@forge/lint 3.2.22-next.4 → 3.3.0-next.10

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +48 -2
  2. package/out/lint/lint.d.ts.map +1 -1
  3. package/out/lint/lint.js +5 -1
  4. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-generic-warning-linter.d.ts +18 -0
  5. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-generic-warning-linter.d.ts.map +1 -0
  6. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-generic-warning-linter.js +35 -0
  7. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-interface.d.ts +6 -0
  8. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-interface.d.ts.map +1 -0
  9. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-interface.js +2 -0
  10. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-permissions-linter.d.ts +18 -0
  11. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-permissions-linter.d.ts.map +1 -0
  12. package/out/lint/linters/dynamic-properties-linter/dynamic-properties-permissions-linter.js +36 -0
  13. package/out/lint/linters/dynamic-properties-linter/verifiers/abstract-dynamic-properties-verifier.d.ts +7 -0
  14. package/out/lint/linters/dynamic-properties-linter/verifiers/abstract-dynamic-properties-verifier.d.ts.map +1 -0
  15. package/out/lint/linters/dynamic-properties-linter/verifiers/abstract-dynamic-properties-verifier.js +23 -0
  16. package/out/lint/linters/dynamic-properties-linter/verifiers/dynamic-properties-icon-verifier.d.ts +13 -0
  17. package/out/lint/linters/dynamic-properties-linter/verifiers/dynamic-properties-icon-verifier.d.ts.map +1 -0
  18. package/out/lint/linters/dynamic-properties-linter/verifiers/dynamic-properties-icon-verifier.js +48 -0
  19. package/out/lint/linters/dynamic-properties-linter/verifiers/generic-warning-verifier.d.ts +11 -0
  20. package/out/lint/linters/dynamic-properties-linter/verifiers/generic-warning-verifier.d.ts.map +1 -0
  21. package/out/lint/linters/dynamic-properties-linter/verifiers/generic-warning-verifier.js +29 -0
  22. package/out/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.d.ts +10 -0
  23. package/out/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.d.ts.map +1 -0
  24. package/out/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.js +40 -0
  25. package/out/lint/linters/dynamic-properties-linter/visitors/confluence-icon-visitor.d.ts +6 -0
  26. package/out/lint/linters/dynamic-properties-linter/visitors/confluence-icon-visitor.d.ts.map +1 -0
  27. package/out/lint/linters/dynamic-properties-linter/visitors/confluence-icon-visitor.js +19 -0
  28. package/out/lint/linters/dynamic-properties-linter/visitors/jira-icon-visitor.d.ts +7 -0
  29. package/out/lint/linters/dynamic-properties-linter/visitors/jira-icon-visitor.d.ts.map +1 -0
  30. package/out/lint/linters/dynamic-properties-linter/visitors/jira-icon-visitor.js +43 -0
  31. package/out/lint/linters/permission-linter/permission-linter.d.ts +1 -1
  32. package/out/lint/linters/permission-linter/permission-linter.d.ts.map +1 -1
  33. package/out/lint/linters/permission-linter/permission-linter.js +16 -21
  34. package/out/lint/text/messages.d.ts +5 -0
  35. package/out/lint/text/messages.d.ts.map +1 -1
  36. package/out/lint/text/messages.js +5 -0
  37. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,10 +1,56 @@
1
1
  # @forge/lint
2
2
 
3
- ## 3.2.22-next.4
3
+ ## 3.3.0-next.10
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [9c3f9e4]
7
+ - Updated dependencies [3bdedf0]
8
+ - @forge/egress@1.2.0-next.1
9
+
10
+ ## 3.3.0-next.9
11
+
12
+ ### Minor Changes
13
+
14
+ - 5795a3e: Update linter to detect missing egress permissions for Jira Issue Context dynamic properties modules. And fix bug related to Confluence ContentByLineItem modules
15
+
16
+ ## 3.3.0-next.8
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [b91c323]
21
+ - @forge/cli-shared@3.11.0-next.6
22
+
23
+ ## 3.3.0-next.7
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [87b2440]
28
+ - @forge/cli-shared@3.11.0-next.5
29
+
30
+ ## 3.3.0-next.6
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [0da2b48]
35
+ - @forge/egress@1.1.3-next.0
36
+
37
+ ## 3.3.0-next.5
38
+
39
+ ### Patch Changes
40
+
41
+ - 2da63a57: Bumping dependencies via Renovate:
42
+
43
+ - atlassian-openapi
44
+
45
+ ## 3.3.0-next.4
46
+
47
+ ### Minor Changes
48
+
49
+ - d50d90b8: Add ability to detect missing image permissions when using Confluence contentByLineItem modules with dynamic properties
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies [9c3f9e47]
8
54
  - @forge/manifest@4.10.0-next.2
9
55
  - @forge/cli-shared@3.11.0-next.4
