@forge/lint 0.0.0-experimental-7c72fec → 0.0.0-experimental-edeb51b

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 CHANGED
@@ -1,17 +1,504 @@
1
1
  # @forge/lint
2
2
 
3
- ## 0.0.0-experimental-7c72fec
3
+ ## 0.0.0-experimental-edeb51b
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [d094c69]
8
+ - Updated dependencies [ba67459]
9
+ - Updated dependencies [f33aada]
10
+ - Updated dependencies [d196b41]
11
+ - Updated dependencies [e411a29]
12
+ - Updated dependencies [0accde8]
13
+ - Updated dependencies [a3bfe81]
14
+ - Updated dependencies [02839be]
15
+ - Updated dependencies [ffb508a]
16
+ - Updated dependencies [726ef79]
17
+ - @forge/manifest@0.0.0-experimental-edeb51b
18
+ - @forge/cli-shared@0.0.0-experimental-edeb51b
19
+
20
+ ## 3.0.4-next.6
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [d196b41]
25
+ - @forge/manifest@3.5.0-next.5
26
+ - @forge/cli-shared@2.4.0-next.6
27
+
28
+ ## 3.0.4-next.5
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [e411a29]
33
+ - @forge/manifest@3.5.0-next.4
34
+ - @forge/cli-shared@2.4.0-next.5
35
+
36
+ ## 3.0.4-next.4
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [d094c69]
41
+ - @forge/manifest@3.5.0-next.3
42
+ - @forge/cli-shared@2.4.0-next.4
43
+
44
+ ## 3.0.4-next.3
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [f33aada8]
49
+ - Updated dependencies [726ef79d]
50
+ - @forge/cli-shared@2.4.0-next.3
51
+
52
+ ## 3.0.4-next.2
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [02839be]
57
+ - @forge/manifest@3.5.0-next.2
58
+ - @forge/cli-shared@2.3.2-next.2
59
+
60
+ ## 3.0.4-next.1
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [a3bfe81]
65
+ - @forge/manifest@3.5.0-next.1
66
+ - @forge/cli-shared@2.3.2-next.1
67
+
68
+ ## 3.0.4-next.0
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies [ba674590]
73
+ - @forge/manifest@3.5.0-next.0
74
+ - @forge/cli-shared@2.3.2-next.0
75
+
76
+ ## 3.0.3
77
+
78
+ ### Patch Changes
79
+
80
+ - 64dd525: Make revokeToken optional in External Auth
81
+ - Updated dependencies [64dd525]
82
+ - Updated dependencies [8e2c90f]
83
+ - Updated dependencies [1c6c578]
84
+ - Updated dependencies [8b4fede]
85
+ - Updated dependencies [54bf134]
86
+ - Updated dependencies [10f147f]
87
+ - Updated dependencies [2484683]
88
+ - Updated dependencies [1a8a4bb]
89
+ - Updated dependencies [e0a44d4]
90
+ - Updated dependencies [19820d3]
91
+ - Updated dependencies [1ca8bbc]
92
+ - @forge/manifest@3.4.0
93
+ - @forge/cli-shared@2.3.1
94
+
95
+ ## 3.0.3-next.9
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [19820d3]
100
+ - @forge/manifest@3.4.0-next.9
101
+ - @forge/cli-shared@2.3.1-next.9
102
+
103
+ ## 3.0.3-next.8
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [8e2c90f]
108
+ - @forge/manifest@3.4.0-next.8
109
+ - @forge/cli-shared@2.3.1-next.8
110
+
111
+ ## 3.0.3-next.7
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [e0a44d40]
116
+ - @forge/manifest@3.4.0-next.7
117
+ - @forge/cli-shared@2.3.1-next.7
118
+
119
+ ## 3.0.3-next.6
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [1ca8bbc9]
124
+ - @forge/manifest@3.4.0-next.6
125
+ - @forge/cli-shared@2.3.1-next.6
126
+
127
+ ## 3.0.3-next.5
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [1c6c578]
132
+ - @forge/manifest@3.4.0-next.5
133
+ - @forge/cli-shared@2.3.1-next.5
134
+
135
+ ## 3.0.3-next.4
136
+
137
+ ### Patch Changes
138
+
139
+ - 64dd525: Make revokeToken optional in External Auth
140
+ - Updated dependencies [64dd525]
141
+ - Updated dependencies [10f147f]
142
+ - @forge/manifest@3.4.0-next.4
143
+ - @forge/cli-shared@2.3.1-next.4
144
+
145
+ ## 3.0.3-next.3
146
+
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies [1a8a4bb]
150
+ - @forge/manifest@3.3.1-next.3
151
+ - @forge/cli-shared@2.3.1-next.3
152
+
153
+ ## 3.0.3-next.2
154
+
155
+ ### Patch Changes
156
+
157
+ - Updated dependencies [8b4fede]
158
+ - @forge/manifest@3.3.1-next.2
159
+ - @forge/cli-shared@2.3.1-next.2
160
+
161
+ ## 3.0.3-next.1
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies [24846832]
166
+ - @forge/manifest@3.3.1-next.1
167
+ - @forge/cli-shared@2.3.1-next.1
168
+
169
+ ## 3.0.3-next.0
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies [54bf134]
174
+ - @forge/manifest@3.3.1-next.0
175
+ - @forge/cli-shared@2.3.1-next.0
176
+
177
+ ## 3.0.2
178
+
179
+ ### Patch Changes
180
+
181
+ - Updated dependencies [fcd9580]
182
+ - Updated dependencies [47a71a6]
183
+ - Updated dependencies [6c44d2b]
184
+ - Updated dependencies [e95919f]
185
+ - Updated dependencies [56164fe]
186
+ - Updated dependencies [949bd40]
187
+ - Updated dependencies [cf2420d]
188
+ - Updated dependencies [e822a8a]
189
+ - Updated dependencies [720953f]
190
+ - Updated dependencies [2420378]
191
+ - Updated dependencies [051ed1f]
192
+ - Updated dependencies [ad94136]
193
+ - Updated dependencies [e65d33e]
194
+ - Updated dependencies [ae111cd]
195
+ - Updated dependencies [8e35955]
196
+ - Updated dependencies [c255b24]
197
+ - Updated dependencies [f894871]
198
+ - @forge/manifest@3.3.0
199
+ - @forge/cli-shared@2.3.0
200
+ - @forge/csp@1.10.0
201
+
202
+ ## 3.0.2-next.12
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [720953f]
207
+ - @forge/manifest@3.3.0-next.9
208
+ - @forge/cli-shared@2.3.0-next.11
209
+
210
+ ## 3.0.2-next.11
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [fcd95803]
215
+ - Updated dependencies [47a71a62]
216
+ - Updated dependencies [e65d33e6]
217
+ - @forge/manifest@3.3.0-next.8
218
+ - @forge/cli-shared@2.3.0-next.10
219
+
220
+ ## 3.0.2-next.10
221
+
222
+ ### Patch Changes
223
+
224
+ - Updated dependencies [cf2420d2]
225
+ - @forge/cli-shared@2.3.0-next.9
226
+
227
+ ## 3.0.2-next.9
228
+
229
+ ### Patch Changes
230
+
231
+ - Updated dependencies [8e35955]
232
+ - @forge/manifest@3.3.0-next.7
233
+ - @forge/cli-shared@2.3.0-next.8
234
+
235
+ ## 3.0.2-next.8
236
+
237
+ ### Patch Changes
238
+
239
+ - Updated dependencies [ad94136]
240
+ - @forge/manifest@3.3.0-next.6
241
+ - @forge/cli-shared@2.3.0-next.7
242
+
243
+ ## 3.0.2-next.7
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies [e95919f]
248
+ - Updated dependencies [f894871]
249
+ - @forge/csp@1.10.0-next.1
250
+ - @forge/manifest@3.3.0-next.5
251
+ - @forge/cli-shared@2.3.0-next.6
252
+
253
+ ## 3.0.2-next.6
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies [ae111cd]
258
+ - @forge/manifest@3.3.0-next.4
259
+ - @forge/cli-shared@2.3.0-next.5
260
+
261
+ ## 3.0.2-next.5
262
+
263
+ ### Patch Changes
264
+
265
+ - Updated dependencies [6c44d2b]
266
+ - Updated dependencies [051ed1f]
267
+ - @forge/manifest@3.3.0-next.3
268
+ - @forge/cli-shared@2.3.0-next.4
269
+
270
+ ## 3.0.2-next.4
271
+
272
+ ### Patch Changes
273
+
274
+ - Updated dependencies [e822a8a]
275
+ - Updated dependencies [c255b24]
276
+ - @forge/manifest@3.3.0-next.2
277
+ - @forge/cli-shared@2.3.0-next.3
278
+
279
+ ## 3.0.2-next.3
280
+
281
+ ### Patch Changes
282
+
283
+ - Updated dependencies [24203783]
284
+ - @forge/manifest@3.3.0-next.1
285
+ - @forge/cli-shared@2.3.0-next.2
286
+
287
+ ## 3.0.2-next.2
288
+
289
+ ### Patch Changes
290
+
291
+ - Updated dependencies [56164fe]
292
+ - @forge/csp@1.10.0-next.0
293
+
294
+ ## 3.0.2-next.1
4
295
 
