@microsoft/teamsfx-core 2.0.6-alpha.da822cd72.0 → 2.0.6-alpha.e5db52f29.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/build/common/featureFlags.d.ts +1 -0
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +5 -1
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/local/constants.d.ts +1 -0
- package/build/common/local/constants.d.ts.map +1 -1
- package/build/common/local/constants.js +1 -0
- package/build/common/local/constants.js.map +1 -1
- package/build/common/m365/launchHelper.d.ts +1 -1
- package/build/common/m365/launchHelper.d.ts.map +1 -1
- package/build/common/m365/launchHelper.js +2 -2
- package/build/common/m365/launchHelper.js.map +1 -1
- package/build/common/m365/packageService.d.ts +1 -0
- package/build/common/m365/packageService.d.ts.map +1 -1
- package/build/common/m365/packageService.js +68 -0
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts +3 -2
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.js +49 -19
- package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -1
- package/build/common/spec-parser/adaptiveCardWrapper.d.ts.map +1 -1
- package/build/common/spec-parser/adaptiveCardWrapper.js.map +1 -1
- package/build/common/spec-parser/constants.d.ts +15 -14
- package/build/common/spec-parser/constants.d.ts.map +1 -1
- package/build/common/spec-parser/constants.js +15 -15
- package/build/common/spec-parser/constants.js.map +1 -1
- package/build/common/spec-parser/index.d.ts +5 -0
- package/build/common/spec-parser/index.d.ts.map +1 -0
- package/build/common/spec-parser/index.js +16 -0
- package/build/common/spec-parser/index.js.map +1 -0
- package/build/common/spec-parser/interfaces.d.ts +20 -4
- package/build/common/spec-parser/interfaces.d.ts.map +1 -1
- package/build/common/spec-parser/interfaces.js +1 -2
- package/build/common/spec-parser/interfaces.js.map +1 -1
- package/build/common/spec-parser/manifestUpdater.d.ts +1 -2
- package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -1
- package/build/common/spec-parser/manifestUpdater.js +9 -98
- package/build/common/spec-parser/manifestUpdater.js.map +1 -1
- package/build/common/spec-parser/specFilter.d.ts +1 -1
- package/build/common/spec-parser/specFilter.d.ts.map +1 -1
- package/build/common/spec-parser/specFilter.js +2 -2
- package/build/common/spec-parser/specFilter.js.map +1 -1
- package/build/common/spec-parser/specParser.d.ts +10 -5
- package/build/common/spec-parser/specParser.d.ts.map +1 -1
- package/build/common/spec-parser/specParser.js +34 -84
- package/build/common/spec-parser/specParser.js.map +1 -1
- package/build/common/spec-parser/utils.d.ts +11 -4
- package/build/common/spec-parser/utils.d.ts.map +1 -1
- package/build/common/spec-parser/utils.js +184 -31
- package/build/common/spec-parser/utils.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/component/configManager/lifecycle.d.ts +1 -0
- package/build/component/configManager/lifecycle.d.ts.map +1 -1
- package/build/component/configManager/lifecycle.js +17 -5
- package/build/component/configManager/lifecycle.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +12 -9
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
- package/build/component/developerPortalScaffoldUtils.js +32 -0
- package/build/component/developerPortalScaffoldUtils.js.map +1 -1
- package/build/component/driver/add/addWebPart.d.ts.map +1 -1
- package/build/component/driver/add/addWebPart.js +2 -0
- package/build/component/driver/add/addWebPart.js.map +1 -1
- package/build/component/driver/add/interface/AddWebPartArgs.d.ts +4 -0
- package/build/component/driver/add/interface/AddWebPartArgs.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts +1 -0
- package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +9 -9
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.d.ts +20 -0
- package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -0
- package/build/component/driver/teamsApp/teamsappMgr.js +278 -0
- package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -0
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +11 -14
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +5 -2
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +83 -13
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +4 -2
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +1 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js +8 -6
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/officeAddin/generator.js +1 -1
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +20 -17
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/utils/common.d.ts.map +1 -1
- package/build/component/utils/common.js +9 -2
- package/build/component/utils/common.js.map +1 -1
- package/build/component/utils/envUtil.d.ts +1 -0
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js +5 -0
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/core/FxCore.d.ts +17 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +75 -7
- package/build/core/FxCore.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +1 -1
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/question/create.d.ts +7 -6
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +77 -73
- package/build/question/create.js.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +4 -4
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
- package/build/question/inputs/SPFxAddWebpartInputs.d.ts +2 -0
- package/build/question/inputs/SPFxAddWebpartInputs.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +7 -8
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/options/SPFxAddWebpartOptions.d.ts.map +1 -1
- package/build/question/options/SPFxAddWebpartOptions.js +9 -0
- package/build/question/options/SPFxAddWebpartOptions.js.map +1 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +21 -0
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +1 -2
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +1 -2
- package/build/question/questionNames.js.map +1 -1
- package/package.json +5 -4
- package/resource/package.nls.json +13 -15
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
"use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.ConstantString = exports.ErrorType = exports.WarningType = exports.ValidationStatus = exports.SpecParserError = exports.SpecParser = void 0;
|
|
6
|
+
var specParser_1 = require("./specParser");
|
|
7
|
+
Object.defineProperty(exports, "SpecParser", { enumerable: true, get: function () { return specParser_1.SpecParser; } });
|
|
8
|
+
var specParserError_1 = require("./specParserError");
|
|
9
|
+
Object.defineProperty(exports, "SpecParserError", { enumerable: true, get: function () { return specParserError_1.SpecParserError; } });
|
|
10
|
+
var interfaces_1 = require("./interfaces");
|
|
11
|
+
Object.defineProperty(exports, "ValidationStatus", { enumerable: true, get: function () { return interfaces_1.ValidationStatus; } });
|
|
12
|
+
Object.defineProperty(exports, "WarningType", { enumerable: true, get: function () { return interfaces_1.WarningType; } });
|
|
13
|
+
Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function () { return interfaces_1.ErrorType; } });
|
|
14
|
+
var constants_1 = require("./constants");
|
|
15
|
+
Object.defineProperty(exports, "ConstantString", { enumerable: true, get: function () { return constants_1.ConstantString; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/spec-parser/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,2CAAuF;AAA9E,8GAAA,gBAAgB,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,uGAAA,SAAS,OAAA;AACjD,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
|
|
@@ -65,6 +65,7 @@ export declare enum ErrorType {
|
|
|
65
65
|
NoSupportedApi = "no-supported-api",
|
|
66
66
|
NoExtraAPICanBeAdded = "no-extra-api-can-be-added",
|
|
67
67
|
ResolveServerUrlFailed = "resolve-server-url-failed",
|
|
68
|
+
SwaggerNotSupported = "swagger-not-supported",
|
|
68
69
|
ListFailed = "list-failed",
|
|
69
70
|
ListOperationMapFailed = "list-operation-map-failed",
|
|
70
71
|
FilterSpecFailed = "filter-spec-failed",
|
|
@@ -79,8 +80,6 @@ export declare enum ErrorType {
|
|
|
79
80
|
* An enum that represents the types of warnings that can occur during validation.
|
|
80
81
|
*/
|
|
81
82
|
export declare enum WarningType {
|
|
82
|
-
AuthNotSupported = "auth-not-supported",
|
|
83
|
-
MethodNotSupported = "method-not-supported",
|
|
84
83
|
OperationIdMissing = "operationid-missing",
|
|
85
84
|
GenerateCardFailed = "generate-card-failed",
|
|
86
85
|
OperationOnlyContainsOptionalParam = "operation-only-contains-optional-param",
|
|
@@ -100,16 +99,21 @@ export interface TextBlockElement {
|
|
|
100
99
|
text: string;
|
|
101
100
|
wrap: boolean;
|
|
102
101
|
}
|
|
102
|
+
export interface ImageElement {
|
|
103
|
+
type: string;
|
|
104
|
+
url: string;
|
|
105
|
+
$when: string;
|
|
106
|
+
}
|
|
103
107
|
export interface ArrayElement {
|
|
104
108
|
type: string;
|
|
105
109
|
$data: string;
|
|
106
|
-
items: Array<TextBlockElement | ArrayElement>;
|
|
110
|
+
items: Array<TextBlockElement | ImageElement | ArrayElement>;
|
|
107
111
|
}
|
|
108
112
|
export interface AdaptiveCard {
|
|
109
113
|
type: string;
|
|
110
114
|
$schema: string;
|
|
111
115
|
version: string;
|
|
112
|
-
body: Array<TextBlockElement | ArrayElement>;
|
|
116
|
+
body: Array<TextBlockElement | ImageElement | ArrayElement>;
|
|
113
117
|
}
|
|
114
118
|
export interface PreviewCardTemplate {
|
|
115
119
|
title: string;
|
|
@@ -138,4 +142,16 @@ export interface CheckParamResult {
|
|
|
138
142
|
optionalNum: number;
|
|
139
143
|
isValid: boolean;
|
|
140
144
|
}
|
|
145
|
+
export interface ParseOptions {
|
|
146
|
+
allowMissingId?: boolean;
|
|
147
|
+
allowSwagger?: boolean;
|
|
148
|
+
}
|
|
149
|
+
export interface APIInfo {
|
|
150
|
+
method: string;
|
|
151
|
+
path: string;
|
|
152
|
+
title: string;
|
|
153
|
+
id: string;
|
|
154
|
+
parameters: Parameter[];
|
|
155
|
+
description: string;
|
|
156
|
+
}
|
|
141
157
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/interfaces.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,oBAAY,SAAS;IACnB,YAAY,mBAAmB;IAC/B,qBAAqB,6BAA6B;IAClD,mBAAmB,0BAA0B;IAC7C,uBAAuB,+BAA+B;IACtD,6BAA6B,sCAAsC;IACnE,cAAc,qBAAqB;IACnC,oBAAoB,8BAA8B;IAClD,sBAAsB,8BAA8B;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/interfaces.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,aAAa,EAAE,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;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SAAS,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -16,6 +16,7 @@ var ErrorType;
|
|
|
16
16
|
ErrorType["NoSupportedApi"] = "no-supported-api";
|
|
17
17
|
ErrorType["NoExtraAPICanBeAdded"] = "no-extra-api-can-be-added";
|
|
18
18
|
ErrorType["ResolveServerUrlFailed"] = "resolve-server-url-failed";
|
|
19
|
+
ErrorType["SwaggerNotSupported"] = "swagger-not-supported";
|
|
19
20
|
ErrorType["ListFailed"] = "list-failed";
|
|
20
21
|
ErrorType["ListOperationMapFailed"] = "list-operation-map-failed";
|
|
21
22
|
ErrorType["FilterSpecFailed"] = "filter-spec-failed";
|
|
@@ -31,8 +32,6 @@ var ErrorType;
|
|
|
31
32
|
*/
|
|
32
33
|
var WarningType;
|
|
33
34
|
(function (WarningType) {
|
|
34
|
-
WarningType["AuthNotSupported"] = "auth-not-supported";
|
|
35
|
-
WarningType["MethodNotSupported"] = "method-not-supported";
|
|
36
35
|
WarningType["OperationIdMissing"] = "operationid-missing";
|
|
37
36
|
WarningType["GenerateCardFailed"] = "generate-card-failed";
|
|
38
37
|
WarningType["OperationOnlyContainsOptionalParam"] = "operation-only-contains-optional-param";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common/spec-parser/interfaces.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAmEb;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common/spec-parser/interfaces.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAmEb;;GAEG;AACH,IAAY,SAqBX;AArBD,WAAY,SAAS;IACnB,4CAA+B,CAAA;IAC/B,+DAAkD,CAAA;IAClD,0DAA6C,CAAA;IAC7C,mEAAsD,CAAA;IACtD,gFAAmE,CAAA;IACnE,gDAAmC,CAAA;IACnC,+DAAkD,CAAA;IAClD,iEAAoD,CAAA;IACpD,0DAA6C,CAAA;IAE7C,uCAA0B,CAAA;IAC1B,iEAAoD,CAAA;IACpD,oDAAuC,CAAA;IACvC,4DAA+C,CAAA;IAC/C,yEAA4D,CAAA;IAC5D,+CAAkC,CAAA;IAClC,+CAAkC,CAAA;IAElC,oCAAuB,CAAA;IACvB,gCAAmB,CAAA;AACrB,CAAC,EArBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAqBpB;AAED;;GAEG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,yDAA0C,CAAA;IAC1C,0DAA2C,CAAA;IAC3C,4FAA6E,CAAA;IAC7E,qEAAsD,CAAA;IACtD,kCAAmB,CAAA;AACrB,CAAC,EANW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAMtB;AAED;;GAEG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,yDAAK,CAAA;IACL,6DAAO,CAAA;IACP,yDAAK,CAAA;AACP,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
import {
|
|
2
|
+
import { WarningResult } from "./interfaces";
|
|
3
3
|
import { IMessagingExtensionCommand, TeamsAppManifest } from "@microsoft/teamsfx-api";
|
|
4
4
|
export declare function updateManifest(manifestPath: string, outputSpecPath: string, adaptiveCardFolder: string, spec: OpenAPIV3.Document): Promise<[TeamsAppManifest, WarningResult[]]>;
|
|
5
|
-
export declare function generateParametersFromSchema(schema: OpenAPIV3.SchemaObject, name: string, isRequired?: boolean): [Parameter[], Parameter[]];
|
|
6
5
|
export declare function generateCommands(spec: OpenAPIV3.Document, adaptiveCardFolder: string, manifestPath: string): Promise<[IMessagingExtensionCommand[], WarningResult[]]>;
|
|
7
6
|
//# sourceMappingURL=manifestUpdater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestUpdater.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/manifestUpdater.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"manifestUpdater.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/manifestUpdater.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAa,aAAa,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EAEL,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,MAAM,EAC1B,IAAI,EAAE,SAAS,CAAC,QAAQ,GACvB,OAAO,CAAC,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC,CAAC,CAyB9C;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,CAAC,QAAQ,EACxB,kBAAkB,EAAE,MAAM,EAC1B,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,CAAC,0BAA0B,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC,CAmC1D"}
|
|
@@ -2,19 +2,17 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.generateCommands = exports.
|
|
5
|
+
exports.generateCommands = exports.updateManifest = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
const interfaces_1 = require("./interfaces");
|
|
8
7
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
|
+
const interfaces_1 = require("./interfaces");
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
const specParserError_1 = require("./specParserError");
|
|
12
12
|
const constants_1 = require("./constants");
|
|
13
|
-
const util_1 = require("util");
|
|
14
13
|
async function updateManifest(manifestPath, outputSpecPath, adaptiveCardFolder, spec) {
|
|
15
14
|
var _a;
|
|
16
15
|
try {
|
|
17
|
-
// TODO: manifest interface can be updated when manifest parser library is ready
|
|
18
16
|
const originalManifest = await fs_extra_1.default.readJSON(manifestPath);
|
|
19
17
|
const [commands, warnings] = await generateCommands(spec, adaptiveCardFolder, manifestPath);
|
|
20
18
|
const ComposeExtension = {
|
|
@@ -37,43 +35,7 @@ async function updateManifest(manifestPath, outputSpecPath, adaptiveCardFolder,
|
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
37
|
exports.updateManifest = updateManifest;
|
|
40
|
-
function generateParametersFromSchema(schema, name, isRequired = false) {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
const requiredParams = [];
|
|
43
|
-
const optionalParams = [];
|
|
44
|
-
if (schema.type === "string" ||
|
|
45
|
-
schema.type === "integer" ||
|
|
46
|
-
schema.type === "boolean" ||
|
|
47
|
-
schema.type === "number") {
|
|
48
|
-
const parameter = {
|
|
49
|
-
name: name,
|
|
50
|
-
title: utils_1.updateFirstLetter(name),
|
|
51
|
-
description: (_a = schema.description) !== null && _a !== void 0 ? _a : "",
|
|
52
|
-
};
|
|
53
|
-
if (isRequired && schema.default === undefined) {
|
|
54
|
-
requiredParams.push(parameter);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
optionalParams.push(parameter);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else if (schema.type === "object") {
|
|
61
|
-
const { properties } = schema;
|
|
62
|
-
for (const property in properties) {
|
|
63
|
-
let isRequired = false;
|
|
64
|
-
if (schema.required && ((_b = schema.required) === null || _b === void 0 ? void 0 : _b.indexOf(property)) >= 0) {
|
|
65
|
-
isRequired = true;
|
|
66
|
-
}
|
|
67
|
-
const [requiredP, optionalP] = generateParametersFromSchema(properties[property], property, isRequired);
|
|
68
|
-
requiredParams.push(...requiredP);
|
|
69
|
-
optionalParams.push(...optionalP);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return [requiredParams, optionalParams];
|
|
73
|
-
}
|
|
74
|
-
exports.generateParametersFromSchema = generateParametersFromSchema;
|
|
75
38
|
async function generateCommands(spec, adaptiveCardFolder, manifestPath) {
|
|
76
|
-
var _a, _b;
|
|
77
39
|
const paths = spec.paths;
|
|
78
40
|
const commands = [];
|
|
79
41
|
const warnings = [];
|
|
@@ -87,66 +49,15 @@ async function generateCommands(spec, adaptiveCardFolder, manifestPath) {
|
|
|
87
49
|
if (method === constants_1.ConstantString.PostMethod || method === constants_1.ConstantString.GetMethod) {
|
|
88
50
|
const operationItem = operations[method];
|
|
89
51
|
if (operationItem) {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
name: param.name,
|
|
98
|
-
title: utils_1.updateFirstLetter(param.name),
|
|
99
|
-
description: (_a = param.description) !== null && _a !== void 0 ? _a : "",
|
|
100
|
-
};
|
|
101
|
-
const schema = param.schema;
|
|
102
|
-
if (param.in !== "header" && param.in !== "cookie") {
|
|
103
|
-
if (param.required && (schema === null || schema === void 0 ? void 0 : schema.default) === undefined) {
|
|
104
|
-
requiredParams.push(parameter);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
optionalParams.push(parameter);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
if (operationItem.requestBody) {
|
|
113
|
-
const requestBody = operationItem.requestBody;
|
|
114
|
-
const requestJson = requestBody.content["application/json"];
|
|
115
|
-
if (Object.keys(requestJson).length !== 0) {
|
|
116
|
-
const schema = requestJson.schema;
|
|
117
|
-
const [requiredP, optionalP] = generateParametersFromSchema(schema, "requestBody", requestBody.required);
|
|
118
|
-
requiredParams.push(...requiredP);
|
|
119
|
-
optionalParams.push(...optionalP);
|
|
120
|
-
}
|
|
52
|
+
const [command, warning] = utils_1.parseApiInfo(operationItem);
|
|
53
|
+
const adaptiveCardPath = path_1.default.join(adaptiveCardFolder, command.id + ".json");
|
|
54
|
+
command.apiResponseRenderingTemplateFile = (await fs_extra_1.default.pathExists(adaptiveCardPath))
|
|
55
|
+
? utils_1.getRelativePath(manifestPath, adaptiveCardPath)
|
|
56
|
+
: "";
|
|
57
|
+
if (warning) {
|
|
58
|
+
warnings.push(warning);
|
|
121
59
|
}
|
|
122
|
-
const operationId = operationItem.operationId;
|
|
123
|
-
const adaptiveCardPath = path_1.default.join(adaptiveCardFolder, operationId + ".json");
|
|
124
|
-
const parameters = [];
|
|
125
|
-
if (requiredParams.length != 0) {
|
|
126
|
-
parameters.push(...requiredParams);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
parameters.push(optionalParams[0]);
|
|
130
|
-
}
|
|
131
|
-
const command = {
|
|
132
|
-
context: ["compose"],
|
|
133
|
-
type: "query",
|
|
134
|
-
title: (_a = operationItem.summary) !== null && _a !== void 0 ? _a : "",
|
|
135
|
-
id: operationId,
|
|
136
|
-
parameters: parameters,
|
|
137
|
-
description: (_b = operationItem.description) !== null && _b !== void 0 ? _b : "",
|
|
138
|
-
apiResponseRenderingTemplateFile: (await fs_extra_1.default.pathExists(adaptiveCardPath))
|
|
139
|
-
? utils_1.getRelativePath(manifestPath, adaptiveCardPath)
|
|
140
|
-
: "",
|
|
141
|
-
};
|
|
142
60
|
commands.push(command);
|
|
143
|
-
if (requiredParams.length === 0 && optionalParams.length > 1) {
|
|
144
|
-
warnings.push({
|
|
145
|
-
type: interfaces_1.WarningType.OperationOnlyContainsOptionalParam,
|
|
146
|
-
content: util_1.format(constants_1.ConstantString.OperationOnlyContainsOptionalParam, operationId),
|
|
147
|
-
data: operationId,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
61
|
}
|
|
151
62
|
}
|
|
152
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifestUpdater.js","sourceRoot":"","sources":["../../../src/common/spec-parser/manifestUpdater.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AAGb,
|
|
1
|
+
{"version":3,"file":"manifestUpdater.js","sourceRoot":"","sources":["../../../src/common/spec-parser/manifestUpdater.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AAGb,gEAA0B;AAC1B,wDAAwB;AACxB,6CAAwD;AACxD,mCAAwD;AACxD,uDAAoD;AACpD,2CAA6C;AAOtC,KAAK,UAAU,cAAc,CAClC,YAAoB,EACpB,cAAsB,EACtB,kBAA0B,EAC1B,IAAwB;;IAExB,IAAI;QACF,MAAM,gBAAgB,GAAqB,MAAM,kBAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE3E,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC;QAC5F,MAAM,gBAAgB,GAAsB;YAC1C,oBAAoB,EAAE,UAAU;YAChC,oBAAoB,EAAE,uBAAe,CAAC,YAAY,EAAE,cAAc,CAAC;YACnE,QAAQ,EAAE,QAAQ;SACnB,CAAC;QAEF,MAAM,WAAW,GAAG;YAClB,WAAW,EAAE;gBACX,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;gBACtB,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,CAAC,WAAW,mCAAI,gBAAgB,CAAC,WAAW,CAAC,IAAI;aACjE;YACD,iBAAiB,EAAE,CAAC,gBAAgB,CAAC;SACtC,CAAC;QAEF,MAAM,eAAe,mCAAQ,gBAAgB,GAAK,WAAW,CAAE,CAAC;QAEhE,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;KACpC;IAAC,OAAO,GAAG,EAAE;QACZ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C,CAAC;yBACxB;qBACF;iBACF;aACF;SACF;KACF;IAED,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC;AAvCD,4CAuCC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
export declare function specFilter(filter: string[], unResolveSpec: OpenAPIV3.Document, resolvedSpec: OpenAPIV3.Document): OpenAPIV3.Document;
|
|
2
|
+
export declare function specFilter(filter: string[], unResolveSpec: OpenAPIV3.Document, resolvedSpec: OpenAPIV3.Document, allowMissingId: boolean): OpenAPIV3.Document;
|
|
3
3
|
//# sourceMappingURL=specFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specFilter.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/specFilter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM1C,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,SAAS,CAAC,QAAQ,EACjC,YAAY,EAAE,SAAS,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"specFilter.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/specFilter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM1C,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,SAAS,CAAC,QAAQ,EACjC,YAAY,EAAE,SAAS,CAAC,QAAQ,EAChC,cAAc,EAAE,OAAO,GACtB,SAAS,CAAC,QAAQ,CAkCpB"}
|
|
@@ -7,14 +7,14 @@ const utils_1 = require("./utils");
|
|
|
7
7
|
const specParserError_1 = require("./specParserError");
|
|
8
8
|
const interfaces_1 = require("./interfaces");
|
|
9
9
|
const constants_1 = require("./constants");
|
|
10
|
-
function specFilter(filter, unResolveSpec, resolvedSpec) {
|
|
10
|
+
function specFilter(filter, unResolveSpec, resolvedSpec, allowMissingId) {
|
|
11
11
|
try {
|
|
12
12
|
const newSpec = Object.assign({}, unResolveSpec);
|
|
13
13
|
const newPaths = {};
|
|
14
14
|
for (const filterItem of filter) {
|
|
15
15
|
const [method, path] = filterItem.split(" ");
|
|
16
16
|
const methodName = method.toLowerCase();
|
|
17
|
-
if (!utils_1.isSupportedApi(methodName, path, resolvedSpec)) {
|
|
17
|
+
if (!utils_1.isSupportedApi(methodName, path, resolvedSpec, allowMissingId)) {
|
|
18
18
|
continue;
|
|
19
19
|
}
|
|
20
20
|
if (!newPaths[path]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specFilter.js","sourceRoot":"","sources":["../../../src/common/spec-parser/specFilter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,mCAAiE;AACjE,uDAAoD;AACpD,6CAAyC;AACzC,2CAA6C;AAE7C,SAAgB,UAAU,CACxB,MAAgB,EAChB,aAAiC,EACjC,YAAgC;
|
|
1
|
+
{"version":3,"file":"specFilter.js","sourceRoot":"","sources":["../../../src/common/spec-parser/specFilter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,mCAAiE;AACjE,uDAAoD;AACpD,6CAAyC;AACzC,2CAA6C;AAE7C,SAAgB,UAAU,CACxB,MAAgB,EAChB,aAAiC,EACjC,YAAgC,EAChC,cAAuB;IAEvB,IAAI;QACF,MAAM,OAAO,qBAAQ,aAAa,CAAE,CAAC;QACrC,MAAM,QAAQ,GAA0B,EAAE,CAAC;QAC3C,KAAK,MAAM,UAAU,IAAI,MAAM,EAAE;YAC/B,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7C,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YAExC,IAAI,CAAC,sBAAc,CAAC,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,CAAC,EAAE;gBACnE,SAAS;aACV;YAED,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACnB,QAAQ,CAAC,IAAI,CAAC,qBAAQ,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAE,CAAC;gBAClD,KAAK,MAAM,CAAC,IAAI,0BAAc,CAAC,mBAAmB,EAAE;oBAClD,OAAQ,QAAQ,CAAC,IAAI,CAAS,CAAC,CAAC,CAAC,CAAC;iBACnC;aACF;YAEA,QAAQ,CAAC,IAAI,CAAS,CAAC,UAAU,CAAC,GAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAS,CAAC,UAAU,CAAC,CAAC;YAErF,iCAAiC;YACjC,IAAI,CAAE,QAAQ,CAAC,IAAI,CAAS,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;gBACnD,QAAQ,CAAC,IAAI,CAAS,CAAC,UAAU,CAAC,CAAC,WAAW,GAAG,GAAG,UAAU,GAAG,8BAAsB,CACtF,IAAI,CACL,EAAE,CAAC;aACL;SACF;QAED,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC;QACzB,OAAO,OAAO,CAAC;KAChB;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,iCAAe,CAAE,GAAa,CAAC,QAAQ,EAAE,EAAE,sBAAS,CAAC,gBAAgB,CAAC,CAAC;KAClF;AACH,CAAC;AAvCD,gCAuCC"}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
2
|
-
import {
|
|
2
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
3
|
+
import { APIInfo, GenerateResult, ParseOptions, ValidateResult } from "./interfaces";
|
|
3
4
|
/**
|
|
4
5
|
* A class that parses an OpenAPI specification file and provides methods to validate, list, and generate artifacts.
|
|
5
6
|
*/
|
|
6
7
|
export declare class SpecParser {
|
|
7
|
-
readonly
|
|
8
|
+
readonly pathOrSpec: string | OpenAPIV3.Document;
|
|
8
9
|
readonly parser: SwaggerParser;
|
|
10
|
+
readonly options: ParseOptions;
|
|
9
11
|
private apiMap;
|
|
10
12
|
private spec;
|
|
11
13
|
private unResolveSpec;
|
|
12
14
|
private isSwaggerFile;
|
|
15
|
+
private defaultOptions;
|
|
13
16
|
/**
|
|
14
17
|
* Creates a new instance of the SpecParser class.
|
|
15
|
-
* @param
|
|
18
|
+
* @param pathOrDoc The path to the OpenAPI specification file or the OpenAPI specification object.
|
|
19
|
+
* @param options The options for parsing the OpenAPI specification file.
|
|
16
20
|
*/
|
|
17
|
-
constructor(
|
|
21
|
+
constructor(pathOrDoc: string | OpenAPIV3.Document, options?: ParseOptions);
|
|
18
22
|
/**
|
|
19
23
|
* Validates the OpenAPI specification file and returns a validation result.
|
|
20
24
|
*
|
|
21
25
|
* @returns A validation result object that contains information about any errors or warnings in the specification file.
|
|
22
26
|
*/
|
|
23
27
|
validate(): Promise<ValidateResult>;
|
|
28
|
+
listSupportedAPIInfo(): Promise<APIInfo[]>;
|
|
24
29
|
/**
|
|
25
30
|
* Lists all the OpenAPI operations in the specification file.
|
|
26
31
|
* @returns A string array that represents the HTTP method and path of each operation, such as ['GET /pets/{petId}', 'GET /user/{userId}']
|
|
@@ -41,6 +46,6 @@ export declare class SpecParser {
|
|
|
41
46
|
*/
|
|
42
47
|
generate(manifestPath: string, filter: string[], outputSpecPath: string, adaptiveCardFolder: string, signal?: AbortSignal): Promise<GenerateResult>;
|
|
43
48
|
private loadSpec;
|
|
44
|
-
private
|
|
49
|
+
private getAllSupportedAPIs;
|
|
45
50
|
}
|
|
46
51
|
//# sourceMappingURL=specParser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specParser.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/specParser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"specParser.d.ts","sourceRoot":"","sources":["../../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ser = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
|
-
const util = tslib_1.__importStar(require("util"));
|
|
8
7
|
const swagger_parser_1 = tslib_1.__importDefault(require("@apidevtools/swagger-parser"));
|
|
9
|
-
const specParserError_1 = require("./specParserError");
|
|
10
8
|
const swagger2openapi_1 = tslib_1.__importDefault(require("swagger2openapi"));
|
|
11
|
-
const interfaces_1 = require("./interfaces");
|
|
12
|
-
const constants_1 = require("./constants");
|
|
13
9
|
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
14
10
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
11
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
+
const interfaces_1 = require("./interfaces");
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
const specParserError_1 = require("./specParserError");
|
|
15
15
|
const specFilter_1 = require("./specFilter");
|
|
16
16
|
const utils_1 = require("./utils");
|
|
17
17
|
const manifestUpdater_1 = require("./manifestUpdater");
|
|
18
18
|
const adaptiveCardGenerator_1 = require("./adaptiveCardGenerator");
|
|
19
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
20
19
|
const adaptiveCardWrapper_1 = require("./adaptiveCardWrapper");
|
|
21
20
|
/**
|
|
22
21
|
* A class that parses an OpenAPI specification file and provides methods to validate, list, and generate artifacts.
|
|
@@ -24,11 +23,17 @@ const adaptiveCardWrapper_1 = require("./adaptiveCardWrapper");
|
|
|
24
23
|
class SpecParser {
|
|
25
24
|
/**
|
|
26
25
|
* Creates a new instance of the SpecParser class.
|
|
27
|
-
* @param
|
|
26
|
+
* @param pathOrDoc The path to the OpenAPI specification file or the OpenAPI specification object.
|
|
27
|
+
* @param options The options for parsing the OpenAPI specification file.
|
|
28
28
|
*/
|
|
29
|
-
constructor(
|
|
30
|
-
this.
|
|
29
|
+
constructor(pathOrDoc, options) {
|
|
30
|
+
this.defaultOptions = {
|
|
31
|
+
allowMissingId: true,
|
|
32
|
+
allowSwagger: true,
|
|
33
|
+
};
|
|
34
|
+
this.pathOrSpec = pathOrDoc;
|
|
31
35
|
this.parser = new swagger_parser_1.default();
|
|
36
|
+
this.options = Object.assign(Object.assign({}, this.defaultOptions), (options !== null && options !== void 0 ? options : {}));
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
34
39
|
* Validates the OpenAPI specification file and returns a validation result.
|
|
@@ -37,80 +42,36 @@ class SpecParser {
|
|
|
37
42
|
*/
|
|
38
43
|
async validate() {
|
|
39
44
|
try {
|
|
40
|
-
const errors = [];
|
|
41
|
-
const warnings = [];
|
|
42
45
|
try {
|
|
43
46
|
await this.loadSpec();
|
|
44
47
|
await this.parser.validate(this.spec);
|
|
45
48
|
}
|
|
46
49
|
catch (e) {
|
|
47
|
-
// Spec not valid
|
|
48
|
-
errors.push({ type: interfaces_1.ErrorType.SpecNotValid, content: e.toString() });
|
|
49
50
|
return {
|
|
50
51
|
status: interfaces_1.ValidationStatus.Error,
|
|
51
|
-
warnings,
|
|
52
|
-
errors,
|
|
52
|
+
warnings: [],
|
|
53
|
+
errors: [{ type: interfaces_1.ErrorType.SpecNotValid, content: e.toString() }],
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
if (this.isSwaggerFile) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
errors.push(...serverErrors);
|
|
64
|
-
// Remote reference not supported
|
|
65
|
-
const refPaths = this.parser.$refs.paths();
|
|
66
|
-
// refPaths [0] is the current spec file path
|
|
67
|
-
if (refPaths.length > 1) {
|
|
68
|
-
errors.push({
|
|
69
|
-
type: interfaces_1.ErrorType.RemoteRefNotSupported,
|
|
70
|
-
content: util.format(constants_1.ConstantString.RemoteRefNotSupported, refPaths.join(", ")),
|
|
71
|
-
data: refPaths,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
// No supported API
|
|
75
|
-
const apiMap = this.getAllSupportedApi(this.spec);
|
|
76
|
-
if (Object.keys(apiMap).length === 0) {
|
|
77
|
-
errors.push({
|
|
78
|
-
type: interfaces_1.ErrorType.NoSupportedApi,
|
|
79
|
-
content: constants_1.ConstantString.NoSupportedApi,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
// OperationId missing
|
|
83
|
-
const apisMissingOperationId = [];
|
|
84
|
-
for (const key in apiMap) {
|
|
85
|
-
const pathObjectItem = apiMap[key];
|
|
86
|
-
if (!pathObjectItem.operationId) {
|
|
87
|
-
apisMissingOperationId.push(key);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (apisMissingOperationId.length > 0) {
|
|
91
|
-
warnings.push({
|
|
92
|
-
type: interfaces_1.WarningType.OperationIdMissing,
|
|
93
|
-
content: util.format(constants_1.ConstantString.MissingOperationId, apisMissingOperationId.join(", ")),
|
|
94
|
-
data: apisMissingOperationId,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
let status = interfaces_1.ValidationStatus.Valid;
|
|
98
|
-
if (warnings.length > 0 && errors.length === 0) {
|
|
99
|
-
status = interfaces_1.ValidationStatus.Warning;
|
|
100
|
-
}
|
|
101
|
-
else if (errors.length > 0) {
|
|
102
|
-
status = interfaces_1.ValidationStatus.Error;
|
|
56
|
+
if (!this.options.allowSwagger && this.isSwaggerFile) {
|
|
57
|
+
return {
|
|
58
|
+
status: interfaces_1.ValidationStatus.Error,
|
|
59
|
+
warnings: [],
|
|
60
|
+
errors: [
|
|
61
|
+
{ type: interfaces_1.ErrorType.SwaggerNotSupported, content: constants_1.ConstantString.SwaggerNotSupported },
|
|
62
|
+
],
|
|
63
|
+
};
|
|
103
64
|
}
|
|
104
|
-
return
|
|
105
|
-
status,
|
|
106
|
-
warnings,
|
|
107
|
-
errors,
|
|
108
|
-
};
|
|
65
|
+
return utils_1.validateSpec(this.spec, this.parser, !!this.isSwaggerFile);
|
|
109
66
|
}
|
|
110
67
|
catch (err) {
|
|
111
68
|
throw new specParserError_1.SpecParserError(err.toString(), interfaces_1.ErrorType.ValidateFailed);
|
|
112
69
|
}
|
|
113
70
|
}
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
72
|
+
async listSupportedAPIInfo() {
|
|
73
|
+
throw new Error("Method not implemented.");
|
|
74
|
+
}
|
|
114
75
|
/**
|
|
115
76
|
* Lists all the OpenAPI operations in the specification file.
|
|
116
77
|
* @returns A string array that represents the HTTP method and path of each operation, such as ['GET /pets/{petId}', 'GET /user/{userId}']
|
|
@@ -119,7 +80,7 @@ class SpecParser {
|
|
|
119
80
|
async list() {
|
|
120
81
|
try {
|
|
121
82
|
await this.loadSpec();
|
|
122
|
-
const apiMap = this.
|
|
83
|
+
const apiMap = this.getAllSupportedAPIs(this.spec);
|
|
123
84
|
return Array.from(Object.keys(apiMap));
|
|
124
85
|
}
|
|
125
86
|
catch (err) {
|
|
@@ -133,7 +94,7 @@ class SpecParser {
|
|
|
133
94
|
async listOperationMap() {
|
|
134
95
|
try {
|
|
135
96
|
await this.loadSpec();
|
|
136
|
-
const apiMap = this.
|
|
97
|
+
const apiMap = this.getAllSupportedAPIs(this.spec);
|
|
137
98
|
const operationMap = new Map();
|
|
138
99
|
for (const key in apiMap) {
|
|
139
100
|
const pathObjectItem = apiMap[key];
|
|
@@ -171,7 +132,7 @@ class SpecParser {
|
|
|
171
132
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
172
133
|
throw new specParserError_1.SpecParserError(constants_1.ConstantString.CancelledMessage, interfaces_1.ErrorType.Cancelled);
|
|
173
134
|
}
|
|
174
|
-
const newUnResolvedSpec = specFilter_1.specFilter(filter, this.unResolveSpec, this.spec);
|
|
135
|
+
const newUnResolvedSpec = specFilter_1.specFilter(filter, this.unResolveSpec, this.spec, this.options.allowMissingId);
|
|
175
136
|
let resultStr;
|
|
176
137
|
if (outputSpecPath.endsWith(".yaml") || outputSpecPath.endsWith(".yml")) {
|
|
177
138
|
resultStr = js_yaml_1.default.dump(newUnResolvedSpec);
|
|
@@ -222,7 +183,7 @@ class SpecParser {
|
|
|
222
183
|
}
|
|
223
184
|
async loadSpec() {
|
|
224
185
|
if (!this.spec) {
|
|
225
|
-
this.unResolveSpec = (await this.parser.parse(this.
|
|
186
|
+
this.unResolveSpec = (await this.parser.parse(this.pathOrSpec));
|
|
226
187
|
// Convert swagger 2.0 to openapi 3.0
|
|
227
188
|
if (!this.unResolveSpec.openapi && this.unResolveSpec.swagger === "2.0") {
|
|
228
189
|
const specObj = await swagger2openapi_1.default.convert(this.unResolveSpec, {});
|
|
@@ -233,22 +194,11 @@ class SpecParser {
|
|
|
233
194
|
this.spec = (await this.parser.dereference(clonedUnResolveSpec));
|
|
234
195
|
}
|
|
235
196
|
}
|
|
236
|
-
|
|
197
|
+
getAllSupportedAPIs(spec) {
|
|
237
198
|
if (this.apiMap !== undefined) {
|
|
238
199
|
return this.apiMap;
|
|
239
200
|
}
|
|
240
|
-
const
|
|
241
|
-
const result = {};
|
|
242
|
-
for (const path in paths) {
|
|
243
|
-
const methods = paths[path];
|
|
244
|
-
for (const method in methods) {
|
|
245
|
-
// For developer preview, only support GET operation with only 1 parameter without auth
|
|
246
|
-
if (utils_1.isSupportedApi(method, path, spec)) {
|
|
247
|
-
const operationObject = methods[method];
|
|
248
|
-
result[`${method.toUpperCase()} ${path}`] = operationObject;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
201
|
+
const result = utils_1.listSupportedAPIs(spec, this.options.allowMissingId);
|
|
252
202
|
this.apiMap = result;
|
|
253
203
|
return result;
|
|
254
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specParser.js","sourceRoot":"","sources":["../../../src/common/spec-parser/specParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AAEb,
|
|
1
|
+
{"version":3,"file":"specParser.js","sourceRoot":"","sources":["../../../src/common/spec-parser/specParser.ts"],"names":[],"mappings":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