@forge/lint 5.15.0-next.8 → 5.15.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/CHANGELOG.md +72 -0
- package/out/lint/linters/permission-linter/api-call-interface.d.ts +6 -2
- package/out/lint/linters/permission-linter/api-call-interface.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/api-call-interface.js +1 -0
- package/out/lint/linters/permission-linter/permission-linter.d.ts +2 -1
- package/out/lint/linters/permission-linter/permission-linter.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/permission-linter.js +10 -4
- package/out/lint/linters/permission-linter/verifiers/index.d.ts +1 -0
- package/out/lint/linters/permission-linter/verifiers/index.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/verifiers/index.js +1 -0
- package/out/lint/linters/permission-linter/verifiers/notification-api-verifier.d.ts +8 -0
- package/out/lint/linters/permission-linter/verifiers/notification-api-verifier.d.ts.map +1 -0
- package/out/lint/linters/permission-linter/verifiers/notification-api-verifier.js +44 -0
- package/out/lint/linters/permission-linter/visitors/index.d.ts +1 -0
- package/out/lint/linters/permission-linter/visitors/index.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/visitors/index.js +1 -0
- package/out/lint/linters/permission-linter/visitors/notification-api-visitor.d.ts +7 -0
- package/out/lint/linters/permission-linter/visitors/notification-api-visitor.d.ts.map +1 -0
- package/out/lint/linters/permission-linter/visitors/notification-api-visitor.js +23 -0
- package/out/lint/text/messages.d.ts +4 -0
- package/out/lint/text/messages.d.ts.map +1 -1
- package/out/lint/text/messages.js +4 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# @forge/lint
|
|
2
2
|
|
|
3
|
+
## 5.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 62086be: Modified Forge CLI linter to detect for usage of Forge NotificationApi
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- d6c8528: Rename remote linter to endpoint in preparation for adding invokeService linter
|
|
12
|
+
- 63d29ca: Update dynamic egress and remote manifest in preparation for Preview
|
|
13
|
+
- Updated dependencies [2b94ed8]
|
|
14
|
+
- Updated dependencies [6204a94]
|
|
15
|
+
- Updated dependencies [c1526eb]
|
|
16
|
+
- Updated dependencies [e4c143c]
|
|
17
|
+
- Updated dependencies [42e069d]
|
|
18
|
+
- Updated dependencies [19807bf]
|
|
19
|
+
- Updated dependencies [a684b69]
|
|
20
|
+
- Updated dependencies [e98e35c]
|
|
21
|
+
- Updated dependencies [5de91aa]
|
|
22
|
+
- Updated dependencies [6247657]
|
|
23
|
+
- Updated dependencies [434fb15]
|
|
24
|
+
- Updated dependencies [d4bbee9]
|
|
25
|
+
- Updated dependencies [8246b16]
|
|
26
|
+
- Updated dependencies [fa9b5aa]
|
|
27
|
+
- Updated dependencies [63d29ca]
|
|
28
|
+
- Updated dependencies [2719ab7]
|
|
29
|
+
- @forge/cli-shared@8.15.1
|
|
30
|
+
- @forge/manifest@12.1.0
|
|
31
|
+
|
|
32
|
+
## 5.15.0-next.13
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [6204a94]
|
|
37
|
+
- Updated dependencies [e98e35c]
|
|
38
|
+
- Updated dependencies [d4bbee9]
|
|
39
|
+
- @forge/manifest@12.1.0-next.8
|
|
40
|
+
- @forge/cli-shared@8.15.1-next.12
|
|
41
|
+
|
|
42
|
+
## 5.15.0-next.12
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [5de91aa]
|
|
47
|
+
- @forge/manifest@12.1.0-next.7
|
|
48
|
+
- @forge/cli-shared@8.15.1-next.11
|
|
49
|
+
|
|
50
|
+
## 5.15.0-next.11
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- 63d29ca: Update dynamic egress and remote manifest in preparation for Preview
|
|
55
|
+
- Updated dependencies [434fb15]
|
|
56
|
+
- Updated dependencies [63d29ca]
|
|
57
|
+
- @forge/manifest@12.1.0-next.6
|
|
58
|
+
- @forge/cli-shared@8.15.1-next.10
|
|
59
|
+
|
|
60
|
+
## 5.15.0-next.10
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- Updated dependencies [a684b69]
|
|
65
|
+
- @forge/cli-shared@8.15.1-next.9
|
|
66
|
+
|
|
67
|
+
## 5.15.0-next.9
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- Updated dependencies [8246b16]
|
|
72
|
+
- @forge/manifest@12.1.0-next.5
|
|
73
|
+
- @forge/cli-shared@8.15.1-next.8
|
|
74
|
+
|
|
3
75
|
## 5.15.0-next.8
|
|
4
76
|
|
|
5
77
|
### Minor Changes
|
|
@@ -5,7 +5,8 @@ export declare enum ApiCallTypes {
|
|
|
5
5
|
'STORAGE' = 2,
|
|
6
6
|
'EXTERNAL' = 3,
|
|
7
7
|
'CONTENT_PROPERTY' = 4,
|
|
8
|
-
'IMAGE' = 5
|
|
8
|
+
'IMAGE' = 5,
|
|
9
|
+
'NOTIFICATION' = 6
|
|
9
10
|
}
|
|
10
11
|
export declare type ProductName = 'jira' | 'confluence' | 'bitbucket';
|
|
11
12
|
export interface ProductApiCall extends LintCriteriaMatch {
|
|
@@ -35,5 +36,8 @@ export interface ContentPropertyApiCall extends LintCriteriaMatch {
|
|
|
35
36
|
context: string;
|
|
36
37
|
method: string;
|
|
37
38
|
}
|
|
38
|
-
export
|
|
39
|
+
export interface NotificationApiCall extends LintCriteriaMatch {
|
|
40
|
+
type: ApiCallTypes.NOTIFICATION;
|
|
41
|
+
}
|
|
42
|
+
export declare type ApiCall = ProductApiCall | UIHookApiCall | StorageApiCall | ExternalApiCall | ImageUrl | ContentPropertyApiCall | NotificationApiCall;
|
|
39
43
|
//# sourceMappingURL=api-call-interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-call-interface.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/api-call-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,oBAAY,YAAY;IACtB,SAAS,IAAA;IACT,MAAM,IAAA;IACN,SAAS,IAAA;IACT,UAAU,IAAA;IACV,kBAAkB,IAAA;IAClB,OAAO,IAAA;
|
|
1
|
+
{"version":3,"file":"api-call-interface.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/api-call-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,oBAAY,YAAY;IACtB,SAAS,IAAA;IACT,MAAM,IAAA;IACN,SAAS,IAAA;IACT,UAAU,IAAA;IACV,kBAAkB,IAAA;IAClB,OAAO,IAAA;IACP,cAAc,IAAA;CACf;AAED,oBAAY,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,CAAC;AAE9D,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,QAAS,SAAQ,iBAAiB;IACjD,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,IAAI,EAAE,YAAY,CAAC,gBAAgB,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,IAAI,EAAE,YAAY,CAAC,YAAY,CAAC;CACjC;AAED,oBAAY,OAAO,GACf,cAAc,GACd,aAAa,GACb,cAAc,GACd,eAAe,GACf,QAAQ,GACR,sBAAsB,GACtB,mBAAmB,CAAC"}
|
|
@@ -9,4 +9,5 @@ var ApiCallTypes;
|
|
|
9
9
|
ApiCallTypes[ApiCallTypes["EXTERNAL"] = 3] = "EXTERNAL";
|
|
10
10
|
ApiCallTypes[ApiCallTypes["CONTENT_PROPERTY"] = 4] = "CONTENT_PROPERTY";
|
|
11
11
|
ApiCallTypes[ApiCallTypes["IMAGE"] = 5] = "IMAGE";
|
|
12
|
+
ApiCallTypes[ApiCallTypes["NOTIFICATION"] = 6] = "NOTIFICATION";
|
|
12
13
|
})(ApiCallTypes = exports.ApiCallTypes || (exports.ApiCallTypes = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ManifestSchema as Manifest } from '@forge/manifest';
|
|
2
2
|
import BaseLinter from '../../base-linter';
|
|
3
3
|
import { LintFixState, LintLogger, LintResultRule } from '../../linter-interface';
|
|
4
|
-
import { ApiCall, ExternalApiCall, ImageUrl, ProductApiCall, StorageApiCall, UIHookApiCall } from './api-call-interface';
|
|
4
|
+
import { ApiCall, ExternalApiCall, ImageUrl, NotificationApiCall, ProductApiCall, StorageApiCall, UIHookApiCall } from './api-call-interface';
|
|
5
5
|
import { PathMethods } from './verifiers';
|
|
6
6
|
interface SwaggerFormat {
|
|
7
7
|
paths: {
|
|
@@ -20,6 +20,7 @@ interface PermissionLintCriteriaMatches {
|
|
|
20
20
|
uiHook: UIHookApiCall[];
|
|
21
21
|
external: ExternalApiCall[];
|
|
22
22
|
image: ImageUrl[];
|
|
23
|
+
notification: NotificationApiCall[];
|
|
23
24
|
}
|
|
24
25
|
export declare class PermissionLinter extends BaseLinter<ApiCall, PermissionLintCriteriaMatches, ApiCall[]> {
|
|
25
26
|
private manifest;
|
|
@@ -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,QAAQ,EACR,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,WAAW,
|
|
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,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,WAAW,EAIZ,MAAM,aAAa,CAAC;AAarB,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,mBAEtB,mBAAmB,GACnB,gCAAgC,GAChC,+BAA+B,GAC/B,iCAAiC,UAC7B,YAAY,KACnB,IAAI,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAAc,cAAc,EAAE,UAAU,YAAY,KAAG,OAI9F,CAAC;AAsCF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,QAAQ,YAAY,CAyEtB,CAAC;AAEF,UAAU,6BAA6B;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;IACzB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,YAAY,EAAE,mBAAmB,EAAE,CAAC;CACrC;AAED,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,OAAO,EAAE,6BAA6B,EAAE,OAAO,EAAE,CAAC;IAe/F,OAAO,CAAC,QAAQ;IAdlB,MAAM,CAAC,cAAc,SAAgC;IACrD,MAAM,CAAC,aAAa,SAA+B;IACnD,MAAM,CAAC,aAAa,SAA+B;IACnD,MAAM,CAAC,oBAAoB,SAAsC;IACjE,MAAM,CAAC,uBAAuB,SAAyC;IACvE,MAAM,CAAC,mBAAmB,SAAqC;IAE/D,OAAO,CAAC,IAAI,CAAC,CAA0B;IACvC,OAAO,CAAC,UAAU,CAAC,CAA0B;IAC7C,OAAO,CAAC,SAAS,CAAC,CAA0B;IAC5C,OAAO,CAAC,KAAK,CAAC,CAAa;gBAGzB,WAAW,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,UAAU;IAKP,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IA6FvC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAejD,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;IAyB3D,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"}
|
|
@@ -40,7 +40,7 @@ const deprecatedEgressPermissions = (warnings, state) => {
|
|
|
40
40
|
};
|
|
41
41
|
exports.deprecatedEgressPermissions = deprecatedEgressPermissions;
|
|
42
42
|
const applyEgressPermissionsMigration = (config) => {
|
|
43
|
-
const { fetch: originalFetch, ...restExternal } = config.external ?? {};
|
|
43
|
+
const { fetch: originalFetch, configurable: _configurable, ...restExternal } = config.external ?? {};
|
|
44
44
|
Object.entries(originalFetch || {}).forEach(([key, values]) => {
|
|
45
45
|
const valuesToOverride = [];
|
|
46
46
|
values.forEach((egressValue) => {
|
|
@@ -190,7 +190,8 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
190
190
|
new visitors_1.UIHookNodeVisitor(),
|
|
191
191
|
new visitors_1.StorageAPINodeVisitor(),
|
|
192
192
|
new visitors_1.ExternalApiCallVisitor(),
|
|
193
|
-
new visitors_1.ImageUrlVisitor()
|
|
193
|
+
new visitors_1.ImageUrlVisitor(),
|
|
194
|
+
new visitors_1.NotificationAPINodeVisitor()
|
|
194
195
|
];
|
|
195
196
|
const humanReadableEnvironment = (0, cli_shared_1.environmentToOption)(this.environment);
|
|
196
197
|
this.verifiers = {
|
|
@@ -200,7 +201,8 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
200
201
|
storage: new verifiers_1.StorageAPIVerifier(humanReadableEnvironment, this.manifest),
|
|
201
202
|
uiHook: new verifiers_1.UIHookVerifier(humanReadableEnvironment, this.manifest),
|
|
202
203
|
external: new verifiers_1.ExternalFetchVerifier(humanReadableEnvironment, this.manifest),
|
|
203
|
-
image: new verifiers_1.ImageUrlVerifier(humanReadableEnvironment, this.manifest)
|
|
204
|
+
image: new verifiers_1.ImageUrlVerifier(humanReadableEnvironment, this.manifest),
|
|
205
|
+
notification: new verifiers_1.NotificationVerifier(humanReadableEnvironment, this.manifest)
|
|
204
206
|
};
|
|
205
207
|
}
|
|
206
208
|
setupMatchesMap(filepath) {
|
|
@@ -213,7 +215,8 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
213
215
|
uiHook: [],
|
|
214
216
|
storage: [],
|
|
215
217
|
external: [],
|
|
216
|
-
image: []
|
|
218
|
+
image: [],
|
|
219
|
+
notification: []
|
|
217
220
|
});
|
|
218
221
|
}
|
|
219
222
|
getFixer() {
|
|
@@ -237,6 +240,9 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
237
240
|
case api_call_interface_1.ApiCallTypes.IMAGE:
|
|
238
241
|
criteriaMatches.image.push(apiCall);
|
|
239
242
|
break;
|
|
243
|
+
case api_call_interface_1.ApiCallTypes.NOTIFICATION:
|
|
244
|
+
criteriaMatches.notification.push(apiCall);
|
|
245
|
+
break;
|
|
240
246
|
}
|
|
241
247
|
}
|
|
242
248
|
async getProductPaths(cacheKey, url) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -6,3 +6,4 @@ tslib_1.__exportStar(require("./image-url-verifier"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./product-verifier"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./storage-api-verifier"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./ui-hook-verifier"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./notification-api-verifier"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LintResultRule, LintClass } from '../../../linter-interface';
|
|
2
|
+
import { ApiCall, NotificationApiCall } from '../api-call-interface';
|
|
3
|
+
import { LintIssueVerifier, BaseLintIssueVerifier } from '../../verifier-interface';
|
|
4
|
+
export declare class NotificationVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<ApiCall[]> {
|
|
5
|
+
protected getLintClass(): LintClass;
|
|
6
|
+
process(apiCalls: NotificationApiCall[]): Promise<LintResultRule[]>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=notification-api-verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-api-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/notification-api-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAOpF,qBAAa,oBAAqB,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IACrG,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CA4CjF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationVerifier = void 0;
|
|
4
|
+
const linter_interface_1 = require("../../../linter-interface");
|
|
5
|
+
const verifier_interface_1 = require("../../verifier-interface");
|
|
6
|
+
const text_1 = require("../../../text");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const JIRA_SCOPE = 'send:app-notification:jira';
|
|
9
|
+
const CONFLUENCE_SCOPE = 'send:app-notification:confluence';
|
|
10
|
+
class NotificationVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
11
|
+
getLintClass() {
|
|
12
|
+
return linter_interface_1.LintClass.Error;
|
|
13
|
+
}
|
|
14
|
+
async process(apiCalls) {
|
|
15
|
+
const rules = [];
|
|
16
|
+
const declaredScopes = (0, utils_1.getAllScopeKeys)(this.manifest.permissions?.scopes ?? []);
|
|
17
|
+
apiCalls.forEach((apiCall) => {
|
|
18
|
+
const { line, column } = apiCall;
|
|
19
|
+
if (!declaredScopes.includes(JIRA_SCOPE) && !declaredScopes.includes(CONFLUENCE_SCOPE)) {
|
|
20
|
+
rules.push({
|
|
21
|
+
class: this.getLintClass(),
|
|
22
|
+
message: text_1.messages.verifiers.notification.message(JIRA_SCOPE, 'Jira'),
|
|
23
|
+
reference: text_1.messages.verifiers.notification.reference,
|
|
24
|
+
line,
|
|
25
|
+
column,
|
|
26
|
+
metadata: {
|
|
27
|
+
missingPermission: JIRA_SCOPE
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
class: this.getLintClass(),
|
|
31
|
+
message: text_1.messages.verifiers.notification.message(CONFLUENCE_SCOPE, 'Confluence'),
|
|
32
|
+
reference: text_1.messages.verifiers.notification.reference,
|
|
33
|
+
line,
|
|
34
|
+
column,
|
|
35
|
+
metadata: {
|
|
36
|
+
missingPermission: CONFLUENCE_SCOPE
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return rules;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.NotificationVerifier = NotificationVerifier;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
|
|
@@ -6,3 +6,4 @@ tslib_1.__exportStar(require("./image-url-visitor"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./product-node-visitor"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./storage-api-node-visitor"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./ui-hook-node-visitor"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./notification-api-visitor"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TSESTree } from '@typescript-eslint/typescript-estree';
|
|
2
|
+
import { NodeVisitor } from '../../node-visitor-interface';
|
|
3
|
+
import { ApiCall } from '../api-call-interface';
|
|
4
|
+
export declare class NotificationAPINodeVisitor implements NodeVisitor<ApiCall> {
|
|
5
|
+
visit(node: TSESTree.Node, _parent: TSESTree.Node | undefined, callback: (apiCall: ApiCall) => void): void;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=notification-api-visitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-api-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/notification-api-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAqC,MAAM,uBAAuB,CAAC;AAKnF,qBAAa,0BAA2B,YAAW,WAAW,CAAC,OAAO,CAAC;IAC9D,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;CAelH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationAPINodeVisitor = void 0;
|
|
4
|
+
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
|
|
5
|
+
const api_call_interface_1 = require("../api-call-interface");
|
|
6
|
+
class NotificationAPINodeVisitor {
|
|
7
|
+
visit(node, _parent, callback) {
|
|
8
|
+
if (node.type === typescript_estree_1.AST_NODE_TYPES.ImportDeclaration) {
|
|
9
|
+
node.specifiers.forEach((specifier) => {
|
|
10
|
+
if (specifier.type === typescript_estree_1.AST_NODE_TYPES.ImportSpecifier && specifier.local.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
11
|
+
if (specifier.loc && specifier.local.name === 'NotificationApi') {
|
|
12
|
+
const notificationApiCall = {
|
|
13
|
+
type: api_call_interface_1.ApiCallTypes.NOTIFICATION,
|
|
14
|
+
...specifier.loc.start
|
|
15
|
+
};
|
|
16
|
+
callback(notificationApiCall);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.NotificationAPINodeVisitor = NotificationAPINodeVisitor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;2BAGA,MAAM;;;;2BAKN,MAAM;2BAER,MAAM;;;;2BAKJ,MAAM;;;;iCAKA,MAAM;;;;iCAKN,MAAM;;;;8BAKT,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;8BAKpC,MAAM;;;;8BAIN,MAAM;;;;8BAIN,MAAM;;;;;;;;;oCASF,MAAM;;;;;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/lint/text/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;2BAGA,MAAM;;;;2BAKN,MAAM;2BAER,MAAM;;;;2BAKJ,MAAM;;;;iCAKA,MAAM;;;;iCAKN,MAAM;;;;8BAKT,MAAM,OAAO,MAAM;;;;+BAKlB,MAAM,UAAU,MAAM,QAAQ,MAAM,GAAG,SAAS,SAAS,MAAM;;;;6BAKjE,MAAM;;;;+BAIJ,MAAM,QAAQ,MAAM,SAAS,MAAM;;;;8BAKpC,MAAM;;;;8BAIN,MAAM;;;;8BAIN,MAAM;;;;;;;;;oCASF,MAAM;;;;;6BAOX,MAAM,WAAW,MAAM;;;;CAK7C,CAAC"}
|
|
@@ -63,6 +63,10 @@ exports.messages = {
|
|
|
63
63
|
},
|
|
64
64
|
reference: 'valid-frame-component-resource-attribute-required'
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
notification: {
|
|
68
|
+
message: (scope, product) => `Missing permission ${scope} required for NotificationApi. Only add this if you are building a ${product} app`,
|
|
69
|
+
reference: 'permission-scope-required'
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/lint",
|
|
3
|
-
"version": "5.15.0
|
|
3
|
+
"version": "5.15.0",
|
|
4
4
|
"description": "Linting for forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@atlassian/xen-test-util": "^4.2.0",
|
|
14
|
-
"@forge/api": "^7.0.1
|
|
14
|
+
"@forge/api": "^7.0.1",
|
|
15
15
|
"@types/array.prototype.flatmap": "^1.2.6",
|
|
16
16
|
"@types/cross-spawn": "^6.0.6",
|
|
17
17
|
"@types/eslint": "8.56.12",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"eslint-plugin-import": "^2.29.1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@forge/cli-shared": "8.15.1
|
|
22
|
+
"@forge/cli-shared": "8.15.1",
|
|
23
23
|
"@forge/csp": "5.6.1",
|
|
24
24
|
"@forge/egress": "2.3.1",
|
|
25
|
-
"@forge/manifest": "12.1.0
|
|
25
|
+
"@forge/manifest": "12.1.0",
|
|
26
26
|
"@typescript-eslint/typescript-estree": "^5.62.0",
|
|
27
27
|
"array.prototype.flatmap": "^1.3.3",
|
|
28
28
|
"@atlassian/atlassian-openapi": "^1.0.6",
|