5
296
  ### Patch Changes
6
297
 
7
- - Updated dependencies [7c72fec]
8
298
  - Updated dependencies [c145946]
299
+ - @forge/manifest@3.3.0-next.0
300
+ - @forge/cli-shared@2.3.0-next.1
301
+
302
+ ## 3.0.2-next.0
303
+
304
+ ### Patch Changes
305
+
306
+ - Updated dependencies [949bd40]
307
+ - @forge/cli-shared@2.3.0-next.0
308
+
309
+ ## 3.0.1
310
+
311
+ ### Patch Changes
312
+
313
+ - Updated dependencies [7f869f7]
314
+ - Updated dependencies [72e020c]
315
+ - Updated dependencies [b2cef71]
316
+ - Updated dependencies [254b239]
317
+ - Updated dependencies [47744fc]
318
+ - Updated dependencies [860c4fb]
319
+ - Updated dependencies [66e969f]
320
+ - Updated dependencies [2c635f9]
321
+ - @forge/manifest@3.2.0
322
+ - @forge/cli-shared@2.2.2
323
+
324
+ ## 3.0.1-next.6
325
+
326
+ ### Patch Changes
327
+
328
+ - Updated dependencies [860c4fb0]
329
+ - @forge/manifest@3.2.0-next.6
330
+ - @forge/cli-shared@2.2.2-next.6
331
+
332
+ ## 3.0.1-next.5
333
+
334
+ ### Patch Changes
335
+
336
+ - Updated dependencies [72e020c]
337
+ - @forge/manifest@3.2.0-next.5
338
+ - @forge/cli-shared@2.2.2-next.5
339
+
340
+ ## 3.0.1-next.4
341
+
342
+ ### Patch Changes
343
+
344
+ - Updated dependencies [254b2397]
345
+ - @forge/manifest@3.2.0-next.4
346
+ - @forge/cli-shared@2.2.2-next.4
347
+
348
+ ## 3.0.1-next.3
349
+
350
+ ### Patch Changes
351
+
352
+ - Updated dependencies [b2cef71d]
353
+ - @forge/manifest@3.2.0-next.3
354
+ - @forge/cli-shared@2.2.2-next.3
355
+
356
+ ## 3.0.1-next.2
357
+
358
+ ### Patch Changes
359
+
360
+ - Updated dependencies [7f869f7]
361
+ - @forge/manifest@3.2.0-next.2
362
+ - @forge/cli-shared@2.2.2-next.2
363
+
364
+ ## 3.0.1-next.1
365
+
366
+ ### Patch Changes
367
+
368
+ - Updated dependencies [47744fc]
369
+ - @forge/manifest@3.1.1-next.1
370
+ - @forge/cli-shared@2.2.2-next.1
371
+
372
+ ## 3.0.1-next.0
373
+
374
+ ### Patch Changes
375
+
376
+ - Updated dependencies [2c635f9]
377
+ - @forge/manifest@3.1.1-next.0
378
+ - @forge/cli-shared@2.2.2-next.0
379
+
380
+ ## 3.0.0
381
+
382
+ ### Major Changes
383
+
384
+ - 4922d09: Only errors set the process exitCode to 1, warnings do not anymore.
385
+
386
+ ### Minor Changes
387
+
388
+ - 83ca609: Adding environment variables to override production swagger with local files.
389
+ - 037c31a5: Upgrade webpack from 4 to 5 and other relavent packages to fix the issue for node17+ (openssl change)
390
+
391
+ ### Patch Changes
392
+
393
+ - ffa0050: Accept both deprecated scopes and granular scopes when verifying scopes required for Forge UI hooks.
394
+ - f5d4a63: Fix unhandled error when invalid method used for Product REST API endpoint.
395
+ - 1f7c428: Accept both deprecated scopes and granular scopes when verifying scopes required for REST product endpoints.
396
+ - 2e70a0b: Accept both granular and deprecated scopes when verifying scopes required for Content Properties.
397
+ - Updated dependencies [debe251]
398
+ - Updated dependencies [037c31a5]
399
+ - Updated dependencies [f6901fd]
9
400
  - Updated dependencies [813f8f3]
