@forge/lint 5.11.7-next.2 → 5.12.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 +62 -0
  2. package/out/lint/lint.d.ts.map +1 -1
  3. package/out/lint/lint.js +2 -0
  4. package/out/lint/linters/llm-module-linter/llm-linter-interface.d.ts +9 -0
  5. package/out/lint/linters/llm-module-linter/llm-linter-interface.d.ts.map +1 -0
  6. package/out/lint/linters/llm-module-linter/llm-linter-interface.js +4 -0
  7. package/out/lint/linters/llm-module-linter/llm-module-linter.d.ts +14 -0
  8. package/out/lint/linters/llm-module-linter/llm-module-linter.d.ts.map +1 -0
  9. package/out/lint/linters/llm-module-linter/llm-module-linter.js +49 -0
  10. package/out/lint/linters/llm-module-linter/llm-node-visitor.d.ts +9 -0
  11. package/out/lint/linters/llm-module-linter/llm-node-visitor.d.ts.map +1 -0
  12. package/out/lint/linters/llm-module-linter/llm-node-visitor.js +29 -0
  13. package/out/lint/linters/llm-module-linter/llm-verifier.d.ts +8 -0
  14. package/out/lint/linters/llm-module-linter/llm-verifier.d.ts.map +1 -0
  15. package/out/lint/linters/llm-module-linter/llm-verifier.js +26 -0
  16. package/out/lint/linters/permission-linter/api-call-interface.d.ts +7 -2
  17. package/out/lint/linters/permission-linter/api-call-interface.d.ts.map +1 -1
  18. package/out/lint/linters/permission-linter/api-call-interface.js +1 -0
  19. package/out/lint/linters/permission-linter/permission-linter.d.ts +2 -1
  20. package/out/lint/linters/permission-linter/permission-linter.d.ts.map +1 -1
  21. package/out/lint/linters/permission-linter/permission-linter.js +9 -3
  22. package/out/lint/linters/permission-linter/verifiers/index.d.ts +3 -2
  23. package/out/lint/linters/permission-linter/verifiers/index.d.ts.map +1 -1
  24. package/out/lint/linters/permission-linter/verifiers/index.js +3 -2
  25. package/out/lint/linters/permission-linter/verifiers/realtime-api-verifier.d.ts +8 -0
  26. package/out/lint/linters/permission-linter/verifiers/realtime-api-verifier.d.ts.map +1 -0
  27. package/out/lint/linters/permission-linter/verifiers/realtime-api-verifier.js +28 -0
  28. package/out/lint/linters/permission-linter/visitors/index.d.ts +3 -2
  29. package/out/lint/linters/permission-linter/visitors/index.d.ts.map +1 -1
  30. package/out/lint/linters/permission-linter/visitors/index.js +3 -2
  31. package/out/lint/linters/permission-linter/visitors/realtime-api-node-visitor.d.ts +7 -0
  32. package/out/lint/linters/permission-linter/visitors/realtime-api-node-visitor.d.ts.map +1 -0
  33. package/out/lint/linters/permission-linter/visitors/realtime-api-node-visitor.js +35 -0
  34. package/out/lint/text/messages.d.ts +8 -0
  35. package/out/lint/text/messages.d.ts.map +1 -1
  36. package/out/lint/text/messages.js +8 -0
  37. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # @forge/lint
2
2
 
