@microsoft/m365-spec-parser 0.2.4-alpha.ad0d7aa1a.0 → 0.2.4-alpha.af47bc3a8.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.
@@ -31,9 +31,7 @@ export declare class ConstantString {
31
31
  static readonly TextBlockType = "TextBlock";
32
32
  static readonly ImageType = "Image";
33
33
  static readonly ContainerType = "Container";
34
- static readonly RegistrationIdPostfix: {
35
- [key: string]: string;
36
- };
34
+ static readonly RegistrationIdPostfix = "REGISTRATION_ID";
37
35
  static readonly ResponseCodeFor20X: string[];
38
36
  static readonly AllOperationMethods: string[];
39
37
  static readonly WellknownResultNames: string[];
@@ -282,3 +282,12 @@ export interface ExistingPluginManifestInfo {
282
282
  manifestPath: string;
283
283
  specPath: string;
284
284
  }
285
+ export interface OperationAuthInfoMap {
286
+ [operationId: string]: AuthInfo;
287
+ }
288
+ export interface FunctionClassificationMap {
289
+ [authType: string]: {
290
+ functionNames: string[];
291
+ authName: string;
292
+ };
293
+ }
@@ -1,11 +1,11 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
- import { AuthInfo, ExistingPluginManifestInfo, ParseOptions, WarningResult } from "./interfaces";
2
+ import { AuthInfo, ExistingPluginManifestInfo, OperationAuthInfoMap, ParseOptions, WarningResult } from "./interfaces";
3
3
  import { IMessagingExtensionCommand, TeamsAppManifest, PluginManifestSchema } from "@microsoft/teams-manifest";
4
4
  export declare class ManifestUpdater {
5
- static updateManifestWithAiPlugin(manifestPath: string, outputSpecPath: string, apiPluginFilePath: string, spec: OpenAPIV3.Document, options: ParseOptions, authInfo?: AuthInfo, existingPluginManifestInfo?: ExistingPluginManifestInfo): Promise<[TeamsAppManifest, PluginManifestSchema, WarningResult[]]>;
5
+ static updateManifestWithAiPlugin(manifestPath: string, outputSpecPath: string, apiPluginFilePath: string, spec: OpenAPIV3.Document, options: ParseOptions, authMap: OperationAuthInfoMap, existingPluginManifestInfo?: ExistingPluginManifestInfo): Promise<[TeamsAppManifest, PluginManifestSchema, WarningResult[]]>;
6
6
  static updateManifestDescription(manifest: TeamsAppManifest, spec: OpenAPIV3.Document): void;
7
7
  static checkSchema(schema: OpenAPIV3.SchemaObject, method: string, pathUrl: string): void;
8
- static generatePluginManifestSchema(spec: OpenAPIV3.Document, specRelativePath: string, apiPluginFilePath: string, appName: string, authInfo: AuthInfo | undefined, options: ParseOptions, existingPluginManifestInfo?: ExistingPluginManifestInfo): Promise<[PluginManifestSchema, WarningResult[]]>;
8
+ static generatePluginManifestSchema(spec: OpenAPIV3.Document, specRelativePath: string, apiPluginFilePath: string, appName: string, authMap: OperationAuthInfoMap, options: ParseOptions, existingPluginManifestInfo?: ExistingPluginManifestInfo): Promise<[PluginManifestSchema, WarningResult[]]>;
9
9
  static updateManifest(manifestPath: string, outputSpecPath: string, spec: OpenAPIV3.Document, options: ParseOptions, adaptiveCardFolder?: string, authInfo?: AuthInfo): Promise<[TeamsAppManifest, WarningResult[]]>;
10
10
  static generateCommands(spec: OpenAPIV3.Document, manifestPath: string, options: ParseOptions, adaptiveCardFolder?: string): Promise<[IMessagingExtensionCommand[], WarningResult[]]>;
11
11
  static getRelativePath(from: string, to: string): string;
@@ -12,6 +12,7 @@ export declare class SpecParser {
12
12
  private spec;
13
13
  private unResolveSpec;
14
14
  private isSwaggerFile;
15
+ private readonly refParser;
15
16
  private defaultOptions;
16
17
  /**
17
18
  * Creates a new instance of the SpecParser class.
@@ -37,6 +38,7 @@ export declare class SpecParser {
37
38
  * @param filter An array of strings that represent the filters to apply when generating the artifacts. If filter is empty, it would process nothing.
38
39
  */
39
40
  getFilteredSpecs(filter: string[], signal?: AbortSignal): Promise<[OpenAPIV3.Document, OpenAPIV3.Document]>;
41
+ private deReferenceSpec;
40
42
  /**
41
43
  * Generates and update artifacts from the OpenAPI specification file. Generate Adaptive Cards, update Teams app manifest, and generate a new OpenAPI specification file.
42
44
  * @param manifestPath A file path of the Teams app manifest file to update.
@@ -1,14 +1,16 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
- import { AuthInfo, AuthType, ErrorResult, ParseOptions } from "./interfaces";
2
+ import { AuthInfo, AuthType, ErrorResult, OperationAuthInfoMap, ParseOptions } from "./interfaces";
3
3
  import { IMessagingExtensionCommand, IParameter } from "@microsoft/teams-manifest";
4
4
  export declare class Utils {
5
5
  static isObjectSchema(schema: OpenAPIV3.SchemaObject): boolean;
6
6
  static containMultipleMediaTypes(bodyObject: OpenAPIV3.RequestBodyObject | OpenAPIV3.ResponseObject): boolean;
7
7
  static isBearerTokenAuth(authScheme: AuthType): boolean;
8
8
  static isAPIKeyAuth(authScheme: AuthType): boolean;
9
+ static isAPIKeyAuthButNotInCookie(authScheme: AuthType): boolean;
9
10
  static isOAuthWithAuthCodeFlow(authScheme: AuthType): boolean;
10
11
  static isNotSupportedAuth(authSchemeArray: AuthInfo[][]): boolean;
11
12
  static getAuthArray(securities: OpenAPIV3.SecurityRequirementObject[] | undefined, spec: OpenAPIV3.Document): AuthInfo[][];
13
+ static getAuthMap(spec: OpenAPIV3.Document): OperationAuthInfoMap;
12
14
  static getAuthInfo(spec: OpenAPIV3.Document): AuthInfo | undefined;
13
15
  static updateFirstLetter(str: string): string;
14
16
  static getResponseJson(operationObject: OpenAPIV3.OperationObject | undefined, allowMultipleMediaType?: boolean): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/m365-spec-parser",
3
- "version": "0.2.4-alpha.ad0d7aa1a.0",
3
+ "version": "0.2.4-alpha.af47bc3a8.0",
4
4
  "description": "OpenAPI specification files Parser for M365 Apps",
5
5
  "main": "dist/index.node.cjs.js",
6
6
  "browser": "dist/index.esm2017.js",
@@ -38,8 +38,9 @@
38
38
  "homepage": "https://github.com/OfficeDev/TeamsFx",
39
39
  "sideEffects": false,
40
40
  "dependencies": {
41
+ "@apidevtools/json-schema-ref-parser": "^11.7.2",
41
42
  "@apidevtools/swagger-parser": "^10.1.0",
42
- "@microsoft/teams-manifest": "0.1.8-alpha.ad0d7aa1a.0",
43
+ "@microsoft/teams-manifest": "0.1.8-alpha.af47bc3a8.0",
43
44
  "fs-extra": "^11.2.0",
44
45
  "js-yaml": "^4.1.0",
45
46
  "openapi-types": "^7.2.3",
@@ -49,7 +50,6 @@
49
50
  "access": "public"
50
51
  },
51
52
  "devDependencies": {
52
- "@apidevtools/json-schema-ref-parser": "^9.0.6",
53
53
  "@apidevtools/openapi-schemas": "2.1.0",
54
54
  "@apidevtools/swagger-methods": "3.0.2",
55
55
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
@@ -147,5 +147,5 @@
147
147
  "npx eslint --cache --fix --quiet"
148
148
  ]
149
149
  },
150
- "gitHead": "9ba67af6f8e12f442b1ef56ac2052759a649e00d"
150
+ "gitHead": "b97991baf56ac7698cbbb217dca8df8f7ddf8d1c"
151
151
  }