10
401
  - Updated dependencies [8ee1c58]
402
+ - Updated dependencies [67d2e17]
403
+ - Updated dependencies [14102be]
404
+ - Updated dependencies [7b2d17a]
405
+ - Updated dependencies [8aaa65c]
406
+ - Updated dependencies [d3ccc04]
11
407
  - Updated dependencies [5152239]
12
- - @forge/manifest@0.0.0-experimental-7c72fec
13
- - @forge/cli-shared@0.0.0-experimental-7c72fec
14
- - @forge/csp@0.0.0-experimental-7c72fec
408
+ - @forge/manifest@3.1.0
409
+ - @forge/cli-shared@2.2.1
410
+
411
+ ## 3.0.0-next.11
412
+
413
+ ### Patch Changes
414
+
415
+ - Updated dependencies [8aaa65c]
416
+ - @forge/manifest@3.1.0-next.9
417
+ - @forge/cli-shared@2.2.1-next.9
418
+
419
+ ## 3.0.0-next.10
420
+
421
+ ### Patch Changes
422
+
423
+ - f5d4a636: Fix unhandled error when invalid method used for Product REST API endpoint.
424
+ - Updated dependencies [67d2e17c]
425
+ - @forge/manifest@3.1.0-next.8
426
+ - @forge/cli-shared@2.2.1-next.8
427
+
428
+ ## 3.0.0-next.9
429
+
430
+ ### Minor Changes
431
+
432
+ - 037c31a: Upgrade webpack from 4 to 5 and other relavent packages to fix the issue for node17+ (openssl change)
433
+
434
+ ### Patch Changes
435
+
436
+ - Updated dependencies [037c31a]
437
+ - @forge/manifest@3.1.0-next.7
438
+ - @forge/cli-shared@2.2.1-next.7
439
+
440
+ ## 3.0.0-next.8
441
+
442
+ ### Minor Changes
443
+
444
+ - 83ca609e: Adding environment variables to override production swagger with local files.
445
+
446
+ ## 3.0.0-next.7
447
+
448
+ ### Patch Changes
449
+
450
+ - Updated dependencies [7b2d17a]
451
+ - @forge/manifest@3.1.0-next.6
452
+ - @forge/cli-shared@2.2.1-next.6
453
+
454
+ ## 3.0.0-next.6
455
+
456
+ ### Major Changes
457
+
458
+ - 4922d09: Only errors set the process exitCode to 1, warnings do not anymore.
459
+
460
+ ## 2.0.1-next.5
461
+
462
+ ### Patch Changes
463
+
464
+ - Updated dependencies [f6901fd]
465
+ - @forge/manifest@3.1.0-next.5
466
+ - @forge/cli-shared@2.2.1-next.5
467
+
468
+ ## 2.0.1-next.4
469
+
470
+ ### Patch Changes
471
+
472
+ - 2e70a0b: Accept both granular and deprecated scopes when verifying scopes required for Content Properties.
473
+ - Updated dependencies [d3ccc04]
474
+ - @forge/manifest@3.1.0-next.4
475
+ - @forge/cli-shared@2.2.1-next.4
476
+
477
+ ## 2.0.1-next.3
478
+
479
+ ### Patch Changes
480
+
481
+ - 1f7c428: Accept both deprecated scopes and granular scopes when verifying scopes required for REST product endpoints.
482
+ - Updated dependencies [debe251]
483
+ - @forge/manifest@3.1.0-next.3
484
+ - @forge/cli-shared@2.2.1-next.3
485
+
486
+ ## 2.0.1-next.2
487
+
488
+ ### Patch Changes
489
+
490
+ - ffa0050: Accept both deprecated scopes and granular scopes when verifying scopes required for Forge UI hooks.
491
+ - Updated dependencies [14102be]
492
+ - @forge/manifest@3.1.0-next.2
493
+ - @forge/cli-shared@2.2.1-next.2
494
+
495
+ ## 2.0.1-next.1
496
+
497
+ ### Patch Changes
498
+
499
+ - Updated dependencies [8ee1c58]
500
+ - @forge/manifest@3.1.0-next.1
501
+ - @forge/cli-shared@2.2.1-next.1
15
502
 
