@microsoft/m365-spec-parser 0.2.4-alpha.ad0d7aa1a.0 → 0.2.4-alpha.db2563b3b.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.
@@ -146,12 +146,7 @@ ConstantString.AdaptiveCardType = "AdaptiveCard";
146
146
  ConstantString.TextBlockType = "TextBlock";
147
147
  ConstantString.ImageType = "Image";
148
148
  ConstantString.ContainerType = "Container";
149
- ConstantString.RegistrationIdPostfix = {
150
- apiKey: "REGISTRATION_ID",
151
- oauth2: "CONFIGURATION_ID",
152
- http: "REGISTRATION_ID",
153
- openIdConnect: "REGISTRATION_ID",
154
- };
149
+ ConstantString.RegistrationIdPostfix = "REGISTRATION_ID";
155
150
  ConstantString.ResponseCodeFor20X = [
156
151
  "200",
157
152
  "201",
@@ -278,6 +273,20 @@ class Utils {
278
273
  result.sort((a, b) => a[0].name.localeCompare(b[0].name));
279
274
  return result;
280
275
  }
276
+ static getAuthMap(spec) {
277
+ const authMap = {};
278
+ for (const url in spec.paths) {
279
+ for (const method in spec.paths[url]) {
280
+ const operation = spec.paths[url][method];
281
+ const authArray = Utils.getAuthArray(operation.security, spec);
282
+ if (authArray && authArray.length > 0) {
283
+ const currentAuth = authArray[0][0];
284
+ authMap[operation.operationId] = currentAuth;
285
+ }
286
+ }
287
+ }
288
+ return authMap;
289
+ }
281
290
  static getAuthInfo(spec) {
282
291
  let authInfo = undefined;
283
292
  for (const url in spec.paths) {