3
+ ## 5.12.0-next.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [49bbec0]
8
+ - @forge/cli-shared@8.9.0-next.7
9
+
10
+ ## 5.12.0-next.9
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [5efbe5a]
15
+ - @forge/cli-shared@8.9.0-next.6
16
+
17
+ ## 5.12.0-next.8
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [ef033a5]
22
+ - @forge/cli-shared@8.8.2-next.5
23
+
24
+ ## 5.12.0-next.7
25
+
26
+ ### Minor Changes
27
+
28
+ - 414eba9: Add LLM module to manifest if sdk in use
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [78efec7]
33
+ - @forge/manifest@11.0.0-next.3
34
+ - @forge/cli-shared@8.8.2-next.4
35
+
36
+ ## 5.12.0-next.6
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [ee02b2c]
41
+ - @forge/csp@5.3.0-next.1
42
+
43
+ ## 5.12.0-next.5
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [260eb24]
48
+ - @forge/manifest@11.0.0-next.2
49
+ - @forge/cli-shared@8.8.2-next.3
50
+
51
+ ## 5.12.0-next.4
52
+
53
+ ### Minor Changes
54
+
55
+ - 738ce50: Add permission linter for Realtime subscribeGlobal method
56
+
57
+ ## 5.11.7-next.3
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [9a6d346]
62
+ - @forge/manifest@11.0.0-next.1
63
+ - @forge/cli-shared@8.8.2-next.2
64
+
3
65
  ## 5.11.7-next.2
4
66
 