16
503
  ## 2.0.1-next.0
17
504
 
@@ -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,MAA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UAAU,eAAe,UAAU,EAAE,4BAAuB,IA+CrG,CAAC;AAEF,eAAO,MAAM,YAAY,gBAAiB,UAAU,EAAE,KAAG,YAQxD,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,UACR,OAAO,QAAQ,oBACN,OAAO,EAAE,CAAC,QAAQ,CAAC,aAAa,KAChD,OAAO,CAAC,SAAS,CAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBACF,MAAM,EAAE,YACX,QAAQ,eACL,MAAM,UACX,UAAU,6BAhBR,MAAM,UACR,OAAO,QAAQ,oBACN,OAAO,EAAE,CAAC,QAAQ,CAAC,aAAa,KAChD,OAAO,CAAC,SAAS,CAAC,YAeV,eAAe,EAAE,KAOzB,OAAO,CAAC,UAAU,EAAE,CAmCtB,CAAC;AAEF,eAAO,MAAM,QAAQ,WACX,UAAU,WACV,eAAe,KACtB,OAAO,CAAC,UAAU,EAAE,CAGtB,CAAC"}
package/out/lint/lint.js CHANGED
@@ -55,7 +55,9 @@ exports.reportLintResults = (logger, lintResults, showSummary = true) => {
55
55
  logger.info(cli_shared_1.Text.lint.noFixableProblems);
56
56
  }
57
57
  }
58
- process.exitCode = 1;
58
+ if (numErrors) {
59
+ process.exitCode = 1;
60
+ }
59
61
  }
60
62
  };
61
63
  exports.problemCount = (lintResults) => {
@@ -32,6 +32,7 @@ export declare class PermissionLinter extends BaseLinter<ApiCall, PermissionLint
32
32
  protected getFixer(): ((errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState) => Promise<LintFixState>) | undefined;
33
33
  protected addLintCriteriaMatch(apiCall: ApiCall, filepath: string): void;
34
34
  getProductPaths(cacheKey: string, url: string): Promise<SwaggerFormat>;
35
+ getProductPathsFile(url: string): Promise<SwaggerFormat>;
35
36
  private processPaths;
36
37
  }
