@microsoft/m365-spec-parser 0.2.6-alpha.ae8d7f58f.0 → 0.2.6-alpha.b67207c1a.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.
@@ -41,6 +41,7 @@ var ErrorType;
41
41
  ErrorType["UrlPathNotExist"] = "url-path-not-exist";
42
42
  ErrorType["Cancelled"] = "cancelled";
43
43
  ErrorType["Unknown"] = "unknown";
44
+ ErrorType["AddAuthFailed"] = "add-auth-failed";
44
45
  })(ErrorType || (ErrorType = {}));
45
46
  /**
46
47
  * An enum that represents the types of warnings that can occur during validation.
@@ -71,7 +72,12 @@ var ProjectType;
71
72
  ProjectType[ProjectType["Copilot"] = 0] = "Copilot";
72
73
  ProjectType[ProjectType["SME"] = 1] = "SME";
73
74
  ProjectType[ProjectType["TeamsAi"] = 2] = "TeamsAi";
74
- })(ProjectType || (ProjectType = {}));
75
+ })(ProjectType || (ProjectType = {}));
76
+ var AdaptiveCardUpdateStrategy;
77
+ (function (AdaptiveCardUpdateStrategy) {
78
+ AdaptiveCardUpdateStrategy[AdaptiveCardUpdateStrategy["CreateNew"] = 0] = "CreateNew";
79
+ AdaptiveCardUpdateStrategy[AdaptiveCardUpdateStrategy["KeepExisting"] = 1] = "KeepExisting";
80
+ })(AdaptiveCardUpdateStrategy || (AdaptiveCardUpdateStrategy = {}));
75
81
 
76
82
  // Copyright (c) Microsoft Corporation.
77
83
  class SpecParserError extends Error {
@@ -105,8 +111,8 @@ ConstantString.AuthTypeIsNotSupported = "Unsupported authorization type in API '
105
111
  ConstantString.UnsupportedSchema = "Unsupported schema in %s %s: %s";
106
112
  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.";
107
113
  ConstantString.GenerateJsonDataFailed = "Failed to generate JSON data for api: %s due to %s.";
108
- ConstantString.WrappedCardVersion = "devPreview";
109
- ConstantString.WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
114
+ ConstantString.WrappedCardVersion = "1.0";
115
+ ConstantString.WrappedCardSchema = "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.ResponseRenderingTemplate.schema.json";
110
116
  ConstantString.WrappedCardResponseLayout = "list";
111
117
  ConstantString.GetMethod = "get";
112
118
  ConstantString.PostMethod = "post";
@@ -572,6 +578,35 @@ class Utils {
572
578
  const serverUrl = operationServer || methodServer || rootServer;
573
579
  return serverUrl;
574
580
  }
581
+ static getAuthSchemaObject(authType, authParameters) {
582
+ switch (authType) {
583
+ case "oauth":
584
+ case "microsoft-entra":
585
+ return {
586
+ type: "oauth2",
587
+ flows: {
588
+ authorizationCode: {
589
+ authorizationUrl: authParameters.authorizationUrl,
590
+ tokenUrl: authParameters.tokenUrl,
591
+ refreshUrl: authParameters.refreshUrl,
592
+ scopes: authParameters.scopes,
593
+ },
594
+ },
595
+ };
596
+ case "api-key":
597
+ return {
598
+ type: "apiKey",
599
+ in: authParameters.in,
600
+ name: authParameters.name,
601
+ };
602
+ case "bearer-token":
603
+ default:
604
+ return {
605
+ type: "http",
606
+ scheme: "bearer",
607
+ };
608
+ }
609
+ }
575
610
  }
576
611
 
577
612
  // Copyright (c) Microsoft Corporation.