Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: merge back to dev after publish TTK for VS 17.12 P3 #12477

Merged
merged 25 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bf3bbf0
hotfix: fix sso-tab template
Yimin-Jin Sep 19, 2024
eb9d9d4
Merge pull request #12417 from OfficeDev/yiminjin/hotfix-sso-tab
eriolchan Sep 19, 2024
bf6de48
build(release): publish detail
MSFT-yiz Sep 19, 2024
fdba767
remove confict dependency (#12336)
QinghuiMeng-M Sep 5, 2024
d30ab64
Merge pull request #12420 from OfficeDev/kuojianlu/hotfix
eriolchan Sep 19, 2024
6f5b003
build(release): publish detail
MSFT-yiz Sep 19, 2024
4784367
hotfix: fix sso-tab template
Yimin-Jin Sep 20, 2024
506a6cb
Merge pull request #12429 from OfficeDev/yiminjin/hotfix-sso-tab
eriolchan Sep 20, 2024
352fdf9
build(release): publish detail
MSFT-yiz Sep 20, 2024
add6bcd
fix: add moduleResolution section to templates tsconfig file
yukun-dong Sep 23, 2024
fdc2f8b
Merge pull request #12433 from OfficeDev/yukun/fix-ts-template
eriolchan Sep 23, 2024
9ee6858
build(release): publish detail
MSFT-yiz Sep 23, 2024
bcf50cb
fix: revert changes for teams-ai related template
yukun-dong Sep 23, 2024
52d8810
Merge branch 'hotfix/templates_4.2.3' into yukun/fix-ts-templates2
yukun-dong Sep 23, 2024
11b79d9
Merge pull request #12434 from OfficeDev/dev
eriolchan Sep 23, 2024
6e5f4d8
build(release): publish detail
MSFT-yiz Sep 23, 2024
3744646
Merge pull request #12435 from OfficeDev/yukun/fix-ts-templates2
eriolchan Sep 23, 2024
0715b5f
fix: remove spec auth support for VS
KennethBWSong Sep 24, 2024
7301633
build(release): publish detail
MSFT-yiz Sep 24, 2024
365fd36
Merge pull request #12438 from OfficeDev/bowsong/hotfix_vs_auth
eriolchan Sep 24, 2024
589494f
build(release): publish detail
MSFT-yiz Sep 25, 2024
7c78fa1
Merge branch 'main' into siglud/after-hotfix-merge
Siglud Sep 25, 2024
1faec96
Merge pull request #12451 from OfficeDev/siglud/after-hotfix-merge
eriolchan Sep 25, 2024
918b2a9
build: rollback package version
Siglud Sep 25, 2024
ef0e026
Merge pull request #12454 from Siglud/siglud/fix-version-rc
eriolchan Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/fx-core/src/common/templates-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "~4.2",
"localVersion": "4.2.2",
"localVersion": "4.2.3",
"tagPrefix": "templates@",
"tagListURL": "https://github.com/OfficeDev/TeamsFx/releases/download/template-tag-list/template-tags.txt",
"templateDownloadBaseURL": "https://github.com/OfficeDev/TeamsFx/releases/download",
Expand Down
13 changes: 10 additions & 3 deletions packages/fx-core/src/component/generator/apiSpec/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ const enum telemetryEvents {
failedToGetGenerateWarning = "failed-to-get-generate-warning",
}

export function getParserOptions(type: ProjectType, isDeclarativeCopilot?: boolean): ParseOptions {
export function getParserOptions(
type: ProjectType,
isDeclarativeCopilot?: boolean,
platform?: string
): ParseOptions {
return type === ProjectType.Copilot
? {
isGptPlugin: isDeclarativeCopilot,
Expand Down Expand Up @@ -113,7 +117,7 @@ export function getParserOptions(type: ProjectType, isDeclarativeCopilot?: boole
}
: {
projectType: type,
allowBearerTokenAuth: true, // Currently, API key auth support is actually bearer token auth
allowBearerTokenAuth: !!platform && platform === Platform.VS ? false : true, // Currently, API key auth support is actually bearer token auth
allowMultipleParameters: true,
allowOauth2: featureFlagManager.getBooleanValue(FeatureFlags.SMEOAuth),
};
Expand Down Expand Up @@ -158,7 +162,10 @@ export async function listOperations(
: ProjectType.SME;

try {
const specParser = new SpecParser(apiSpecUrl as string, getParserOptions(projectType));
const specParser = new SpecParser(
apiSpecUrl as string,
getParserOptions(projectType, undefined, inputs.platform)
);
const validationRes = await specParser.validate();
validationRes.errors = formatValidationErrors(validationRes.errors, inputs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,36 @@ describe("listOperations", async () => {
expect(res.error[0].type).to.be.equal(ErrorType.AddedAPINotInOriginalSpec);
}
});

it("should not allow auth for VS project", async () => {
const inputs = {
platform: Platform.VS,
};
sandbox.stub(CopilotPluginHelper, "formatValidationErrors").resolves([]);
sandbox.stub(CopilotPluginHelper, "logValidationResults").resolves();
sandbox.stub(SpecParser.prototype, "validate").resolves({
status: ValidationStatus.Valid,
warnings: [],
errors: [],
specHash: "xxx",
});
sandbox.stub(SpecParser.prototype, "list").resolves({
APIs: [
{
api: "1",
server: "https://test",
operationId: "id1",
isValid: false,
reason: [ErrorType.AuthTypeIsNotSupported],
},
],
allAPICount: 1,
validAPICount: 0,
});

const res = await CopilotPluginHelper.listOperations(context, "", inputs, true, false, "");
expect(res.isOk()).to.be.true;
});
});

describe("SpecGenerator", async () => {
Expand Down
2 changes: 1 addition & 1 deletion templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "templates",
"version": "4.3.0-alpha",
"version": "4.2.3",
"private": "true",
"license": "MIT",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions templates/ts/ai-assistant-bot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/ai-bot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/command-and-response/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/default-bot-message-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/default-bot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/link-unfurling/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/m365-message-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/message-extension-action/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
2 changes: 1 addition & 1 deletion templates/ts/message-extension-copilot/package.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/node": "^20.8.9",
"env-cmd": "^10.1.0",
"ts-node": "^10.4.0",
"typescript": "^5.2.2",
"typescript": "^4.4.4",
"nodemon": "^3.0.1",
"shx": "^0.3.3"
}
Expand Down
1 change: 1 addition & 0 deletions templates/ts/message-extension-copilot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/message-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/non-sso-tab-default-bot/bot/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"resolveJsonModule": true,
Expand Down
1 change: 1 addition & 0 deletions templates/ts/notification-http-trigger/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"resolveJsonModule": true,
Expand Down
1 change: 1 addition & 0 deletions templates/ts/notification-restify/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
1 change: 1 addition & 0 deletions templates/ts/notification-timer-trigger/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./dist",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"resolveJsonModule": true,
Expand Down
5 changes: 3 additions & 2 deletions templates/ts/sso-tab-with-obo-flow/api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "nodenext",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
Expand Down
1 change: 1 addition & 0 deletions templates/ts/workflow/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"outDir": "./lib",
"rootDir": "./",
"moduleResolution": "nodenext",
"sourceMap": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
Expand Down
Loading