37
38
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAA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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;IAmCvC,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;IAWnF,OAAO,CAAC,YAAY;CAarB"}
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,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AAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAWtE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrE,OAAO,CAAC,YAAY;CAarB"}
@@ -8,6 +8,7 @@ const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
8
8
  const api_call_interface_1 = require("./api-call-interface");
9
9
  const verifiers_1 = require("./verifiers");
10
10
  const visitors_1 = require("./visitors");
11
+ const fs_1 = tslib_1.__importDefault(require("fs"));
11
12
  exports.NON_FWD_SLASH_REGEX = '[^\\/\\s]*';
12
13
  const CACHE_KEY = 'PERMISSIONS_LINTER';
13
14
  const ONE_HOUR_MS = 1000 * 60 * 60;
@@ -81,10 +82,20 @@ class PermissionLinter extends base_linter_1.default {
81
82
  }
82
83
  async bootstrap() {
83
84
  this.cache = cli_shared_1.CachedConf.getCache(CACHE_KEY);
84
- const [jira, confluence] = await Promise.all([
85
- this.getProductPaths(PermissionLinter.JIRA_CACHE_KEY, 'https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json'),
86
- this.getProductPaths(PermissionLinter.CONFLUENCE_CACHE_KEY, 'https://developer.atlassian.com/cloud/confluence/swagger.v3.json')
87
- ]);
85
+ const LOCAL_CONF_SWAGGER = process.env.LOCAL_CONF_SWAGGER;
86
+ const LOCAL_JIRA_SWAGGER = process.env.LOCAL_JIRA_SWAGGER;
87
+ const USE_LOCAL_SWAGGER = process.env.USE_LOCAL_SWAGGER;
88
+ let swaggerFiles;
89
+ if (USE_LOCAL_SWAGGER && LOCAL_CONF_SWAGGER && LOCAL_JIRA_SWAGGER) {
90
+ swaggerFiles = [this.getProductPathsFile(LOCAL_JIRA_SWAGGER), this.getProductPathsFile(LOCAL_CONF_SWAGGER)];
91
+ }
92
+ else {
93
+ swaggerFiles = [
94
+ this.getProductPaths(PermissionLinter.JIRA_CACHE_KEY, 'https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json'),
95
+ this.getProductPaths(PermissionLinter.CONFLUENCE_CACHE_KEY, 'https://developer.atlassian.com/cloud/confluence/swagger.v3.json')
96
+ ];
97
+ }
98
+ const [jira, confluence] = await Promise.all(swaggerFiles);
88
99
  this.jira = this.processPaths(jira.paths);
89
100
  this.confluence = this.processPaths(confluence.paths);
90
101
  this.nodeVisitors = [
@@ -150,6 +161,10 @@ class PermissionLinter extends base_linter_1.default {
150
161
  }
151
162
  return cached;
152
163
  }
164
+ async getProductPathsFile(url) {
165
+ const response = fs_1.default.readFileSync(url);
166
+ return JSON.parse(response.toString());
167
+ }
153
168
  processPaths(paths) {
154
169
  const pathMap = new Map();
155
170
  Object.keys(paths).forEach((path) => {
@@ -1,10 +1,15 @@
1
1
  import { LintClass, LintResultRule } from '../../../linter-interface';
2
2
  import { BaseLintIssueVerifier, LintIssueVerifier } from '../../verifier-interface';
3
3
  import { ContentPropertyApiCall } from '../api-call-interface';
4
- export declare const CONTENT_PROPERTY_PERMISSIONS_MAP: Record<string, Record<string, string[]>>;
4
+ declare type ContentPropertyPermissions = {
5
+ current: string[];
6
+ deprecated: string[];
7
+ };
8
+ export declare const CONTENT_PROPERTY_PERMISSIONS_MAP: Record<string, Record<string, ContentPropertyPermissions>>;
5
9
  export declare class ContentPropertyVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<ContentPropertyApiCall[]> {
6
10
  protected getLintClass(): LintClass;
7
11
  process(apiCalls: ContentPropertyApiCall[]): Promise<LintResultRule[]>;
8
12
  private getMissingScopes;
9
13
  }
14
+ export {};
10
15
  //# sourceMappingURL=content-property-verifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-property-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/content-property-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAqBrF,CAAC;AAEF,qBAAa,uBACX,SAAQ,qBACR,YAAW,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;IACtD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAuBnF,OAAO,CAAC,gBAAgB;CAQzB"}
1
+ {"version":3,"file":"content-property-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/content-property-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,aAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAyDvG,CAAC;AAEF,qBAAa,uBACX,SAAQ,qBACR,YAAW,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;IACtD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAuBnF,OAAO,CAAC,gBAAgB;CAyBzB"}
@@ -7,24 +7,60 @@ const text_1 = require("../../../text");
7
7
  const verifier_interface_1 = require("../../verifier-interface");
8
8
  exports.CONTENT_PROPERTY_PERMISSIONS_MAP = {
9
9
  onJiraIssue: {
10
- get: ['read:jira-work'],
11
- set: ['write:jira-work'],
12
- delete: ['write:jira-work']
10
+ get: {
11
+ current: ['read:issue.property:jira'],
12
+ deprecated: ['read:jira-work']
13
+ },
14
+ set: {
15
+ current: ['write:issue.property:jira'],
16
+ deprecated: ['write:jira-work']
17
+ },
18
+ delete: {
19
+ current: ['delete:issue.property:jira'],
20
+ deprecated: ['write:jira-work']
21
+ }
13
22
  },
14
23
  onJiraProject: {
15
- get: ['read:jira-work'],
16
- set: ['manage:jira-project'],
17
- delete: ['manage:jira-project']
24
+ get: {
25
+ current: ['read:project.property:jira'],
26
+ deprecated: ['read:jira-work']
27
+ },
28
+ set: {
29
+ current: ['write:project.property:jira'],
30
+ deprecated: ['manage:jira-project']
31
+ },
32
+ delete: {
33
+ current: ['delete:project.property:jira'],
34
+ deprecated: ['manage:jira-project']
35
+ }
18
36
  },
19
37
  onConfluencePage: {
20
- get: ['read:confluence-props'],
21
- set: ['read:confluence-props', 'write:confluence-props'],
22
- delete: ['write:confluence-props']
38
+ get: {
39
+ current: ['read:content-details:confluence'],
40
+ deprecated: ['read:confluence-props']
41
+ },
42
+ set: {
43
+ current: ['read:content.property:confluence', 'write:content.property:confluence'],
44
+ deprecated: ['read:confluence-props', 'write:confluence-props']
45
+ },
46
+ delete: {
47
+ current: ['write:content.property:confluence'],
48
+ deprecated: ['write:confluence-props']
49
+ }
23
50
  },
24
51
  onConfluenceSpace: {
25
- get: ['read:confluence-props'],
26
- set: ['read:confluence-props', 'write:confluence-props'],
27
- delete: ['write:confluence-props']
52
+ get: {
53
+ current: ['read:content-details:confluence'],
54
+ deprecated: ['read:confluence-props']
55
+ },
56
+ set: {
57
+ current: ['read:space.property:confluence', 'write:space.property:confluence'],
58
+ deprecated: ['read:confluence-props', 'write:confluence-props']
59
+ },
60
+ delete: {
61
+ current: ['write:space.property:confluence'],
62
+ deprecated: ['write:confluence-props']
63
+ }
28
64
  }
29
65
  };
30
66
  class ContentPropertyVerifier extends verifier_interface_1.BaseLintIssueVerifier {
@@ -50,10 +86,24 @@ class ContentPropertyVerifier extends verifier_interface_1.BaseLintIssueVerifier
50
86
  getMissingScopes({ context, method }) {
51
87
  var _a, _b;
52
88
  const existingScopes = (_b = (_a = this.manifest) === null || _a === void 0 ? void 0 : _a.permissions) === null || _b === void 0 ? void 0 : _b.scopes;
53
- const requiredScopes = exports.CONTENT_PROPERTY_PERMISSIONS_MAP[context][method];
54
- if (!existingScopes)
55
- return requiredScopes;
56
- return requiredScopes.filter((requiredScope) => !existingScopes.includes(requiredScope));
89
+ const requiredScopesCurrent = exports.CONTENT_PROPERTY_PERMISSIONS_MAP[context][method]['current'];
90
+ const requiredScopesDeprecated = exports.CONTENT_PROPERTY_PERMISSIONS_MAP[context][method]['deprecated'];
91
+ const missingCurrentPerms = requiredScopesCurrent.filter((perm) => !(existingScopes === null || existingScopes === void 0 ? void 0 : existingScopes.includes(perm)));
92
+ if (missingCurrentPerms.length == 0)
93
+ return [];
94
+ let missingDeprecatedPerms = null;
95
+ if (requiredScopesDeprecated) {
96
+ missingDeprecatedPerms = requiredScopesDeprecated.filter((perm) => !(existingScopes === null || existingScopes === void 0 ? void 0 : existingScopes.includes(perm)));
97
+ if (missingDeprecatedPerms.length == 0)
98
+ return [];
99
+ }
100
+ if (missingCurrentPerms.length < requiredScopesCurrent.length) {
101
+ return missingCurrentPerms;
102
+ }
103
+ if (missingDeprecatedPerms && missingDeprecatedPerms.length < requiredScopesDeprecated.length) {
104
+ return missingDeprecatedPerms;
105
+ }
106
+ return requiredScopesCurrent;
57
107
  }
58
108
  }
59
109
  exports.ContentPropertyVerifier = ContentPropertyVerifier;
@@ -27,6 +27,7 @@ export declare class ProductVerifier extends BaseLintIssueVerifier implements Li
27
27
  private lookupApiCall;
28
28
  private getMissingPermissionScopes;
29
29
  private getRequiredScopes;
30
+ private getRequiredDeprecatedScopes;
30
31
  }
31
32
  export {};
32
33
  //# sourceMappingURL=product-verifier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/product-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC1B,2BAA2B,CAAC,EAAE,qBAAqB,EAAE,CAAC;KACvD,CAAC;CACH;AAED,UAAU,aAAa;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B;AAED,oBAAY,uBAAuB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEjE,qBAAa,eAAgB,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAI9F,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHxB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,MAAM;IAKlC,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoC3E,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,0BAA0B;IAQlC,OAAO,CAAC,iBAAiB;CAoB1B"}
1
+ {"version":3,"file":"product-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/product-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC1B,2BAA2B,CAAC,EAAE,qBAAqB,EAAE,CAAC;KACvD,CAAC;CACH;AAED,UAAU,aAAa;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B;AAED,oBAAY,uBAAuB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEjE,qBAAa,eAAgB,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAI9F,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHxB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,MAAM;IAKlC,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoC3E,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,0BAA0B;IA8BlC,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,2BAA2B;CAWpC"}
@@ -53,24 +53,46 @@ class ProductVerifier extends verifier_interface_1.BaseLintIssueVerifier {
53
53
  }
54
54
  getMissingPermissionScopes(apiCall) {
55
55
  var _a, _b, _c;
56
- const requiredScopes = this.getRequiredScopes(apiCall);
56
+ const currentScopes = this.getRequiredScopes(apiCall);
57
+ const deprecatedScopes = this.getRequiredDeprecatedScopes(apiCall);
57
58
  if (!((_c = (_b = (_a = this.manifest) === null || _a === void 0 ? void 0 : _a.permissions) === null || _b === void 0 ? void 0 : _b.scopes) === null || _c === void 0 ? void 0 : _c.length)) {
58
- return requiredScopes;
59
+ return currentScopes;
59
60
  }
60
- return requiredScopes.filter((scope) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(scope)); });
61
+ const missingCurrentScopes = currentScopes.filter((scope) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(scope)); });
62
+ if (!missingCurrentScopes.length)
63
+ return [];
64
+ const missingDeprecatedScopes = deprecatedScopes.filter((scope) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(scope)); });
65
+ if (deprecatedScopes.length && !missingDeprecatedScopes.length)
66
+ return [];
67
+ if (missingCurrentScopes.length < currentScopes.length) {
68
+ return missingCurrentScopes;
69
+ }
70
+ if (missingDeprecatedScopes.length < deprecatedScopes.length) {
71
+ return missingDeprecatedScopes;
72
+ }
73
+ return missingCurrentScopes;
61
74
  }
