@microsoft/m365-spec-parser 0.1.1-alpha.f4dd51600.0 → 0.1.1-alpha.fbb412c19.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.
@@ -5,7 +5,7 @@ export declare class ConstantString {
5
5
  static readonly MissingOperationId = "Missing operationIds: %s.";
6
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
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.";
8
+ static readonly SchemaNotSupported = "'oneOf', 'allOf', 'anyOf', and 'not' schema are not supported: %s.";
9
9
  static readonly UnknownSchema = "Unknown schema: %s.";
10
10
  static readonly UrlProtocolNotSupported = "Server url is not correct: protocol %s is not supported, you should use https protocol instead.";
11
11
  static readonly RelativeServerUrlNotSupported = "Server url is not correct: relative server url is not supported.";
@@ -27,8 +27,9 @@ export declare class ConstantString {
27
27
  static readonly TextBlockType = "TextBlock";
28
28
  static readonly ImageType = "Image";
29
29
  static readonly ContainerType = "Container";
30
- static readonly RegistrationIdPostfix = "REGISTRATION_ID";
31
- static readonly OAuthRegistrationIdPostFix = "OAUTH_REGISTRATION_ID";
30
+ static readonly RegistrationIdPostfix: {
31
+ [key: string]: string;
32
+ };
32
33
  static readonly ResponseCodeFor20X: string[];
33
34
  static readonly AllOperationMethods: string[];
34
35
  static readonly WellknownResultNames: string[];
@@ -39,6 +40,7 @@ export declare class ConstantString {
39
40
  static readonly FullDescriptionMaxLens = 4000;
40
41
  static readonly CommandDescriptionMaxLens = 128;
41
42
  static readonly ParameterDescriptionMaxLens = 128;
43
+ static readonly ConversationStarterMaxLens = 50;
42
44
  static readonly CommandTitleMaxLens = 32;
43
45
  static readonly ParameterTitleMaxLens = 32;
44
46
  static readonly SMERequiredParamsMaxNum = 5;
@@ -205,11 +205,19 @@ export interface ParseOptions {
205
205
  * If true, the parser will allow response semantics in plugin file. Only take effect in Copilot project
206
206
  */
207
207
  allowResponseSemantics?: boolean;
208
+ /**
209
+ * If true, the paser will allow confirmation in plugin file. Only take effect in Copilot project
210
+ */
211
+ allowConfirmation?: boolean;
208
212
  /**
209
213
  * The type of project that the parser is being used for.
210
214
  * Project can be SME/Copilot/TeamsAi
211
215
  */
212
216
  projectType?: ProjectType;
217
+ /**
218
+ * If true, we will generate files of plugin for GPT (Declarative Extensions in a Copilot Extension). Otherwise, we will generate files of plugin for Copilot.
219
+ */
220
+ isGptPlugin?: boolean;
213
221
  }
214
222
  export declare enum ProjectType {
215
223
  Copilot = 0,
@@ -1,13 +1,15 @@
1
1
  import { OpenAPIV3 } from "openapi-types";
2
2
  import { AuthInfo, ParseOptions, WarningResult } from "./interfaces";
3
- import { IMessagingExtensionCommand, TeamsAppManifest, PluginManifestSchema, FunctionParameter } from "@microsoft/teams-manifest";
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): Promise<[TeamsAppManifest, PluginManifestSchema]>;
5
+ static updateManifestWithAiPlugin(manifestPath: string, outputSpecPath: string, apiPluginFilePath: string, spec: OpenAPIV3.Document, options: ParseOptions, authInfo?: AuthInfo): Promise<[TeamsAppManifest, PluginManifestSchema]>;
6
6
  static updateManifestDescription(manifest: TeamsAppManifest, spec: OpenAPIV3.Document): void;
7
- static mapOpenAPISchemaToFuncParam(schema: OpenAPIV3.SchemaObject, method: string, pathUrl: string): FunctionParameter;
8
- static generatePluginManifestSchema(spec: OpenAPIV3.Document, specRelativePath: string, apiPluginFilePath: string, appName: string, options: ParseOptions): Promise<PluginManifestSchema>;
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): Promise<PluginManifestSchema>;
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
12
  static removeEnvs(str: string): string;
13
+ static removeAllSpecialCharacters(str: string): string;
14
+ static getConfirmationBodyItem(paramName: string): string;
13
15
  }
@@ -56,4 +56,5 @@ export declare class SpecParser {
56
56
  private loadSpec;
57
57
  private getAPIs;
58
58
  private getValidator;
59
+ private saveFilterSpec;
59
60
  }
@@ -8,6 +8,7 @@ export declare class Utils {
8
8
  static isAPIKeyAuth(authScheme: OpenAPIV3.SecuritySchemeObject): boolean;
9
9
  static isOAuthWithAuthCodeFlow(authScheme: OpenAPIV3.SecuritySchemeObject): boolean;
10
10
  static getAuthArray(securities: OpenAPIV3.SecurityRequirementObject[] | undefined, spec: OpenAPIV3.Document): AuthInfo[][];
11
+ static getAuthInfo(spec: OpenAPIV3.Document): AuthInfo | undefined;
11
12
  static updateFirstLetter(str: string): string;
12
13
  static getResponseJson(operationObject: OpenAPIV3.OperationObject | undefined): {
13
14
  json: OpenAPIV3.MediaTypeObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/m365-spec-parser",
3
- "version": "0.1.1-alpha.f4dd51600.0",
3
+ "version": "0.1.1-alpha.fbb412c19.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",
@@ -39,7 +39,7 @@
39
39
  "sideEffects": false,
40
40
  "dependencies": {
41
41
  "@apidevtools/swagger-parser": "^10.1.0",
42
- "@microsoft/teams-manifest": "0.1.4-alpha.f4dd51600.0",
42
+ "@microsoft/teams-manifest": "0.1.4-alpha.fbb412c19.0",
43
43
  "fs-extra": "^11.2.0",
44
44
  "js-yaml": "^4.1.0",
45
45
  "openapi-types": "^7.2.3",
@@ -94,7 +94,6 @@
94
94
  "has-symbols": "1.0.3",
95
95
  "has-tostringtag": "1.0.2",
96
96
  "he": "1.2.0",
97
- "http": "^0.0.1-security",
98
97
  "https-browserify": "^1.0.0",
99
98
  "is-arguments": "1.1.1",
100
99
  "is-callable": "1.2.7",
@@ -148,5 +147,5 @@
148
147
  "npx eslint --cache --fix --quiet"
149
148
  ]
150
149
  },
151
- "gitHead": "5d3c1e63820d0b645136457eb83557a3627478b2"
150
+ "gitHead": "b65de4899cdf58aa21de20488da251b55e69bb37"
152
151
  }