@microsoft/m365-spec-parser 0.2.12-alpha.d89dca114.0 → 0.2.12-alpha.eaecfe55f.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 +1565 -1565
- package/dist/index.esm2017.mjs +2605 -2604
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +1572 -1612
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +2606 -2672
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/src/adaptiveCardGenerator.d.ts +10 -10
- package/dist/src/adaptiveCardWrapper.d.ts +16 -16
- package/dist/src/constants.d.ts +53 -53
- package/dist/src/index.browser.d.ts +7 -7
- package/dist/src/index.d.ts +6 -6
- package/dist/src/interfaces.d.ts +300 -300
- package/dist/src/jsonDataGenerator.d.ts +6 -6
- package/dist/src/manifestUpdater.d.ts +16 -16
- package/dist/src/specFilter.d.ts +5 -5
- package/dist/src/specOptimizer.d.ts +18 -18
- package/dist/src/specParser.browser.d.ts +60 -60
- package/dist/src/specParser.d.ts +71 -71
- package/dist/src/specParserError.d.ts +5 -5
- package/dist/src/utils.d.ts +34 -34
- package/package.json +21 -20
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
-
import { AdaptiveCard, ArrayElement, ImageElement, TextBlockElement, WarningResult } from "./interfaces";
|
|
3
|
-
export declare class AdaptiveCardGenerator {
|
|
4
|
-
static generateAdaptiveCard(operationItem: OpenAPIV3.OperationObject, allowMultipleMediaType?: boolean, maxElementCount?: number): [AdaptiveCard, string, any, WarningResult[]];
|
|
5
|
-
static generateCardFromResponse(schema: OpenAPIV3.SchemaObject, name: string, parentArrayName?: string, maxElementCount?: number, counter?: {
|
|
6
|
-
count: number;
|
|
7
|
-
}): Array<TextBlockElement | ImageElement | ArrayElement>;
|
|
8
|
-
static getResponseJsonPathFromSchema(schema: OpenAPIV3.SchemaObject): string;
|
|
9
|
-
static isImageUrlProperty(schema: OpenAPIV3.NonArraySchemaObject, name: string, parentArrayName: string): boolean;
|
|
10
|
-
}
|
|
1
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
+
import { AdaptiveCard, ArrayElement, ImageElement, TextBlockElement, WarningResult } from "./interfaces";
|
|
3
|
+
export declare class AdaptiveCardGenerator {
|
|
4
|
+
static generateAdaptiveCard(operationItem: OpenAPIV3.OperationObject, allowMultipleMediaType?: boolean, maxElementCount?: number): [AdaptiveCard, string, any, WarningResult[]];
|
|
5
|
+
static generateCardFromResponse(schema: OpenAPIV3.SchemaObject, name: string, parentArrayName?: string, maxElementCount?: number, counter?: {
|
|
6
|
+
count: number;
|
|
7
|
+
}): Array<TextBlockElement | ImageElement | ArrayElement>;
|
|
8
|
+
static getResponseJsonPathFromSchema(schema: OpenAPIV3.SchemaObject): string;
|
|
9
|
+
static isImageUrlProperty(schema: OpenAPIV3.NonArraySchemaObject, name: string, parentArrayName: string): boolean;
|
|
10
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ResponseSemanticsObject } from "@microsoft/app-manifest";
|
|
2
|
-
import { AdaptiveCard, PreviewCardTemplate, WrappedAdaptiveCard } from "./interfaces";
|
|
3
|
-
export declare function wrapAdaptiveCard(card: AdaptiveCard, jsonPath: string): WrappedAdaptiveCard;
|
|
4
|
-
export declare function wrapResponseSemantics(card: AdaptiveCard, jsonPath: string): ResponseSemanticsObject;
|
|
5
|
-
/**
|
|
6
|
-
* Infers the preview card template from an Adaptive Card and a JSON path.
|
|
7
|
-
* The preview card template includes a title and an optional subtitle and image.
|
|
8
|
-
* It populates the preview card template with the first text block that matches
|
|
9
|
-
* each well-known name, in the order of title, subtitle, and image.
|
|
10
|
-
* If no text block matches the title or subtitle, it uses the first two text block as the title and subtitle.
|
|
11
|
-
* If the title is still empty and the subtitle is not empty, it uses subtitle as the title.
|
|
12
|
-
* @param card The Adaptive Card to infer the preview card template from.
|
|
13
|
-
* @param jsonPath The JSON path to the root object in the card body.
|
|
14
|
-
* @returns The inferred preview card template.
|
|
15
|
-
*/
|
|
16
|
-
export declare function inferPreviewCardTemplate(card: AdaptiveCard): PreviewCardTemplate;
|
|
1
|
+
import { ResponseSemanticsObject } from "@microsoft/app-manifest";
|
|
2
|
+
import { AdaptiveCard, PreviewCardTemplate, WrappedAdaptiveCard } from "./interfaces";
|
|
3
|
+
export declare function wrapAdaptiveCard(card: AdaptiveCard, jsonPath: string): WrappedAdaptiveCard;
|
|
4
|
+
export declare function wrapResponseSemantics(card: AdaptiveCard, jsonPath: string): ResponseSemanticsObject;
|
|
5
|
+
/**
|
|
6
|
+
* Infers the preview card template from an Adaptive Card and a JSON path.
|
|
7
|
+
* The preview card template includes a title and an optional subtitle and image.
|
|
8
|
+
* It populates the preview card template with the first text block that matches
|
|
9
|
+
* each well-known name, in the order of title, subtitle, and image.
|
|
10
|
+
* If no text block matches the title or subtitle, it uses the first two text block as the title and subtitle.
|
|
11
|
+
* If the title is still empty and the subtitle is not empty, it uses subtitle as the title.
|
|
12
|
+
* @param card The Adaptive Card to infer the preview card template from.
|
|
13
|
+
* @param jsonPath The JSON path to the root object in the card body.
|
|
14
|
+
* @returns The inferred preview card template.
|
|
15
|
+
*/
|
|
16
|
+
export declare function inferPreviewCardTemplate(card: AdaptiveCard): PreviewCardTemplate;
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
export declare class ConstantString {
|
|
2
|
-
static readonly CancelledMessage = "Operation is cancelled.";
|
|
3
|
-
static readonly NoServerInformation = "No server information is found in the OpenAPI description document.";
|
|
4
|
-
static readonly RemoteRefNotSupported = "Remote reference is not supported: %s.";
|
|
5
|
-
static readonly MissingOperationId = "Missing operationIds: %s.";
|
|
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
|
-
static readonly AdditionalPropertiesNotSupported = "'additionalProperties' is not supported, and will be ignored.";
|
|
8
|
-
static readonly SchemaNotSupported = "'oneOf', 'allOf', 'anyOf', and 'not' schema are not supported: %s.";
|
|
9
|
-
static readonly UnknownSchema = "Unknown schema: %s.";
|
|
10
|
-
static readonly UrlProtocolNotSupported = "Server url is not correct: protocol %s is not supported, you should use https protocol instead.";
|
|
11
|
-
static readonly RelativeServerUrlNotSupported = "Server url is not correct: relative server url is not supported.";
|
|
12
|
-
static readonly ResolveServerUrlFailed = "Unable to resolve the server URL: please make sure that the environment variable %s is defined.";
|
|
13
|
-
static readonly OperationOnlyContainsOptionalParam = "Operation %s contains multiple optional parameters. The first optional parameter is used for this command.";
|
|
14
|
-
static readonly ConvertSwaggerToOpenAPI = "The Swagger 2.0 file has been converted to OpenAPI 3.0.";
|
|
15
|
-
static readonly OpenAPI31ConvertTo30 = "OpenAPI 3.1 document has been converted to OpenAPI 3.0.";
|
|
16
|
-
static readonly SwaggerNotSupported = "Swagger 2.0 is not supported. Please convert to OpenAPI 3.0 manually before proceeding.";
|
|
17
|
-
static readonly SpecVersionNotSupported = "Unsupported OpenAPI version %s. Please use version 3.0.x.";
|
|
18
|
-
static readonly MultipleAuthNotSupported = "Multiple authentication methods are unsupported. Ensure all selected APIs use identical authentication.";
|
|
19
|
-
static readonly OperationIdContainsSpecialCharacters = "Operation id '%s' in OpenAPI description document contained special characters and was renamed to '%s'.";
|
|
20
|
-
static readonly AuthTypeIsNotSupported = "Unsupported authorization type in API '%s'. No authorization will be used.";
|
|
21
|
-
static readonly UnsupportedSchema = "Unsupported schema in %s %s: %s";
|
|
22
|
-
static readonly FuncDescriptionTooLong = "The description of the function '%s' is too long. The current length is %s characters, while the maximum allowed length is %s characters.";
|
|
23
|
-
static readonly GenerateJsonDataFailed = "Failed to generate JSON data for api: %s due to %s.";
|
|
24
|
-
static readonly WrappedCardVersion = "1.0";
|
|
25
|
-
static readonly WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
|
|
26
|
-
static readonly WrappedCardResponseLayout = "list";
|
|
27
|
-
static readonly GetMethod = "get";
|
|
28
|
-
static readonly PostMethod = "post";
|
|
29
|
-
static readonly AdaptiveCardVersion = "1.5";
|
|
30
|
-
static readonly AdaptiveCardSchema = "https://adaptivecards.io/schemas/adaptive-card.json";
|
|
31
|
-
static readonly AdaptiveCardType = "AdaptiveCard";
|
|
32
|
-
static readonly TextBlockType = "TextBlock";
|
|
33
|
-
static readonly ImageType = "Image";
|
|
34
|
-
static readonly ContainerType = "Container";
|
|
35
|
-
static readonly RegistrationIdPostfix = "REGISTRATION_ID";
|
|
36
|
-
static readonly ResponseCodeFor20X: string[];
|
|
37
|
-
static readonly AllOperationMethods: string[];
|
|
38
|
-
static readonly WellknownResultNames: string[];
|
|
39
|
-
static readonly WellknownTitleName: string[];
|
|
40
|
-
static readonly WellknownSubtitleName: string[];
|
|
41
|
-
static readonly WellknownImageName: string[];
|
|
42
|
-
static readonly ShortDescriptionMaxLens = 80;
|
|
43
|
-
static readonly FullDescriptionMaxLens = 4000;
|
|
44
|
-
static readonly CommandDescriptionMaxLens = 128;
|
|
45
|
-
static readonly ParameterDescriptionMaxLens = 128;
|
|
46
|
-
static readonly ConversationStarterMaxLens = 50;
|
|
47
|
-
static readonly CommandTitleMaxLens = 32;
|
|
48
|
-
static readonly ParameterTitleMaxLens = 32;
|
|
49
|
-
static readonly SMERequiredParamsMaxNum = 5;
|
|
50
|
-
static readonly FunctionDescriptionMaxLens = 100;
|
|
51
|
-
static readonly DefaultPluginId = "plugin_1";
|
|
52
|
-
static readonly PluginManifestSchema = "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.2/schema.json";
|
|
53
|
-
}
|
|
1
|
+
export declare class ConstantString {
|
|
2
|
+
static readonly CancelledMessage = "Operation is cancelled.";
|
|
3
|
+
static readonly NoServerInformation = "No server information is found in the OpenAPI description document.";
|
|
4
|
+
static readonly RemoteRefNotSupported = "Remote reference is not supported: %s.";
|
|
5
|
+
static readonly MissingOperationId = "Missing operationIds: %s.";
|
|
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
|
+
static readonly AdditionalPropertiesNotSupported = "'additionalProperties' is not supported, and will be ignored.";
|
|
8
|
+
static readonly SchemaNotSupported = "'oneOf', 'allOf', 'anyOf', and 'not' schema are not supported: %s.";
|
|
9
|
+
static readonly UnknownSchema = "Unknown schema: %s.";
|
|
10
|
+
static readonly UrlProtocolNotSupported = "Server url is not correct: protocol %s is not supported, you should use https protocol instead.";
|
|
11
|
+
static readonly RelativeServerUrlNotSupported = "Server url is not correct: relative server url is not supported.";
|
|
12
|
+
static readonly ResolveServerUrlFailed = "Unable to resolve the server URL: please make sure that the environment variable %s is defined.";
|
|
13
|
+
static readonly OperationOnlyContainsOptionalParam = "Operation %s contains multiple optional parameters. The first optional parameter is used for this command.";
|
|
14
|
+
static readonly ConvertSwaggerToOpenAPI = "The Swagger 2.0 file has been converted to OpenAPI 3.0.";
|
|
15
|
+
static readonly OpenAPI31ConvertTo30 = "OpenAPI 3.1 document has been converted to OpenAPI 3.0.";
|
|
16
|
+
static readonly SwaggerNotSupported = "Swagger 2.0 is not supported. Please convert to OpenAPI 3.0 manually before proceeding.";
|
|
17
|
+
static readonly SpecVersionNotSupported = "Unsupported OpenAPI version %s. Please use version 3.0.x.";
|
|
18
|
+
static readonly MultipleAuthNotSupported = "Multiple authentication methods are unsupported. Ensure all selected APIs use identical authentication.";
|
|
19
|
+
static readonly OperationIdContainsSpecialCharacters = "Operation id '%s' in OpenAPI description document contained special characters and was renamed to '%s'.";
|
|
20
|
+
static readonly AuthTypeIsNotSupported = "Unsupported authorization type in API '%s'. No authorization will be used.";
|
|
21
|
+
static readonly UnsupportedSchema = "Unsupported schema in %s %s: %s";
|
|
22
|
+
static readonly FuncDescriptionTooLong = "The description of the function '%s' is too long. The current length is %s characters, while the maximum allowed length is %s characters.";
|
|
23
|
+
static readonly GenerateJsonDataFailed = "Failed to generate JSON data for api: %s due to %s.";
|
|
24
|
+
static readonly WrappedCardVersion = "1.0";
|
|
25
|
+
static readonly WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
|
|
26
|
+
static readonly WrappedCardResponseLayout = "list";
|
|
27
|
+
static readonly GetMethod = "get";
|
|
28
|
+
static readonly PostMethod = "post";
|
|
29
|
+
static readonly AdaptiveCardVersion = "1.5";
|
|
30
|
+
static readonly AdaptiveCardSchema = "https://adaptivecards.io/schemas/adaptive-card.json";
|
|
31
|
+
static readonly AdaptiveCardType = "AdaptiveCard";
|
|
32
|
+
static readonly TextBlockType = "TextBlock";
|
|
33
|
+
static readonly ImageType = "Image";
|
|
34
|
+
static readonly ContainerType = "Container";
|
|
35
|
+
static readonly RegistrationIdPostfix = "REGISTRATION_ID";
|
|
36
|
+
static readonly ResponseCodeFor20X: string[];
|
|
37
|
+
static readonly AllOperationMethods: string[];
|
|
38
|
+
static readonly WellknownResultNames: string[];
|
|
39
|
+
static readonly WellknownTitleName: string[];
|
|
40
|
+
static readonly WellknownSubtitleName: string[];
|
|
41
|
+
static readonly WellknownImageName: string[];
|
|
42
|
+
static readonly ShortDescriptionMaxLens = 80;
|
|
43
|
+
static readonly FullDescriptionMaxLens = 4000;
|
|
44
|
+
static readonly CommandDescriptionMaxLens = 128;
|
|
45
|
+
static readonly ParameterDescriptionMaxLens = 128;
|
|
46
|
+
static readonly ConversationStarterMaxLens = 50;
|
|
47
|
+
static readonly CommandTitleMaxLens = 32;
|
|
48
|
+
static readonly ParameterTitleMaxLens = 32;
|
|
49
|
+
static readonly SMERequiredParamsMaxNum = 5;
|
|
50
|
+
static readonly FunctionDescriptionMaxLens = 100;
|
|
51
|
+
static readonly DefaultPluginId = "plugin_1";
|
|
52
|
+
static readonly PluginManifestSchema = "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.2/schema.json";
|
|
53
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { SpecParser } from "./specParser.browser";
|
|
2
|
-
export { SpecParserError } from "./specParserError";
|
|
3
|
-
export { ValidationStatus, WarningType, ErrorType, ListAPIResult } from "./interfaces";
|
|
4
|
-
export type { ErrorResult, APIInfo, ValidateResult, WarningResult, ParseOptions, AdaptiveCard, ProjectType, } from "./interfaces";
|
|
5
|
-
export { ConstantString } from "./constants";
|
|
6
|
-
export { Utils } from "./utils";
|
|
7
|
-
export { AdaptiveCardGenerator } from "./adaptiveCardGenerator";
|
|
1
|
+
export { SpecParser } from "./specParser.browser";
|
|
2
|
+
export { SpecParserError } from "./specParserError";
|
|
3
|
+
export { ValidationStatus, WarningType, ErrorType, ListAPIResult } from "./interfaces";
|
|
4
|
+
export type { ErrorResult, APIInfo, ValidateResult, WarningResult, ParseOptions, AdaptiveCard, ProjectType, } from "./interfaces";
|
|
5
|
+
export { ConstantString } from "./constants";
|
|
6
|
+
export { Utils } from "./utils";
|
|
7
|
+
export { AdaptiveCardGenerator } from "./adaptiveCardGenerator";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { SpecParser } from "./specParser";
|
|
2
|
-
export { SpecParserError } from "./specParserError";
|
|
3
|
-
export { ValidationStatus, WarningType, ErrorType, WarningResult, ErrorResult, ListAPIResult, APIInfo, ValidateResult, ParseOptions, AdaptiveCard, ProjectType, InvalidAPIInfo, AuthType, AdaptiveCardUpdateStrategy, ListAPIInfo, AuthInfo, GenerateResult, } from "./interfaces";
|
|
4
|
-
export { ConstantString } from "./constants";
|
|
5
|
-
export { Utils } from "./utils";
|
|
6
|
-
export { AdaptiveCardGenerator } from "./adaptiveCardGenerator";
|
|
1
|
+
export { SpecParser } from "./specParser";
|
|
2
|
+
export { SpecParserError } from "./specParserError";
|
|
3
|
+
export { ValidationStatus, WarningType, ErrorType, WarningResult, ErrorResult, ListAPIResult, APIInfo, ValidateResult, ParseOptions, AdaptiveCard, ProjectType, InvalidAPIInfo, AuthType, AdaptiveCardUpdateStrategy, ListAPIInfo, AuthInfo, GenerateResult, } from "./interfaces";
|
|
4
|
+
export { ConstantString } from "./constants";
|
|
5
|
+
export { Utils } from "./utils";
|
|
6
|
+
export { AdaptiveCardGenerator } from "./adaptiveCardGenerator";
|