62
75
  getRequiredScopes({ regex, method }) {
63
- var _a, _b, _c;
76
+ var _a, _b, _c, _d;
64
77
  if (!regex)
65
78
  return [];
66
- const oAuth2Scopes = (_a = this.pathMap.get(regex)) === null || _a === void 0 ? void 0 : _a.methods[method]['x-atlassian-oauth2-scopes'];
79
+ const oAuth2Scopes = (_b = (_a = this.pathMap.get(regex)) === null || _a === void 0 ? void 0 : _a.methods[method]) === null || _b === void 0 ? void 0 : _b['x-atlassian-oauth2-scopes'];
67
80
  if (oAuth2Scopes) {
68
81
  return array_prototype_flatmap_1.default(oAuth2Scopes.filter((scope) => scope.state === 'Current').map((scope) => scope.scopes), (x) => x);
69
82
  }
70
- const swaggerEntries = (_c = (_b = this.pathMap.get(regex)) === null || _b === void 0 ? void 0 : _b.methods[method]) === null || _c === void 0 ? void 0 : _c.security;
83
+ const swaggerEntries = (_d = (_c = this.pathMap.get(regex)) === null || _c === void 0 ? void 0 : _c.methods[method]) === null || _d === void 0 ? void 0 : _d.security;
71
84
  if (!swaggerEntries)
72
85
  return [];
73
86
  return swaggerEntries === null || swaggerEntries === void 0 ? void 0 : swaggerEntries.reduce((prev, curr) => [...prev, ...(curr['OAuth2'] || []), ...(curr['oAuthDefinitions'] || [])], []);
74
87
  }