10
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAQxG,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,WAAY,UAAU,eAAe,UAAU,EAAE,4BAAuB,IA+CrG,CAAC;AAEF,eAAO,MAAM,YAAY,gBAAiB,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QAAQ,SAAS,CAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBACF,MAAM,EAAE,YACX,QAAQ,eACL,MAAM,UACX,UAAU,6BAhBR,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAAC,YAeV,eAAe,EAAE,KASzB,QAAQ,UAAU,EAAE,CAmCtB,CAAC;AAEF,eAAO,MAAM,QAAQ,WACX,UAAU,WACV,eAAe,KACtB,QAAQ,UAAU,EAAE,CAGtB,CAAC"}
package/out/lint/lint.js CHANGED
@@ -13,6 +13,8 @@ const full_manifest_linter_1 = require("./linters/manifest-linter/full-manifest-
13
13
  const permissions_manifest_linter_1 = require("./linters/manifest-linter/permissions-manifest-linter");
14
14
  const permission_linter_1 = require("./linters/permission-linter/permission-linter");
15
15
  const deprecated_csp_permissions_manifest_linter_1 = require("./linters/manifest-linter/deprecated-csp-permissions-manifest-linter");
16
+ const dynamic_properties_permissions_linter_1 = require("./linters/dynamic-properties-linter/dynamic-properties-permissions-linter");
17
+ const dynamic_properties_generic_warning_linter_1 = require("./linters/dynamic-properties-linter/dynamic-properties-generic-warning-linter");
16
18
  class FailedLinterError extends Error {
17
19
  }
18
20
  exports.FailedLinterError = FailedLinterError;
@@ -82,7 +84,9 @@ const lint = async (filesToLint, manifest, environment, logger, parseFunction =
82
84
  new permissions_manifest_linter_1.PermissionsManifestLinter(logger),
83
85
  new deprecated_csp_permissions_manifest_linter_1.DeprecatedCspPermissionsManifestLinter(logger),
84
86
  new full_manifest_linter_1.FullManifestLinter(logger),
85
- new handler_linter_1.HandlerLinter(environment, manifest, logger)
87
+ new handler_linter_1.HandlerLinter(environment, manifest, logger),
88
+ new dynamic_properties_permissions_linter_1.DynamicPropertiesPermissionsLinter(environment, manifest, logger),
89
+ new dynamic_properties_generic_warning_linter_1.DynamicPropertiesGenericWarningLinter(environment, manifest, logger)
86
90
  ]) => {
87
91
  const { include, exclude } = await (0, cli_shared_1.listTSConfigIncludeExclude)(new cli_shared_1.FileSystemReader());
88
92
  const tsInclude = new Set(include);
@@ -0,0 +1,18 @@
1
+ import { ManifestSchema as Manifest } from '@forge/manifest';
2
+ import BaseLinter from '../../base-linter';
3
+ import { DynamicPropertiesIconUrl } from './dynamic-properties-interface';
4
+ import { LintFixState, LintLogger, LintResultRule } from '../../linter-interface';
5
+ interface DynamicPropertiesLintCriteriaMatches {
6
+ [key: string]: DynamicPropertiesIconUrl[];
7
+ dynamicPropertiesIcon: DynamicPropertiesIconUrl[];
8
+ }
9
+ export declare class DynamicPropertiesGenericWarningLinter extends BaseLinter<DynamicPropertiesIconUrl, DynamicPropertiesLintCriteriaMatches, DynamicPropertiesIconUrl[]> {
10
+ private manifest;
11
+ constructor(environment: string, manifest: Manifest, logger: LintLogger);
12
+ bootstrap(): Promise<void>;
13
+ protected getFixer(): ((errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState) => Promise<LintFixState>) | undefined;
14
+ protected setupMatchesMap(filepath: string): void;
15
+ protected addLintCriteriaMatch(dynamicPropertiesIconUrl: DynamicPropertiesIconUrl, filepath: string): void;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=dynamic-properties-generic-warning-linter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-properties-generic-warning-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/dynamic-properties-linter/dynamic-properties-generic-warning-linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKlF,UAAU,oCAAoC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,EAAE,CAAC;IAC1C,qBAAqB,EAAE,wBAAwB,EAAE,CAAC;CACnD;AAED,qBAAa,qCAAsC,SAAQ,UAAU,CACnE,wBAAwB,EACxB,oCAAoC,EACpC,wBAAwB,EAAE,CAC3B;IACkC,OAAO,CAAC,QAAQ;gBAArC,WAAW,EAAE,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU;IAIlE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IASvC,SAAS,CAAC,QAAQ,IACd,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,GACtG,SAAS;IAIb,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMjD,SAAS,CAAC,oBAAoB,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAK3G"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynamicPropertiesGenericWarningLinter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const cli_shared_1 = require("@forge/cli-shared");
6
+ const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
7
+ const generic_warning_verifier_1 = require("./verifiers/generic-warning-verifier");
8
+ const confluence_icon_visitor_1 = require("./visitors/confluence-icon-visitor");
9
+ const jira_icon_visitor_1 = require("./visitors/jira-icon-visitor");
10
+ class DynamicPropertiesGenericWarningLinter extends base_linter_1.default {
11
+ constructor(environment, manifest, logger) {
12
+ super(environment, logger);
13
+ this.manifest = manifest;
14
+ }
15
+ async bootstrap() {
16
+ this.nodeVisitors = [new confluence_icon_visitor_1.ConfluenceIconVisitor(), new jira_icon_visitor_1.JiraIconVisitor()];
17
+ const humanReadableEnvironment = (0, cli_shared_1.environmentToOption)(this.environment);
18
+ this.verifiers = {
19
+ dynamicPropertiesIcon: new generic_warning_verifier_1.GenericWarningVerifier(humanReadableEnvironment, this.manifest)
20
+ };
21
+ }
22
+ getFixer() {
23
+ return undefined;
24
+ }
25
+ setupMatchesMap(filepath) {
26
+ this.matches.set(filepath, {
27
+ dynamicPropertiesIcon: []
28
+ });
29
+ }
30
+ addLintCriteriaMatch(dynamicPropertiesIconUrl, filepath) {
31
+ const criteriaMatches = this.matches.get(filepath);
32
+ criteriaMatches.dynamicPropertiesIcon.push(dynamicPropertiesIconUrl);
33
+ }
34
+ }
35
+ exports.DynamicPropertiesGenericWarningLinter = DynamicPropertiesGenericWarningLinter;
@@ -0,0 +1,6 @@
1
+ import { LintCriteriaMatch } from '../../linter-interface';
2
+ export interface DynamicPropertiesIconUrl extends LintCriteriaMatch {
3
+ type: 'DYNAMIC_PROPERTIES_ICON';
4
+ url: string;
5
+ }
6
+ //# sourceMappingURL=dynamic-properties-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-properties-interface.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/dynamic-properties-linter/dynamic-properties-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,IAAI,EAAE,yBAAyB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { ManifestSchema as Manifest } from '@forge/manifest';
2
+ import BaseLinter from '../../base-linter';
3
+ import { DynamicPropertiesIconUrl } from './dynamic-properties-interface';
4
+ import { LintFixState, LintLogger, LintResultRule } from '../../linter-interface';
5
+ interface DynamicPropertiesLintCriteriaMatches {
6
+ [key: string]: DynamicPropertiesIconUrl[];
7
+ dynamicPropertiesIcon: DynamicPropertiesIconUrl[];
8
+ }
9
+ export declare class DynamicPropertiesPermissionsLinter extends BaseLinter<DynamicPropertiesIconUrl, DynamicPropertiesLintCriteriaMatches, DynamicPropertiesIconUrl[]> {
10
+ private manifest;
11
+ constructor(environment: string, manifest: Manifest, logger: LintLogger);
12
+ bootstrap(): Promise<void>;
13
+ protected getFixer(): ((errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState) => Promise<LintFixState>) | undefined;
14
+ protected setupMatchesMap(filepath: string): void;
15
+ protected addLintCriteriaMatch(dynamicPropertiesIconUrl: DynamicPropertiesIconUrl, filepath: string): void;
16
+ }
17
+ export {};
18
+ //# sourceMappingURL=dynamic-properties-permissions-linter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-properties-permissions-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/dynamic-properties-linter/dynamic-properties-permissions-linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIlF,UAAU,oCAAoC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,EAAE,CAAC;IAC1C,qBAAqB,EAAE,wBAAwB,EAAE,CAAC;CACnD;AAED,qBAAa,kCAAmC,SAAQ,UAAU,CAChE,wBAAwB,EACxB,oCAAoC,EACpC,wBAAwB,EAAE,CAC3B;IACkC,OAAO,CAAC,QAAQ;gBAArC,WAAW,EAAE,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU;IAIlE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IASvC,SAAS,CAAC,QAAQ,IACd,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,GACtG,SAAS;IAIb,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMjD,SAAS,CAAC,oBAAoB,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAK3G"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynamicPropertiesPermissionsLinter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const cli_shared_1 = require("@forge/cli-shared");
6
+ const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
7
+ const dynamic_properties_icon_verifier_1 = require("./verifiers/dynamic-properties-icon-verifier");
8
+ const confluence_icon_visitor_1 = require("./visitors/confluence-icon-visitor");
9
+ const permission_linter_1 = require("../permission-linter/permission-linter");
10
+ const jira_icon_visitor_1 = require("./visitors/jira-icon-visitor");
11
+ class DynamicPropertiesPermissionsLinter extends base_linter_1.default {
12
+ constructor(environment, manifest, logger) {
13
+ super(environment, logger);
14
+ this.manifest = manifest;
15
+ }
16
+ async bootstrap() {
17
+ this.nodeVisitors = [new confluence_icon_visitor_1.ConfluenceIconVisitor(), new jira_icon_visitor_1.JiraIconVisitor()];
18
+ const humanReadableEnvironment = (0, cli_shared_1.environmentToOption)(this.environment);
19
+ this.verifiers = {
20
+ dynamicPropertiesIcon: new dynamic_properties_icon_verifier_1.DynamicPropertiesIconVerifier(humanReadableEnvironment, this.manifest)
21
+ };
22
+ }
23
+ getFixer() {
24
+ return permission_linter_1.fixMissingPermissions;
25
+ }
26
+ setupMatchesMap(filepath) {
27
+ this.matches.set(filepath, {
28
+ dynamicPropertiesIcon: []
29
+ });
30
+ }
31
+ addLintCriteriaMatch(dynamicPropertiesIconUrl, filepath) {
32
+ const criteriaMatches = this.matches.get(filepath);
33
+ criteriaMatches.dynamicPropertiesIcon.push(dynamicPropertiesIconUrl);
34
+ }
35
+ }
36
+ exports.DynamicPropertiesPermissionsLinter = DynamicPropertiesPermissionsLinter;
@@ -0,0 +1,7 @@
1
+ import { ManifestSchema as Manifest } from '@forge/manifest';
2
+ import { BaseLintIssueVerifier } from '../../verifier-interface';
3
+ export declare class AbstractDynamicPropertiesVerifier extends BaseLintIssueVerifier {
4
+ protected shouldRunCheck: boolean;
5
+ constructor(environment: string, manifest: Manifest);
6
+ }
7
+ //# sourceMappingURL=abstract-dynamic-properties-verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstract-dynamic-properties-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/verifiers/abstract-dynamic-properties-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,qBAAa,iCAAkC,SAAQ,qBAAqB;IAC1E,SAAS,CAAC,cAAc,UAAS;gBAErB,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;CAgBpD"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractDynamicPropertiesVerifier = void 0;
4
+ const verifier_interface_1 = require("../../verifier-interface");
5
+ class AbstractDynamicPropertiesVerifier extends verifier_interface_1.BaseLintIssueVerifier {
6
+ constructor(environment, manifest) {
7
+ super(environment, manifest);
8
+ this.shouldRunCheck = false;
9
+ Object.keys(this.manifest.modules || {}).forEach((moduleType) => {
10
+ var _a, _b;
11
+ switch (moduleType) {
12
+ case 'confluence:contentBylineItem':
13
+ case 'jira:issueGlance':
14
+ case 'jira:issueContext':
15
+ this.shouldRunCheck =
16
+ ((_b = (_a = this.manifest.modules) === null || _a === void 0 ? void 0 : _a[moduleType]) === null || _b === void 0 ? void 0 : _b.find((module) => { var _a; return (_a = module.dynamicProperties) === null || _a === void 0 ? void 0 : _a.function; })) !==
17
+ undefined;
18
+ break;
19
+ }
20
+ });
21
+ }
22
+ }
23
+ exports.AbstractDynamicPropertiesVerifier = AbstractDynamicPropertiesVerifier;
@@ -0,0 +1,13 @@
1
+ import type { ManifestSchema as Manifest } from '@forge/manifest';
2
+ import { LintClass, LintResultRule } from '../../../linter-interface';
3
+ import { LintIssueVerifier } from '../../verifier-interface';
4
+ import { DynamicPropertiesIconUrl } from '../dynamic-properties-interface';
5
+ import { AbstractDynamicPropertiesVerifier } from './abstract-dynamic-properties-verifier';
6
+ export declare class DynamicPropertiesIconVerifier extends AbstractDynamicPropertiesVerifier implements LintIssueVerifier<DynamicPropertiesIconUrl[]> {
7
+ private egressFilteringService;
8
+ constructor(environment: string, manifest: Manifest);
9
+ protected getLintClass(): LintClass;
10
+ private extractDomain;
11
+ process(iconUrls: DynamicPropertiesIconUrl[]): Promise<LintResultRule[]>;
12
+ }
13
+ //# sourceMappingURL=dynamic-properties-icon-verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-properties-icon-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/verifiers/dynamic-properties-icon-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAE3F,qBAAa,6BACX,SAAQ,iCACR,YAAW,iBAAiB,CAAC,wBAAwB,EAAE,CAAC;IACxD,OAAO,CAAC,sBAAsB,CAAyB;gBAE3C,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IASnD,SAAS,CAAC,YAAY,IAAI,SAAS;IAInC,OAAO,CAAC,aAAa,CAMnB;IAEW,OAAO,CAAC,QAAQ,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAmBtF"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DynamicPropertiesIconVerifier = void 0;
4
+ const egress_1 = require("@forge/egress");
5
+ const linter_interface_1 = require("../../../linter-interface");
6
+ const text_1 = require("../../../text");
7
+ const url_1 = require("url");
8
+ const abstract_dynamic_properties_verifier_1 = require("./abstract-dynamic-properties-verifier");
9
+ class DynamicPropertiesIconVerifier extends abstract_dynamic_properties_verifier_1.AbstractDynamicPropertiesVerifier {
10
+ constructor(environment, manifest) {
11
+ var _a, _b, _c, _d;
12
+ super(environment, manifest);
13
+ this.extractDomain = (iconUrl) => {
14
+ try {
15
+ return new url_1.URL(iconUrl.url).hostname;
16
+ }
17
+ catch (e) {
18
+ return iconUrl.url;
19
+ }
20
+ };
21
+ const allowList = (_d = (_c = (_b = (_a = this.manifest) === null || _a === void 0 ? void 0 : _a.permissions) === null || _b === void 0 ? void 0 : _b.external) === null || _c === void 0 ? void 0 : _c.images) !== null && _d !== void 0 ? _d : [];
22
+ const collectedUrls = allowList.filter((item) => typeof item === 'string');
23
+ this.egressFilteringService = new egress_1.EgressFilteringService(collectedUrls);
24
+ }
25
+ getLintClass() {
26
+ return linter_interface_1.LintClass.Error;
27
+ }
28
+ async process(iconUrls) {
29
+ if (!this.shouldRunCheck) {
30
+ return [];
31
+ }
32
+ return [
33
+ ...iconUrls
34
+ .filter(({ url }) => !this.egressFilteringService.isValidUrl(url))
35
+ .map((iconUrl) => ({
36
+ class: this.getLintClass(),
37
+ message: text_1.messages.verifiers.dynamicPropertiesIcon.message(iconUrl.url),
38
+ reference: text_1.messages.verifiers.dynamicPropertiesIcon.reference,
39
+ column: iconUrl.column,
40
+ line: iconUrl.line,
41
+ metadata: {
42
+ missingExternalImagesPermission: this.extractDomain(iconUrl)
43
+ }
44
+ }))
45
+ ];
46
+ }
47
+ }
48
+ exports.DynamicPropertiesIconVerifier = DynamicPropertiesIconVerifier;
@@ -0,0 +1,11 @@
1
+ import type { ManifestSchema as Manifest } from '@forge/manifest';
2
+ import { LintClass, LintResultRule } from '../../../linter-interface';
3
+ import { LintIssueVerifier } from '../../verifier-interface';
4
+ import { DynamicPropertiesIconUrl } from '../dynamic-properties-interface';
5
+ import { AbstractDynamicPropertiesVerifier } from './abstract-dynamic-properties-verifier';
6
+ export declare class GenericWarningVerifier extends AbstractDynamicPropertiesVerifier implements LintIssueVerifier<DynamicPropertiesIconUrl[]> {
7
+ constructor(environment: string, manifest: Manifest);
8
+ protected getLintClass(): LintClass;
9
+ process(iconUrls: DynamicPropertiesIconUrl[]): Promise<LintResultRule[]>;
10
+ }
11
+ //# sourceMappingURL=generic-warning-verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-warning-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/verifiers/generic-warning-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAE3F,qBAAa,sBACX,SAAQ,iCACR,YAAW,iBAAiB,CAAC,wBAAwB,EAAE,CAAC;gBAC5C,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAInD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CActF"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenericWarningVerifier = void 0;
4
+ const linter_interface_1 = require("../../../linter-interface");
5
+ const text_1 = require("../../../text");
6
+ const abstract_dynamic_properties_verifier_1 = require("./abstract-dynamic-properties-verifier");
7
+ class GenericWarningVerifier extends abstract_dynamic_properties_verifier_1.AbstractDynamicPropertiesVerifier {
8
+ constructor(environment, manifest) {
9
+ super(environment, manifest);
10
+ }
11
+ getLintClass() {
12
+ return linter_interface_1.LintClass.Warning;
13
+ }
14
+ async process(iconUrls) {
15
+ if (!this.shouldRunCheck) {
16
+ return [];
17
+ }
18
+ return [
19
+ {
20
+ class: this.getLintClass(),
21
+ message: text_1.messages.verifiers.dynamicPropertiesIcon.warning(),
22
+ reference: text_1.messages.verifiers.dynamicPropertiesIcon.reference,
23
+ column: 0,
24
+ line: 0
25
+ }
26
+ ];
27
+ }
28
+ }
29
+ exports.GenericWarningVerifier = GenericWarningVerifier;
@@ -0,0 +1,10 @@
1
+ import { NodeVisitor } from '../../node-visitor-interface';
2
+ import { DynamicPropertiesIconUrl } from '../dynamic-properties-interface';
3
+ import { TSESTree } from '@typescript-eslint/typescript-estree';
4
+ export declare abstract class AbstractIconVisitor implements NodeVisitor<DynamicPropertiesIconUrl> {
5
+ visit(node: TSESTree.Node, parent: TSESTree.Node | undefined, callback: (input: DynamicPropertiesIconUrl) => void): void;
6
+ protected abstract getIconDefinitionNode(node: any): any;
7
+ private handleIconNode;
8
+ private transformArgsToIconUrl;
9
+ }
10
+ //# sourceMappingURL=abstract-icon-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstract-icon-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/visitors/abstract-icon-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhF,8BAAsB,mBAAoB,YAAW,WAAW,CAAC,wBAAwB,CAAC;IACxF,KAAK,CACH,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EACjC,QAAQ,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,GAClD,IAAI;IAkBP,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAExD,OAAO,CAAC,cAAc,CAOpB;IAEF,OAAO,CAAC,sBAAsB,CAK3B;CACJ"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbstractIconVisitor = void 0;
4
+ const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
5
+ class AbstractIconVisitor {
6
+ constructor() {
7
+ this.handleIconNode = (iconNode, callback) => {
8
+ if ((iconNode === null || iconNode === void 0 ? void 0 : iconNode.type) === typescript_estree_1.AST_NODE_TYPES.Literal && typeof (iconNode === null || iconNode === void 0 ? void 0 : iconNode.value) === 'string') {
9
+ if (iconNode.value.trim() !== '') {
10
+ const iconUrl = this.transformArgsToIconUrl(iconNode);
11
+ callback(iconUrl);
12
+ }
13
+ }
14
+ };
15
+ this.transformArgsToIconUrl = (iconNode) => ({
16
+ type: 'DYNAMIC_PROPERTIES_ICON',
17
+ url: iconNode.value,
18
+ line: iconNode.loc.start.line,
19
+ column: iconNode.loc.start.column
20
+ });
21
+ }
22
+ visit(node, parent, callback) {
23
+ var _a, _b;
24
+ switch (node.type) {
25
+ case typescript_estree_1.AST_NODE_TYPES.ArrowFunctionExpression:
26
+ if (((_a = node.body) === null || _a === void 0 ? void 0 : _a.type) === typescript_estree_1.AST_NODE_TYPES.ObjectExpression) {
27
+ const iconDefinitionNode = this.getIconDefinitionNode(node.body);
28
+ this.handleIconNode(iconDefinitionNode === null || iconDefinitionNode === void 0 ? void 0 : iconDefinitionNode.value, callback);
29
+ }
30
+ break;
31
+ case typescript_estree_1.AST_NODE_TYPES.ReturnStatement:
32
+ if (((_b = node.argument) === null || _b === void 0 ? void 0 : _b.type) === typescript_estree_1.AST_NODE_TYPES.ObjectExpression) {
33
+ const iconDefinitionNode = this.getIconDefinitionNode(node.argument);
34
+ this.handleIconNode(iconDefinitionNode === null || iconDefinitionNode === void 0 ? void 0 : iconDefinitionNode.value, callback);
35
+ }
36
+ break;
37
+ }
38
+ }
39
+ }
40
+ exports.AbstractIconVisitor = AbstractIconVisitor;
@@ -0,0 +1,6 @@
1
+ import { AbstractIconVisitor } from './abstract-icon-visitor';
2
+ export declare class ConfluenceIconVisitor extends AbstractIconVisitor {
3
+ protected getIconDefinitionNode(node: any): any;
4
+ private isIconPropertyDefinition;
5
+ }
6
+ //# sourceMappingURL=confluence-icon-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confluence-icon-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/visitors/confluence-icon-visitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBAAa,qBAAsB,SAAQ,mBAAmB;IAY5D,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAI/C,OAAO,CAAC,wBAAwB,CAM9B;CACH"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfluenceIconVisitor = void 0;
4
+ const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
5
+ const abstract_icon_visitor_1 = require("./abstract-icon-visitor");
6
+ class ConfluenceIconVisitor extends abstract_icon_visitor_1.AbstractIconVisitor {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.isIconPropertyDefinition = (node) => {
10
+ return (node.type === typescript_estree_1.AST_NODE_TYPES.Property &&
11
+ ((node.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier && node.key.name === 'icon') ||
12
+ (node.key.type === typescript_estree_1.AST_NODE_TYPES.Literal && node.key.value === 'icon')));
13
+ };
14
+ }
15
+ getIconDefinitionNode(node) {
16
+ return node.properties.find(this.isIconPropertyDefinition);
17
+ }
18
+ }
19
+ exports.ConfluenceIconVisitor = ConfluenceIconVisitor;
@@ -0,0 +1,7 @@
1
+ import { AbstractIconVisitor } from './abstract-icon-visitor';
2
+ export declare class JiraIconVisitor extends AbstractIconVisitor {
3
+ protected getIconDefinitionNode(node: any): any;
4
+ private isStatusPropertyDefinition;
5
+ private extractIconDefinition;
6
+ }
7
+ //# sourceMappingURL=jira-icon-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-icon-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/dynamic-properties-linter/visitors/jira-icon-visitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBAAa,eAAgB,SAAQ,mBAAmB;IAsBtD,SAAS,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG;IAK/C,OAAO,CAAC,0BAA0B,CAgBhC;IAEF,OAAO,CAAC,qBAAqB,CAoB3B;CACH"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JiraIconVisitor = void 0;
4
+ const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
5
+ const abstract_icon_visitor_1 = require("./abstract-icon-visitor");
6
+ class JiraIconVisitor extends abstract_icon_visitor_1.AbstractIconVisitor {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.isStatusPropertyDefinition = (node) => {
10
+ return (node.type === typescript_estree_1.AST_NODE_TYPES.Property &&
11
+ ((node.key.type === typescript_estree_1.AST_NODE_TYPES.Literal && node.key.value === 'status') ||
12
+ (node.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier && node.key.name === 'status')) &&
13
+ node.value.type === typescript_estree_1.AST_NODE_TYPES.ObjectExpression &&
14
+ node.value.properties.find((prop) => {
15
+ return (prop.type === typescript_estree_1.AST_NODE_TYPES.Property &&
16
+ ((prop.key.type === typescript_estree_1.AST_NODE_TYPES.Literal && prop.key.value === 'type') ||
17
+ (prop.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier && prop.key.name === 'type')) &&
18
+ ((prop.value.type === typescript_estree_1.AST_NODE_TYPES.Literal && prop.value.value === 'icon') ||
19
+ (prop.value.type === typescript_estree_1.AST_NODE_TYPES.Identifier && prop.value.name === 'icon')));
20
+ }) !== undefined);
21
+ };
22
+ this.extractIconDefinition = (node) => {
23
+ if (!node) {
24
+ return undefined;
25
+ }
26
+ const valueDefinitionNode = node === null || node === void 0 ? void 0 : node.value.properties.find((prop) => {
27
+ return (prop.type === typescript_estree_1.AST_NODE_TYPES.Property &&
28
+ ((prop.key.type === typescript_estree_1.AST_NODE_TYPES.Literal && prop.key.value === 'value') ||
29
+ (prop.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier && prop.key.name === 'value')));
30
+ });
31
+ return valueDefinitionNode.value.properties.find((prop) => {
32
+ return (prop.type === typescript_estree_1.AST_NODE_TYPES.Property &&
33
+ ((prop.key.type === typescript_estree_1.AST_NODE_TYPES.Literal && prop.key.value === 'url') ||
34
+ (prop.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier && prop.key.name === 'url')));
35
+ });
36
+ };
37
+ }
38
+ getIconDefinitionNode(node) {
39
+ const statusPropertyNode = node.properties.find(this.isStatusPropertyDefinition);
40
+ return this.extractIconDefinition(statusPropertyNode);
41
+ }
42
+ }
43
+ exports.JiraIconVisitor = JiraIconVisitor;
@@ -9,7 +9,7 @@ interface SwaggerFormat {
9
9
  };
