Skip to content

Commit

Permalink
Merge pull request #369 from stephanbisser/preview
Browse files Browse the repository at this point in the history
Added support for Manifest Version 1.16
  • Loading branch information
stephanbisser authored Aug 30, 2023
2 parents d1953d9 + 50baf79 commit 3367160
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ManifestGenerator as ManifestGenerator112 } from "./manifestGenerators/
import { ManifestGenerator as ManifestGenerator113 } from "./manifestGenerators/generator113/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator114 } from "./manifestGenerators/generator114/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator115 } from "./manifestGenerators/generator115/ManifestGenerator";
import { ManifestGenerator as ManifestGenerator116 } from "./manifestGenerators/generator116/ManifestGenerator";
import { ManifestGenerator as ManifestGeneratorDevPreview } from "./manifestGenerators/generatorDevPreview/ManifestGenerator";
import { ManifestGenerator as ManifestGeneratorM365DevPreview } from "./manifestGenerators/generatorM365DevPreview/ManifestGenerator";
import { BaseManifestGenerator } from "./BaseManifestGenerator";
Expand Down Expand Up @@ -78,6 +79,14 @@ export class ManifestGeneratorFactory {
hide: false,
comment: "With support for extending Teams apps to other parts of the Microsoft 365 ecosystem"
},
{
manifestVersion: ManifestVersions.v116,
schemaUrl: "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
manifestValue: "1.16",
default: true,
hide: false,
comment: "With support for extending Teams apps to other parts of the Microsoft 365 ecosystem"
},
{
manifestVersion: ManifestVersions.devPreview,
schemaUrl: "https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json",
Expand Down Expand Up @@ -129,6 +138,8 @@ export class ManifestGeneratorFactory {
return new ManifestGenerator114();
} else if (manifestVersion == ManifestVersions.v115) {
return new ManifestGenerator115();
} else if (manifestVersion == ManifestVersions.v116) {
return new ManifestGenerator116();
} else if (manifestVersion == ManifestVersions.devPreview) {
return new ManifestGeneratorDevPreview();
} else if (manifestVersion == ManifestVersions.m365DevPreview) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum ManifestVersions {
v113 = "v1.13",
v114 = "v1.14",
v115 = "v1.15",
v116 = "v1.16",
devPreview = "devPreview",
m365DevPreview = "m365DevPreview"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (c) Wictor Wilén. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { BaseManifestGenerator } from "../../BaseManifestGenerator";
import { TabManifestUpdater } from "../generator19/TabManifestUpdater";
import { BotManifestUpdater } from "../generator18/BotManifestUpdater";
import { ConnectorManifestUpdater } from "../generator18/ConnectorManifestUpdater";
import { MessageExtensionManifestUpdater } from "../generator18/MessageExtensionManifestUpdater";
import { GeneratorTeamsAppOptions } from "../../../GeneratorTeamsAppOptions";
import { LocalizationManifestUpdater } from "../generator18/LocalizationManifestUpdater";
import * as chalk from 'chalk';


export class ManifestGenerator extends BaseManifestGenerator {
constructor() {
super();
this.tabUpdater = new TabManifestUpdater();
this.botUpdater = new BotManifestUpdater();
this.connectorUpdater = new ConnectorManifestUpdater();
this.messageExtensionUpdater = new MessageExtensionManifestUpdater();
this.localizationUpdater = new LocalizationManifestUpdater();
}

public generateManifest(options: GeneratorTeamsAppOptions): any {
const manifest = super.generateManifest(options);
manifest["$schema"] = "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json";
manifest.manifestVersion = "1.16";

return manifest;
}

public supportsUpdateManifest(from: string): boolean {
return from === "1.8" || from === "1.9" || from === "1.10" || from === "1.11" || from === "1.12" || from === "1.13" || from === "1.14" || from === "1.15";
}

public updateManifest(manifest: any, log?: (message?: string, context?: any) => void): any {
switch (manifest.manifestVersion) {
case "1.8":
case "1.9":
case "1.10":
case "1.11":
case "1.12":
case "1.13":
case "1.14":
case "1.15":
manifest["$schema"] = "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json";
manifest.manifestVersion = "1.16";
return manifest;
default:
throw "Unable to update manifest";

}
};
}
4 changes: 3 additions & 1 deletion packages/generator-teams/tests/helpers/TestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ export const SCHEMA_112 = 'https://developer.microsoft.com/en-us/json-schemas/te
export const SCHEMA_113 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.13/MicrosoftTeams.schema.json';
export const SCHEMA_114 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.14/MicrosoftTeams.schema.json';
export const SCHEMA_115 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.15/MicrosoftTeams.schema.json';
export const SCHEMA_116 = 'https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json';
export const SCHEMA_DEVPREVIEW = 'https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json';
export const SCHEMA_M365DEVPREVIEW = 'https://raw.githubusercontent.com/OfficeDev/microsoft-teams-app-schema/preview/DevPreview/MicrosoftTeams.schema.json';

export const INTEGRATION_TEST_VERSIONS = ["v1.13", "devPreview"]; // only keep two versions, so we can stay under Github 360 minute rule
export const INTEGRATION_TEST_VERSIONS = ["v1.16", "devPreview"]; // only keep two versions, so we can stay under Github 360 minute rule

export const SCHEMAS: { [key: string]: string } = {
// "v1.8": SCHEMA_18,
Expand All @@ -139,6 +140,7 @@ export const SCHEMAS: { [key: string]: string } = {
"v1.13": SCHEMA_113,
"v1.14": SCHEMA_114,
"v1.15": SCHEMA_115,
"v1.16": SCHEMA_116,
"devPreview": SCHEMA_DEVPREVIEW,
"m365DevPreview": SCHEMA_M365DEVPREVIEW
}
Expand Down
23 changes: 23 additions & 0 deletions packages/generator-teams/tests/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"
],
"prompts": {
Expand All @@ -21,6 +22,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview",
"m365DevPreview"
],
Expand All @@ -36,6 +38,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"
],
"prompts": {
Expand All @@ -53,6 +56,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"
],
"prompts": {
Expand All @@ -68,6 +72,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"
],
"prompts": {
Expand All @@ -89,6 +94,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"
],
"prompts": {
Expand All @@ -111,6 +117,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -133,6 +140,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -157,6 +165,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -181,6 +190,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -202,6 +212,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -219,6 +230,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -234,6 +246,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -256,6 +269,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -273,6 +287,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -290,6 +305,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -308,6 +324,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -330,6 +347,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -351,6 +369,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -370,6 +389,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -390,6 +410,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -410,6 +431,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand All @@ -429,6 +451,7 @@
"v1.13",
"v1.14",
"v1.15",
"v1.16",
"devPreview"

],
Expand Down

0 comments on commit 3367160

Please sign in to comment.