88
+ getRequiredDeprecatedScopes({ regex, method }) {
89
+ var _a, _b;
90
+ if (!regex)
91
+ return [];
92
+ const oAuth2Scopes = (_b = (_a = this.pathMap.get(regex)) === null || _a === void 0 ? void 0 : _a.methods[method]) === null || _b === void 0 ? void 0 : _b['x-atlassian-oauth2-scopes'];
93
+ if (!oAuth2Scopes)
94
+ return [];
95
+ return array_prototype_flatmap_1.default(oAuth2Scopes.filter((scope) => scope.state === 'Deprecated').map((scope) => scope.scopes), (x) => x);
96
+ }
75
97
  }
76
98
  exports.ProductVerifier = ProductVerifier;
@@ -1 +1 @@
1
- {"version":3,"file":"ui-hook-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/ui-hook-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAiBpF,qBAAa,cAAe,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAC/F,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAiB1E,OAAO,CAAC,WAAW;CAepB"}
1
+ {"version":3,"file":"ui-hook-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/ui-hook-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AA2BpF,qBAAa,cAAe,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAC/F,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoC1E,OAAO,CAAC,WAAW;CAepB"}
@@ -5,17 +5,22 @@ const linter_interface_1 = require("../../../linter-interface");
5
5
  const verifier_interface_1 = require("../../verifier-interface");
