@microsoft/m365-spec-parser 0.2.2-alpha.4a7c0c761.0 → 0.2.2-alpha.557dab381.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/dist/index.esm2017.js +24 -2
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +210 -14
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +24 -2
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +210 -14
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/interfaces.d.ts +7 -3
- package/dist/src/specOptimizer.d.ts +18 -0
- package/dist/src/utils.d.ts +5 -4
- package/package.json +3 -3
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { SpecParser } from "./specParser";
|
|
2
2
|
export { SpecParserError } from "./specParserError";
|
|
3
|
-
export { ValidationStatus, WarningType, ErrorType, WarningResult, ErrorResult, ListAPIResult, APIInfo, ValidateResult, ParseOptions, AdaptiveCard, ProjectType, InvalidAPIInfo, } from "./interfaces";
|
|
3
|
+
export { ValidationStatus, WarningType, ErrorType, WarningResult, ErrorResult, ListAPIResult, APIInfo, ValidateResult, ParseOptions, AdaptiveCard, ProjectType, InvalidAPIInfo, AuthType, } from "./interfaces";
|
|
4
4
|
export { ConstantString } from "./constants";
|
|
5
5
|
export { Utils } from "./utils";
|
|
6
6
|
export { AdaptiveCardGenerator } from "./adaptiveCardGenerator";
|
package/dist/src/interfaces.d.ts
CHANGED
|
@@ -136,16 +136,17 @@ export interface ImageElement {
|
|
|
136
136
|
url: string;
|
|
137
137
|
$when: string;
|
|
138
138
|
}
|
|
139
|
+
export declare type AdaptiveCardBody = Array<TextBlockElement | ImageElement | ArrayElement>;
|
|
139
140
|
export interface ArrayElement {
|
|
140
141
|
type: string;
|
|
141
142
|
$data: string;
|
|
142
|
-
items:
|
|
143
|
+
items: AdaptiveCardBody;
|
|
143
144
|
}
|
|
144
145
|
export interface AdaptiveCard {
|
|
145
146
|
type: string;
|
|
146
147
|
$schema: string;
|
|
147
148
|
version: string;
|
|
148
|
-
body:
|
|
149
|
+
body: AdaptiveCardBody;
|
|
149
150
|
}
|
|
150
151
|
export interface PreviewCardTemplate {
|
|
151
152
|
title: string;
|
|
@@ -259,8 +260,11 @@ export interface ListAPIResult {
|
|
|
259
260
|
validAPICount: number;
|
|
260
261
|
APIs: ListAPIInfo[];
|
|
261
262
|
}
|
|
263
|
+
export declare type AuthType = OpenAPIV3.SecuritySchemeObject | {
|
|
264
|
+
type: "multipleAuth";
|
|
265
|
+
};
|
|
262
266
|
export interface AuthInfo {
|
|
263
|
-
authScheme:
|
|
267
|
+
authScheme: AuthType;
|
|
264
268
|
name: string;
|
|
265
269
|
}
|
|
266
270
|
export interface InvalidAPIInfo {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
+
export interface OptimizerOptions {
|
|
3
|
+
removeUnusedComponents: boolean;
|
|
4
|
+
removeUnusedTags: boolean;
|
|
5
|
+
removeUserDefinedRootProperty: boolean;
|
|
6
|
+
removeUnusedSecuritySchemas: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class SpecOptimizer {
|
|
9
|
+
private static defaultOptions;
|
|
10
|
+
static optimize(spec: OpenAPIV3.Document, options?: OptimizerOptions): OpenAPIV3.Document;
|
|
11
|
+
private static removeUnusedSecuritySchemas;
|
|
12
|
+
private static removeUnusedTags;
|
|
13
|
+
private static removeUserDefinedRootProperty;
|
|
14
|
+
private static removeUnusedComponents;
|
|
15
|
+
private static getComponentReferences;
|
|
16
|
+
private static getComponent;
|
|
17
|
+
private static addComponent;
|
|
18
|
+
}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
import { AuthInfo, ErrorResult, ParseOptions } from "./interfaces";
|
|
2
|
+
import { AdaptiveCardBody, AuthInfo, AuthType, ErrorResult, ParseOptions } from "./interfaces";
|
|
3
3
|
import { IMessagingExtensionCommand, IParameter } from "@microsoft/teams-manifest";
|
|
4
4
|
export declare class Utils {
|
|
5
5
|
static hasNestedObjectInSchema(schema: OpenAPIV3.SchemaObject): boolean;
|
|
6
6
|
static containMultipleMediaTypes(bodyObject: OpenAPIV3.RequestBodyObject | OpenAPIV3.ResponseObject): boolean;
|
|
7
|
-
static isBearerTokenAuth(authScheme:
|
|
8
|
-
static isAPIKeyAuth(authScheme:
|
|
9
|
-
static isOAuthWithAuthCodeFlow(authScheme:
|
|
7
|
+
static isBearerTokenAuth(authScheme: AuthType): boolean;
|
|
8
|
+
static isAPIKeyAuth(authScheme: AuthType): boolean;
|
|
9
|
+
static isOAuthWithAuthCodeFlow(authScheme: AuthType): boolean;
|
|
10
10
|
static getAuthArray(securities: OpenAPIV3.SecurityRequirementObject[] | undefined, spec: OpenAPIV3.Document): AuthInfo[][];
|
|
11
11
|
static getAuthInfo(spec: OpenAPIV3.Document): AuthInfo | undefined;
|
|
12
12
|
static updateFirstLetter(str: string): string;
|
|
@@ -26,4 +26,5 @@ export declare class Utils {
|
|
|
26
26
|
static format(str: string, ...args: string[]): string;
|
|
27
27
|
static getSafeRegistrationIdEnvName(authName: string): string;
|
|
28
28
|
static getServerObject(spec: OpenAPIV3.Document, method: string, path: string): OpenAPIV3.ServerObject | undefined;
|
|
29
|
+
static limitACBodyProperties(body: AdaptiveCardBody, maxCount: number): AdaptiveCardBody;
|
|
29
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/m365-spec-parser",
|
|
3
|
-
"version": "0.2.2-alpha.
|
|
3
|
+
"version": "0.2.2-alpha.557dab381.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.6-alpha.
|
|
42
|
+
"@microsoft/teams-manifest": "0.1.6-alpha.557dab381.0",
|
|
43
43
|
"fs-extra": "^11.2.0",
|
|
44
44
|
"js-yaml": "^4.1.0",
|
|
45
45
|
"openapi-types": "^7.2.3",
|
|
@@ -147,5 +147,5 @@
|
|
|
147
147
|
"npx eslint --cache --fix --quiet"
|
|
148
148
|
]
|
|
149
149
|
},
|
|
150
|
-
"gitHead": "
|
|
150
|
+
"gitHead": "398fd60c43c5432aaa76b7d41d3cce5ac01d0752"
|
|
151
151
|
}
|