@microsoft/teamsfx-core 1.0.0 → 1.0.1-alpha.d18908a8.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/armInterface.d.ts +1 -11
- package/build/common/armInterface.d.ts.map +1 -1
- package/build/core/error.d.ts +1 -0
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +5 -1
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +41 -4
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/envInfoWriter.d.ts.map +1 -1
- package/build/core/middleware/envInfoWriter.js +2 -0
- package/build/core/middleware/envInfoWriter.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts +2 -3
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +3 -0
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js +9 -0
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/apim/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +16 -6
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/interfaces/IAppDefinition.d.ts +6 -2
- package/build/plugins/resource/appstudio/interfaces/IAppDefinition.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +123 -36
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.d.ts +3 -0
- package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.js +9 -0
- package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
- package/build/plugins/resource/frontend/index.d.ts +1 -2
- package/build/plugins/resource/frontend/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/index.js.map +1 -1
- package/build/plugins/resource/function/plugin.js +2 -2
- package/build/plugins/resource/function/plugin.js.map +1 -1
- package/build/plugins/resource/index.d.ts +1 -0
- package/build/plugins/resource/index.d.ts.map +1 -1
- package/build/plugins/resource/index.js +1 -0
- package/build/plugins/resource/index.js.map +1 -1
- package/build/plugins/resource/keyvault/constants.d.ts +35 -0
- package/build/plugins/resource/keyvault/constants.d.ts.map +1 -0
- package/build/plugins/resource/keyvault/constants.js +42 -0
- package/build/plugins/resource/keyvault/constants.js.map +1 -0
- package/build/plugins/resource/keyvault/index.d.ts +14 -0
- package/build/plugins/resource/keyvault/index.d.ts.map +1 -0
- package/build/plugins/resource/keyvault/index.js +60 -0
- package/build/plugins/resource/keyvault/index.js.map +1 -0
- package/build/plugins/resource/keyvault/plugin.d.ts +6 -0
- package/build/plugins/resource/keyvault/plugin.d.ts.map +1 -0
- package/build/plugins/resource/keyvault/plugin.js +31 -0
- package/build/plugins/resource/keyvault/plugin.js.map +1 -0
- package/build/plugins/resource/keyvault/result.d.ts +9 -0
- package/build/plugins/resource/keyvault/result.d.ts.map +1 -0
- package/build/plugins/resource/keyvault/result.js +21 -0
- package/build/plugins/resource/keyvault/result.js.map +1 -0
- package/build/plugins/resource/keyvault/utils/telemetry.d.ts +17 -0
- package/build/plugins/resource/keyvault/utils/telemetry.d.ts.map +1 -0
- package/build/plugins/resource/keyvault/utils/telemetry.js +45 -0
- package/build/plugins/resource/keyvault/utils/telemetry.js.map +1 -0
- package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.js +2 -2
- package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
- package/build/plugins/resource/simpleauth/v2/index.d.ts +7 -6
- package/build/plugins/resource/simpleauth/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/v2/index.js +12 -6
- package/build/plugins/resource/simpleauth/v2/index.js.map +1 -1
- package/build/plugins/resource/utils4v2.d.ts +8 -8
- package/build/plugins/resource/utils4v2.d.ts.map +1 -1
- package/build/plugins/resource/utils4v2.js +26 -1
- package/build/plugins/resource/utils4v2.js.map +1 -1
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts +1 -0
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.js +1 -0
- package/build/plugins/solution/fx-solution/ResourcePluginContainer.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +41 -22
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +2 -2
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +2 -1
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +10 -3
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts +1 -3
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +33 -544
- package/build/plugins/solution/fx-solution/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/adaptor.d.ts +3 -0
- package/build/plugins/solution/fx-solution/v2/adaptor.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/adaptor.js +45 -7
- package/build/plugins/solution/fx-solution/v2/adaptor.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/checkPermission.d.ts +5 -0
- package/build/plugins/solution/fx-solution/v2/checkPermission.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/checkPermission.js +185 -0
- package/build/plugins/solution/fx-solution/v2/checkPermission.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/collaborationUtil.d.ts +20 -0
- package/build/plugins/solution/fx-solution/v2/collaborationUtil.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/collaborationUtil.js +83 -0
- package/build/plugins/solution/fx-solution/v2/collaborationUtil.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/executor.d.ts +1 -0
- package/build/plugins/solution/fx-solution/v2/executor.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executor.js +17 -1
- package/build/plugins/solution/fx-solution/v2/executor.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js +2 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/grantPermission.d.ts +5 -0
- package/build/plugins/solution/fx-solution/v2/grantPermission.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/grantPermission.js +200 -0
- package/build/plugins/solution/fx-solution/v2/grantPermission.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.d.ts +5 -0
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js +118 -0
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts +8 -0
- package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v2/listCollaborator.js +195 -0
- package/build/plugins/solution/fx-solution/v2/listCollaborator.js.map +1 -0
- package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provision.js +23 -6
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.d.ts +4 -0
- package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.js +8 -0
- package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.d.ts +3 -1
- package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.js +6 -1
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/package.json +4 -3
- package/resource/strings.json +1 -0
- package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +10 -0
- package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +5 -0
- package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +53 -0
- package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +13 -0
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +5 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare class Constants {
|
|
2
|
+
static readonly provisionModuleTemplateFileName: string;
|
|
3
|
+
static readonly configModuleTemplateFileName: string;
|
|
4
|
+
static readonly SolutionPlugin: {
|
|
5
|
+
id: string;
|
|
6
|
+
configKeys: {
|
|
7
|
+
remoteTeamsAppId: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
static readonly KeyVaultPlugin: {
|
|
11
|
+
pluginName: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
shortName: string;
|
|
14
|
+
};
|
|
15
|
+
static readonly KeyVaultBicep: {
|
|
16
|
+
m365ClientSecretReference: string;
|
|
17
|
+
botClientSecretReference: string;
|
|
18
|
+
};
|
|
19
|
+
static readonly Stage: {
|
|
20
|
+
generateArmTemplates: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare class Telemetry {
|
|
24
|
+
static component: string;
|
|
25
|
+
static errorCode: string;
|
|
26
|
+
static errorType: string;
|
|
27
|
+
static errorMessage: string;
|
|
28
|
+
static userError: string;
|
|
29
|
+
static systemError: string;
|
|
30
|
+
static isSuccess: string;
|
|
31
|
+
static success: string;
|
|
32
|
+
static fail: string;
|
|
33
|
+
static appId: string;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/constants.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IACpB,MAAM,CAAC,QAAQ,CAAC,+BAA+B,EAAE,MAAM,CAAsC;IAC7F,MAAM,CAAC,QAAQ,CAAC,4BAA4B,EAAE,MAAM,CAA0C;IAE9F,MAAM,CAAC,QAAQ,CAAC,cAAc;;;;;MAK5B;IAEF,MAAM,CAAC,QAAQ,CAAC,cAAc;;;;MAI5B;IAEF,MAAM,CAAC,QAAQ,CAAC,aAAa;;;MAG3B;IAEF,MAAM,CAAC,QAAQ,CAAC,KAAK;;MAEnB;CACH;AAED,qBAAa,SAAS;IACpB,MAAM,CAAC,SAAS,SAAe;IAC/B,MAAM,CAAC,SAAS,SAAgB;IAChC,MAAM,CAAC,SAAS,SAAgB;IAChC,MAAM,CAAC,YAAY,SAAmB;IACtC,MAAM,CAAC,SAAS,SAAU;IAC1B,MAAM,CAAC,WAAW,SAAY;IAC9B,MAAM,CAAC,SAAS,SAAa;IAC7B,MAAM,CAAC,OAAO,SAAS;IACvB,MAAM,CAAC,IAAI,SAAQ;IACnB,MAAM,CAAC,KAAK,SAAW;CACxB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Telemetry = exports.Constants = void 0;
|
|
4
|
+
// Copyright (c) Microsoft Corporation.
|
|
5
|
+
// Licensed under the MIT license.
|
|
6
|
+
class Constants {
|
|
7
|
+
}
|
|
8
|
+
exports.Constants = Constants;
|
|
9
|
+
Constants.provisionModuleTemplateFileName = "keyVaultProvision.template.bicep";
|
|
10
|
+
Constants.configModuleTemplateFileName = "keyVaultConfiguration.template.bicep";
|
|
11
|
+
Constants.SolutionPlugin = {
|
|
12
|
+
id: "solution",
|
|
13
|
+
configKeys: {
|
|
14
|
+
remoteTeamsAppId: "remoteTeamsAppId",
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
Constants.KeyVaultPlugin = {
|
|
18
|
+
pluginName: "fx-resource-key-vault",
|
|
19
|
+
displayName: "Key Vault Plugin",
|
|
20
|
+
shortName: "kv",
|
|
21
|
+
};
|
|
22
|
+
Constants.KeyVaultBicep = {
|
|
23
|
+
m365ClientSecretReference: "provisionOutputs.keyVaultOutput.value.m365ClientSecretReference",
|
|
24
|
+
botClientSecretReference: "provisionOutputs.keyVaultOutput.value.botClientSecretReference",
|
|
25
|
+
};
|
|
26
|
+
Constants.Stage = {
|
|
27
|
+
generateArmTemplates: "generate-arm-templates",
|
|
28
|
+
};
|
|
29
|
+
class Telemetry {
|
|
30
|
+
}
|
|
31
|
+
exports.Telemetry = Telemetry;
|
|
32
|
+
Telemetry.component = "component";
|
|
33
|
+
Telemetry.errorCode = "error-code";
|
|
34
|
+
Telemetry.errorType = "error-type";
|
|
35
|
+
Telemetry.errorMessage = "error-message";
|
|
36
|
+
Telemetry.userError = "user";
|
|
37
|
+
Telemetry.systemError = "system";
|
|
38
|
+
Telemetry.isSuccess = "success";
|
|
39
|
+
Telemetry.success = "yes";
|
|
40
|
+
Telemetry.fail = "no";
|
|
41
|
+
Telemetry.appId = "appid";
|
|
42
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/constants.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,MAAa,SAAS;;AAAtB,8BAyBC;AAxBiB,yCAA+B,GAAW,kCAAkC,CAAC;AAC7E,sCAA4B,GAAW,sCAAsC,CAAC;AAE9E,wBAAc,GAAG;IAC/B,EAAE,EAAE,UAAU;IACd,UAAU,EAAE;QACV,gBAAgB,EAAE,kBAAkB;KACrC;CACF,CAAC;AAEc,wBAAc,GAAG;IAC/B,UAAU,EAAE,uBAAuB;IACnC,WAAW,EAAE,kBAAkB;IAC/B,SAAS,EAAE,IAAI;CAChB,CAAC;AAEc,uBAAa,GAAG;IAC9B,yBAAyB,EAAE,iEAAiE;IAC5F,wBAAwB,EAAE,gEAAgE;CAC3F,CAAC;AAEc,eAAK,GAAG;IACtB,oBAAoB,EAAE,wBAAwB;CAC/C,CAAC;AAGJ,MAAa,SAAS;;AAAtB,8BAWC;AAVQ,mBAAS,GAAG,WAAW,CAAC;AACxB,mBAAS,GAAG,YAAY,CAAC;AACzB,mBAAS,GAAG,YAAY,CAAC;AACzB,sBAAY,GAAG,eAAe,CAAC;AAC/B,mBAAS,GAAG,MAAM,CAAC;AACnB,qBAAW,GAAG,QAAQ,CAAC;AACvB,mBAAS,GAAG,SAAS,CAAC;AACtB,iBAAO,GAAG,KAAK,CAAC;AAChB,cAAI,GAAG,IAAI,CAAC;AACZ,eAAK,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Plugin, PluginContext, AzureSolutionSettings, Result, FxError } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { KeyVaultPluginImpl } from "./plugin";
|
|
3
|
+
import { ArmTemplateResult } from "../../../common/armInterface";
|
|
4
|
+
export declare class KeyVaultPlugin implements Plugin {
|
|
5
|
+
name: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
activate(solutionSettings: AzureSolutionSettings): boolean;
|
|
8
|
+
keyVaultPluginImpl: KeyVaultPluginImpl;
|
|
9
|
+
generateArmTemplates(ctx: PluginContext): Promise<Result<ArmTemplateResult, FxError>>;
|
|
10
|
+
private runWithErrorHandling;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: KeyVaultPlugin;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,aAAa,EAIb,qBAAqB,EACrB,MAAM,EACN,OAAO,EACR,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjE,qBACa,cAAe,YAAW,MAAM;IAC3C,IAAI,SAAuC;IAC3C,WAAW,SAAwC;IAEnD,QAAQ,CAAC,gBAAgB,EAAE,qBAAqB,GAAG,OAAO;IAO1D,kBAAkB,qBAA4B;IAEjC,oBAAoB,CAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;YAShC,oBAAoB;CA+BnC;;AAED,wBAAoC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyVaultPlugin = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// Copyright (c) Microsoft Corporation.
|
|
6
|
+
// Licensed under the MIT license.
|
|
7
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
|
+
const question_1 = require("../../solution/fx-solution/question");
|
|
9
|
+
const plugin_1 = require("./plugin");
|
|
10
|
+
const typedi_1 = require("typedi");
|
|
11
|
+
const ResourcePluginContainer_1 = require("../../solution/fx-solution/ResourcePluginContainer");
|
|
12
|
+
const result_1 = require("./result");
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
const telemetry_1 = require("./utils/telemetry");
|
|
15
|
+
let KeyVaultPlugin = class KeyVaultPlugin {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.name = constants_1.Constants.KeyVaultPlugin.pluginName;
|
|
18
|
+
this.displayName = constants_1.Constants.KeyVaultPlugin.displayName;
|
|
19
|
+
this.keyVaultPluginImpl = new plugin_1.KeyVaultPluginImpl();
|
|
20
|
+
}
|
|
21
|
+
activate(solutionSettings) {
|
|
22
|
+
const azureResources = solutionSettings.azureResources || [];
|
|
23
|
+
return (solutionSettings.hostType === question_1.HostTypeOptionAzure.id &&
|
|
24
|
+
azureResources.includes(question_1.AzureResourceKeyVault.id));
|
|
25
|
+
}
|
|
26
|
+
async generateArmTemplates(ctx) {
|
|
27
|
+
telemetry_1.TelemetryUtils.init(ctx);
|
|
28
|
+
return this.runWithErrorHandling(() => this.keyVaultPluginImpl.generateArmTemplates(ctx), ctx, constants_1.Constants.Stage.generateArmTemplates);
|
|
29
|
+
}
|
|
30
|
+
async runWithErrorHandling(fn, ctx, stage) {
|
|
31
|
+
var _a;
|
|
32
|
+
try {
|
|
33
|
+
telemetry_1.TelemetryUtils.sendEvent(`${stage}-start`);
|
|
34
|
+
const res = await fn();
|
|
35
|
+
telemetry_1.TelemetryUtils.sendEvent(stage);
|
|
36
|
+
return res;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
if (!(e instanceof Error || e instanceof teamsfx_api_1.SystemError || e instanceof teamsfx_api_1.UserError)) {
|
|
40
|
+
e = new Error(e.toString());
|
|
41
|
+
}
|
|
42
|
+
(_a = ctx.logProvider) === null || _a === void 0 ? void 0 : _a.error(e.message);
|
|
43
|
+
if (e instanceof teamsfx_api_1.SystemError || e instanceof teamsfx_api_1.UserError) {
|
|
44
|
+
telemetry_1.TelemetryUtils.sendErrorEvent(stage, e.name, e instanceof teamsfx_api_1.UserError ? constants_1.Telemetry.userError : constants_1.Telemetry.systemError, e.message);
|
|
45
|
+
return teamsfx_api_1.err(e);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const UnhandledErrorCode = "UnhandledError";
|
|
49
|
+
telemetry_1.TelemetryUtils.sendErrorEvent(stage, UnhandledErrorCode, constants_1.Telemetry.systemError, e === null || e === void 0 ? void 0 : e.message);
|
|
50
|
+
return teamsfx_api_1.err(result_1.ResultFactory.SystemError(UnhandledErrorCode, e === null || e === void 0 ? void 0 : e.message, e));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
KeyVaultPlugin = tslib_1.__decorate([
|
|
56
|
+
typedi_1.Service(ResourcePluginContainer_1.ResourcePlugins.KeyVaultPlugin)
|
|
57
|
+
], KeyVaultPlugin);
|
|
58
|
+
exports.KeyVaultPlugin = KeyVaultPlugin;
|
|
59
|
+
exports.default = new KeyVaultPlugin();
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,wDASgC;AAChC,kEAAiG;AACjG,qCAA8C;AAC9C,mCAAiC;AACjC,gGAAqF;AAErF,qCAAwD;AACxD,2CAAmD;AACnD,iDAAmD;AAGnD,IAAa,cAAc,GAA3B,MAAa,cAAc;IAA3B;QACE,SAAI,GAAG,qBAAS,CAAC,cAAc,CAAC,UAAU,CAAC;QAC3C,gBAAW,GAAG,qBAAS,CAAC,cAAc,CAAC,WAAW,CAAC;QASnD,uBAAkB,GAAG,IAAI,2BAAkB,EAAE,CAAC;IA4ChD,CAAC;IAnDC,QAAQ,CAAC,gBAAuC;QAC9C,MAAM,cAAc,GAAG,gBAAgB,CAAC,cAAc,IAAI,EAAE,C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O,CACV,CAAC;gBACF,OAAO,iBAAG,CAAC,CAAC,CAAC,CAAC;aACf;iBAAM;gBACL,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;gBAC5C,0BAAc,CAAC,cAAc,CAAC,KAAK,EAAE,kBAAkB,EAAE,qBAAS,CAAC,WAAW,EAAE,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAC,CAAC;gBAC5F,OAAO,iBAAG,CAAC,sBAAa,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;aAC1E;SACF;IACH,CAAC;CACF,CAAA;AAvDY,cAAc;IAD1B,gBAAO,CAAC,yCAAe,CAAC,cAAc,CAAC;GAC3B,cAAc,CAuD1B;AAvDY,wCAAc;AAyD3B,kBAAe,IAAI,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FxError, PluginContext, Result } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { ArmTemplateResult } from "../../../common/armInterface";
|
|
3
|
+
export declare class KeyVaultPluginImpl {
|
|
4
|
+
generateArmTemplates(ctx: PluginContext): Promise<Result<ArmTemplateResult, FxError>>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAM,aAAa,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAI5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjE,qBAAa,kBAAkB;IAChB,oBAAoB,CAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;CAgC/C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyVaultPluginImpl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
6
|
+
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
7
|
+
const __1 = require("../../..");
|
|
8
|
+
const constants_1 = require("../../../common/constants");
|
|
9
|
+
const constants_2 = require("./constants");
|
|
10
|
+
const result_1 = require("./result");
|
|
11
|
+
class KeyVaultPluginImpl {
|
|
12
|
+
async generateArmTemplates(ctx) {
|
|
13
|
+
const bicepTemplateDirectory = path.join(__1.getTemplatesFolder(), "plugins", "resource", "keyvault", "bicep");
|
|
14
|
+
const provisionModuleResult = path.join(bicepTemplateDirectory, constants_2.Constants.provisionModuleTemplateFileName);
|
|
15
|
+
const result = {
|
|
16
|
+
Provision: {
|
|
17
|
+
Orchestration: await fs.readFile(path.join(bicepTemplateDirectory, constants_1.Bicep.ProvisionFileName), constants_1.ConstantString.UTF8Encoding),
|
|
18
|
+
Reference: {
|
|
19
|
+
m365ClientSecretReference: constants_2.Constants.KeyVaultBicep.m365ClientSecretReference,
|
|
20
|
+
botClientSecretReference: constants_2.Constants.KeyVaultBicep.botClientSecretReference,
|
|
21
|
+
},
|
|
22
|
+
Modules: {
|
|
23
|
+
keyVault: await fs.readFile(provisionModuleResult, constants_1.ConstantString.UTF8Encoding),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
return result_1.ResultFactory.Success(result);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.KeyVaultPluginImpl = KeyVaultPluginImpl;
|
|
31
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/plugin.ts"],"names":[],"mappings":";;;;AAGA,mDAA6B;AAC7B,qDAA+B;AAC/B,gCAA8C;AAE9C,yDAAkE;AAClE,2CAAwC;AACxC,qCAAyC;AAEzC,MAAa,kBAAkB;IACtB,KAAK,CAAC,oBAAoB,CAC/B,GAAkB;QAElB,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CACtC,sBAAkB,EAAE,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,CACR,CAAC;QAEF,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CACrC,sBAAsB,EACtB,qBAAS,CAAC,+BAA+B,CAC1C,CAAC;QAEF,MAAM,MAAM,GAAsB;YAChC,SAAS,EAAE;gBACT,aAAa,EAAE,MAAM,EAAE,CAAC,QAAQ,CAC9B,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,iBAAK,CAAC,iBAAiB,CAAC,EAC1D,0BAAc,CAAC,YAAY,CAC5B;gBACD,SAAS,EAAE;oBACT,yBAAyB,EAAE,qBAAS,CAAC,aAAa,CAAC,yBAAyB;oBAC5E,wBAAwB,EAAE,qBAAS,CAAC,aAAa,CAAC,wBAAwB;iBAC3E;gBACD,OAAO,EAAE;oBACP,QAAQ,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,EAAE,0BAAc,CAAC,YAAY,CAAC;iBAChF;aACF;SACF,CAAC;QAEF,OAAO,sBAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;CACF;AAnCD,gDAmCC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FxError, Result, SystemError, UserError } from "@microsoft/teamsfx-api";
|
|
2
|
+
export declare type TeamsFxResult = Result<any, FxError>;
|
|
3
|
+
export declare class ResultFactory {
|
|
4
|
+
static readonly source: string;
|
|
5
|
+
static UserError(name: string, message: string, innerError?: any, stack?: string, helpLink?: string): UserError;
|
|
6
|
+
static SystemError(name: string, message: string, innerError?: any, stack?: string, issueLink?: string): SystemError;
|
|
7
|
+
static Success(result?: any): TeamsFxResult;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAM,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIrF,oBAAY,aAAa,GAAG,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAEjD,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAsC;WAEtD,SAAS,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,GAAG,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,GAChB,SAAS;WAIE,WAAW,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,GAAG,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GACjB,WAAW;WAIA,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,aAAa;CAGnD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResultFactory = void 0;
|
|
4
|
+
// Copyright (c) Microsoft Corporation.
|
|
5
|
+
// Licensed under the MIT license.
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
class ResultFactory {
|
|
9
|
+
static UserError(name, message, innerError, stack, helpLink) {
|
|
10
|
+
return new teamsfx_api_1.UserError(name, message, this.source, stack, helpLink, innerError);
|
|
11
|
+
}
|
|
12
|
+
static SystemError(name, message, innerError, stack, issueLink) {
|
|
13
|
+
return new teamsfx_api_1.SystemError(name, message, this.source, stack, issueLink, innerError);
|
|
14
|
+
}
|
|
15
|
+
static Success(result) {
|
|
16
|
+
return teamsfx_api_1.ok(result);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ResultFactory = ResultFactory;
|
|
20
|
+
ResultFactory.source = constants_1.Constants.KeyVaultPlugin.shortName;
|
|
21
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../../src/plugins/resource/keyvault/result.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,wDAAqF;AAErF,2CAAwC;AAIxC,MAAa,aAAa;IAGjB,MAAM,CAAC,SAAS,CACrB,IAAY,EACZ,OAAe,EACf,UAAgB,EAChB,KAAc,EACd,QAAiB;QAEjB,OAAO,IAAI,uBAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAChF,CAAC;IAEM,MAAM,CAAC,WAAW,CACvB,IAAY,EACZ,OAAe,EACf,UAAgB,EAChB,KAAc,EACd,SAAkB;QAElB,OAAO,IAAI,yBAAW,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACnF,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,MAAY;QAChC,OAAO,gBAAE,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;;AAzBH,sCA0BC;AAzBiB,oBAAM,GAAW,qBAAS,CAAC,cAAc,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PluginContext } from "@microsoft/teamsfx-api";
|
|
2
|
+
export declare class TelemetryUtils {
|
|
3
|
+
static ctx: PluginContext;
|
|
4
|
+
static init(ctx: PluginContext): void;
|
|
5
|
+
static sendEvent(eventName: string, properties?: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
}, measurements?: {
|
|
8
|
+
[key: string]: number;
|
|
9
|
+
}): void;
|
|
10
|
+
static sendErrorEvent(eventName: string, errorName: string, errorType: string, errorMessage: string, properties?: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}, measurements?: {
|
|
13
|
+
[key: string]: number;
|
|
14
|
+
}): void;
|
|
15
|
+
private static addAppIdInProperty;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/keyvault/utils/telemetry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,qBAAa,cAAc;IACzB,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC;WAEZ,IAAI,CAAC,GAAG,EAAE,aAAa;WAIvB,SAAS,CACrB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACtC,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;WAW5B,cAAc,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACtC,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAkB1C,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAalC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TelemetryUtils = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
class TelemetryUtils {
|
|
6
|
+
static init(ctx) {
|
|
7
|
+
TelemetryUtils.ctx = ctx;
|
|
8
|
+
}
|
|
9
|
+
static sendEvent(eventName, properties, measurements) {
|
|
10
|
+
var _a;
|
|
11
|
+
if (!properties) {
|
|
12
|
+
properties = {};
|
|
13
|
+
}
|
|
14
|
+
properties[constants_1.Telemetry.isSuccess] = constants_1.Telemetry.success;
|
|
15
|
+
properties[constants_1.Telemetry.component] = constants_1.Constants.KeyVaultPlugin.pluginName;
|
|
16
|
+
TelemetryUtils.addAppIdInProperty(properties, this.ctx);
|
|
17
|
+
(_a = TelemetryUtils.ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(eventName, properties, measurements);
|
|
18
|
+
}
|
|
19
|
+
static sendErrorEvent(eventName, errorName, errorType, errorMessage, properties, measurements) {
|
|
20
|
+
var _a;
|
|
21
|
+
if (!properties) {
|
|
22
|
+
properties = {};
|
|
23
|
+
}
|
|
24
|
+
properties[constants_1.Telemetry.isSuccess] = constants_1.Telemetry.fail;
|
|
25
|
+
properties[constants_1.Telemetry.component] = constants_1.Constants.KeyVaultPlugin.pluginName;
|
|
26
|
+
properties[constants_1.Telemetry.errorCode] = `${constants_1.Constants.KeyVaultPlugin.shortName}.${errorName}`;
|
|
27
|
+
properties[constants_1.Telemetry.errorType] = errorType;
|
|
28
|
+
properties[constants_1.Telemetry.errorMessage] = errorMessage;
|
|
29
|
+
TelemetryUtils.addAppIdInProperty(properties, this.ctx);
|
|
30
|
+
(_a = TelemetryUtils.ctx.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryErrorEvent(eventName, properties, measurements);
|
|
31
|
+
}
|
|
32
|
+
static addAppIdInProperty(properties, ctx) {
|
|
33
|
+
var _a;
|
|
34
|
+
const appId = (_a = ctx.envInfo.state
|
|
35
|
+
.get(constants_1.Constants.SolutionPlugin.id)) === null || _a === void 0 ? void 0 : _a.get(constants_1.Constants.SolutionPlugin.configKeys.remoteTeamsAppId);
|
|
36
|
+
if (appId) {
|
|
37
|
+
properties[constants_1.Telemetry.appId] = appId;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
properties[constants_1.Telemetry.appId] = "";
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.TelemetryUtils = TelemetryUtils;
|
|
45
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/keyvault/utils/telemetry.ts"],"names":[],"mappings":";;;AAGA,4CAAoD;AAEpD,MAAa,cAAc;IAGlB,MAAM,CAAC,IAAI,CAAC,GAAkB;QACnC,cAAc,CAAC,GAAG,GAAG,GAAG,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,SAAS,CACrB,SAAiB,EACjB,UAAsC,EACtC,YAAwC;;QAExC,IAAI,CAAC,UAAU,EAAE;YACf,UAAU,GAAG,EAAE,CAAC;SACjB;QACD,UAAU,CAAC,qBAAS,CAAC,SAAS,CAAC,GAAG,qBAAS,CAAC,OAAO,CAAC;QACpD,UAAU,CAAC,qBAAS,CAAC,SAAS,CAAC,GAAG,qBAAS,CAAC,cAAc,CAAC,UAAU,CAAC;QACtE,cAAc,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,MAAA,cAAc,CAAC,GAAG,CAAC,iBAAiB,0CAAE,kBAAkB,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAChG,CAAC;IAEM,MAAM,CAAC,cAAc,CAC1B,SAAiB,EACjB,SAAiB,EACjB,SAAiB,EACjB,YAAoB,EACpB,UAAsC,EACtC,YAAwC;;QAExC,IAAI,CAAC,UAAU,EAAE;YACf,UAAU,GAAG,EAAE,CAAC;SACjB;QACD,UAAU,CAAC,qBAAS,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AAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/simpleauth/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAyB,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAO/F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjE,qBAAa,oBAAoB;IAC/B,YAAY,EAAG,YAAY,CAAC;IAEf,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAiB7D,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IA2BjE,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IA6B5D,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAuBhE,oBAAoB,CAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;YAkDhC,gBAAgB;CAyC/B"}
|
|
@@ -11,7 +11,7 @@ const telemetry_1 = require("./utils/telemetry");
|
|
|
11
11
|
const webAppClient_1 = require("./webAppClient");
|
|
12
12
|
const path = tslib_1.__importStar(require("path"));
|
|
13
13
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
14
|
-
const
|
|
14
|
+
const folder_1 = require("../../../folder");
|
|
15
15
|
const common_2 = require("../../../common");
|
|
16
16
|
const localSettingsConstants_1 = require("../../../common/localSettingsConstants");
|
|
17
17
|
const constants_2 = require("../../../common/constants");
|
|
@@ -86,7 +86,7 @@ class SimpleAuthPluginImpl {
|
|
|
86
86
|
async generateArmTemplates(ctx) {
|
|
87
87
|
telemetry_1.TelemetryUtils.init(ctx);
|
|
88
88
|
common_1.Utils.addLogAndTelemetry(ctx.logProvider, constants_1.Messages.StartGenerateArmTemplates);
|
|
89
|
-
const bicepTemplateDirectory = path.join(
|
|
89
|
+
const bicepTemplateDirectory = path.join(folder_1.getTemplatesFolder(), "plugins", "resource", "simpleauth", "bicep");
|
|
90
90
|
const provisionModuleResult = path.join(bicepTemplateDirectory, constants_1.Constants.provisionModuleTemplateFileName);
|
|
91
91
|
const configModuleFilePath = path.join(bicepTemplateDirectory, constants_1.Constants.configModuleTemplateFileName);
|
|
92
92
|
const result = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/resource/simpleauth/plugin.ts"],"names":[],"mappings":";;;;AAGA,2CAA6D;AAC7D,qCAA+D;AAC/D,qCAAyC;AACzC,2CAAuC;AACvC,2CAA6C;AAC7C,iDAAmD;AACnD,iDAA8C;AAC9C,mDAA6B;AAC7B,qDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/plugins/resource/simpleauth/plugin.ts"],"names":[],"mappings":";;;;AAGA,2CAA6D;AAC7D,qCAA+D;AAC/D,qCAAyC;AACzC,2CAAuC;AACvC,2CAA6C;AAC7C,iDAAmD;AACnD,iDAA8C;AAC9C,mDAA6B;AAC7B,qDAA+B;AAC/B,4CAAqD;AAErD,4CAAyE;AACzE,mFAA+E;AAC/E,yDAAkE;AAElE,MAAa,oBAAoB;IAGxB,KAAK,CAAC,UAAU,CAAC,GAAkB;;QACxC,0BAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzB,cAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,WAAW,EAAE,oBAAQ,CAAC,eAAe,CAAC,CAAC;QAEpE,MAAM,kBAAkB,GAAG,cA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AAC,UAAU,CAAC,QAAQ,CACnC,CAAC;QAEZ,MAAM,UAAU,GAAG,cAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC,eAAgB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAChG,MAAM,kBAAkB,GAAG,UAAU,CAAC;QAEtC,IAAI,CAAC,YAAY,GAAG,IAAI,2BAAY,CAClC,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EACV,QAAQ,EACR,GAAG,CACJ,CAAC;IACJ,CAAC;CACF;AAhMD,oDAgMC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { AzureSolutionSettings, FxError, Inputs, Json, Result, TokenProvider, Void } from "@microsoft/teamsfx-api";
|
|
2
|
-
import { Context, ResourcePlugin, ResourceTemplate } from "@microsoft/teamsfx-api/build/v2";
|
|
1
|
+
import { AzureSolutionSettings, FxError, Inputs, Json, Result, TokenProvider, v2, Void } from "@microsoft/teamsfx-api";
|
|
3
2
|
import { SimpleAuthPlugin } from "../..";
|
|
4
|
-
export declare class
|
|
3
|
+
export declare class SimpleAuthPluginV2 implements v2.ResourcePlugin {
|
|
5
4
|
name: string;
|
|
6
5
|
displayName: string;
|
|
7
6
|
plugin: SimpleAuthPlugin;
|
|
8
7
|
activate(solutionSettings: AzureSolutionSettings): boolean;
|
|
9
|
-
generateResourceTemplate(ctx: Context, inputs: Inputs): Promise<Result<ResourceTemplate, FxError>>;
|
|
10
|
-
provisionLocalResource(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
11
|
-
configureLocalResource(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
8
|
+
generateResourceTemplate(ctx: v2.Context, inputs: Inputs): Promise<Result<v2.ResourceTemplate, FxError>>;
|
|
9
|
+
provisionLocalResource(ctx: v2.Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
10
|
+
configureLocalResource(ctx: v2.Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
11
|
+
provisionResource(ctx: v2.Context, inputs: v2.ProvisionInputs, envInfo: v2.DeepReadonly<v2.EnvInfoV2>, tokenProvider: TokenProvider): Promise<Result<v2.ResourceProvisionOutput, FxError>>;
|
|
12
|
+
configureResource(ctx: v2.Context, inputs: v2.ProvisionInputs, envInfo: v2.DeepReadonly<v2.EnvInfoV2>, tokenProvider: TokenProvider): Promise<Result<v2.ResourceProvisionOutput, FxError>>;
|
|
12
13
|
}
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/simpleauth/v2/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,IAAI,EACJ,MAAM,EACN,aAAa,EACb,IAAI,EACL,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/simpleauth/v2/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,IAAI,EACJ,MAAM,EACN,aAAa,EACb,EAAE,EACF,IAAI,EACL,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAazC,qBACa,kBAAmB,YAAW,EAAE,CAAC,cAAc;IAC1D,IAAI,SAA6B;IACjC,WAAW,SAAiB;IAE5B,MAAM,EAAG,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,qBAAqB,GAAG,OAAO;IAIpD,wBAAwB,CAC5B,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAI1C,sBAAsB,CAC1B,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,IAAI,EACnB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAU3B,sBAAsB,CAC1B,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,IAAI,EACnB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAU3B,iBAAiB,CACrB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,eAAe,EAC1B,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;IAIjD,iBAAiB,CACrB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,eAAe,EAC1B,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;CAGxD"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.SimpleAuthPluginV2 = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const typedi_1 = require("typedi");
|
|
8
8
|
const __1 = require("../..");
|
|
9
9
|
const ResourcePluginContainer_1 = require("../../../solution/fx-solution/ResourcePluginContainer");
|
|
10
10
|
const utils4v2_1 = require("../../utils4v2");
|
|
11
|
-
let
|
|
11
|
+
let SimpleAuthPluginV2 = class SimpleAuthPluginV2 {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.name = "fx-resource-simple-auth";
|
|
14
14
|
this.displayName = "Simple Auth";
|
|
@@ -25,13 +25,19 @@ let AadPluginV2 = class AadPluginV2 {
|
|
|
25
25
|
async configureLocalResource(ctx, inputs, localSettings, tokenProvider) {
|
|
26
26
|
return await utils4v2_1.configureLocalResourceAdapter(ctx, inputs, localSettings, tokenProvider, this.plugin);
|
|
27
27
|
}
|
|
28
|
+
async provisionResource(ctx, inputs, envInfo, tokenProvider) {
|
|
29
|
+
return await utils4v2_1.provisionResourceAdapter(ctx, inputs, envInfo, tokenProvider, this.plugin);
|
|
30
|
+
}
|
|
31
|
+
async configureResource(ctx, inputs, envInfo, tokenProvider) {
|
|
32
|
+
return await utils4v2_1.configureResourceAdapter(ctx, inputs, envInfo, tokenProvider, this.plugin);
|
|
33
|
+
}
|
|
28
34
|
};
|
|
29
35
|
tslib_1.__decorate([
|
|
30
36
|
typedi_1.Inject(ResourcePluginContainer_1.ResourcePlugins.SimpleAuthPlugin),
|
|
31
37
|
tslib_1.__metadata("design:type", __1.SimpleAuthPlugin)
|
|
32
|
-
],
|
|
33
|
-
|
|
38
|
+
], SimpleAuthPluginV2.prototype, "plugin", void 0);
|
|
39
|
+
SimpleAuthPluginV2 = tslib_1.__decorate([
|
|
34
40
|
typedi_1.Service(ResourcePluginContainer_1.ResourcePluginsV2.SimpleAuthPlugin)
|
|
35
|
-
],
|
|
36
|
-
exports.
|
|
41
|
+
], SimpleAuthPluginV2);
|
|
42
|
+
exports.SimpleAuthPluginV2 = SimpleAuthPluginV2;
|
|
37
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/simpleauth/v2/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAYlC,mCAAyC;AACzC,6BAAyC;AACzC,mGAG+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/simpleauth/v2/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAYlC,mCAAyC;AACzC,6BAAyC;AACzC,mGAG+D;AAC/D,6CAMwB;AAGxB,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAA/B;QACE,SAAI,GAAG,yBAAyB,CAAC;QACjC,gBAAW,GAAG,aAAa,CAAC;IA6D9B,CAAC;IA1DC,QAAQ,CAAC,gBAAuC;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,wBAAwB,CAC5B,GAAe,EACf,MAAc;QAEd,OAAO,MAAM,0CAA+B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC1B,GAAe,EACf,MAAc,EACd,aAAmB,EACnB,aAA4B;QAE5B,OAAO,MAAM,wCAA6B,CACxC,GAAG,EACH,MAAM,EACN,aAAa,EACb,aAAa,EACb,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC1B,GAAe,EACf,MAAc,EACd,aAAmB,EACnB,aAA4B;QAE5B,OAAO,MAAM,wCAA6B,CACxC,GAAG,EACH,MAAM,EACN,aAAa,EACb,aAAa,EACb,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,GAAe,EACf,MAA0B,EAC1B,OAAsC,EACtC,aAA4B;QAE5B,OAAO,MAAM,mCAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1F,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,GAAe,EACf,MAA0B,EAC1B,OAAsC,EACtC,aAA4B;QAE5B,OAAO,MAAM,mCAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1F,CAAC;CACF,CAAA;AA3DC;IADC,eAAM,CAAC,yCAAe,CAAC,gBAAgB,CAAC;sCAChC,oBAAgB;kDAAC;AAJf,kBAAkB;IAD9B,gBAAO,CAAC,2CAAiB,CAAC,gBAAgB,CAAC;GAC/B,kBAAkB,CA+D9B;AA/DY,gDAAkB"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { AzureAccountProvider, ConfigMap, Func, FxError, Inputs, Json, LocalSettings, Plugin, PluginContext, QTreeNode, Result, TokenProvider, Void } from "@microsoft/teamsfx-api";
|
|
1
|
+
import { AzureAccountProvider, ConfigMap, Func, FxError, Inputs, Json, LocalSettings, Plugin, PluginContext, QTreeNode, Result, TokenProvider, Void, v2 } from "@microsoft/teamsfx-api";
|
|
2
2
|
import { Context, DeepReadonly, DeploymentInputs, EnvInfoV2, ProvisionInputs, ResourceProvisionOutput, ResourceTemplate } from "@microsoft/teamsfx-api/build/v2";
|
|
3
|
-
import { ArmResourcePlugin } from "../../common/armInterface";
|
|
4
3
|
export declare function convert2PluginContext(pluginName: string, ctx: Context, inputs: Inputs, ignoreEmptyProjectPath?: boolean): PluginContext;
|
|
5
|
-
export declare function scaffoldSourceCodeAdapter(ctx: Context, inputs: Inputs, plugin: Plugin
|
|
6
|
-
export declare function generateResourceTemplateAdapter(ctx: Context, inputs: Inputs, plugin: Plugin
|
|
4
|
+
export declare function scaffoldSourceCodeAdapter(ctx: Context, inputs: Inputs, plugin: Plugin): Promise<Result<Void, FxError>>;
|
|
5
|
+
export declare function generateResourceTemplateAdapter(ctx: Context, inputs: Inputs, plugin: Plugin): Promise<Result<ResourceTemplate, FxError>>;
|
|
7
6
|
export declare function provisionResourceAdapter(ctx: Context, inputs: ProvisionInputs, envInfo: Readonly<EnvInfoV2>, tokenProvider: TokenProvider, plugin: Plugin): Promise<Result<ResourceProvisionOutput, FxError>>;
|
|
8
7
|
export declare function flattenConfigMap(configMap: ConfigMap): ConfigMap;
|
|
9
8
|
export declare function legacyConfig2EnvState(config: ConfigMap, pluginName: string): {
|
|
10
9
|
output: Json;
|
|
11
10
|
secrets: Json;
|
|
12
11
|
};
|
|
13
|
-
export declare function configureResourceAdapter(ctx: Context, inputs: ProvisionInputs, envInfo: Readonly<EnvInfoV2>, tokenProvider: TokenProvider, plugin: Plugin
|
|
14
|
-
export declare function deployAdapter(ctx: Context, inputs: DeploymentInputs, provisionOutput: Json, tokenProvider: AzureAccountProvider, plugin: Plugin
|
|
15
|
-
export declare function provisionLocalResourceAdapter(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider, plugin: Plugin
|
|
16
|
-
export declare function configureLocalResourceAdapter(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider, plugin: Plugin
|
|
12
|
+
export declare function configureResourceAdapter(ctx: Context, inputs: ProvisionInputs, envInfo: Readonly<EnvInfoV2>, tokenProvider: TokenProvider, plugin: Plugin): Promise<Result<ResourceProvisionOutput, FxError>>;
|
|
13
|
+
export declare function deployAdapter(ctx: Context, inputs: DeploymentInputs, provisionOutput: Json, tokenProvider: AzureAccountProvider, plugin: Plugin): Promise<Result<Void, FxError>>;
|
|
14
|
+
export declare function provisionLocalResourceAdapter(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider, plugin: Plugin): Promise<Result<Json, FxError>>;
|
|
15
|
+
export declare function configureLocalResourceAdapter(ctx: Context, inputs: Inputs, localSettings: Json, tokenProvider: TokenProvider, plugin: Plugin): Promise<Result<Json, FxError>>;
|
|
17
16
|
export declare function executeUserTaskAdapter(ctx: Context, inputs: Inputs, func: Func, localSettings: Json, envInfo: EnvInfoV2, tokenProvider: TokenProvider, plugin: Plugin): Promise<Result<unknown, FxError>>;
|
|
18
17
|
export declare function getQuestionsForScaffoldingAdapter(ctx: Context, inputs: Inputs, plugin: Plugin): Promise<Result<QTreeNode | undefined, FxError>>;
|
|
19
18
|
export declare function getQuestionsAdapter(ctx: Context, inputs: Inputs, envInfo: DeepReadonly<EnvInfoV2>, tokenProvider: TokenProvider, plugin: Plugin): Promise<Result<QTreeNode | undefined, FxError>>;
|
|
@@ -23,4 +22,5 @@ export declare function setEnvInfoV1ByStateV2(pluginName: string, pluginContext:
|
|
|
23
22
|
export declare function setLocalSettingsV2(localSettingsJson: Json, localSettings?: LocalSettings): void;
|
|
24
23
|
export declare function assignJsonInc(target?: Json, source?: Json): Json | undefined;
|
|
25
24
|
export declare function setLocalSettingsV1(pluginContext: PluginContext, localSettings: Json): void;
|
|
25
|
+
export declare function collaborationApiAdaptor(ctx: Context, inputs: v2.InputsWithProjectPath, envInfo: DeepReadonly<EnvInfoV2>, tokenProvider: TokenProvider, userInfo: Json, plugin: Plugin, taskName: "grantPermission" | "listCollaborator" | "checkPermission"): Promise<Result<Json, FxError>>;
|
|
26
26
|
//# sourceMappingURL=utils4v2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils4v2.d.ts","sourceRoot":"","sources":["../../../src/plugins/resource/utils4v2.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,SAAS,EAGT,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,aAAa,EAEb,MAAM,EACN,aAAa,EACb,SAAS,EACT,MAAM,EAEN,aAAa,EACb,IAAI,
|
|
1
|
+
{"version":3,"file":"utils4v2.d.ts","sourceRoot":"","sources":["../../../src/plugins/resource/utils4v2.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oBAAoB,EACpB,SAAS,EAGT,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,aAAa,EAEb,MAAM,EAC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GACnE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAuBhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setLocalSettingsV1 = exports.assignJsonInc = exports.setLocalSettingsV2 = exports.setEnvInfoV1ByStateV2 = exports.setStateV2ByConfigMapInc = exports.getQuestionsForUserTaskAdapter = exports.getQuestionsAdapter = exports.getQuestionsForScaffoldingAdapter = exports.executeUserTaskAdapter = exports.configureLocalResourceAdapter = exports.provisionLocalResourceAdapter = exports.deployAdapter = exports.configureResourceAdapter = exports.legacyConfig2EnvState = exports.flattenConfigMap = exports.provisionResourceAdapter = exports.generateResourceTemplateAdapter = exports.scaffoldSourceCodeAdapter = exports.convert2PluginContext = void 0;
|
|
3
|
+
exports.collaborationApiAdaptor = exports.setLocalSettingsV1 = exports.assignJsonInc = exports.setLocalSettingsV2 = exports.setEnvInfoV1ByStateV2 = exports.setStateV2ByConfigMapInc = exports.getQuestionsForUserTaskAdapter = exports.getQuestionsAdapter = exports.getQuestionsForScaffoldingAdapter = exports.executeUserTaskAdapter = exports.configureLocalResourceAdapter = exports.provisionLocalResourceAdapter = exports.deployAdapter = exports.configureResourceAdapter = exports.legacyConfig2EnvState = exports.flattenConfigMap = exports.provisionResourceAdapter = exports.generateResourceTemplateAdapter = exports.scaffoldSourceCodeAdapter = exports.convert2PluginContext = void 0;
|
|
4
4
|
// Copyright (c) Microsoft Corporation.
|
|
5
5
|
// Licensed under the MIT license.
|
|
6
6
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
@@ -334,4 +334,29 @@ function setLocalSettingsV1(pluginContext, localSettings) {
|
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
exports.setLocalSettingsV1 = setLocalSettingsV1;
|
|
337
|
+
async function collaborationApiAdaptor(ctx, inputs, envInfo, tokenProvider, userInfo, plugin, taskName) {
|
|
338
|
+
var _a;
|
|
339
|
+
// API v2 only works with multiple env enabled
|
|
340
|
+
if (!tools_1.isMultiEnvEnabled()) {
|
|
341
|
+
return teamsfx_api_1.err(error_1.MultipleEnvNotEnabledError());
|
|
342
|
+
}
|
|
343
|
+
const fn = plugin[taskName];
|
|
344
|
+
if (!fn) {
|
|
345
|
+
return teamsfx_api_1.err(error_1.PluginHasNoTaskImpl(plugin.displayName, taskName));
|
|
346
|
+
}
|
|
347
|
+
const state = teamsfx_api_1.ConfigMap.fromJSON(envInfo.state);
|
|
348
|
+
if (!state) {
|
|
349
|
+
return teamsfx_api_1.err(error_1.InvalidStateError(plugin.name, envInfo.state));
|
|
350
|
+
}
|
|
351
|
+
const pluginContext = convert2PluginContext(plugin.name, ctx, inputs);
|
|
352
|
+
pluginContext.azureAccountProvider = tokenProvider.azureAccountProvider;
|
|
353
|
+
pluginContext.appStudioToken = tokenProvider.appStudioToken;
|
|
354
|
+
pluginContext.graphTokenProvider = tokenProvider.graphTokenProvider;
|
|
355
|
+
pluginContext.envInfo = tools_2.newEnvInfo();
|
|
356
|
+
pluginContext.envInfo.state = flattenConfigMap(state);
|
|
357
|
+
pluginContext.envInfo.config = envInfo.config;
|
|
358
|
+
pluginContext.config = (_a = pluginContext.envInfo.state.get(plugin.name)) !== null && _a !== void 0 ? _a : new teamsfx_api_1.ConfigMap();
|
|
359
|
+
return fn.bind(plugin)(pluginContext, userInfo);
|
|
360
|
+
}
|
|
361
|
+
exports.collaborationApiAdaptor = collaborationApiAdaptor;
|
|
337
362
|
//# sourceMappingURL=utils4v2.js.map
|