6
6
  const text_1 = require("../../../text");
7
7
  const FORGE_UI_HOOK_PERMISSIONS = {
8
- useContentProperty: [
9
- 'read:content-details:confluence',
10
- 'read:content.property:confluence',
11
- 'write:content.property:confluence'
12
- ],
13
- useSpaceProperty: [
14
- 'read:content-details:confluence',
15
- 'read:space.property:confluence',
16
- 'write:space.property:confluence'
17
- ],
18
- useIssueProperty: ['read:issue.property:jira']
8
+ useContentProperty: {
9
+ current: [
10
+ 'read:content-details:confluence',
11
+ 'read:content.property:confluence',
12
+ 'write:content.property:confluence'
13
+ ],
14
+ deprecated: ['read:confluence-props', 'write:confluence-props']
15
+ },
16
+ useSpaceProperty: {
17
+ current: ['read:content-details:confluence', 'read:space.property:confluence', 'write:space.property:confluence'],
18
+ deprecated: ['read:confluence-props', 'write:confluence-props']
19
+ },
20
+ useIssueProperty: {
21
+ current: ['read:issue.property:jira'],
22
+ deprecated: ['read:jira-work', 'write:jira-work']
23
+ }
19
24
  };
20
25
  class UIHookVerifier extends verifier_interface_1.BaseLintIssueVerifier {
21
26
  getLintClass() {
@@ -23,17 +28,30 @@ class UIHookVerifier extends verifier_interface_1.BaseLintIssueVerifier {
23
28
  }
24
29
  async process(apiCalls) {
25
30
  const rules = [];
26
- apiCalls.forEach((apiCall) => {
31
+ for (const apiCall of apiCalls) {
27
32
  const requiredPermissions = FORGE_UI_HOOK_PERMISSIONS[apiCall.hookName];
28
33
  if (!requiredPermissions)
29
34
  return rules;
30
- requiredPermissions.forEach((requiredPermission) => {
31
- var _a, _b;
32
- if (!((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(requiredPermission))) {
33
- rules.push(this.getHookRule(apiCall, requiredPermission));
34
- }
35
- });
36
- });
35
+ const { current, deprecated } = requiredPermissions;
36
+ const missingCurrentPerms = current.filter((perm) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(perm)); });
37
+ if (!missingCurrentPerms.length)
38
+ continue;
39
+ let missingDeprecatedPerms = null;
40
+ if (deprecated) {
41
+ missingDeprecatedPerms = deprecated.filter((perm) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(perm)); });
42
+ if (!missingDeprecatedPerms.length)
43
+ continue;
44
+ }
45
+ if (missingCurrentPerms.length < current.length) {
46
+ missingCurrentPerms.forEach((perm) => rules.push(this.getHookRule(apiCall, perm)));
47
+ continue;
48
+ }
49
+ if (deprecated && missingDeprecatedPerms && (missingDeprecatedPerms === null || missingDeprecatedPerms === void 0 ? void 0 : missingDeprecatedPerms.length) < deprecated.length) {
50
+ missingDeprecatedPerms.forEach((perm) => rules.push(this.getHookRule(apiCall, perm)));
51
+ continue;
52
+ }
53
+ missingCurrentPerms.forEach((perm) => rules.push(this.getHookRule(apiCall, perm)));
54
+ }
37
55
  return rules;
38
56
  }
39
57
  getHookRule(apiCall, permission) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/lint",
3
- "version": "0.0.0-experimental-7c72fec",
3
+ "version": "0.0.0-experimental-edeb51b",
4
4
  "description": "Linting for forge apps",
5
5
  "main": "out/index.js",
6
6
  "license": "UNLICENSED",
@@ -11,16 +11,16 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@types/cross-spawn": "^6.0.1",
14
- "@types/eslint": "^6.8.0",
14
+ "@types/eslint": "8.2.2",
15
15
  "@types/node-fetch": "^2.5.7"
16
16
  },
17
17
  "dependencies": {
18
- "@forge/cli-shared": "0.0.0-experimental-7c72fec",
19
- "@forge/csp": "0.0.0-experimental-7c72fec",
20
- "@forge/manifest": "0.0.0-experimental-7c72fec",
18
+ "@forge/cli-shared": "0.0.0-experimental-edeb51b",
19
+ "@forge/csp": "1.10.0",
20
+ "@forge/manifest": "0.0.0-experimental-edeb51b",
21
21
  "@typescript-eslint/typescript-estree": "^3.5.0",
22
22
  "cross-spawn": "^7.0.1",
23
- "node-fetch": "^2.6.1",
23
+ "node-fetch": "2.6.1",
24
24
  "atlassian-openapi": "^1.0.13"
25
25
  }
26
26
  }