@microsoft/teamsfx-core 2.0.7-alpha.bdb04bd16.0 → 2.0.7-alpha.c6f5fa837.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/constants.d.ts +1 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +1 -0
- package/build/common/constants.js.map +1 -1
- 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/packageJsonHelper.d.ts.map +1 -1
- package/build/common/local/packageJsonHelper.js +1 -2
- package/build/common/local/packageJsonHelper.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 +13 -0
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/samples.d.ts +1 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +1 -3
- package/build/common/samples.js.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/component/coordinator/index.d.ts +8 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +36 -4
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts +1 -0
- package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +14 -0
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/apiKey/create.js +2 -2
- package/build/component/driver/apiKey/create.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +5 -5
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts +30 -0
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +63 -0
- package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +3 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +3 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +2 -0
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +42 -14
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationDetailsResponse.d.ts +21 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationDetailsResponse.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationDetailsResponse.js +5 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationDetailsResponse.js.map +1 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResponse.d.ts +17 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResponse.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResponse.js +16 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResponse.js.map +1 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResultsResponse.d.ts +41 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResultsResponse.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResultsResponse.js +5 -0
- package/build/component/driver/teamsApp/interfaces/AsyncAppValidationResultsResponse.js.map +1 -0
- package/build/component/generator/copilotPlugin/generator.d.ts +3 -2
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +31 -15
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +1 -1
- package/build/component/generator/copilotPlugin/helper.js +19 -19
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/error.d.ts +1 -1
- package/build/component/generator/error.d.ts.map +1 -1
- package/build/component/generator/error.js +4 -4
- package/build/component/generator/error.js.map +1 -1
- package/build/component/generator/generator.d.ts +5 -0
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +27 -25
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +5 -15
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js +44 -92
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/officeAddin/config/projectProperties.d.ts +1 -0
- package/build/component/generator/officeAddin/config/projectProperties.d.ts.map +1 -1
- package/build/component/generator/officeAddin/config/projectProperties.js +1 -0
- package/build/component/generator/officeAddin/config/projectProperties.js.map +1 -1
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts +1 -4
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts.map +1 -1
- package/build/component/generator/officeAddin/config/projectsJsonData.js +4 -11
- package/build/component/generator/officeAddin/config/projectsJsonData.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +7 -6
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts +2 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +21 -10
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/utils.d.ts +0 -1
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +14 -15
- package/build/component/generator/utils.js.map +1 -1
- package/build/core/FxCore.js +3 -3
- package/build/core/FxCore.js.map +1 -1
- package/build/error/arm.d.ts.map +1 -1
- package/build/error/arm.js +0 -2
- package/build/error/arm.js.map +1 -1
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +1 -1
- package/build/error/common.js.map +1 -1
- package/build/error/deploy.d.ts.map +1 -1
- package/build/error/deploy.js +17 -6
- package/build/error/deploy.js.map +1 -1
- package/build/question/create.d.ts +17 -0
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +288 -35
- package/build/question/create.js.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +16 -4
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +49 -8
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/questionNames.d.ts +9 -1
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +8 -0
- package/build/question/questionNames.js.map +1 -1
- package/package.json +6 -6
- package/resource/package.nls.json +50 -6
- 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
- package/templates/plugins/resource/aad/auth/V3/Enable SSO.txt +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts +0 -7
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +0 -1
- package/build/common/spec-parser/adaptiveCardGenerator.js +0 -168
- package/build/common/spec-parser/adaptiveCardGenerator.js.map +0 -1
- package/build/common/spec-parser/adaptiveCardWrapper.d.ts +0 -15
- package/build/common/spec-parser/adaptiveCardWrapper.d.ts.map +0 -1
- package/build/common/spec-parser/adaptiveCardWrapper.js +0 -98
- package/build/common/spec-parser/adaptiveCardWrapper.js.map +0 -1
- package/build/common/spec-parser/constants.d.ts +0 -41
- package/build/common/spec-parser/constants.d.ts.map +0 -1
- package/build/common/spec-parser/constants.js +0 -95
- package/build/common/spec-parser/constants.js.map +0 -1
- package/build/common/spec-parser/index.browser.d.ts +0 -6
- package/build/common/spec-parser/index.browser.d.ts.map +0 -1
- package/build/common/spec-parser/index.browser.js +0 -16
- package/build/common/spec-parser/index.browser.js.map +0 -1
- package/build/common/spec-parser/index.d.ts +0 -5
- package/build/common/spec-parser/index.d.ts.map +0 -1
- package/build/common/spec-parser/index.js +0 -16
- package/build/common/spec-parser/index.js.map +0 -1
- package/build/common/spec-parser/interfaces.d.ts +0 -180
- package/build/common/spec-parser/interfaces.d.ts.map +0 -1
- package/build/common/spec-parser/interfaces.js +0 -51
- package/build/common/spec-parser/interfaces.js.map +0 -1
- package/build/common/spec-parser/manifestUpdater.d.ts +0 -7
- package/build/common/spec-parser/manifestUpdater.d.ts.map +0 -1
- package/build/common/spec-parser/manifestUpdater.js +0 -98
- package/build/common/spec-parser/manifestUpdater.js.map +0 -1
- package/build/common/spec-parser/specFilter.d.ts +0 -3
- package/build/common/spec-parser/specFilter.d.ts.map +0 -1
- package/build/common/spec-parser/specFilter.js +0 -40
- package/build/common/spec-parser/specFilter.js.map +0 -1
- package/build/common/spec-parser/specParser.browser.d.ts +0 -46
- package/build/common/spec-parser/specParser.browser.d.ts.map +0 -1
- package/build/common/spec-parser/specParser.browser.js +0 -139
- package/build/common/spec-parser/specParser.browser.js.map +0 -1
- package/build/common/spec-parser/specParser.d.ts +0 -46
- package/build/common/spec-parser/specParser.d.ts.map +0 -1
- package/build/common/spec-parser/specParser.js +0 -244
- package/build/common/spec-parser/specParser.js.map +0 -1
- package/build/common/spec-parser/specParserError.d.ts +0 -6
- package/build/common/spec-parser/specParserError.d.ts.map +0 -1
- package/build/common/spec-parser/specParserError.js +0 -13
- package/build/common/spec-parser/specParserError.js.map +0 -1
- package/build/common/spec-parser/utils.d.ts +0 -43
- package/build/common/spec-parser/utils.d.ts.map +0 -1
- package/build/common/spec-parser/utils.js +0 -587
- package/build/common/spec-parser/utils.js.map +0 -1
|
@@ -117,18 +117,15 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
117
117
|
zip.addLocalFile(fileName, dir === "." ? "" : dir);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
//
|
|
120
|
+
// API ME, API specification and Adaptive card templates
|
|
121
121
|
if (manifest.composeExtensions &&
|
|
122
122
|
manifest.composeExtensions.length > 0 &&
|
|
123
123
|
manifest.composeExtensions[0].composeExtensionType == "apiBased" &&
|
|
124
124
|
manifest.composeExtensions[0].apiSpecificationFile) {
|
|
125
125
|
const apiSpecificationFile = path.resolve(appDirectory, manifest.composeExtensions[0].apiSpecificationFile);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const relativePath = path.relative(appDirectory, apiSpecificationFile);
|
|
130
|
-
if (relativePath.startsWith("..")) {
|
|
131
|
-
return teamsfx_api_1.err(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(apiSpecificationFile));
|
|
126
|
+
const checkExistenceRes = await this.validateReferencedFile(apiSpecificationFile, appDirectory);
|
|
127
|
+
if (checkExistenceRes.isErr()) {
|
|
128
|
+
return teamsfx_api_1.err(checkExistenceRes.error);
|
|
132
129
|
}
|
|
133
130
|
const expandedEnvVarResult = await CreateAppPackageDriver_1.expandOpenAPIEnvVars(apiSpecificationFile, context);
|
|
134
131
|
if (expandedEnvVarResult.isErr()) {
|
|
@@ -141,19 +138,37 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
141
138
|
for (const command of manifest.composeExtensions[0].commands) {
|
|
142
139
|
if (command.apiResponseRenderingTemplateFile) {
|
|
143
140
|
const adaptiveCardFile = path.resolve(appDirectory, command.apiResponseRenderingTemplateFile);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const relativePath = path.relative(appDirectory, adaptiveCardFile);
|
|
148
|
-
if (relativePath.startsWith("..")) {
|
|
149
|
-
return teamsfx_api_1.err(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(adaptiveCardFile));
|
|
141
|
+
const checkExistenceRes = await this.validateReferencedFile(adaptiveCardFile, appDirectory);
|
|
142
|
+
if (checkExistenceRes.isErr()) {
|
|
143
|
+
return teamsfx_api_1.err(checkExistenceRes.error);
|
|
150
144
|
}
|
|
151
145
|
const dir = path.dirname(command.apiResponseRenderingTemplateFile);
|
|
152
|
-
|
|
146
|
+
this.addFileInZip(zip, dir, adaptiveCardFile);
|
|
153
147
|
}
|
|
154
148
|
}
|
|
155
149
|
}
|
|
156
150
|
}
|
|
151
|
+
// API plugin
|
|
152
|
+
if (manifest.apiPlugins &&
|
|
153
|
+
manifest.apiPlugins.length > 0 &&
|
|
154
|
+
manifest.apiPlugins[0].pluginFile) {
|
|
155
|
+
const pluginFile = path.resolve(appDirectory, manifest.apiPlugins[0].pluginFile);
|
|
156
|
+
const checkExistenceRes = await this.validateReferencedFile(pluginFile, appDirectory);
|
|
157
|
+
if (checkExistenceRes.isErr()) {
|
|
158
|
+
return teamsfx_api_1.err(checkExistenceRes.error);
|
|
159
|
+
}
|
|
160
|
+
const dir = path.dirname(manifest.apiPlugins[0].pluginFile);
|
|
161
|
+
this.addFileInZip(zip, dir, pluginFile);
|
|
162
|
+
// TODO: Add API spec and templates
|
|
163
|
+
// const addResponseTemplateRes = await this.addPluginRelatedFiles(
|
|
164
|
+
// zip,
|
|
165
|
+
// pluginFile,
|
|
166
|
+
// appDirectory
|
|
167
|
+
// );
|
|
168
|
+
// if (addResponseTemplateRes.isErr()) {
|
|
169
|
+
// return err(addResponseTemplateRes.error);
|
|
170
|
+
// }
|
|
171
|
+
}
|
|
157
172
|
zip.writeZip(zipFileName);
|
|
158
173
|
if (await fs_extra_1.default.pathExists(jsonFileName)) {
|
|
159
174
|
await fs_extra_1.default.chmod(jsonFileName, 0o777);
|
|
@@ -200,6 +215,19 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
200
215
|
return teamsfx_api_1.ok(undefined);
|
|
201
216
|
}
|
|
202
217
|
}
|
|
218
|
+
async validateReferencedFile(file, directory) {
|
|
219
|
+
if (!(await fs_extra_1.default.pathExists(file))) {
|
|
220
|
+
return teamsfx_api_1.err(new common_1.FileNotFoundError(exports.actionName, file, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
|
|
221
|
+
}
|
|
222
|
+
const relativePath = path.relative(directory, file);
|
|
223
|
+
if (relativePath.startsWith("..")) {
|
|
224
|
+
return teamsfx_api_1.err(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(file));
|
|
225
|
+
}
|
|
226
|
+
return teamsfx_api_1.ok(undefined);
|
|
227
|
+
}
|
|
228
|
+
addFileInZip(zip, dir, filePath) {
|
|
229
|
+
zip.addLocalFile(filePath, dir === "." ? "" : dir);
|
|
230
|
+
}
|
|
203
231
|
};
|
|
204
232
|
tslib_1.__decorate([
|
|
205
233
|
lib_1.hooks([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAppPackage.js","sourceRoot":"","sources":["../../../../src/component/driver/teamsApp/createAppPackage.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;AAElC,+CAA8C;AAC9C,wDAA0E;AAC1E,8DAA6B;AAC7B,gEAA0B;AAC1B,mDAA6B;AAC7B,mCAAiC;AACjC,iEAAmE;AACnE,yDAA0D;AAC1D,kDAI+B;AAG/B,mFAAgF;AAChF,+CAAqD;AACrD,2CAAwC;AAExC,yDAAsD;AACtD,+CAAwF;AACxF,iDAAyD;AACzD,sDAAiF;AAEpE,QAAA,UAAU,GAAG,wBAAwB,CAAC;AAGnD,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IAAnC;QACE,gBAAW,GAAG,kCAAkB,CAAC,oDAAoD,CAAC,CAAC;QAC9E,kBAAa,GAAG,kCAAkB,CACzC,qDAAqD,CACtD,CAAC;
|
|
1
|
+
{"version":3,"file":"createAppPackage.js","sourceRoot":"","sources":["../../../../src/component/driver/teamsApp/createAppPackage.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;AAElC,+CAA8C;AAC9C,wDAA0E;AAC1E,8DAA6B;AAC7B,gEAA0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,CAAC;SACH;aAAM;YACL,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;SACtB;IACH,CAAC;IAEO,KAAK,CAAC,sBAAsB,CAClC,IAAY,EACZ,SAAiB;QAEjB,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE;YAChC,OAAO,iBAAG,CACR,IAAI,0BAAiB,CACnB,kBAAU,EACV,IAAI,EACJ,uDAAuD,CACxD,CACF,CAAC;SACH;QAED,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACpD,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACjC,OAAO,iBAAG,CAAC,IAAI,iDAAsC,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;QAED,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC;IAEO,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,QAAgB;QAC7D,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;CACF,CAAA;AAxRC;IAJC,WAAK,CAAC;QACL,2BAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CAAC;QACxE,iDAAuB,CAAC,kBAAU,EAAE,kBAAU,CAAC;KAChD,CAAC;;qDAGS,4BAAiB;;mDAgN3B;AAxOU,sBAAsB;IADlC,gBAAO,CAAC,kBAAU,CAAC;GACP,sBAAsB,CA8SlC;AA9SY,wDAAsB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AsyncAppValidationStatus } from "./AsyncAppValidationResponse";
|
|
2
|
+
export interface AsyncAppValidationDetailsResponse {
|
|
3
|
+
continuationToken: string;
|
|
4
|
+
appValidations: AsyncAppValidationDetailsViewModel[];
|
|
5
|
+
}
|
|
6
|
+
export interface AsyncAppValidationDetailsViewModel {
|
|
7
|
+
/**
|
|
8
|
+
* app validation id
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Teams app id
|
|
13
|
+
*/
|
|
14
|
+
appId: string;
|
|
15
|
+
appVersion: string;
|
|
16
|
+
manifestVersion: string;
|
|
17
|
+
status: AsyncAppValidationStatus;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AsyncAppValidationDetailsResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncAppValidationDetailsResponse.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/interfaces/AsyncAppValidationDetailsResponse.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,WAAW,iCAAiC;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,kCAAkC,EAAE,CAAC;CACtD;AAED,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncAppValidationDetailsResponse.js","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/interfaces/AsyncAppValidationDetailsResponse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response details for the Async App Validation request submitted.
|
|
3
|
+
*/
|
|
4
|
+
export interface AsyncAppValidationResponse {
|
|
5
|
+
status: AsyncAppValidationStatus;
|
|
6
|
+
appValidationId: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Async app validation status
|
|
10
|
+
*/
|
|
11
|
+
export declare enum AsyncAppValidationStatus {
|
|
12
|
+
Created = "Created",
|
|
13
|
+
InProgress = "InProgress",
|
|
14
|
+
Completed = "Completed",
|
|
15
|
+
Aborted = "Aborted"
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=AsyncAppValidationResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncAppValidationResponse.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/interfaces/AsyncAppValidationResponse.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,wBAAwB,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.AsyncAppValidationStatus = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Async app validation status
|
|
8
|
+
*/
|
|
9
|
+
var AsyncAppValidationStatus;
|
|
10
|
+
(function (AsyncAppValidationStatus) {
|
|
11
|
+
AsyncAppValidationStatus["Created"] = "Created";
|
|
12
|
+
AsyncAppValidationStatus["InProgress"] = "InProgress";
|
|
13
|
+
AsyncAppValidationStatus["Completed"] = "Completed";
|
|
14
|
+
AsyncAppValidationStatus["Aborted"] = "Aborted";
|
|
15
|
+
})(AsyncAppValidationStatus = exports.AsyncAppValidationStatus || (exports.AsyncAppValidationStatus = {}));
|
|
16
|
+
//# sourceMappingURL=AsyncAppValidationResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncAppValidationResponse.js","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/interfaces/AsyncAppValidationResponse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAUlC;;GAEG;AACH,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,+CAAmB,CAAA;IACnB,qDAAyB,CAAA;IACzB,mDAAuB,CAAA;IACvB,+CAAmB,CAAA;AACrB,CAAC,EALW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAKnC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AsyncAppValidationStatus } from "./AsyncAppValidationResponse";
|
|
2
|
+
export interface AsyncAppValidationResultsResponse {
|
|
3
|
+
appValidationId: string;
|
|
4
|
+
/**
|
|
5
|
+
* Teams app id
|
|
6
|
+
*/
|
|
7
|
+
appId: string;
|
|
8
|
+
status: AsyncAppValidationStatus;
|
|
9
|
+
appVersion: string;
|
|
10
|
+
manifestVersion: string;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
validationResults: {
|
|
14
|
+
successes: AsyncAppValidationResult[];
|
|
15
|
+
warnings: AsyncAppValidationResult[];
|
|
16
|
+
failures: AsyncAppValidationResult[];
|
|
17
|
+
skipped: AsyncAppValidationResult[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface AsyncAppValidationResult {
|
|
21
|
+
/**
|
|
22
|
+
* The unique code for each validation performed in a test case, e.g. "Validation_ThirdPartyUrl_WebSiteURL"
|
|
23
|
+
*/
|
|
24
|
+
title: string;
|
|
25
|
+
message: string;
|
|
26
|
+
/**
|
|
27
|
+
* Validation code details
|
|
28
|
+
*/
|
|
29
|
+
artifacts: AsyncAppValidationTestDetails;
|
|
30
|
+
}
|
|
31
|
+
export interface AsyncAppValidationTestDetails {
|
|
32
|
+
filePath: string;
|
|
33
|
+
docsUrl: string;
|
|
34
|
+
policyNumber: string;
|
|
35
|
+
policyLinkUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* Recommendation as per guideline
|
|
38
|
+
*/
|
|
39
|
+
recommendation: string;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=AsyncAppValidationResultsResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncAppValidationResultsResponse.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/interfaces/AsyncAppValidationResultsResponse.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,WAAW,iCAAiC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,wBAAwB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,iBAAiB,EAAE;QACjB,SAAS,EAAE,wBAAwB,EAAE,CAAC;QACtC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;QACrC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;QACrC,OAAO,EAAE,wBAAwB,EAAE,CAAC;KACrC,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,6BAA6B,CAAC;CAC1C;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncAppValidationResultsResponse.js","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/interfaces/AsyncAppValidationResultsResponse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Context, FxError, Inputs, Result, Warning } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { ActionContext } from "../../middleware/actionExecutionMW";
|
|
2
3
|
export interface CopilotPluginGeneratorResult {
|
|
3
4
|
warnings?: Warning[];
|
|
4
5
|
}
|
|
5
6
|
export declare class CopilotPluginGenerator {
|
|
6
|
-
static generateFromApiSpec(context: Context, inputs: Inputs, destinationPath: string): Promise<Result<CopilotPluginGeneratorResult, FxError>>;
|
|
7
|
+
static generateFromApiSpec(context: Context, inputs: Inputs, destinationPath: string, actionContext?: ActionContext): Promise<Result<CopilotPluginGeneratorResult, FxError>>;
|
|
7
8
|
static generateFromOpenAIPlugin(context: Context, inputs: Inputs, destinationPath: string): Promise<Result<CopilotPluginGeneratorResult, FxError>>;
|
|
8
|
-
private static
|
|
9
|
+
private static generate;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/copilotPlugin/generator.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,OAAO,EAEP,OAAO,EACP,MAAM,EAIN,MAAM,EAIN,OAAO,EAGR,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/copilotPlugin/generator.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,OAAO,EAEP,OAAO,EACP,MAAM,EAIN,MAAM,EAIN,OAAO,EAGR,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAqB,MAAM,oCAAoC,CAAC;AA0DtF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,qBAAa,sBAAsB;WASb,mBAAmB,CACrC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;WAmCrC,wBAAwB,CAC1C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;mBAWpC,QAAQ;CAsM9B"}
|
|
@@ -20,13 +20,13 @@ const ManifestUtils_1 = require("../../driver/teamsApp/utils/ManifestUtils");
|
|
|
20
20
|
const create_1 = require("../../../question/create");
|
|
21
21
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
22
22
|
const error_1 = require("../../../error");
|
|
23
|
-
const
|
|
23
|
+
const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
|
|
24
24
|
const util = tslib_1.__importStar(require("util"));
|
|
25
25
|
const util_1 = require("../../../question/util");
|
|
26
26
|
const featureFlags_1 = require("../../../common/featureFlags");
|
|
27
|
+
const lodash_1 = require("lodash");
|
|
27
28
|
const fromApiSpecComponentName = "copilot-plugin-existing-api";
|
|
28
29
|
const fromApiSpecTemplateName = "copilot-plugin-existing-api";
|
|
29
|
-
const fromApiSpecWithApiKeyComponentName = "copilot-plugin-existing-api-api-key";
|
|
30
30
|
const fromApiSpecWithApiKeyTemplateName = "copilot-plugin-existing-api-api-key";
|
|
31
31
|
const fromOpenAIPlugincomponentName = "copilot-plugin-from-oai-plugin";
|
|
32
32
|
const fromOpenAIPluginTemplateName = "copilot-plugin-from-oai-plugin";
|
|
@@ -35,25 +35,39 @@ const apiSpecYamlFileName = "openapi.yaml";
|
|
|
35
35
|
const apiSpecJsonFileName = "openapi.json";
|
|
36
36
|
const invalidApiSpecErrorName = "invalid-api-spec";
|
|
37
37
|
const copilotPluginExistingApiSpecUrlTelemetryEvent = "copilot-plugin-existing-api-spec-url";
|
|
38
|
-
const
|
|
38
|
+
const apiPluginFromApiSpecTemplateName = "api-plugin-existing-api";
|
|
39
|
+
var GenerateType;
|
|
40
|
+
(function (GenerateType) {
|
|
41
|
+
GenerateType["ME"] = "api-me";
|
|
42
|
+
GenerateType["ApiPlugin"] = "api-plugin";
|
|
43
|
+
})(GenerateType || (GenerateType = {}));
|
|
39
44
|
function normalizePath(path) {
|
|
40
45
|
return "./" + path.replace(/\\/g, "/");
|
|
41
46
|
}
|
|
42
47
|
class CopilotPluginGenerator {
|
|
43
|
-
static async generateFromApiSpec(context, inputs, destinationPath) {
|
|
48
|
+
static async generateFromApiSpec(context, inputs, destinationPath, actionContext) {
|
|
44
49
|
const apiOperations = inputs[questionNames_1.QuestionNames.ApiOperation];
|
|
45
50
|
const authApi = inputs.supportedApisFromApiSpec.find((api) => !!api.data.authName && apiOperations.includes(api.id));
|
|
46
|
-
|
|
51
|
+
const isApiPlugin = inputs[questionNames_1.QuestionNames.Capabilities] === create_1.CapabilityOptions.copilotPluginApiSpec().id;
|
|
52
|
+
const templateName = isApiPlugin
|
|
53
|
+
? apiPluginFromApiSpecTemplateName
|
|
54
|
+
: authApi
|
|
55
|
+
? fromApiSpecWithApiKeyTemplateName
|
|
56
|
+
: fromApiSpecTemplateName;
|
|
57
|
+
const componentName = fromApiSpecComponentName;
|
|
58
|
+
lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, { ["template-name" /* templateName */]: templateName });
|
|
59
|
+
return await this.generate(context, inputs, destinationPath, templateName, componentName, isApiPlugin, authApi === null || authApi === void 0 ? void 0 : authApi.data);
|
|
47
60
|
}
|
|
48
61
|
static async generateFromOpenAIPlugin(context, inputs, destinationPath) {
|
|
49
|
-
return await this.
|
|
62
|
+
return await this.generate(context, inputs, destinationPath, fromOpenAIPluginTemplateName, fromOpenAIPlugincomponentName, false);
|
|
50
63
|
}
|
|
51
|
-
static async
|
|
64
|
+
static async generate(context, inputs, destinationPath, templateName, componentName, isApiPlugin, apiKeyAuthData) {
|
|
52
65
|
var _a, _b;
|
|
53
66
|
try {
|
|
54
67
|
const appName = inputs[questionNames_1.QuestionNames.AppName];
|
|
55
68
|
const language = inputs[questionNames_1.QuestionNames.ProgrammingLanguage];
|
|
56
69
|
const safeProjectNameFromVS = language === "csharp" ? inputs[questionNames_1.QuestionNames.SafeProjectName] : undefined;
|
|
70
|
+
const type = isApiPlugin ? GenerateType.ApiPlugin : GenerateType.ME;
|
|
57
71
|
const manifestPath = path_1.default.join(destinationPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName);
|
|
58
72
|
const apiSpecFolderPath = path_1.default.join(destinationPath, teamsfx_api_1.AppPackageFolderName, apiSpecFolderName);
|
|
59
73
|
let url = (_a = inputs[questionNames_1.QuestionNames.ApiSpecLocation]) !== null && _a !== void 0 ? _a : (_b = inputs.openAIPluginManifest) === null || _b === void 0 ? void 0 : _b.api.url;
|
|
@@ -83,15 +97,16 @@ class CopilotPluginGenerator {
|
|
|
83
97
|
if (templateRes.isErr())
|
|
84
98
|
return teamsfx_api_1.err(templateRes.error);
|
|
85
99
|
context.telemetryReporter.sendTelemetryEvent(copilotPluginExistingApiSpecUrlTelemetryEvent, {
|
|
86
|
-
[isRemoteUrlTelemetryProperty]: util_1.isValidHttpUrl(url).toString(),
|
|
100
|
+
["remote-url" /* isRemoteUrlTelemetryProperty */]: util_1.isValidHttpUrl(url).toString(),
|
|
101
|
+
["generate-type" /* generateType */]: type,
|
|
87
102
|
});
|
|
88
103
|
// validate API spec
|
|
89
104
|
const allowAPIKeyAuth = featureFlags_1.isApiKeyEnabled();
|
|
90
105
|
const allowMultipleParameters = featureFlags_1.isMultipleParametersEnabled();
|
|
91
|
-
const specParser = new
|
|
106
|
+
const specParser = new m365_spec_parser_1.SpecParser(url, { allowAPIKeyAuth, allowMultipleParameters });
|
|
92
107
|
const validationRes = await specParser.validate();
|
|
93
108
|
const warnings = validationRes.warnings;
|
|
94
|
-
const operationIdWarning = warnings.find((w) => w.type ===
|
|
109
|
+
const operationIdWarning = warnings.find((w) => w.type === m365_spec_parser_1.WarningType.OperationIdMissing);
|
|
95
110
|
if (operationIdWarning && operationIdWarning.data) {
|
|
96
111
|
const apisMissingOperationId = operationIdWarning.data.filter((api) => filters.includes(api));
|
|
97
112
|
if (apisMissingOperationId.length > 0) {
|
|
@@ -102,11 +117,11 @@ class CopilotPluginGenerator {
|
|
|
102
117
|
warnings.splice(warnings.indexOf(operationIdWarning), 1);
|
|
103
118
|
}
|
|
104
119
|
}
|
|
105
|
-
const specVersionWarning = warnings.find((w) => w.type ===
|
|
120
|
+
const specVersionWarning = warnings.find((w) => w.type === m365_spec_parser_1.WarningType.ConvertSwaggerToOpenAPI);
|
|
106
121
|
if (specVersionWarning) {
|
|
107
122
|
specVersionWarning.content = ""; // We don't care content of this warning
|
|
108
123
|
}
|
|
109
|
-
if (validationRes.status ===
|
|
124
|
+
if (validationRes.status === m365_spec_parser_1.ValidationStatus.Error) {
|
|
110
125
|
helper_1.logValidationResults(validationRes.errors, warnings, context, true, false, true);
|
|
111
126
|
const errorMessage = inputs.platform === teamsfx_api_1.Platform.VSCode
|
|
112
127
|
? localizeUtils_1.getLocalizedString("core.createProjectQuestion.apiSpec.multipleValidationErrors.vscode.message")
|
|
@@ -118,6 +133,7 @@ class CopilotPluginGenerator {
|
|
|
118
133
|
const adaptiveCardFolder = path_1.default.join(destinationPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ResponseTemplatesFolderName);
|
|
119
134
|
const generateResult = await specParser.generate(manifestPath, filters, openapiSpecPath, adaptiveCardFolder);
|
|
120
135
|
context.telemetryReporter.sendTelemetryEvent(helper_1.specParserGenerateResultTelemetryEvent, {
|
|
136
|
+
["generate-type" /* generateType */]: type,
|
|
121
137
|
[helper_1.specParserGenerateResultAllSuccessTelemetryProperty]: generateResult.allSuccess.toString(),
|
|
122
138
|
[helper_1.specParserGenerateResultWarningsTelemetryProperty]: generateResult.warnings
|
|
123
139
|
.map((w) => w.type.toString() + ": " + w.content)
|
|
@@ -125,7 +141,7 @@ class CopilotPluginGenerator {
|
|
|
125
141
|
});
|
|
126
142
|
if (generateResult.warnings.length > 0) {
|
|
127
143
|
generateResult.warnings.find((o) => {
|
|
128
|
-
if (o.type ===
|
|
144
|
+
if (o.type === m365_spec_parser_1.WarningType.OperationOnlyContainsOptionalParam) {
|
|
129
145
|
o.content = ""; // We don't care content of this warning
|
|
130
146
|
}
|
|
131
147
|
});
|
|
@@ -166,7 +182,7 @@ class CopilotPluginGenerator {
|
|
|
166
182
|
}
|
|
167
183
|
catch (e) {
|
|
168
184
|
let error;
|
|
169
|
-
if (e instanceof
|
|
185
|
+
if (e instanceof m365_spec_parser_1.SpecParserError) {
|
|
170
186
|
error = helper_1.convertSpecParserErrorToFxError(e);
|
|
171
187
|
}
|
|
172
188
|
else {
|
|
@@ -186,7 +202,7 @@ tslib_1.__decorate([
|
|
|
186
202
|
}),
|
|
187
203
|
]),
|
|
188
204
|
tslib_1.__metadata("design:type", Function),
|
|
189
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object, String]),
|
|
205
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, String, Object]),
|
|
190
206
|
tslib_1.__metadata("design:returntype", Promise)
|
|
191
207
|
], CopilotPluginGenerator, "generateFromApiSpec", null);
|
|
192
208
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/copilotPlugin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,+CAA8C;AAC9C,wDAegC;AAChC,4CAAyC;AACzC,wDAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/copilotPlugin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,+CAA8C;AAC9C,wDAegC;AAChC,4CAAyC;AACzC,wDAAwB;AACxB,0EAAsF;AACtF,mEAAgE;AAChE,mEAAgE;AAChE,qCASkB;AAClB,iEAAmE;AACnE,6EAA0E;AAC1E,qDAAkF;AAClF,qDAA+B;AAC/B,0CAA+C;AAC/C,kEAKqC;AACrC,mDAA6B;AAC7B,iDAAwD;AACxD,+DAA4F;AAC5F,mCAA+B;AAE/B,MAAM,wBAAwB,GAAG,6BAA6B,CAAC;AAC/D,MAAM,uBAAuB,GAAG,6BAA6B,CAAC;AAC9D,MAAM,iCAAiC,GAAG,qCAAqC,CAAC;AAChF,MAAM,6BAA6B,GAAG,gCAAgC,CAAC;AACvE,MAAM,4BAA4B,GAAG,gCAAgC,CAAC;AACtE,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AACjD,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAC3C,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AACnD,MAAM,6CAA6C,GAAG,sCAAsC,CAAC;AAE7F,MAAM,gCAAgC,GAAG,yBAAyB,CAAC;AAQnE,IAAK,YAGJ;AAHD,WAAK,YAAY;IACf,6BAAa,CAAA;IACb,wCAAwB,CAAA;AAC1B,CAAC,EAHI,YAAY,KAAZ,YAAY,QAGhB;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AAMD,MAAa,sBAAsB;IAS1B,MAAM,CAAC,KAAK,CAAC,mBAAmB,CACrC,OAAgB,EAChB,MAAc,EACd,eAAuB,EACvB,aAA6B;QAE7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,IAAI,KAAc,CAAC;YACnB,IAAI,CAAC,YAAY,kCAAe,EAAE;gBAChC,KAAK,GAAG,wCAA+B,CAAC,CAAC,CAAC,CAAC;aAC5C;iBAAM;gBACL,KAAK,GAAG,qBAAa,CAAC,CAAC,CAAC,CAAC;aAC1B;YACD,OAAO,iBAAG,CAAC,KAAK,CAAC,CAAC;SACnB;IACH,CAAC;CACF;AA7PC;IARC,WAAK,CAAC;QACL,qCAAiB,CAAC;YAChB,eAAe,EAAE,IAAI;YACrB,sBAAsB,EAAE,wBAAwB;YAChD,kBAAkB,EAAE,iCAAe,CAAC,QAAQ;YAC5C,WAAW,EAAE,wBAAwB;SACtC,CAAC;KACH,CAAC;;;;uDA+BD;AAUD;IARC,WAAK,CAAC;QACL,qCAAiB,CAAC;YAChB,eAAe,EAAE,IAAI;YACrB,sBAAsB,EAAE,6BAA6B;YACrD,kBAAkB,EAAE,iCAAe,CAAC,QAAQ;YAC5C,WAAW,EAAE,6BAA6B;SAC3C,CAAC;KACH,CAAC;;;;4DAcD;AA9DH,wDAsQC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @author yuqzho@microsoft.com
|
|
3
3
|
*/
|
|
4
4
|
import { Context, FxError, OpenAIPluginManifest, Result, TeamsAppManifest, ApiOperation, Warning } from "@microsoft/teamsfx-api";
|
|
5
|
-
import { ErrorType as ApiSpecErrorType, WarningResult, SpecParserError, ErrorResult as ApiSpecErrorResult } from "
|
|
5
|
+
import { ErrorType as ApiSpecErrorType, WarningResult, SpecParserError, ErrorResult as ApiSpecErrorResult } from "@microsoft/m365-spec-parser";
|
|
6
6
|
declare enum OpenAIPluginManifestErrorType {
|
|
7
7
|
AuthNotSupported = "openai-pliugin-auth-not-supported",
|
|
8
8
|
ApiUrlMissing = "openai-plugin-api-url-missing"
|
|
@@ -10,7 +10,7 @@ const tslib_1 = require("tslib");
|
|
|
10
10
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
11
11
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
|
-
const
|
|
13
|
+
const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
|
|
14
14
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
15
15
|
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
16
16
|
const error_1 = require("../../../error");
|
|
@@ -72,14 +72,14 @@ async function listOperations(context, manifest, apiSpecUrl, teamsManifestPath,
|
|
|
72
72
|
try {
|
|
73
73
|
const allowAPIKeyAuth = featureFlags_1.isApiKeyEnabled();
|
|
74
74
|
const allowMultipleParameters = featureFlags_1.isMultipleParametersEnabled();
|
|
75
|
-
const specParser = new
|
|
75
|
+
const specParser = new m365_spec_parser_1.SpecParser(apiSpecUrl, {
|
|
76
76
|
allowAPIKeyAuth,
|
|
77
77
|
allowMultipleParameters,
|
|
78
78
|
});
|
|
79
79
|
const validationRes = await specParser.validate();
|
|
80
80
|
validationRes.errors = formatValidationErrors(validationRes.errors);
|
|
81
81
|
logValidationResults(validationRes.errors, validationRes.warnings, context, true, shouldLogWarning, false, existingCorrelationId);
|
|
82
|
-
if (validationRes.status ===
|
|
82
|
+
if (validationRes.status === m365_spec_parser_1.ValidationStatus.Error) {
|
|
83
83
|
return teamsfx_api_1.err(validationRes.errors);
|
|
84
84
|
}
|
|
85
85
|
let operations = await specParser.list();
|
|
@@ -97,7 +97,7 @@ async function listOperations(context, manifest, apiSpecUrl, teamsManifestPath,
|
|
|
97
97
|
if (operations.length == 0) {
|
|
98
98
|
const errors = [
|
|
99
99
|
{
|
|
100
|
-
type:
|
|
100
|
+
type: m365_spec_parser_1.ErrorType.NoExtraAPICanBeAdded,
|
|
101
101
|
content: localizeUtils_1.getLocalizedString("error.copilotPlugin.noExtraAPICanBeAdded"),
|
|
102
102
|
},
|
|
103
103
|
];
|
|
@@ -113,7 +113,7 @@ async function listOperations(context, manifest, apiSpecUrl, teamsManifestPath,
|
|
|
113
113
|
return teamsfx_api_1.ok(sortedOperations);
|
|
114
114
|
}
|
|
115
115
|
catch (e) {
|
|
116
|
-
if (e instanceof
|
|
116
|
+
if (e instanceof m365_spec_parser_1.SpecParserError) {
|
|
117
117
|
throw convertSpecParserErrorToFxError(e);
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
@@ -242,11 +242,11 @@ function generateScaffoldingSummary(warnings, teamsManifest, projectPath) {
|
|
|
242
242
|
exports.generateScaffoldingSummary = generateScaffoldingSummary;
|
|
243
243
|
function formatApiSpecValidationWarningMessage(specWarnings, apiSpecFileName) {
|
|
244
244
|
const resultWarnings = [];
|
|
245
|
-
const operationIdWarning = specWarnings.find((w) => w.type ===
|
|
245
|
+
const operationIdWarning = specWarnings.find((w) => w.type === m365_spec_parser_1.WarningType.OperationIdMissing);
|
|
246
246
|
if (operationIdWarning) {
|
|
247
247
|
resultWarnings.push(localizeUtils_1.getLocalizedString("core.copilotPlugin.scaffold.summary.warning.operationId", `${constant_1.SummaryConstant.NotExecuted} ${operationIdWarning.content}`, teamsfx_api_1.ManifestTemplateFileName));
|
|
248
248
|
}
|
|
249
|
-
const swaggerWarning = specWarnings.find((w) => w.type ===
|
|
249
|
+
const swaggerWarning = specWarnings.find((w) => w.type === m365_spec_parser_1.WarningType.ConvertSwaggerToOpenAPI);
|
|
250
250
|
if (swaggerWarning) {
|
|
251
251
|
resultWarnings.push(`${constant_1.SummaryConstant.NotExecuted} ` +
|
|
252
252
|
localizeUtils_1.getLocalizedString("core.copilotPlugin.scaffold.summary.warning.swaggerVersion", apiSpecFileName));
|
|
@@ -285,7 +285,7 @@ function validateTeamsManifestLength(teamsManifest, projectPath, warnings) {
|
|
|
285
285
|
}
|
|
286
286
|
// validate command
|
|
287
287
|
if (teamsfx_api_1.ManifestUtil.parseCommonProperties(teamsManifest).isApiME) {
|
|
288
|
-
const optionalParamsOnlyWarnings = warnings.filter((o) => o.type ===
|
|
288
|
+
const optionalParamsOnlyWarnings = warnings.filter((o) => o.type === m365_spec_parser_1.WarningType.OperationOnlyContainsOptionalParam);
|
|
289
289
|
const commands = teamsManifest.composeExtensions[0].commands;
|
|
290
290
|
if (optionalParamsOnlyWarnings) {
|
|
291
291
|
for (const optionalParamsOnlyWarning of optionalParamsOnlyWarnings) {
|
|
@@ -300,7 +300,7 @@ function validateTeamsManifestLength(teamsManifest, projectPath, warnings) {
|
|
|
300
300
|
for (const command of commands) {
|
|
301
301
|
if (command.type === "query") {
|
|
302
302
|
if (!command.apiResponseRenderingTemplateFile) {
|
|
303
|
-
const errorDetail = (_e = warnings.find((w) => w.type ===
|
|
303
|
+
const errorDetail = (_e = warnings.find((w) => w.type === m365_spec_parser_1.WarningType.GenerateCardFailed && w.data === command.id)) === null || _e === void 0 ? void 0 : _e.content;
|
|
304
304
|
resultWarnings.push(localizeUtils_1.getLocalizedString("core.copilotPlugin.scaffold.summary.warning.teamsManifest.missingCardTemlate", "apiResponseRenderingTemplateFile", command.id) +
|
|
305
305
|
localizeUtils_1.getLocalizedString("core.copilotPlugin.scaffold.summary.warning.teamsManifest.missingCardTemlate.mitigation", teamsfx_api_1.AppPackageFolderName, `composeExtensions/commands/${command.id}/apiResponseRenderingTemplateFile`, path_1.default.join(teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName)) +
|
|
306
306
|
(errorDetail ? os_1.EOL + errorDetail : ""));
|
|
@@ -351,7 +351,7 @@ exports.formatValidationErrors = formatValidationErrors;
|
|
|
351
351
|
function formatValidationErrorContent(error) {
|
|
352
352
|
try {
|
|
353
353
|
switch (error.type) {
|
|
354
|
-
case
|
|
354
|
+
case m365_spec_parser_1.ErrorType.SpecNotValid: {
|
|
355
355
|
let content = error.content;
|
|
356
356
|
if (error.content.startsWith("ResolverError: Error downloading")) {
|
|
357
357
|
content = error.content
|
|
@@ -362,23 +362,23 @@ function formatValidationErrorContent(error) {
|
|
|
362
362
|
}
|
|
363
363
|
return content;
|
|
364
364
|
}
|
|
365
|
-
case
|
|
365
|
+
case m365_spec_parser_1.ErrorType.RemoteRefNotSupported:
|
|
366
366
|
return localizeUtils_1.getLocalizedString("core.common.RemoteRefNotSupported", error.data.join(", "));
|
|
367
|
-
case
|
|
367
|
+
case m365_spec_parser_1.ErrorType.NoServerInformation:
|
|
368
368
|
return localizeUtils_1.getLocalizedString("core.common.NoServerInformation");
|
|
369
|
-
case
|
|
369
|
+
case m365_spec_parser_1.ErrorType.UrlProtocolNotSupported:
|
|
370
370
|
return localizeUtils_1.getLocalizedString("core.common.UrlProtocolNotSupported", error.data);
|
|
371
|
-
case
|
|
371
|
+
case m365_spec_parser_1.ErrorType.RelativeServerUrlNotSupported:
|
|
372
372
|
return localizeUtils_1.getLocalizedString("core.common.RelativeServerUrlNotSupported");
|
|
373
|
-
case
|
|
373
|
+
case m365_spec_parser_1.ErrorType.NoSupportedApi:
|
|
374
374
|
return localizeUtils_1.getLocalizedString("core.common.NoSupportedApi");
|
|
375
|
-
case
|
|
375
|
+
case m365_spec_parser_1.ErrorType.NoExtraAPICanBeAdded:
|
|
376
376
|
return localizeUtils_1.getLocalizedString("error.copilotPlugin.noExtraAPICanBeAdded");
|
|
377
|
-
case
|
|
377
|
+
case m365_spec_parser_1.ErrorType.ResolveServerUrlFailed:
|
|
378
378
|
return error.content;
|
|
379
|
-
case
|
|
379
|
+
case m365_spec_parser_1.ErrorType.Cancelled:
|
|
380
380
|
return localizeUtils_1.getLocalizedString("core.common.CancelledMessage");
|
|
381
|
-
case
|
|
381
|
+
case m365_spec_parser_1.ErrorType.SwaggerNotSupported:
|
|
382
382
|
return localizeUtils_1.getLocalizedString("core.common.SwaggerNotSupported");
|
|
383
383
|
default:
|
|
384
384
|
return error.content;
|