10
10
  }
11
11
  export declare const NON_FWD_SLASH_REGEX = "[^\\/\\s]*";
12
- export declare const findMissingPermissions: (errors: LintResultRule[], warnings: LintResultRule[], permissionsType: 'missingPermission' | 'missingExternalFetchPermission' | 'missingContentStylePermission', state?: LintFixState) => Set<string>;
12
+ export declare const findMissingPermissions: (errors: LintResultRule[], warnings: LintResultRule[], permissionsType: 'missingPermission' | 'missingExternalFetchPermission' | 'missingContentStylePermission' | 'missingExternalImagesPermission', state?: LintFixState) => Set<string>;
13
13
  export declare const fixMissingPermissions: (errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState) => Promise<LintFixState>;
14
14
  interface PermissionLintCriteriaMatches {
15
15
  [key: string]: ApiCall[];
@@ -1 +1 @@
1
- {"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAE/E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,OAAO,EAEP,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,WAAW,EAGZ,MAAM,aAAa,CAAC;AAUrB,UAAU,aAAa;IACrB,KAAK,EAAE;QACL,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;KAC7B,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAKhD,eAAO,MAAM,sBAAsB,WACzB,cAAc,EAAE,YACd,cAAc,EAAE,mBACT,mBAAmB,GAAG,gCAAgC,GAAG,+BAA+B,UACjG,YAAY,KACnB,IAAI,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,QAAQ,YAAY,CAsEtB,CAAC;AAEF,UAAU,6BAA6B;IACrC,CAAC,GAAG,EAAE,MA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AAC,aAAa,SAA+B;IACnD,MAAM,CAAC,aAAa,SAA+B;IACnD,MAAM,CAAC,oBAAoB,SAAsC;IAEjE,OAAO,CAAC,IAAI,CAAC,CAA0B;IACvC,OAAO,CAAC,UAAU,CAAC,CAA0B;IAC7C,OAAO,CAAC,KAAK,CAAC,CAAa;gBAEf,WAAW,EAAE,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU;IAIlE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAgEvC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAajD,SAAS,CAAC,QAAQ,IACd,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,GACtG,SAAS;IAIb,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAsB3D,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAWtE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrE,OAAO,CAAC,YAAY;CAarB"}
@@ -32,10 +32,11 @@ const findMissingPermissions = (errors, warnings, permissionsType, state) => {
32
32
  };
33
33
  exports.findMissingPermissions = findMissingPermissions;
34
34
  const fixMissingPermissions = async (errors, warnings, state) => {
35
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
36
36
  const missingScopes = (0, exports.findMissingPermissions)(errors, warnings, 'missingPermission', state);
37
37
  const missingExternalFetchBackend = (0, exports.findMissingPermissions)(errors, warnings, 'missingExternalFetchPermission', state);
38
38
  const missingContentStyle = (0, exports.findMissingPermissions)(errors, warnings, 'missingContentStylePermission', state);
39
+ const missingExternalImage = (0, exports.findMissingPermissions)(errors, warnings, 'missingExternalImagesPermission', state);
39
40
  const currentPermissions = (_b = (_a = (await state.configFile.readConfig())) === null || _a === void 0 ? void 0 : _a.permissions) !== null && _b !== void 0 ? _b : {};
40
41
  const currentRemotes = (_d = (_c = (await state.configFile.readConfig())) === null || _c === void 0 ? void 0 : _c.remotes) !== null && _d !== void 0 ? _d : [];
41
42
  const currentScopes = (_e = currentPermissions === null || currentPermissions === void 0 ? void 0 : currentPermissions.scopes) !== null && _e !== void 0 ? _e : [];
@@ -54,26 +55,20 @@ const fixMissingPermissions = async (errors, warnings, state) => {
54
55
  const currentContentStyles = (_k = (_j = currentPermissions === null || currentPermissions === void 0 ? void 0 : currentPermissions.content) === null || _j === void 0 ? void 0 : _j.styles) !== null && _k !== void 0 ? _k : [];
55
56
  currentContentStyles.forEach((e) => missingContentStyle.add(e));
56
57
  const arrayMissingContentStyles = [...missingContentStyle];
57
- await state.configFile.writeToConfigFile('permissions', Object.assign(Object.assign(Object.assign(Object.assign({}, currentPermissions), { scopes: [...missingScopes] }), (arrayMissingExternalFetchBackend.length > 0
58
- ? {
59
- external: currentPermissions.external
60
- ? Object.assign(Object.assign({}, currentPermissions.external), { fetch: currentPermissions.external.fetch
61
- ? Object.assign(Object.assign({}, currentPermissions.external.fetch), { backend: arrayMissingExternalFetchBackend }) : {
62
- backend: arrayMissingExternalFetchBackend
63
- } }) : {
64
- fetch: {
65
- backend: arrayMissingExternalFetchBackend
66
- }
67
- }
68
- }
69
- : {})), (arrayMissingContentStyles.length > 0
70
- ? {
71
- content: currentPermissions.content
72
- ? Object.assign(Object.assign({}, currentPermissions.content), { styles: arrayMissingContentStyles }) : {
73
- styles: arrayMissingContentStyles
74
- }
75
- }
76
- : {})));
58
+ const currentExternalImages = (_m = (_l = currentPermissions === null || currentPermissions === void 0 ? void 0 : currentPermissions.external) === null || _l === void 0 ? void 0 : _l.images) !== null && _m !== void 0 ? _m : [];
59
+ currentExternalImages.forEach((e) => missingExternalImage.add(e));
60
+ const arrayMissingExternalImages = [...missingExternalImage];
61
+ const config = Object.assign(Object.assign({}, currentPermissions), { scopes: [...missingScopes] });
62
+ if (arrayMissingExternalFetchBackend.length > 0) {
63
+ config.external = Object.assign(Object.assign({}, config.external), { fetch: Object.assign(Object.assign({}, (_o = config.external) === null || _o === void 0 ? void 0 : _o.fetch), { backend: arrayMissingExternalFetchBackend }) });
64
+ }
65
+ if (arrayMissingExternalImages.length > 0) {
66
+ config.external = Object.assign(Object.assign({}, config.external), { images: arrayMissingExternalImages });
67
+ }
68
+ if (arrayMissingContentStyles.length > 0) {
69
+ config.content = Object.assign(Object.assign({}, config.content), { styles: arrayMissingContentStyles });
70
+ }
71
+ await state.configFile.writeToConfigFile('permissions', config);
77
72
  return state;
78
73
  };
79
74
  exports.fixMissingPermissions = fixMissingPermissions;
@@ -8,6 +8,11 @@ export declare const messages: {
8
8
  message: (url: string) => string;
9
9
  reference: string;
10
10
  };
11
+ dynamicPropertiesIcon: {
12
+ message: (url: string) => string;
13
+ warning: () => string;
14
+ reference: string;
15
+ };
11
16
  handler: {
12
17
  message: (method: string, key: string) => string;
13
18
  reference: string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;+BAGI,MAAM,UAAU,MAAM,SAAS,MAAM,KAAG,MAAM;;;;2BAKlD,MAAM;;;;8BAIH,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;CAK3D,CAAC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;+BAGI,MAAM,UAAU,MAAM,SAAS,MAAM,KAAG,MAAM;;;;2BAKlD,MAAM;;;;2BAIN,MAAM;2BAER,MAAM;;;;8BAKD,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;CAK3D,CAAC"}
@@ -11,6 +11,11 @@ exports.messages = {
11
11
  message: (url) => `The domain ${url} is not included in the external permissions of your app manifest`,
12
12
  reference: 'egress-permission-required'
13
13
  },
14
+ dynamicPropertiesIcon: {
15
+ message: (url) => `The domain ${url} is not included in the external images permissions of your app manifest`,
16
+ warning: () => `When using dynamic content properties along with icons, make sure to add the icon URL into the external images permissions of your app manifest. Otherwise, the icon will not be rendered.`,
17
+ reference: 'egress-permission-required'
18
+ },
14
19
  handler: {
15
20
  message: (method, key) => `Cannot find exported function '${method}', which is required by module '${key}' handler defined in the manifest`,
16
21
  reference: 'valid-module-required'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/lint",
3
- "version": "3.2.22-next.4",
3
+ "version": "3.3.0-next.10",
4
4
  "description": "Linting for forge apps",
5
5
  "main": "out/index.js",
6
6
  "license": "UNLICENSED",
@@ -17,12 +17,12 @@
17
17
  "@types/node-fetch": "^2.5.7"
18
18
  },
19
19
  "dependencies": {
20
- "@forge/cli-shared": "3.11.0-next.4",
21
- "@forge/egress": "1.1.2",
20
+ "@forge/cli-shared": "3.11.0-next.6",
21
+ "@forge/egress": "1.2.0-next.1",
22
22
  "@forge/manifest": "4.10.0-next.2",
23
23
  "@typescript-eslint/typescript-estree": "^5.40.0",
24
24
  "array.prototype.flatmap": "^1.2.3",
25
- "atlassian-openapi": "^1.0.13",
25
+ "atlassian-openapi": "^1.0.17",
26
26
  "cross-spawn": "^7.0.3",
27
27
  "node-fetch": "2.6.7"
28
28
  }