5
67
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,cAAc,EACf,MAAM,mBAAmB,CAAC;AAC3B,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;AAcxG,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,UAAU,EAAE,KAAG,YAQxD,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBACF,MAAM,EAAE,YACX,QAAQ,eACL,MAAM,UACX,UAAU,kBACF,cAAc,6BAjBpB,MAAM,UACR,eAAe,oBACN,OAAO,GAAG,QAAQ,CAAC,aAAa,KAChD,QAAQ,SAAS,CAAC,YAgBV,eAAe,EAAE,K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invoke_remote_linter_1 = require("./linters/remote-linter/invoke-remote-li
19
19
  const storage_module_linter_1 = require("./linters/storage-module-linter/storage-module-linter");
20
20
  const frame_component_linter_1 = require("./linters/frame-component-linter/frame-component-linter");
21
21
  const deprecated_egress_permissions_manifest_linter_1 = require("./linters/manifest-linter/deprecated-egress-permissions-manifest-linter");
22
+ const llm_module_linter_1 = require("./linters/llm-module-linter/llm-module-linter");
22
23
  const reportLintResults = (logger, lintResults, showSummary = true) => {
23
24
  let numErrors = 0, numWarnings = 0;
24
25
  let noProblemsFound = true;
@@ -91,6 +92,7 @@ const lint = async (filesToLint, manifest, environment, logger, statsigService,
91
92
  new invoke_remote_linter_1.InvokeRemoteLinter(environment, manifest, logger),
92
93
  new storage_module_linter_1.StorageModulesLinter(environment, manifest, logger),
93
94
  new frame_component_linter_1.FrameComponentLinter(environment, manifest, logger),
95
+ new llm_module_linter_1.LlmModuleLinter(environment, manifest, logger),
94
96
  new deprecated_egress_permissions_manifest_linter_1.DeprecatedEgressPermissionsManifestLinter(logger, statsigService)
95
97
  ]) => {
96
98
  const { include, exclude } = await (0, cli_shared_1.listTSConfigIncludeExclude)(new cli_shared_1.FileSystemReader());
@@ -0,0 +1,9 @@
1
+ import { LintCriteriaMatch } from '../../linter-interface';
2
+ export interface LLMModuleLintCriteriaMatch extends LintCriteriaMatch {
3
+ type: 'llm';
4
+ }
5
+ export interface LLMModuleMatches {
6
+ [key: string]: LLMModuleLintCriteriaMatch[];
7
+ }
8
+ export declare const LLM_SDK_PACKAGE = "@atlassian/forge-llms-sdk";
9
+ //# sourceMappingURL=llm-linter-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-linter-interface.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/llm-module-linter/llm-linter-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACnE,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,0BAA0B,EAAE,CAAC;CAC7C;AAED,eAAO,MAAM,eAAe,8BAA8B,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LLM_SDK_PACKAGE = void 0;
4
+ exports.LLM_SDK_PACKAGE = '@atlassian/forge-llms-sdk';
@@ -0,0 +1,14 @@
1
+ import { LintFixState, LintLogger, LintResultRule } from '../../linter-interface';
2
+ import BaseLinter from '../../base-linter';
3
+ import { ManifestSchema as Manifest } from '@forge/manifest';
4
+ import { LLMModuleLintCriteriaMatch, LLMModuleMatches } from './llm-linter-interface';
5
+ export declare class LlmModuleLinter extends BaseLinter<LLMModuleLintCriteriaMatch, LLMModuleMatches, LLMModuleLintCriteriaMatch[]> {
6
+ private manifest;
7
+ constructor(environment: string, manifest: Manifest, logger: LintLogger);
8
+ addLintCriteriaMatch(usage: LLMModuleLintCriteriaMatch, filepath: string): void;
9
+ bootstrap(): Promise<void>;
10
+ protected setupMatchesMap(filePath: string): void;
11
+ protected getFixer(): ((errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState) => Promise<LintFixState>) | undefined;
12
+ applyFixes(_errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState): Promise<LintFixState>;
13
+ }
14
+ //# sourceMappingURL=llm-module-linter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-module-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/llm-module-linter/llm-module-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAW,MAAM,iBAAiB,CAAC;AAGtE,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAItF,qBAAa,eAAgB,SAAQ,UAAU,CAC7C,0BAA0B,EAC1B,gBAAgB,EAChB,0BAA0B,EAAE,CAC7B;IAGG,OAAO,CAAC,QAAQ;gBADhB,WAAW,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAC1B,MAAM,EAAE,UAAU;IAKpB,oBAAoB,CAAC,KAAK,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKlE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAOvC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMjD,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;IAIP,UAAU,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;CAiBpH"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LlmModuleLinter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
6
+ const llm_node_visitor_1 = require("./llm-node-visitor");
7
+ const llm_verifier_1 = require("./llm-verifier");
8
+ const DEFAULT_LLM_MODULES = [{ key: 'llm', model: ['claude'] }];
9
+ class LlmModuleLinter extends base_linter_1.default {
10
+ manifest;
11
+ constructor(environment, manifest, logger) {
12
+ super(environment, logger);
13
+ this.manifest = manifest;
14
+ }
15
+ addLintCriteriaMatch(usage, filepath) {
16
+ const criteriaMatches = this.matches.get(filepath);
17
+ criteriaMatches?.llm.push(usage);
18
+ }
19
+ async bootstrap() {
20
+ this.nodeVisitors = [new llm_node_visitor_1.LlmNodeVisitor()];
21
+ this.verifiers = {
22
+ llm: new llm_verifier_1.LlmVerifier(this.environment, this.manifest)
23
+ };
24
+ }
25
+ setupMatchesMap(filePath) {
26
+ this.matches.set(filePath, {
27
+ llm: []
28
+ });
29
+ }
30
+ getFixer() {
31
+ return this.applyFixes;
32
+ }
33
+ async applyFixes(_errors, warnings, state) {
34
+ if (warnings?.length > 0) {
35
+ const currentModules = (await state.configFile.readConfig())?.modules ?? {};
36
+ const isLLMModuleMissing = warnings.find((warning) => warning.metadata?.missingLLMModule === 'llm') !== undefined;
37
+ if (isLLMModuleMissing && !currentModules.llm) {
38
+ const newModules = {
39
+ ...currentModules,
40
+ llm: DEFAULT_LLM_MODULES
41
+ };
42
+ await state.configFile.writeToConfigFile('modules', newModules);
43
+ state.warningsFixed += 1;
44
+ }
45
+ }
46
+ return state;
47
+ }
48
+ }
49
+ exports.LlmModuleLinter = LlmModuleLinter;
@@ -0,0 +1,9 @@
1
+ import { NodeVisitor } from '../node-visitor-interface';
2
+ import { LLMModuleLintCriteriaMatch } from './llm-linter-interface';
3
+ import { TSESTree } from '@typescript-eslint/typescript-estree';
4
+ export declare class LlmNodeVisitor implements NodeVisitor<LLMModuleLintCriteriaMatch> {
5
+ visit(node: TSESTree.Node, _parent: TSESTree.Node | undefined, onMatchCallback: (llmModuleCall: LLMModuleLintCriteriaMatch) => void): void;
6
+ private isNodeSDKPackageImport;
7
+ private isImportSpecifier;
8
+ }
9
+ //# sourceMappingURL=llm-node-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-node-visitor.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/llm-module-linter/llm-node-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAmB,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhF,qBAAa,cAAe,YAAW,WAAW,CAAC,0BAA0B,CAAC;IACrE,KAAK,CACV,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,OAAO,EAAE,QAAQ,CAAC,IAAI,GAAG,SAAS,EAClC,eAAe,EAAE,CAAC,aAAa,EAAE,0BAA0B,KAAK,IAAI;IAgBtE,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,iBAAiB;CAM1B"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LlmNodeVisitor = void 0;
4
+ const llm_linter_interface_1 = require("./llm-linter-interface");
5
+ const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
6
+ class LlmNodeVisitor {
7
+ visit(node, _parent, onMatchCallback) {
8
+ if (this.isNodeSDKPackageImport(node) && 'specifiers' in node) {
9
+ node.specifiers.forEach((specifier) => {
10
+ if (this.isImportSpecifier(specifier)) {
11
+ if (specifier.loc) {
12
+ onMatchCallback({
13
+ type: 'llm',
14
+ ...specifier.loc.start
15
+ });
16
+ }
17
+ }
18
+ });
19
+ }
20
+ }
21
+ isNodeSDKPackageImport(node) {
22
+ return node.type === typescript_estree_1.AST_NODE_TYPES.ImportDeclaration && node.source.value === llm_linter_interface_1.LLM_SDK_PACKAGE;
23
+ }
24
+ isImportSpecifier(specifier) {
25
+ return ((specifier.type === typescript_estree_1.AST_NODE_TYPES.ImportSpecifier || specifier.type === typescript_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier) &&
26
+ specifier.local.type === typescript_estree_1.AST_NODE_TYPES.Identifier);
27
+ }
28
+ }
29
+ exports.LlmNodeVisitor = LlmNodeVisitor;
@@ -0,0 +1,8 @@
1
+ import { BaseLintIssueVerifier, LintIssueVerifier } from '../verifier-interface';
2
+ import { LintClass, LintResultRule } from '../../linter-interface';
3
+ import { LLMModuleLintCriteriaMatch } from './llm-linter-interface';
4
+ export declare class LlmVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<LLMModuleLintCriteriaMatch[]> {
5
+ protected getLintClass(): LintClass;
6
+ process(moduleCalls: LLMModuleLintCriteriaMatch[]): Promise<LintResultRule[]>;
7
+ }
8
+ //# sourceMappingURL=llm-verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-verifier.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/llm-module-linter/llm-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGpE,qBAAa,WAAY,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,0BAA0B,EAAE,CAAC;IAC/G,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,WAAW,EAAE,0BAA0B,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAe3F"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LlmVerifier = void 0;
4
+ const verifier_interface_1 = require("../verifier-interface");
5
+ const linter_interface_1 = require("../../linter-interface");
6
+ const text_1 = require("../../text");
7
+ class LlmVerifier extends verifier_interface_1.BaseLintIssueVerifier {
8
+ getLintClass() {
9
+ return linter_interface_1.LintClass.Warning;
10
+ }
11
+ async process(moduleCalls) {
12
+ if (this.manifest.modules && 'llm' in this.manifest.modules) {
13
+ return [];
14
+ }
15
+ return moduleCalls.map((llmModuleCall) => ({
16
+ class: this.getLintClass(),
17
+ message: text_1.messages.verifiers.llm.message('llm'),
18
+ reference: text_1.messages.verifiers.llm.reference,
19
+ ...llmModuleCall,
20
+ metadata: {
21
+ missingLLMModule: 'llm'
22
+ }
23
+ }));
24
+ }
25
+ }
26
+ exports.LlmVerifier = LlmVerifier;
@@ -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
+ 'REALTIME' = 6
9
10
  }
10
11
  export declare type ProductName = 'jira' | 'confluence' | 'bitbucket';
11
12
  export interface ProductApiCall extends LintCriteriaMatch {
@@ -35,5 +36,9 @@ export interface ContentPropertyApiCall extends LintCriteriaMatch {
35
36
  context: string;
36
37
  method: string;
37
38
  }
38
- export declare type ApiCall = ProductApiCall | UIHookApiCall | StorageApiCall | ExternalApiCall | ImageUrl | ContentPropertyApiCall;
39
+ export interface RealtimeApiCall extends LintCriteriaMatch {
40
+ type: ApiCallTypes.REALTIME;
41
+ method: string;
42
+ }
43
+ export declare type ApiCall = ProductApiCall | UIHookApiCall | StorageApiCall | ExternalApiCall | ImageUrl | ContentPropertyApiCall | RealtimeApiCall;
39
44
  //# 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;CACR;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,oBAAY,OAAO,GACf,cAAc,GACd,aAAa,GACb,cAAc,GACd,eAAe,GACf,QAAQ,GACR,sBAAsB,CAAC"}
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,UAAU,IAAA;CACX;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,eAAgB,SAAQ,iBAAiB;IACxD,IAAI,EAAE,YAAY,CAAC,QAAQ,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oBAAY,OAAO,GACf,cAAc,GACd,aAAa,GACb,cAAc,GACd,eAAe,GACf,QAAQ,GACR,sBAAsB,GACtB,eAAe,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["REALTIME"] = 6] = "REALTIME";
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, ProductApiCall, StorageApiCall, UIHookApiCall, RealtimeApiCall } 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
+ realtime: RealtimeApiCall[];
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,EAGZ,MAAM,aAAa,CAAC;AAYrB,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,c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AC,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"}
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,EACb,eAAe,EAChB,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;AAoCF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,QAAQ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AAQ,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"}
@@ -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.RealtimeApiNodeVisitor()
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
+ realtime: new verifiers_1.RealtimeAPIVerifier(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
+ realtime: []
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.REALTIME:
244
+ criteriaMatches.realtime.push(apiCall);
245
+ break;
240
246
  }
