@microsoft/m365-spec-parser 0.2.6-alpha.d99d3c39d.0 → 0.2.6-alpha.dea29f186.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.
@@ -71,6 +71,7 @@ var ErrorType;
71
71
  ErrorType["UrlPathNotExist"] = "url-path-not-exist";
72
72
  ErrorType["Cancelled"] = "cancelled";
73
73
  ErrorType["Unknown"] = "unknown";
74
+ ErrorType["AddAuthFailed"] = "add-auth-failed";
74
75
  })(ErrorType || (ErrorType = {}));
75
76
  /**
76
77
  * An enum that represents the types of warnings that can occur during validation.
@@ -101,7 +102,12 @@ var ProjectType;
101
102
  ProjectType[ProjectType["Copilot"] = 0] = "Copilot";
102
103
  ProjectType[ProjectType["SME"] = 1] = "SME";
103
104
  ProjectType[ProjectType["TeamsAi"] = 2] = "TeamsAi";
104
- })(ProjectType || (ProjectType = {}));
105
+ })(ProjectType || (ProjectType = {}));
106
+ var AdaptiveCardUpdateStrategy;
107
+ (function (AdaptiveCardUpdateStrategy) {
108
+ AdaptiveCardUpdateStrategy[AdaptiveCardUpdateStrategy["CreateNew"] = 0] = "CreateNew";
109
+ AdaptiveCardUpdateStrategy[AdaptiveCardUpdateStrategy["KeepExisting"] = 1] = "KeepExisting";
110
+ })(AdaptiveCardUpdateStrategy || (AdaptiveCardUpdateStrategy = {}));
105
111
 
106
112
  // Copyright (c) Microsoft Corporation.
107
113
  class SpecParserError extends Error {
@@ -135,8 +141,8 @@ ConstantString.AuthTypeIsNotSupported = "Unsupported authorization type in API '
135
141
  ConstantString.UnsupportedSchema = "Unsupported schema in %s %s: %s";
136
142
  ConstantString.FuncDescriptionTooLong = "The description of the function '%s' is too long. The current length is %s characters, while the maximum allowed length is %s characters.";
137
143
  ConstantString.GenerateJsonDataFailed = "Failed to generate JSON data for api: %s due to %s.";
138
- ConstantString.WrappedCardVersion = "devPreview";
139
- ConstantString.WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
144
+ ConstantString.WrappedCardVersion = "1.0";
145
+ ConstantString.WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
140
146
  ConstantString.WrappedCardResponseLayout = "list";
141
147
  ConstantString.GetMethod = "get";
142
148
  ConstantString.PostMethod = "post";
@@ -602,6 +608,35 @@ class Utils {
602
608
  const serverUrl = operationServer || methodServer || rootServer;
603
609
  return serverUrl;
604
610
  }
611
+ static getAuthSchemaObject(authType, authParameters) {
612
+ switch (authType) {
613
+ case "oauth":
614
+ case "microsoft-entra":
615
+ return {
616
+ type: "oauth2",
617
+ flows: {
618
+ authorizationCode: {
619
+ authorizationUrl: authParameters.authorizationUrl,
620
+ tokenUrl: authParameters.tokenUrl,
621
+ refreshUrl: authParameters.refreshUrl,
622
+ scopes: authParameters.scopes,
623
+ },
624
+ },
625
+ };
626
+ case "api-key":
627
+ return {
628
+ type: "apiKey",
629
+ in: authParameters.in,
630
+ name: authParameters.name,
631
+ };
632
+ case "bearer-token":
633
+ default:
634
+ return {
635
+ type: "http",
636
+ scheme: "bearer",
637
+ };
638
+ }
639
+ }
605
640
  }
606
641
 
607
642
  // Copyright (c) Microsoft Corporation.