@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.
@@ -116,12 +116,7 @@ ConstantString.AdaptiveCardType = "AdaptiveCard";
116
116
  ConstantString.TextBlockType = "TextBlock";
117
117
  ConstantString.ImageType = "Image";
118
118
  ConstantString.ContainerType = "Container";
119
- ConstantString.RegistrationIdPostfix = {
120
- apiKey: "REGISTRATION_ID",
121
- oauth2: "CONFIGURATION_ID",
122
- http: "REGISTRATION_ID",
123
- openIdConnect: "REGISTRATION_ID",
124
- };
119
+ ConstantString.RegistrationIdPostfix = "REGISTRATION_ID";
125
120
  ConstantString.ResponseCodeFor20X = [
126
121
  "200",
127
122
  "201",
@@ -248,6 +243,20 @@ class Utils {
248
243
  result.sort((a, b) => a[0].name.localeCompare(b[0].name));
249
244
  return result;
250
245
  }
246
+ static getAuthMap(spec) {
247
+ const authMap = {};
248
+ for (const url in spec.paths) {
249
+ for (const method in spec.paths[url]) {
250
+ const operation = spec.paths[url][method];
251
+ const authArray = Utils.getAuthArray(operation.security, spec);
252
+ if (authArray && authArray.length > 0) {
253
+ const currentAuth = authArray[0][0];
254
+ authMap[operation.operationId] = currentAuth;
255
+ }
256
+ }
257
+ }
258
+ return authMap;
259
+ }
251
260
  static getAuthInfo(spec) {
252
261
  let authInfo = undefined;
253
262
  for (const url in spec.paths) {