@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.
- package/dist/index.esm2017.js +15 -6
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm2017.mjs +87 -56
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.esm5.js +15 -6
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +87 -56
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/src/constants.d.ts +1 -3
- package/dist/src/interfaces.d.ts +9 -0
- package/dist/src/manifestUpdater.d.ts +3 -3
- package/dist/src/utils.d.ts +2 -1
- package/package.json +3 -3
package/dist/index.esm2017.js
CHANGED
|
@@ -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) {
|