@forge/manifest
13.7.0-next.213.7.0-next.3
out/validators/twg-preview-scopes-validator.js−
out/validators/twg-preview-scopes-validator.jsDeleted−32
Index: package/out/validators/twg-preview-scopes-validator.js
===================================================================
--- package/out/validators/twg-preview-scopes-validator.js
+++ package/out/validators/twg-preview-scopes-validator.js
@@ -1,32 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.TwgPreviewScopesValidator = void 0;
-const text_1 = require("../text");
-const utils_1 = require("../utils");
-const scopes_1 = require("../utils/scopes");
-const TWG_PREVIEW_SCOPES = ['read:graph:jira', 'read:graph:confluence'];
-class TwgPreviewScopesValidator {
- async validate(manifest) {
- if (!manifest?.typedContent?.permissions?.scopes) {
- return { success: true, manifestObject: manifest };
- }
- const manifestScopes = (0, scopes_1.getAllScopeKeys)(manifest.typedContent.permissions.scopes);
- const foundTwgScopes = manifestScopes.filter((scope) => TWG_PREVIEW_SCOPES.includes(scope));
- if (foundTwgScopes.length > 0) {
- return {
- success: true,
- manifestObject: manifest,
- errors: [
- {
- message: text_1.errors.twgPreviewScopes(foundTwgScopes),
- reference: text_1.References.Deprecated,
- level: 'warning',
- ...(0, utils_1.findPosition)('scopes', manifest?.yamlContentByLine)
- }
- ]
- };
- }
- return { success: true, manifestObject: manifest };
- }
-}
-exports.TwgPreviewScopesValidator = TwgPreviewScopesValidator;