@microsoft/teamsfx-core 2.0.6-alpha.07708d12e.0 → 2.0.6-alpha.136ac351d.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 -1
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +1 -1
- package/build/common/constants.js.map +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.d.ts +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/funcToolChecker.js.map +1 -1
- package/build/common/featureFlags.d.ts +1 -1
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +5 -6
- 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/local/localCertificateManager.d.ts +3 -2
- package/build/common/local/localCertificateManager.d.ts.map +1 -1
- package/build/common/local/localCertificateManager.js +5 -1
- package/build/common/local/localCertificateManager.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/samples.d.ts +5 -0
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +28 -30
- package/build/common/samples.js.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.js +2 -4
- package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -1
- package/build/common/spec-parser/constants.d.ts +22 -13
- package/build/common/spec-parser/constants.d.ts.map +1 -1
- package/build/common/spec-parser/constants.js +22 -14
- package/build/common/spec-parser/constants.js.map +1 -1
- package/build/common/spec-parser/index.browser.d.ts +6 -0
- package/build/common/spec-parser/index.browser.d.ts.map +1 -0
- package/build/common/spec-parser/index.browser.js +16 -0
- package/build/common/spec-parser/index.browser.js.map +1 -0
- package/build/common/spec-parser/index.d.ts +1 -1
- package/build/common/spec-parser/index.d.ts.map +1 -1
- package/build/common/spec-parser/index.js.map +1 -1
- package/build/common/spec-parser/interfaces.d.ts +23 -2
- package/build/common/spec-parser/interfaces.d.ts.map +1 -1
- package/build/common/spec-parser/interfaces.js +3 -2
- package/build/common/spec-parser/interfaces.js.map +1 -1
- package/build/common/spec-parser/manifestUpdater.d.ts +2 -1
- package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -1
- package/build/common/spec-parser/manifestUpdater.js +20 -7
- 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.browser.d.ts +51 -0
- package/build/common/spec-parser/specParser.browser.d.ts.map +1 -0
- package/build/common/spec-parser/specParser.browser.js +145 -0
- package/build/common/spec-parser/specParser.browser.js.map +1 -0
- package/build/common/spec-parser/specParser.d.ts +11 -6
- package/build/common/spec-parser/specParser.d.ts.map +1 -1
- package/build/common/spec-parser/specParser.js +108 -101
- package/build/common/spec-parser/specParser.js.map +1 -1
- package/build/common/spec-parser/utils.d.ts +10 -4
- package/build/common/spec-parser/utils.d.ts.map +1 -1
- package/build/common/spec-parser/utils.js +142 -26
- package/build/common/spec-parser/utils.js.map +1 -1
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +1 -1
- package/build/common/tools.js.map +1 -1
- package/build/component/configManager/validator.d.ts.map +1 -1
- package/build/component/configManager/validator.js +2 -3
- package/build/component/configManager/validator.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/aad/create.js +1 -1
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/error/invalidFieldInManifestError.js +1 -1
- package/build/component/driver/aad/error/invalidFieldInManifestError.js.map +1 -1
- package/build/component/driver/aad/permissions/permissions.json +42 -42
- package/build/component/driver/aad/update.d.ts.map +1 -1
- package/build/component/driver/aad/update.js +6 -4
- package/build/component/driver/aad/update.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +8 -8
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/aad/utility/constants.js +1 -1
- package/build/component/driver/aad/utility/constants.js.map +1 -1
- package/build/component/driver/apiKey/create.d.ts +16 -0
- package/build/component/driver/apiKey/create.d.ts.map +1 -0
- package/build/component/driver/apiKey/create.js +211 -0
- package/build/component/driver/apiKey/create.js.map +1 -0
- package/build/component/driver/apiKey/error/apiKeyClientSecretInvalid.d.ts +5 -0
- package/build/component/driver/apiKey/error/apiKeyClientSecretInvalid.d.ts.map +1 -0
- package/build/component/driver/apiKey/error/apiKeyClientSecretInvalid.js +22 -0
- package/build/component/driver/apiKey/error/apiKeyClientSecretInvalid.js.map +1 -0
- package/build/component/driver/apiKey/error/apiKeyDomainInvalid.d.ts +5 -0
- package/build/component/driver/apiKey/error/apiKeyDomainInvalid.d.ts.map +1 -0
- package/build/component/driver/apiKey/error/apiKeyDomainInvalid.js +22 -0
- package/build/component/driver/apiKey/error/apiKeyDomainInvalid.js.map +1 -0
- package/build/component/driver/apiKey/error/apiKeyNameTooLong.d.ts +5 -0
- package/build/component/driver/apiKey/error/apiKeyNameTooLong.d.ts.map +1 -0
- package/build/component/driver/apiKey/error/apiKeyNameTooLong.js +21 -0
- package/build/component/driver/apiKey/error/apiKeyNameTooLong.js.map +1 -0
- package/build/component/driver/apiKey/interface/createApiKeyArgs.d.ts +8 -0
- package/build/component/driver/apiKey/interface/createApiKeyArgs.d.ts.map +1 -0
- package/build/component/driver/apiKey/interface/createApiKeyArgs.js +5 -0
- package/build/component/driver/apiKey/interface/createApiKeyArgs.js.map +1 -0
- package/build/component/driver/apiKey/interface/createApiKeyOutputs.d.ts +7 -0
- package/build/component/driver/apiKey/interface/createApiKeyOutputs.d.ts.map +1 -0
- package/build/component/driver/apiKey/interface/createApiKeyOutputs.js +10 -0
- package/build/component/driver/apiKey/interface/createApiKeyOutputs.js.map +1 -0
- package/build/component/driver/apiKey/utility/constants.d.ts +10 -0
- package/build/component/driver/apiKey/utility/constants.d.ts.map +1 -0
- package/build/component/driver/apiKey/utility/constants.js +15 -0
- package/build/component/driver/apiKey/utility/constants.js.map +1 -0
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +6 -6
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
- package/build/component/driver/devTool/installDriver.d.ts.map +1 -1
- package/build/component/driver/devTool/installDriver.js +2 -1
- package/build/component/driver/devTool/installDriver.js.map +1 -1
- package/build/component/driver/devTool/interfaces/InstallToolArgs.d.ts +1 -1
- package/build/component/driver/devTool/interfaces/InstallToolArgs.d.ts.map +1 -1
- package/build/component/driver/index.d.ts +1 -0
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +1 -0
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +2 -2
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts +13 -0
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +38 -0
- package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +2 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +2 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.d.ts +44 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.js +21 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.js.map +1 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistrationClientSecret.d.ts +15 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistrationClientSecret.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistrationClientSecret.js +5 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistrationClientSecret.js.map +1 -0
- package/build/component/driver/teamsApp/interfaces/appdefinitions/IValidationResult.d.ts +1 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/IValidationResult.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +26 -6
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +15 -8
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +3 -1
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +72 -8
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.js +7 -0
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/spfx/utils/constants.d.ts +1 -14
- package/build/component/generator/spfx/utils/constants.d.ts.map +1 -1
- package/build/component/generator/spfx/utils/constants.js +1 -14
- package/build/component/generator/spfx/utils/constants.js.map +1 -1
- package/build/component/utils/ResourceGroupHelper.d.ts +1 -0
- package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
- package/build/component/utils/ResourceGroupHelper.js +31 -1
- package/build/component/utils/ResourceGroupHelper.js.map +1 -1
- package/build/core/FxCore.d.ts +1 -0
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +3 -1
- 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/core/middleware/utils/debug/taskMigrator.js +1 -1
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +26 -7
- package/build/question/create.js.map +1 -1
- package/build/question/inputs/DeployAadManifestInputs.d.ts +1 -1
- package/build/question/inputs/DeployAadManifestInputs.d.ts.map +1 -1
- package/build/question/inputs/PermissionGrantInputs.d.ts +2 -2
- package/build/question/inputs/PermissionGrantInputs.d.ts.map +1 -1
- package/build/question/inputs/PermissionListInputs.d.ts +1 -1
- package/build/question/inputs/PermissionListInputs.d.ts.map +1 -1
- package/build/question/options/DeployAadManifestOptions.js +1 -1
- package/build/question/options/DeployAadManifestOptions.js.map +1 -1
- package/build/question/options/PermissionGrantOptions.js +1 -1
- package/build/question/options/PermissionGrantOptions.js.map +1 -1
- package/build/question/options/PermissionListOptions.js +1 -1
- package/build/question/options/PermissionListOptions.js.map +1 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +23 -2
- package/build/question/other.js.map +1 -1
- package/package.json +6 -5
- package/resource/package.nls.json +52 -43
- package/resource/yaml-schema/v1.3/yaml.schema.json +83 -32
- package/templates/core/v3Migration/csharp.app.local.yml +6 -6
- package/templates/core/v3Migration/csharp.app.yml +6 -6
- package/templates/core/v3Migration/js.ts.app.local.yml +11 -11
- package/templates/core/v3Migration/js.ts.app.yml +12 -12
- 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 +2 -2
- package/templates/plugins/resource/aad/auth/bot/README.md +13 -13
- package/templates/plugins/resource/aad/auth/bot/README.txt +7 -7
- package/templates/plugins/resource/aad/auth/tab/README.md +6 -6
- package/templates/plugins/resource/aad/auth/tab/README.txt +5 -5
- package/templates/plugins/resource/aad/auth/tab/js/sso/GetUserProfile.jsx +1 -1
- package/templates/plugins/resource/aad/auth/tab/ts/sso/GetUserProfile.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"samples.js","sourceRoot":"","sources":["../../src/common/samples.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,0DAA0B;AAE1B,wDAAsF;AACtF,2CAA8C;
|
|
1
|
+
{"version":3,"file":"samples.js","sourceRoot":"","sources":["../../src/common/samples.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,0DAA0B;AAE1B,wDAAsF;AACtF,2CAA8C;AAE9C,4CAAoD;AACpD,6CAA0C;AAC1C,mDAAoD;AAEpD,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAElD,MAAM,iBAAiB,GAAG,WAAW,CAAC;AACtC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAC3C,MAAM,gBAAgB,GAAG,gCAAgC,CAAC;AAC7C,QAAA,eAAe,GAAG,QAAQ,CAAC;AACxC,6FAA6F;AAChF,QAAA,oBAAoB,GAAG,QAAQ,CAAC;AAChC,QAAA,+BAA+B,GAAG,IAAI,CAAC;AAuCpD,MAAM,cAAc;IAApB;QAGU,gBAAW,GAAG,uBAAe,CAAC;IAqGxC,CAAC;IAlGQ,KAAK,CAAC,iBAAiB;QAC5B,MAAM,OAAO,GAAW,WAAW,CAAC,OAAO,CAAC;QAC5C,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC7B,8CAA8C;YAC9C,IAAI,CAA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C;
|
|
1
|
+
{"version":3,"file":"adaptiveCardGenerator.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/adaptiveCardGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EACL,YAAY,EACZ,YAAY,EAEZ,YAAY,EACZ,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAItB,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,SAAS,CAAC,eAAe,GACvC,CAAC,YAAY,EAAE,MAAM,CAAC,CAkDxB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,CAAC,YAAY,EAC9B,IAAI,EAAE,MAAM,EACZ,eAAe,SAAK,GACnB,KAAK,CAAC,gBAAgB,GAAG,YAAY,GAAG,YAAY,CAAC,CAiGvD;AAGD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,GAAG,MAAM,CAepF;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,CAAC,oBAAoB,EACtC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,OAAO,CAQT"}
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.isImageUrlProperty = exports.getResponseJsonPathFromSchema = exports.generateCardFromResponse = exports.generateAdaptiveCard = void 0;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
|
-
const util = tslib_1.__importStar(require("util"));
|
|
8
6
|
const utils_1 = require("./utils");
|
|
9
7
|
const interfaces_1 = require("./interfaces");
|
|
10
8
|
const constants_1 = require("./constants");
|
|
@@ -139,9 +137,9 @@ function generateCardFromResponse(schema, name, parentArrayName = "") {
|
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
if (schema.oneOf || schema.anyOf || schema.not || schema.allOf) {
|
|
142
|
-
throw new Error(
|
|
140
|
+
throw new Error(utils_1.format(constants_1.ConstantString.SchemaNotSupported, JSON.stringify(schema)));
|
|
143
141
|
}
|
|
144
|
-
throw new Error(
|
|
142
|
+
throw new Error(utils_1.format(constants_1.ConstantString.UnknownSchema, JSON.stringify(schema)));
|
|
145
143
|
}
|
|
146
144
|
exports.generateCardFromResponse = generateCardFromResponse;
|
|
147
145
|
// Find the first array property in the response schema object with the well-known name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptiveCardGenerator.js","sourceRoot":"","sources":["../../../src/common/spec-parser/adaptiveCardGenerator.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"adaptiveCardGenerator.js","sourceRoot":"","sources":["../../../src/common/spec-parser/adaptiveCardGenerator.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAGb,mCAAmE;AACnE,6CAMsB;AACtB,2CAA6C;AAC7C,uDAAoD;AAEpD,SAAgB,oBAAoB,CAClC,aAAwC;IAExC,IAAI;QACF,MAAM,IAAI,GAAG,uBAAe,CAAC,aAAa,CAAC,CAAC;QAE5C,IAAI,QAAQ,GAA0D,EAAE,CAAC;QAEzE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAgC,CAAC;QACnD,IAAI,QAAQ,GAAG,GAAG,CAAC;QACnB,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5C,QAAQ,GAAG,6BAA6B,CAAC,MAAM,CAAC,CAAC;YACjD,IAAI,QAAQ,KAAK,GAAG,EAAE;gBACpB,MAAM,GAAG,MAAM,CAAC,UAAW,CAAC,QAAQ,CAA2B,CAAC;aACjE;YAED,QAAQ,GAAG,wBAAwB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACjD;QAED,yCAAyC;QACzC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAA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ACvF,SAAgB,6BAA6B,CAAC,MAA8B;IAC1E,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,EAAE;QACnE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QAC9B,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE;YACjC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAA2B,CAAC;YAC9D,IACE,MAAM,CAAC,IAAI,KAAK,OAAO;gBACvB,uBAAe,CAAC,QAAQ,EAAE,0BAAc,CAAC,oBAAoB,CAAC,EAC9D;gBACA,OAAO,QAAQ,CAAC;aACjB;SACF;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAfD,sEAeC;AAED,SAAgB,kBAAkB,CAChC,MAAsC,EACtC,IAAY,EACZ,eAAuB;IAEvB,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;IACnD,OAAO,CACL,CAAC,CAAC,YAAY;QACd,MAAM,CAAC,IAAI,KAAK,QAAQ;QACxB,uBAAe,CAAC,YAAY,EAAE,0BAAc,CAAC,kBAAkB,CAAC;QAChE,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,CAClF,CAAC;AACJ,CAAC;AAZD,gDAYC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
export declare class ConstantString {
|
|
2
|
-
static readonly CancelledMessage
|
|
3
|
-
static readonly NoServerInformation
|
|
4
|
-
static readonly RemoteRefNotSupported:
|
|
5
|
-
static readonly MissingOperationId:
|
|
6
|
-
static readonly NoSupportedApi:
|
|
7
|
-
static readonly AdditionalPropertiesNotSupported
|
|
8
|
-
static readonly SchemaNotSupported:
|
|
9
|
-
static readonly UnknownSchema:
|
|
10
|
-
static readonly UrlProtocolNotSupported:
|
|
11
|
-
static readonly RelativeServerUrlNotSupported:
|
|
12
|
-
static readonly ResolveServerUrlFailed:
|
|
13
|
-
static readonly OperationOnlyContainsOptionalParam
|
|
14
|
-
static readonly ConvertSwaggerToOpenAPI
|
|
2
|
+
static readonly CancelledMessage = "Operation is cancelled.";
|
|
3
|
+
static readonly NoServerInformation = "No server information is found in the OpenAPI description document.";
|
|
4
|
+
static readonly RemoteRefNotSupported = "Remote reference is not supported: %s.";
|
|
5
|
+
static readonly MissingOperationId = "Missing operationIds: %s.";
|
|
6
|
+
static readonly NoSupportedApi = "No supported API is found in the OpenAPI description document: only GET and POST methods are supported, additionally, there can be at most one required parameter, and no auth is allowed.";
|
|
7
|
+
static readonly AdditionalPropertiesNotSupported = "'additionalProperties' is not supported, and will be ignored.";
|
|
8
|
+
static readonly SchemaNotSupported = "'oneOf', 'anyOf', and 'not' schema are not supported: %s.";
|
|
9
|
+
static readonly UnknownSchema = "Unknown schema: %s.";
|
|
10
|
+
static readonly UrlProtocolNotSupported = "Server url is not correct: protocol %s is not supported, you should use https protocol instead.";
|
|
11
|
+
static readonly RelativeServerUrlNotSupported = "Server url is not correct: relative server url is not supported.";
|
|
12
|
+
static readonly ResolveServerUrlFailed = "Unable to resolve the server URL: please make sure that the environment variable %s is defined.";
|
|
13
|
+
static readonly OperationOnlyContainsOptionalParam = "Operation %s contains multiple optional parameters. The first optional parameter is used for this command.";
|
|
14
|
+
static readonly ConvertSwaggerToOpenAPI = "The Swagger 2.0 file has been converted to OpenAPI 3.0.";
|
|
15
|
+
static readonly SwaggerNotSupported = "Swagger 2.0 is not supported. Please convert to OpenAPI 3.0 manually before proceeding.";
|
|
16
|
+
static readonly MultipleAPIKeyNotSupported = "Multiple API keys are not supported. Please make sure that all selected APIs use the same API key.";
|
|
15
17
|
static readonly WrappedCardVersion = "devPreview";
|
|
16
18
|
static readonly WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
|
|
17
19
|
static readonly WrappedCardResponseLayout = "list";
|
|
@@ -22,11 +24,18 @@ export declare class ConstantString {
|
|
|
22
24
|
static readonly AdaptiveCardType = "AdaptiveCard";
|
|
23
25
|
static readonly TextBlockType = "TextBlock";
|
|
24
26
|
static readonly ContainerType = "Container";
|
|
27
|
+
static readonly RegistrationIdPostfix = "REGISTRATION_ID";
|
|
25
28
|
static readonly ResponseCodeFor20X: string[];
|
|
26
29
|
static readonly AllOperationMethods: string[];
|
|
27
30
|
static readonly WellknownResultNames: string[];
|
|
28
31
|
static readonly WellknownTitleName: string[];
|
|
29
32
|
static readonly WellknownSubtitleName: string[];
|
|
30
33
|
static readonly WellknownImageName: string[];
|
|
34
|
+
static readonly ShortDescriptionMaxLens = 80;
|
|
35
|
+
static readonly FullDescriptionMaxLens = 4000;
|
|
36
|
+
static readonly CommandDescriptionMaxLens = 128;
|
|
37
|
+
static readonly ParameterDescriptionMaxLens = 128;
|
|
38
|
+
static readonly CommandTitleMaxLens = 32;
|
|
39
|
+
static readonly ParameterTitleMaxLens = 32;
|
|
31
40
|
}
|
|
32
41
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/constants.ts"],"names":[],"mappings":"AAIA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA6B;IAC7D,MAAM,CAAC,QAAQ,CAAC,mBAAmB,yEACqC;IACxE,MAAM,CAAC,QAAQ,CAAC,qBAAqB,4CAA4C;IACjF,MAAM,CAAC,QAAQ,CAAC,kBAAkB,+BAA+B;IACjE,MAAM,CAAC,QAAQ,CAAC,cAAc,gMACiK;IAE/L,MAAM,CAAC,QAAQ,CAAC,gCAAgC,m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MAAM,CAAC,QAAQ,CAAC,uBAAuB,MAAM;IAC7C,MAAM,CAAC,QAAQ,CAAC,sBAAsB,QAAQ;IAC9C,MAAM,CAAC,QAAQ,CAAC,yBAAyB,OAAO;IAChD,MAAM,CAAC,QAAQ,CAAC,2BAA2B,OAAO;IAClD,MAAM,CAAC,QAAQ,CAAC,mBAAmB,MAAM;IACzC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,MAAM;CAC5C"}
|
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ConstantString = void 0;
|
|
6
|
-
const localizeUtils_1 = require("../localizeUtils");
|
|
7
6
|
class ConstantString {
|
|
8
7
|
}
|
|
9
8
|
exports.ConstantString = ConstantString;
|
|
10
|
-
ConstantString.CancelledMessage =
|
|
11
|
-
ConstantString.NoServerInformation =
|
|
12
|
-
ConstantString.RemoteRefNotSupported =
|
|
13
|
-
ConstantString.MissingOperationId =
|
|
14
|
-
ConstantString.NoSupportedApi =
|
|
15
|
-
ConstantString.AdditionalPropertiesNotSupported =
|
|
16
|
-
ConstantString.SchemaNotSupported =
|
|
17
|
-
ConstantString.UnknownSchema =
|
|
18
|
-
ConstantString.UrlProtocolNotSupported =
|
|
19
|
-
ConstantString.RelativeServerUrlNotSupported =
|
|
20
|
-
ConstantString.ResolveServerUrlFailed =
|
|
21
|
-
ConstantString.OperationOnlyContainsOptionalParam =
|
|
22
|
-
ConstantString.ConvertSwaggerToOpenAPI =
|
|
9
|
+
ConstantString.CancelledMessage = "Operation is cancelled.";
|
|
10
|
+
ConstantString.NoServerInformation = "No server information is found in the OpenAPI description document.";
|
|
11
|
+
ConstantString.RemoteRefNotSupported = "Remote reference is not supported: %s.";
|
|
12
|
+
ConstantString.MissingOperationId = "Missing operationIds: %s.";
|
|
13
|
+
ConstantString.NoSupportedApi = "No supported API is found in the OpenAPI description document: only GET and POST methods are supported, additionally, there can be at most one required parameter, and no auth is allowed.";
|
|
14
|
+
ConstantString.AdditionalPropertiesNotSupported = "'additionalProperties' is not supported, and will be ignored.";
|
|
15
|
+
ConstantString.SchemaNotSupported = "'oneOf', 'anyOf', and 'not' schema are not supported: %s.";
|
|
16
|
+
ConstantString.UnknownSchema = "Unknown schema: %s.";
|
|
17
|
+
ConstantString.UrlProtocolNotSupported = "Server url is not correct: protocol %s is not supported, you should use https protocol instead.";
|
|
18
|
+
ConstantString.RelativeServerUrlNotSupported = "Server url is not correct: relative server url is not supported.";
|
|
19
|
+
ConstantString.ResolveServerUrlFailed = "Unable to resolve the server URL: please make sure that the environment variable %s is defined.";
|
|
20
|
+
ConstantString.OperationOnlyContainsOptionalParam = "Operation %s contains multiple optional parameters. The first optional parameter is used for this command.";
|
|
21
|
+
ConstantString.ConvertSwaggerToOpenAPI = "The Swagger 2.0 file has been converted to OpenAPI 3.0.";
|
|
22
|
+
ConstantString.SwaggerNotSupported = "Swagger 2.0 is not supported. Please convert to OpenAPI 3.0 manually before proceeding.";
|
|
23
|
+
ConstantString.MultipleAPIKeyNotSupported = "Multiple API keys are not supported. Please make sure that all selected APIs use the same API key.";
|
|
23
24
|
ConstantString.WrappedCardVersion = "devPreview";
|
|
24
25
|
ConstantString.WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
|
|
25
26
|
ConstantString.WrappedCardResponseLayout = "list";
|
|
@@ -30,6 +31,7 @@ ConstantString.AdaptiveCardSchema = "http://adaptivecards.io/schemas/adaptive-ca
|
|
|
30
31
|
ConstantString.AdaptiveCardType = "AdaptiveCard";
|
|
31
32
|
ConstantString.TextBlockType = "TextBlock";
|
|
32
33
|
ConstantString.ContainerType = "Container";
|
|
34
|
+
ConstantString.RegistrationIdPostfix = "REGISTRATION_ID";
|
|
33
35
|
ConstantString.ResponseCodeFor20X = [
|
|
34
36
|
"200",
|
|
35
37
|
"201",
|
|
@@ -84,4 +86,10 @@ ConstantString.WellknownImageName = [
|
|
|
84
86
|
"thumbnail",
|
|
85
87
|
"img",
|
|
86
88
|
];
|
|
89
|
+
ConstantString.ShortDescriptionMaxLens = 80;
|
|
90
|
+
ConstantString.FullDescriptionMaxLens = 4000;
|
|
91
|
+
ConstantString.CommandDescriptionMaxLens = 128;
|
|
92
|
+
ConstantString.ParameterDescriptionMaxLens = 128;
|
|
93
|
+
ConstantString.CommandTitleMaxLens = 32;
|
|
94
|
+
ConstantString.ParameterTitleMaxLens = 32;
|
|
87
95
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/spec-parser/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/spec-parser/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,MAAa,cAAc;;AAA3B,wCA0GC;AAzGiB,+BAAgB,GAAG,yBAAyB,CAAC;AAC7C,kCAAmB,GACjC,qEAAqE,CAAC;AACxD,oCAAqB,GAAG,wCAAwC,CAAC;AACjE,iCAAkB,GAAG,2BAA2B,CAAC;AACjD,6BAAc,GAC5B,4LAA4L,CAAC;AAE/K,+CAAgC,GAC9C,+DAA+D,CAAC;AAClD,iCAAkB,GAAG,2DAA2D,CAAC;AACjF,4BAAa,GAAG,qBAAqB,CAAC;AAEtC,sCAAuB,GACrC,iGAAiG,CAAC;AACpF,4CAA6B,GAC3C,kEAAkE,CAAC;AACrD,qCAAsB,GACpC,iGAAiG,CAAC;AACpF,iDAAkC,GAChD,4GAA4G,CAAC;AAC/F,sCAAuB,GACrC,yDAAyD,CAAC;AAE5C,kCAAmB,GACjC,yFAAyF,CAAC;AAE5E,yCAA0B,GACxC,oGAAoG,CAAC;AAEvF,iCAAkB,GAAG,Y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,GAAG,EAAE,CAAC;AACzB,oCAAqB,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SpecParser } from "./specParser.browser";
|
|
2
|
+
export { SpecParserError } from "./specParserError";
|
|
3
|
+
export { ValidationStatus, WarningType, ErrorType, ListAPIResult } from "./interfaces";
|
|
4
|
+
export type { ErrorResult, APIInfo, ValidateResult, WarningResult } from "./interfaces";
|
|
5
|
+
export { ConstantString } from "./constants";
|
|
6
|
+
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/index.browser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACvF,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -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_browser_1 = require("./specParser.browser");
|
|
7
|
+
Object.defineProperty(exports, "SpecParser", { enumerable: true, get: function () { return specParser_browser_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.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../../src/common/spec-parser/index.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,2DAAkD;AAAzC,gHAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,2CAAuF;AAA9E,8GAAA,gBAAgB,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,uGAAA,SAAS,OAAA;AAEjD,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { SpecParser } from "./specParser";
|
|
2
2
|
export { SpecParserError } from "./specParserError";
|
|
3
|
-
export { ValidationStatus, WarningType, ErrorType, WarningResult } from "./interfaces";
|
|
3
|
+
export { ValidationStatus, WarningType, ErrorType, WarningResult, ErrorResult, ListAPIResult, } from "./interfaces";
|
|
4
4
|
export { ConstantString } from "./constants";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +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,
|
|
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,2CAOsB;AANpB,8GAAA,gBAAgB,OAAA;AAChB,yGAAA,WAAW,OAAA;AACX,uGAAA,SAAS,OAAA;AAKX,yCAA6C;AAApC,2GAAA,cAAc,OAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
1
2
|
/**
|
|
2
3
|
* An interface that represents the result of validating an OpenAPI specification file.
|
|
3
4
|
*/
|
|
@@ -65,8 +66,11 @@ export declare enum ErrorType {
|
|
|
65
66
|
NoSupportedApi = "no-supported-api",
|
|
66
67
|
NoExtraAPICanBeAdded = "no-extra-api-can-be-added",
|
|
67
68
|
ResolveServerUrlFailed = "resolve-server-url-failed",
|
|
69
|
+
SwaggerNotSupported = "swagger-not-supported",
|
|
70
|
+
MultipleAPIKeyNotSupported = "multiple-api-key-not-supported",
|
|
68
71
|
ListFailed = "list-failed",
|
|
69
72
|
ListOperationMapFailed = "list-operation-map-failed",
|
|
73
|
+
listSupportedAPIInfoFailed = "list-supported-api-info-failed",
|
|
70
74
|
FilterSpecFailed = "filter-spec-failed",
|
|
71
75
|
UpdateManifestFailed = "update-manifest-failed",
|
|
72
76
|
GenerateAdaptiveCardFailed = "generate-adaptive-card-failed",
|
|
@@ -79,8 +83,6 @@ export declare enum ErrorType {
|
|
|
79
83
|
* An enum that represents the types of warnings that can occur during validation.
|
|
80
84
|
*/
|
|
81
85
|
export declare enum WarningType {
|
|
82
|
-
AuthNotSupported = "auth-not-supported",
|
|
83
|
-
MethodNotSupported = "method-not-supported",
|
|
84
86
|
OperationIdMissing = "operationid-missing",
|
|
85
87
|
GenerateCardFailed = "generate-card-failed",
|
|
86
88
|
OperationOnlyContainsOptionalParam = "operation-only-contains-optional-param",
|
|
@@ -143,4 +145,23 @@ export interface CheckParamResult {
|
|
|
143
145
|
optionalNum: number;
|
|
144
146
|
isValid: boolean;
|
|
145
147
|
}
|
|
148
|
+
export interface ParseOptions {
|
|
149
|
+
allowMissingId?: boolean;
|
|
150
|
+
allowSwagger?: boolean;
|
|
151
|
+
allowAPIKeyAuth?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface APIInfo {
|
|
154
|
+
method: string;
|
|
155
|
+
path: string;
|
|
156
|
+
title: string;
|
|
157
|
+
id: string;
|
|
158
|
+
parameters: Parameter[];
|
|
159
|
+
description: string;
|
|
160
|
+
warning?: WarningResult;
|
|
161
|
+
}
|
|
162
|
+
export interface ListAPIResult {
|
|
163
|
+
api: string;
|
|
164
|
+
server: string;
|
|
165
|
+
auth?: OpenAPIV3.ApiKeySecurityScheme;
|
|
166
|
+
}
|
|
146
167
|
//# 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,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,aAAa,EAAE,C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C;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC,oBAAoB,CAAC;CACvC"}
|
|
@@ -16,8 +16,11 @@ 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";
|
|
20
|
+
ErrorType["MultipleAPIKeyNotSupported"] = "multiple-api-key-not-supported";
|
|
19
21
|
ErrorType["ListFailed"] = "list-failed";
|
|
20
22
|
ErrorType["ListOperationMapFailed"] = "list-operation-map-failed";
|
|
23
|
+
ErrorType["listSupportedAPIInfoFailed"] = "list-supported-api-info-failed";
|
|
21
24
|
ErrorType["FilterSpecFailed"] = "filter-spec-failed";
|
|
22
25
|
ErrorType["UpdateManifestFailed"] = "update-manifest-failed";
|
|
23
26
|
ErrorType["GenerateAdaptiveCardFailed"] = "generate-adaptive-card-failed";
|
|
@@ -31,8 +34,6 @@ var ErrorType;
|
|
|
31
34
|
*/
|
|
32
35
|
var WarningType;
|
|
33
36
|
(function (WarningType) {
|
|
34
|
-
WarningType["AuthNotSupported"] = "auth-not-supported";
|
|
35
|
-
WarningType["MethodNotSupported"] = "method-not-supported";
|
|
36
37
|
WarningType["OperationIdMissing"] = "operationid-missing";
|
|
37
38
|
WarningType["GenerateCardFailed"] = "generate-card-failed";
|
|
38
39
|
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;;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/common/spec-parser/interfaces.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAqEb;;GAEG;AACH,IAAY,SAuBX;AAvBD,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;IAC7C,0EAA6D,CAAA;IAE7D,uCAA0B,CAAA;IAC1B,iEAAoD,CAAA;IACpD,0EAA6D,CAAA;IAC7D,oDAAuC,CAAA;IACvC,4DAA+C,CAAA;IAC/C,yEAA4D,CAAA;IAC5D,+CAAkC,CAAA;IAClC,+CAAkC,CAAA;IAElC,oCAAuB,CAAA;IACvB,gCAAmB,CAAA;AACrB,CAAC,EAvBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAuBpB;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,6 +1,7 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
2
|
import { WarningResult } from "./interfaces";
|
|
3
3
|
import { IMessagingExtensionCommand, TeamsAppManifest } from "@microsoft/teamsfx-api";
|
|
4
|
-
export declare function updateManifest(manifestPath: string, outputSpecPath: string, adaptiveCardFolder: string, spec: OpenAPIV3.Document): Promise<[TeamsAppManifest, WarningResult[]]>;
|
|
4
|
+
export declare function updateManifest(manifestPath: string, outputSpecPath: string, adaptiveCardFolder: string, spec: OpenAPIV3.Document, apiKeyAuthName?: string): Promise<[TeamsAppManifest, WarningResult[]]>;
|
|
5
5
|
export declare function generateCommands(spec: OpenAPIV3.Document, adaptiveCardFolder: string, manifestPath: string): Promise<[IMessagingExtensionCommand[], WarningResult[]]>;
|
|
6
|
+
export declare function getRelativePath(from: string, to: string): string;
|
|
6
7
|
//# 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;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,
|
|
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,EACxB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,CAAC,gBAAgB,EAAE,aAAa,EAAE,CAAC,CAAC,CAuC9C;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;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAGhE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.generateCommands = exports.updateManifest = void 0;
|
|
5
|
+
exports.getRelativePath = exports.generateCommands = exports.updateManifest = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
8
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
@@ -10,20 +10,28 @@ 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
|
-
async function updateManifest(manifestPath, outputSpecPath, adaptiveCardFolder, spec) {
|
|
14
|
-
var _a;
|
|
13
|
+
async function updateManifest(manifestPath, outputSpecPath, adaptiveCardFolder, spec, apiKeyAuthName) {
|
|
14
|
+
var _a, _b;
|
|
15
15
|
try {
|
|
16
16
|
const originalManifest = await fs_extra_1.default.readJSON(manifestPath);
|
|
17
17
|
const [commands, warnings] = await generateCommands(spec, adaptiveCardFolder, manifestPath);
|
|
18
18
|
const ComposeExtension = {
|
|
19
19
|
composeExtensionType: "apiBased",
|
|
20
|
-
apiSpecificationFile:
|
|
20
|
+
apiSpecificationFile: getRelativePath(manifestPath, outputSpecPath),
|
|
21
21
|
commands: commands,
|
|
22
22
|
};
|
|
23
|
+
if (apiKeyAuthName) {
|
|
24
|
+
ComposeExtension.authorization = {
|
|
25
|
+
authType: "apiSecretServiceAuth",
|
|
26
|
+
apiSecretServiceAuthConfiguration: {
|
|
27
|
+
apiSecretRegistrationId: `\${{${apiKeyAuthName.toUpperCase()}_${constants_1.ConstantString.RegistrationIdPostfix}}}`,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
23
31
|
const updatedPart = {
|
|
24
32
|
description: {
|
|
25
|
-
short: spec.info.title,
|
|
26
|
-
full: (_a = spec.info.description) !== null && _a !== void 0 ? _a : originalManifest.description.full,
|
|
33
|
+
short: spec.info.title.slice(0, constants_1.ConstantString.ShortDescriptionMaxLens),
|
|
34
|
+
full: (_b = ((_a = spec.info.description) !== null && _a !== void 0 ? _a : originalManifest.description.full)) === null || _b === void 0 ? void 0 : _b.slice(0, constants_1.ConstantString.FullDescriptionMaxLens),
|
|
27
35
|
},
|
|
28
36
|
composeExtensions: [ComposeExtension],
|
|
29
37
|
};
|
|
@@ -52,7 +60,7 @@ async function generateCommands(spec, adaptiveCardFolder, manifestPath) {
|
|
|
52
60
|
const [command, warning] = utils_1.parseApiInfo(operationItem);
|
|
53
61
|
const adaptiveCardPath = path_1.default.join(adaptiveCardFolder, command.id + ".json");
|
|
54
62
|
command.apiResponseRenderingTemplateFile = (await fs_extra_1.default.pathExists(adaptiveCardPath))
|
|
55
|
-
?
|
|
63
|
+
? getRelativePath(manifestPath, adaptiveCardPath)
|
|
56
64
|
: "";
|
|
57
65
|
if (warning) {
|
|
58
66
|
warnings.push(warning);
|
|
@@ -67,4 +75,9 @@ async function generateCommands(spec, adaptiveCardFolder, manifestPath) {
|
|
|
67
75
|
return [commands, warnings];
|
|
68
76
|
}
|
|
69
77
|
exports.generateCommands = generateCommands;
|
|
78
|
+
function getRelativePath(from, to) {
|
|
79
|
+
const relativePath = path_1.default.relative(path_1.default.dirname(from), to);
|
|
80
|
+
return path_1.default.normalize(relativePath).replace(/\\/g, "/");
|
|
81
|
+
}
|
|
82
|
+
exports.getRelativePath = getRelativePath;
|
|
70
83
|
//# sourceMappingURL=manifestUpdater.js.map
|
|
@@ -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,gEAA0B;AAC1B,wDAAwB;AACxB,6CAAwD;AACxD,
|
|
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,mCAAuC;AACvC,uDAAoD;AACpD,2CAA6C;AAOtC,KAAK,UAAU,cAAc,CAClC,YAAoB,EACpB,cAAsB,EACtB,kBAA0B,EAC1B,IAAwB,EACxB,cAAuB;;IAEvB,IAAI;QACF,MAAM,gBAAgB,GAAqB,MAAM,kBAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,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AO,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,cAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC;AAHD,0CAGC"}
|
|
@@ -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, allowAPIKeyAuth: 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,EACvB,eAAe,EAAE,OAAO,GACvB,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, allowAPIKeyAuth) {
|
|
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, allowAPIKeyAuth)) {
|
|
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,EACvB,eAAwB;IAExB,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,E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ListAPIResult } from "./interfaces";
|
|
4
|
+
/**
|
|
5
|
+
* A class that parses an OpenAPI specification file and provides methods to validate, list, and generate artifacts.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SpecParser {
|
|
8
|
+
readonly pathOrSpec: string | OpenAPIV3.Document;
|
|
9
|
+
readonly parser: SwaggerParser;
|
|
10
|
+
readonly options: Required<ParseOptions>;
|
|
11
|
+
private apiMap;
|
|
12
|
+
private spec;
|
|
13
|
+
private unResolveSpec;
|
|
14
|
+
private isSwaggerFile;
|
|
15
|
+
private defaultOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of the SpecParser class.
|
|
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.
|
|
20
|
+
*/
|
|
21
|
+
constructor(pathOrDoc: string | OpenAPIV3.Document, options?: ParseOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Validates the OpenAPI specification file and returns a validation result.
|
|
24
|
+
*
|
|
25
|
+
* @returns A validation result object that contains information about any errors or warnings in the specification file.
|
|
26
|
+
*/
|
|
27
|
+
validate(): Promise<ValidateResult>;
|
|
28
|
+
listSupportedAPIInfo(): Promise<APIInfo[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Lists all the OpenAPI operations in the specification file.
|
|
31
|
+
* @returns A string array that represents the HTTP method and path of each operation, such as ['GET /pets/{petId}', 'GET /user/{userId}']
|
|
32
|
+
* according to copilot plugin spec, only list get and post method without auth
|
|
33
|
+
*/
|
|
34
|
+
list(): Promise<ListAPIResult[]>;
|
|
35
|
+
/**
|
|
36
|
+
* List all the OpenAPI operations in the specification file and return a map of operationId and operation path.
|
|
37
|
+
* @returns A map of operationId and operation path, such as [{'getPetById': 'GET /pets/{petId}'}, {'getUser': 'GET /user/{userId}'}]
|
|
38
|
+
*/
|
|
39
|
+
listOperationMap(): Promise<Map<string, string>>;
|
|
40
|
+
/**
|
|
41
|
+
* Generates and update artifacts from the OpenAPI specification file. Generate Adaptive Cards, update Teams app manifest, and generate a new OpenAPI specification file.
|
|
42
|
+
* @param manifestPath A file path of the Teams app manifest file to update.
|
|
43
|
+
* @param filter An array of strings that represent the filters to apply when generating the artifacts. If filter is empty, it would process nothing.
|
|
44
|
+
* @param outputSpecPath File path of the new OpenAPI specification file to generate. If not specified or empty, no spec file will be generated.
|
|
45
|
+
* @param adaptiveCardFolder Folder path where the Adaptive Card files will be generated. If not specified or empty, Adaptive Card files will not be generated.
|
|
46
|
+
*/
|
|
47
|
+
generate(manifestPath: string, filter: string[], outputSpecPath: string, adaptiveCardFolder: string, signal?: AbortSignal): Promise<GenerateResult>;
|
|
48
|
+
private loadSpec;
|
|
49
|
+
private getAllSupportedAPIs;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=specParser.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specParser.browser.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/specParser.browser.ts"],"names":[],"mappings":"AAIA,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,OAAO,EAEP,cAAc,EACd,YAAY,EACZ,cAAc,EAGd,aAAa,EACd,MAAM,cAAc,CAAC;AAKtB;;GAEG;AACH,qBAAa,UAAU;IACrB,SAAgB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC;IACxD,SAAgB,MAAM,EAAE,aAAa,CAAC;IACtC,SAAgB,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEhD,OAAO,CAAC,MAAM,CAA0D;IACxE,OAAO,CAAC,IAAI,CAAiC;IAC7C,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,aAAa,CAAsB;IAE3C,OAAO,CAAC,cAAc,CAIpB;IAEF;;;;OAIG;gBACS,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,QAA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