@forge/lint 3.1.3-next.2 → 3.2.0-next.5
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 +20 -0
- package/out/lint/linters/handler-linter/visitors/exported-function-node-visitor.d.ts +7 -0
- package/out/lint/linters/handler-linter/visitors/exported-function-node-visitor.d.ts.map +1 -1
- package/out/lint/linters/handler-linter/visitors/exported-function-node-visitor.js +56 -61
- package/out/lint/linters/permission-linter/permission-linter.d.ts +2 -0
- package/out/lint/linters/permission-linter/permission-linter.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/permission-linter.js +16 -5
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @forge/lint
|
|
2
2
|
|
|
3
|
+
## 3.2.0-next.5
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8309725: FORGEPAPA-959 - Add support for linting against JSW and JSM open api
|
|
8
|
+
|
|
9
|
+
## 3.1.3-next.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7fe19b40: More resilient linting against handler exports
|
|
14
|
+
|
|
15
|
+
## 3.1.3-next.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [4285fc36]
|
|
20
|
+
- @forge/manifest@3.9.0-next.2
|
|
21
|
+
- @forge/cli-shared@2.6.0-next.3
|
|
22
|
+
|
|
3
23
|
## 3.1.3-next.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -3,5 +3,12 @@ import { NodeVisitor } from '../../node-visitor-interface';
|
|
|
3
3
|
import { ExportedMethod } from '../exported-method-interface';
|
|
4
4
|
export declare class ExportedFunctionNodeVisitor implements NodeVisitor<ExportedMethod> {
|
|
5
5
|
visit(node: TSESTree.Node, _parent: TSESTree.Node | undefined, callback: (exportedMethod: ExportedMethod) => void): void;
|
|
6
|
+
private visitSpecifiedNamedExports;
|
|
7
|
+
private visitInlineNamedExport;
|
|
8
|
+
private visitObjectAssignmentExpression;
|
|
9
|
+
private visitMemberExpression;
|
|
10
|
+
private tryAddObjectExpressionPropertiesExportedMethods;
|
|
11
|
+
private createExportedMethod;
|
|
12
|
+
private isExports;
|
|
6
13
|
}
|
|
7
14
|
//# sourceMappingURL=exported-function-node-visitor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exported-function-node-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/handler-linter/visitors/exported-function-node-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,qBAAa,2BAA4B,YAAW,WAAW,CAAC,cAAc,CAAC;IACtE,KAAK,CACV,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EAClC,QAAQ,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,GACjD,IAAI;
|
|
1
|
+
{"version":3,"file":"exported-function-node-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/handler-linter/visitors/exported-function-node-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,qBAAa,2BAA4B,YAAW,WAAW,CAAC,cAAc,CAAC;IACtE,KAAK,CACV,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EAClC,QAAQ,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,GACjD,IAAI;IAuCP,OAAO,CAAC,0BAA0B;IAelC,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,+BAA+B;IAkBvC,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,+CAA+C;IAavD,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,SAAS;CAUlB"}
|
|
@@ -4,78 +4,73 @@ exports.ExportedFunctionNodeVisitor = void 0;
|
|
|
4
4
|
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
|
|
5
5
|
class ExportedFunctionNodeVisitor {
|
|
6
6
|
visit(node, _parent, callback) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
8
7
|
if (node.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
|
|
9
8
|
node.object &&
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (((_a = node.object) === null || _a === void 0 ? void 0 : _a.object.type) === typescript_estree_1.AST_NODE_TYPES.Identifier && ((_b = node.object) === null || _b === void 0 ? void 0 : _b.object.name) === 'module') {
|
|
13
|
-
if (((_c = node.object) === null || _c === void 0 ? void 0 : _c.property.type) === typescript_estree_1.AST_NODE_TYPES.Identifier && ((_d = node.object) === null || _d === void 0 ? void 0 : _d.property.name) === 'exports') {
|
|
14
|
-
const exportedMethod = Object.assign({ method: node.property.name }, node.property.loc.start);
|
|
15
|
-
return callback(exportedMethod);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (node.object.type === typescript_estree_1.AST_NODE_TYPES.Identifier && node.object.name === 'exports') {
|
|
20
|
-
if (node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
21
|
-
const exportedMethod = Object.assign({ method: node.property.name }, node.property.loc.start);
|
|
22
|
-
return callback(exportedMethod);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
9
|
+
node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
10
|
+
this.visitMemberExpression(node, callback);
|
|
25
11
|
}
|
|
26
12
|
if (node.type === typescript_estree_1.AST_NODE_TYPES.AssignmentExpression && node.operator === '=') {
|
|
27
|
-
|
|
28
|
-
if (((_h = node.left) === null || _h === void 0 ? void 0 : _h.object.type) === typescript_estree_1.AST_NODE_TYPES.Identifier && ((_j = node.left) === null || _j === void 0 ? void 0 : _j.object.name) === 'module') {
|
|
29
|
-
if (((_k = node.left) === null || _k === void 0 ? void 0 : _k.property.type) === typescript_estree_1.AST_NODE_TYPES.Identifier && ((_l = node.left) === null || _l === void 0 ? void 0 : _l.property.name) === 'exports') {
|
|
30
|
-
((_m = node.right) === null || _m === void 0 ? void 0 : _m.properties).forEach((property) => {
|
|
31
|
-
if (property.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
32
|
-
const exportedMethod = Object.assign({ method: property.key.name }, property.key.loc.start);
|
|
33
|
-
return callback(exportedMethod);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (((_o = node.left) === null || _o === void 0 ? void 0 : _o.type) === typescript_estree_1.AST_NODE_TYPES.Identifier && ((_p = node.left) === null || _p === void 0 ? void 0 : _p.name) === 'exports') {
|
|
40
|
-
((_q = node.right) === null || _q === void 0 ? void 0 : _q.properties).forEach((property) => {
|
|
41
|
-
if (property.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
42
|
-
const exportedMethod = Object.assign({ method: property.key.name }, property.key.loc.start);
|
|
43
|
-
return callback(exportedMethod);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
13
|
+
this.visitObjectAssignmentExpression(node, callback);
|
|
47
14
|
}
|
|
48
15
|
if (node.type === typescript_estree_1.AST_NODE_TYPES.ExportNamedDeclaration) {
|
|
49
16
|
if (node.declaration) {
|
|
50
|
-
|
|
51
|
-
node.declaration.declarations.forEach((declarator) => {
|
|
52
|
-
if (declarator.id && declarator.id.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
53
|
-
const exportedMethod = Object.assign({ method: declarator.id.name }, declarator.id.loc.start);
|
|
54
|
-
return callback(exportedMethod);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
else if (((_s = node.declaration) === null || _s === void 0 ? void 0 : _s.type) === typescript_estree_1.AST_NODE_TYPES.FunctionDeclaration) {
|
|
59
|
-
if (((_t = node.declaration) === null || _t === void 0 ? void 0 : _t.id) && ((_u = node.declaration) === null || _u === void 0 ? void 0 : _u.id.type) === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
60
|
-
const exportedMethod = Object.assign({ method: node.declaration.id.name }, node.declaration.id.loc.start);
|
|
61
|
-
return callback(exportedMethod);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
17
|
+
this.visitInlineNamedExport(node, callback);
|
|
64
18
|
}
|
|
65
19
|
else {
|
|
66
|
-
node.specifiers.forEach((specifier) =>
|
|
67
|
-
if (specifier.type === typescript_estree_1.AST_NODE_TYPES.ExportSpecifier &&
|
|
68
|
-
specifier.exported.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
69
|
-
const exportedMethod = Object.assign({ method: specifier.exported.name }, node.loc.start);
|
|
70
|
-
return callback(exportedMethod);
|
|
71
|
-
}
|
|
72
|
-
if (specifier.type === typescript_estree_1.AST_NODE_TYPES.ExportSpecifier && specifier.local.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
73
|
-
const exportedMethod = Object.assign({ method: specifier.local.name }, node.loc.start);
|
|
74
|
-
return callback(exportedMethod);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
20
|
+
node.specifiers.forEach((specifier) => this.visitSpecifiedNamedExports(node, specifier, callback));
|
|
77
21
|
}
|
|
78
22
|
}
|
|
79
23
|
}
|
|
24
|
+
visitSpecifiedNamedExports(node, specifier, callback) {
|
|
25
|
+
if (specifier.type === typescript_estree_1.AST_NODE_TYPES.ExportSpecifier && specifier.local.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
26
|
+
callback(this.createExportedMethod(specifier.exported.name, Object.assign({}, node.loc.start)));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
visitInlineNamedExport(node, callback) {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
if (((_a = node.declaration) === null || _a === void 0 ? void 0 : _a.type) === typescript_estree_1.AST_NODE_TYPES.VariableDeclaration) {
|
|
32
|
+
node.declaration.declarations.forEach((declarator) => {
|
|
33
|
+
if (declarator.id && declarator.id.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
34
|
+
callback(this.createExportedMethod(declarator.id.name, Object.assign({}, declarator.id.loc.start)));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
else if (((_b = node.declaration) === null || _b === void 0 ? void 0 : _b.type) === typescript_estree_1.AST_NODE_TYPES.FunctionDeclaration) {
|
|
39
|
+
if (((_c = node.declaration) === null || _c === void 0 ? void 0 : _c.id) && ((_d = node.declaration) === null || _d === void 0 ? void 0 : _d.id.type) === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
40
|
+
callback(this.createExportedMethod(node.declaration.id.name, Object.assign({}, node.declaration.id.loc.start)));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
visitObjectAssignmentExpression(node, callback) {
|
|
45
|
+
if (this.isExports(node.left)) {
|
|
46
|
+
this.tryAddObjectExpressionPropertiesExportedMethods(node, callback);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
visitMemberExpression(node, callback) {
|
|
50
|
+
if (node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier && this.isExports(node.object)) {
|
|
51
|
+
callback(this.createExportedMethod(node.property.name, Object.assign({}, node.property.loc.start)));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
tryAddObjectExpressionPropertiesExportedMethods(node, callback) {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
if (((_a = node.right) === null || _a === void 0 ? void 0 : _a.type) === typescript_estree_1.AST_NODE_TYPES.ObjectExpression) {
|
|
57
|
+
(_b = node.right.properties) === null || _b === void 0 ? void 0 : _b.forEach((property) => {
|
|
58
|
+
if (property.key.type === typescript_estree_1.AST_NODE_TYPES.Identifier) {
|
|
59
|
+
callback(this.createExportedMethod(property.key.name, Object.assign({}, property.key.loc.start)));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
createExportedMethod(method, location) {
|
|
65
|
+
return Object.assign({ method }, location);
|
|
66
|
+
}
|
|
67
|
+
isExports(node) {
|
|
68
|
+
return ((node.type === typescript_estree_1.AST_NODE_TYPES.MemberExpression &&
|
|
69
|
+
node.object.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
|
|
70
|
+
node.object.name === 'module' &&
|
|
71
|
+
node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
|
|
72
|
+
node.property.name === 'exports') ||
|
|
73
|
+
((node === null || node === void 0 ? void 0 : node.type) === typescript_estree_1.AST_NODE_TYPES.Identifier && (node === null || node === void 0 ? void 0 : node.name) === 'exports'));
|
|
74
|
+
}
|
|
80
75
|
}
|
|
81
76
|
exports.ExportedFunctionNodeVisitor = ExportedFunctionNodeVisitor;
|
|
@@ -22,6 +22,8 @@ interface PermissionLintCriteriaMatches {
|
|
|
22
22
|
export declare class PermissionLinter extends BaseLinter<ApiCall, PermissionLintCriteriaMatches, ApiCall[]> {
|
|
23
23
|
private manifest;
|
|
24
24
|
static JIRA_CACHE_KEY: string;
|
|
25
|
+
static JSM_CACHE_KEY: string;
|
|
26
|
+
static JSW_CACHE_KEY: string;
|
|
25
27
|
static CONFLUENCE_CACHE_KEY: string;
|
|
26
28
|
private jira?;
|
|
27
29
|
private confluence?;
|
|
@@ -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,uCAExG,GAAG,CAAC,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,OAAO,CAAC,YAAY,CAsEtB,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;CAC7B;AAED,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,OAAO,EAAE,6BAA6B,EAAE,OAAO,EAAE,CAAC;
|
|
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,uCAExG,GAAG,CAAC,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,OAAO,CAAC,YAAY,CAsEtB,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;CAC7B;AAED,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,OAAO,EAAE,6BAA6B,EAAE,OAAO,EAAE,CAAC;IAUhE,OAAO,CAAC,QAAQ;IATjD,MAAM,CAAC,cAAc,SAAgC;IACrD,MAAM,CAAC,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"}
|
|
@@ -84,20 +84,29 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
84
84
|
this.cache = cli_shared_1.CachedConf.getCache(CACHE_KEY);
|
|
85
85
|
const LOCAL_CONF_SWAGGER = process.env.LOCAL_CONF_SWAGGER;
|
|
86
86
|
const LOCAL_JIRA_SWAGGER = process.env.LOCAL_JIRA_SWAGGER;
|
|
87
|
+
const LOCAL_JSM_SWAGGER = process.env.LOCAL_JSM_SWAGGER;
|
|
88
|
+
const LOCAL_JSW_SWAGGER = process.env.LOCAL_JSW_SWAGGER;
|
|
87
89
|
const USE_LOCAL_SWAGGER = process.env.USE_LOCAL_SWAGGER;
|
|
88
90
|
let swaggerFiles;
|
|
89
|
-
if (USE_LOCAL_SWAGGER && LOCAL_CONF_SWAGGER && LOCAL_JIRA_SWAGGER) {
|
|
90
|
-
swaggerFiles = [
|
|
91
|
+
if (USE_LOCAL_SWAGGER && LOCAL_CONF_SWAGGER && LOCAL_JIRA_SWAGGER && LOCAL_JSM_SWAGGER && LOCAL_JSW_SWAGGER) {
|
|
92
|
+
swaggerFiles = [
|
|
93
|
+
this.getProductPathsFile(LOCAL_JIRA_SWAGGER),
|
|
94
|
+
this.getProductPathsFile(LOCAL_JSM_SWAGGER),
|
|
95
|
+
this.getProductPathsFile(LOCAL_JSW_SWAGGER),
|
|
96
|
+
this.getProductPathsFile(LOCAL_CONF_SWAGGER)
|
|
97
|
+
];
|
|
91
98
|
}
|
|
92
99
|
else {
|
|
93
100
|
swaggerFiles = [
|
|
94
101
|
this.getProductPaths(PermissionLinter.JIRA_CACHE_KEY, 'https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json'),
|
|
102
|
+
this.getProductPaths(PermissionLinter.JSM_CACHE_KEY, 'https://developer.atlassian.com/cloud/jira/service-desk/swagger.v3.json'),
|
|
103
|
+
this.getProductPaths(PermissionLinter.JSW_CACHE_KEY, 'https://developer.atlassian.com/cloud/jira/software/swagger.v3.json'),
|
|
95
104
|
this.getProductPaths(PermissionLinter.CONFLUENCE_CACHE_KEY, 'https://developer.atlassian.com/cloud/confluence/swagger.v3.json')
|
|
96
105
|
];
|
|
97
106
|
}
|
|
98
|
-
const [
|
|
99
|
-
this.jira = this.processPaths(
|
|
100
|
-
this.confluence = this.processPaths(
|
|
107
|
+
const [jiraSwagger, jsmSwagger, jswSwagger, confluenceSwagger] = await Promise.all(swaggerFiles);
|
|
108
|
+
this.jira = this.processPaths(Object.assign(Object.assign(Object.assign({}, jiraSwagger.paths), jsmSwagger.paths), jswSwagger.paths));
|
|
109
|
+
this.confluence = this.processPaths(confluenceSwagger.paths);
|
|
101
110
|
this.nodeVisitors = [
|
|
102
111
|
new visitors_1.ProductNodeVisitor(),
|
|
103
112
|
new visitors_1.UIHookNodeVisitor(),
|
|
@@ -176,4 +185,6 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
176
185
|
}
|
|
177
186
|
exports.PermissionLinter = PermissionLinter;
|
|
178
187
|
PermissionLinter.JIRA_CACHE_KEY = 'permissions-jira-cache-key';
|
|
188
|
+
PermissionLinter.JSM_CACHE_KEY = 'permissions-jsm-cache-key';
|
|
189
|
+
PermissionLinter.JSW_CACHE_KEY = 'permissions-jsw-cache-key';
|
|
179
190
|
PermissionLinter.CONFLUENCE_CACHE_KEY = 'permissions-confluence-cache-key';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/lint",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-next.5",
|
|
4
4
|
"description": "Linting for forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"@types/node-fetch": "^2.5.7"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@forge/cli-shared": "2.6.0-next.
|
|
18
|
+
"@forge/cli-shared": "2.6.0-next.3",
|
|
19
19
|
"@forge/csp": "1.11.0",
|
|
20
|
-
"@forge/manifest": "3.9.0-next.
|
|
20
|
+
"@forge/manifest": "3.9.0-next.2",
|
|
21
21
|
"@typescript-eslint/typescript-estree": "^3.5.0",
|
|
22
22
|
"cross-spawn": "^7.0.1",
|
|
23
23
|
"node-fetch": "2.6.1",
|