241
247
  }
242
248
  async getProductPaths(cacheKey, url) {
@@ -1,6 +1,7 @@
1
+ export * from './external-fetch-verifier';
2
+ export * from './image-url-verifier';
1
3
  export * from './product-verifier';
4
+ export * from './realtime-api-verifier';
2
5
  export * from './storage-api-verifier';
3
6
  export * from './ui-hook-verifier';
4
- export * from './external-fetch-verifier';
5
- export * from './image-url-verifier';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,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,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./external-fetch-verifier"), exports);
5
+ tslib_1.__exportStar(require("./image-url-verifier"), exports);
4
6
  tslib_1.__exportStar(require("./product-verifier"), exports);
7
+ tslib_1.__exportStar(require("./realtime-api-verifier"), exports);
5
8
  tslib_1.__exportStar(require("./storage-api-verifier"), exports);
6
9
  tslib_1.__exportStar(require("./ui-hook-verifier"), exports);
7
- tslib_1.__exportStar(require("./external-fetch-verifier"), exports);
8
- tslib_1.__exportStar(require("./image-url-verifier"), exports);
@@ -0,0 +1,8 @@
1
+ import { LintClass, LintResultRule } from '../../../linter-interface';
2
+ import { BaseLintIssueVerifier, LintIssueVerifier } from '../../verifier-interface';
3
+ import { ApiCall, RealtimeApiCall } from '../api-call-interface';
4
+ export declare class RealtimeAPIVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<ApiCall[]> {
5
+ protected getLintClass(): LintClass;
6
+ process(apiCalls: RealtimeApiCall[]): Promise<LintResultRule[]>;
7
+ }
8
+ //# sourceMappingURL=realtime-api-verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime-api-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/realtime-api-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIjE,qBAAa,mBAAoB,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IACpG,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;CAe7E"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RealtimeAPIVerifier = void 0;
4
+ const linter_interface_1 = require("../../../linter-interface");
5
+ const text_1 = require("../../../text");
6
+ const utils_1 = require("../../utils");
7
+ const verifier_interface_1 = require("../../verifier-interface");
8
+ const SUBSCRIBE_GLOBAL_PERMISSION = 'read:app-global-channel:realtime';
9
+ class RealtimeAPIVerifier extends verifier_interface_1.BaseLintIssueVerifier {
10
+ getLintClass() {
11
+ return linter_interface_1.LintClass.Error;
12
+ }
13
+ async process(apiCalls) {
14
+ if ((0, utils_1.getAllScopeKeys)(this.manifest.permissions?.scopes ?? []).includes(SUBSCRIBE_GLOBAL_PERMISSION)) {
15
+ return [];
16
+ }
17
+ return apiCalls.map((apiCall) => ({
18
+ class: this.getLintClass(),
19
+ message: text_1.messages.verifiers.realtime.message(SUBSCRIBE_GLOBAL_PERMISSION),
20
+ reference: text_1.messages.verifiers.realtime.reference,
21
+ ...apiCall,
22
+ metadata: {
23
+ missingPermission: SUBSCRIBE_GLOBAL_PERMISSION
24
+ }
25
+ }));
26
+ }
27
+ }
28
+ exports.RealtimeAPIVerifier = RealtimeAPIVerifier;
@@ -1,6 +1,7 @@
1
+ export * from './external-fetch-call-visitor';
2
+ export * from './image-url-visitor';
1
3
  export * from './product-node-visitor';
4
+ export * from './realtime-api-node-visitor';
2
5
  export * from './storage-api-node-visitor';
3
6
  export * from './ui-hook-node-visitor';
4
- export * from './external-fetch-call-visitor';
5
- export * from './image-url-visitor';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,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,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./external-fetch-call-visitor"), exports);
5
+ tslib_1.__exportStar(require("./image-url-visitor"), exports);
4
6
  tslib_1.__exportStar(require("./product-node-visitor"), exports);
7
+ tslib_1.__exportStar(require("./realtime-api-node-visitor"), exports);
5
8
  tslib_1.__exportStar(require("./storage-api-node-visitor"), exports);
6
9
  tslib_1.__exportStar(require("./ui-hook-node-visitor"), exports);
7
- tslib_1.__exportStar(require("./external-fetch-call-visitor"), exports);
8
- tslib_1.__exportStar(require("./image-url-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 RealtimeApiNodeVisitor implements NodeVisitor<ApiCall> {
5
+ visit(node: TSESTree.Node, _parent: TSESTree.Node | undefined, callback: (apiCall: ApiCall) => void): void;
6
+ }
7
+ //# sourceMappingURL=realtime-api-node-visitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime-api-node-visitor.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/visitors/realtime-api-node-visitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAiC,MAAM,uBAAuB,CAAC;AAI/E,qBAAa,sBAAuB,YAAW,WAAW,CAAC,OAAO,CAAC;IAC1D,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;CA4ClH"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RealtimeApiNodeVisitor = void 0;
4
+ const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
5
+ const api_call_interface_1 = require("../api-call-interface");
6
+ const SUBSCRIBE_GLOBAL_REGEX = /^subscribeGlobal$/;
7
+ class RealtimeApiNodeVisitor {
8
+ visit(node, _parent, callback) {
9
+ switch (node.type) {
10
+ case typescript_estree_1.AST_NODE_TYPES.CallExpression:
11
+ if (node.callee.type === typescript_estree_1.AST_NODE_TYPES.Identifier && node.callee.name.match(SUBSCRIBE_GLOBAL_REGEX)) {
12
+ const subscribeGlobalCall = {
13
+ type: api_call_interface_1.ApiCallTypes.REALTIME,
14
+ method: node.callee.name,
15
+ ...node.callee.loc.start
16
+ };
17
+ callback(subscribeGlobalCall);
18
+ }
19
+ break;
20
+ case typescript_estree_1.AST_NODE_TYPES.MemberExpression:
21
+ if (node.property.type === typescript_estree_1.AST_NODE_TYPES.Identifier &&
22
+ node.property.name.match(SUBSCRIBE_GLOBAL_REGEX) &&
23
+ _parent?.type === typescript_estree_1.AST_NODE_TYPES.CallExpression) {
24
+ const subscribeGlobalCall = {
25
+ type: api_call_interface_1.ApiCallTypes.REALTIME,
26
+ method: node.property.name,
27
+ ...node.property.loc.start
28
+ };
29
+ callback(subscribeGlobalCall);
30
+ }
31
+ break;
32
+ }
33
+ }
34
+ }
35
+ exports.RealtimeApiNodeVisitor = RealtimeApiNodeVisitor;
@@ -45,6 +45,10 @@ export declare const messages: {
45
45
  message: (module: string) => string;
46
46
  reference: string;
47
47
  };
48
+ llm: {
49
+ message: (module: string) => string;
50
+ reference: string;
51
+ };
48
52
  frameComponentResource: {
49
53
  missing: {
50
54
  message: () => string;
@@ -55,6 +59,10 @@ export declare const messages: {
55
59
  reference: string;
56
60
  };
57
61
  };
62
+ realtime: {
63
+ message: (scope: string) => string;
64
+ reference: string;
65
+ };
58
66
  };
59
67
  };
60
68
  //# sourceMappingURL=messages.d.ts.map
@@ -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;;;;;;;;;oCASF,MAAM;;;;;CAOjC,CAAC"}
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;;;;CAI5B,CAAC"}
@@ -48,6 +48,10 @@ exports.messages = {
48
48
  message: (module) => `OS package is used but '${module}' module is not defined in the manifest`,
49
49
  reference: 'https://developer.atlassian.com/platform/forge/manifest-reference/#modules'
50
50
  },
51
+ llm: {
52
+ message: (module) => `LLM package is used but '${module}' module is not defined in the manifest`,
53
+ reference: 'https://developer.atlassian.com/platform/forge/manifest-reference/#modules'
54
+ },
51
55
  frameComponentResource: {
52
56
  missing: {
53
57
  message: () => 'The "resource" property is missing in the Frame component',
@@ -59,6 +63,10 @@ exports.messages = {
59
63
  },
60
64
  reference: 'valid-frame-component-resource-attribute-required'
61
65
  }
66
+ },
67
+ realtime: {
68
+ message: (scope) => `Using the Forge Realtime subscribeGlobal method requires the "${scope}" scope`,
69
+ reference: 'permission-scope-required'
62
70
  }
63
71
  }
64
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/lint",
3
- "version": "5.11.7-next.2",
3
+ "version": "5.12.0-next.10",
4
4
  "description": "Linting for forge apps",
5
5
  "main": "out/index.js",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -19,10 +19,10 @@
19
19
  "eslint-plugin-import": "^2.29.1"
20
20
  },
21
21
  "dependencies": {
22
- "@forge/cli-shared": "8.8.2-next.1",
23
- "@forge/csp": "5.3.0-next.0",
22
+ "@forge/cli-shared": "8.9.0-next.7",
23
+ "@forge/csp": "5.3.0-next.1",
24
24
  "@forge/egress": "2.1.1",
25
- "@forge/manifest": "11.0.0-next.0",
25
+ "@forge/manifest": "11.0.0-next.3",
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",