@sentryx-ai/core 0.0.1

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.
@@ -0,0 +1,123 @@
1
+ type Brand<Value, Name extends string> = Value & {
2
+ readonly __brand: Name;
3
+ };
4
+ type TenantId = Brand<string, 'TenantId'>;
5
+ type UserId = Brand<string, 'UserId'>;
6
+ type RepositoryId = Brand<string, 'RepositoryId'>;
7
+ type PullRequestId = Brand<string, 'PullRequestId'>;
8
+ type AnalysisRunId = Brand<string, 'AnalysisRunId'>;
9
+ type FindingId = Brand<string, 'FindingId'>;
10
+ type RuleId = Brand<string, 'RuleId'>;
11
+ type RulesetId = Brand<string, 'RulesetId'>;
12
+
13
+ interface SentryxTimestamps {
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ }
17
+ interface SentryxSoftDeleteTimestamps extends SentryxTimestamps {
18
+ deletedAt?: string | null;
19
+ }
20
+
21
+ type GitProvider = 'github' | 'gitlab' | 'bitbucket';
22
+
23
+ interface SentryxPullRequest {
24
+ id: PullRequestId;
25
+ repositoryId: RepositoryId;
26
+ externalId: string;
27
+ number: number;
28
+ title: string;
29
+ author?: string;
30
+ sourceBranch: string;
31
+ targetBranch: string;
32
+ headSha: string;
33
+ baseSha?: string;
34
+ url: string;
35
+ }
36
+
37
+ interface SentryxRepository {
38
+ id: RepositoryId;
39
+ tenantId: TenantId;
40
+ provider: GitProvider;
41
+ externalId: string;
42
+ owner: string;
43
+ name: string;
44
+ fullName: string;
45
+ defaultBranch: string;
46
+ url: string;
47
+ }
48
+
49
+ type SentryxStatusCheckState = 'pending' | 'success' | 'failure' | 'error';
50
+ interface SentryxStatusCheck {
51
+ state: SentryxStatusCheckState;
52
+ summary: string;
53
+ targetUrl?: string;
54
+ }
55
+
56
+ type FindingCategory = 'code_quality' | 'bug_risk' | 'security' | 'architecture' | 'testing' | 'dependency';
57
+
58
+ interface FindingLocation {
59
+ filePath: string;
60
+ lineStart?: number;
61
+ lineEnd?: number;
62
+ columnStart?: number;
63
+ columnEnd?: number;
64
+ symbol?: string;
65
+ }
66
+
67
+ type FindingSeverity = 'info' | 'low' | 'medium' | 'high' | 'critical';
68
+
69
+ type FindingStatus = 'open' | 'dismissed' | 'fixed' | 'false_positive';
70
+
71
+ interface SentryxFinding {
72
+ id: FindingId;
73
+ ruleId: RuleId;
74
+ severity: FindingSeverity;
75
+ status: FindingStatus;
76
+ category: FindingCategory;
77
+ title: string;
78
+ message?: string;
79
+ location: FindingLocation;
80
+ fingerprint: string;
81
+ }
82
+
83
+ interface SentryxRule {
84
+ id: RuleId;
85
+ name: string;
86
+ category: FindingCategory;
87
+ defaultSeverity: FindingSeverity;
88
+ description?: string;
89
+ enabled: boolean;
90
+ }
91
+
92
+ interface SentryxRuleset {
93
+ id: RulesetId;
94
+ tenantId?: TenantId;
95
+ name: string;
96
+ enabledRuleIds: RuleId[];
97
+ }
98
+
99
+ type AnalysisSource = 'pull_request' | 'push' | 'manual' | 'scheduled';
100
+
101
+ interface SentryxAnalysisContext {
102
+ tenantId: TenantId;
103
+ source: AnalysisSource;
104
+ repository: SentryxRepository;
105
+ pullRequest?: SentryxPullRequest;
106
+ ruleset: SentryxRuleset;
107
+ }
108
+
109
+ interface SentryxAnalysisResult {
110
+ context: SentryxAnalysisContext;
111
+ findings: SentryxFinding[];
112
+ statusCheck: SentryxStatusCheck;
113
+ }
114
+
115
+ type AnalysisRunStatus = 'queued' | 'running' | 'completed' | 'failed' | 'canceled';
116
+
117
+ interface SentryxTenant {
118
+ id: TenantId;
119
+ name: string;
120
+ slug: string;
121
+ }
122
+
123
+ export type { AnalysisRunId, AnalysisRunStatus, AnalysisSource, Brand, FindingCategory, FindingId, FindingLocation, FindingSeverity, FindingStatus, GitProvider, PullRequestId, RepositoryId, RuleId, RulesetId, SentryxAnalysisContext, SentryxAnalysisResult, SentryxFinding, SentryxPullRequest, SentryxRepository, SentryxRule, SentryxRuleset, SentryxSoftDeleteTimestamps, SentryxStatusCheck, SentryxStatusCheckState, SentryxTenant, SentryxTimestamps, TenantId, UserId };
package/dist/index.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@sentryx-ai/core",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsup src/index.ts --format esm --dts --clean",
16
+ "clean": "rm -rf dist *.tsbuildinfo",
17
+ "dev": "tsup src/index.ts --format esm --dts --watch",
18
+ "lint": "tsc --noEmit",
19
+ "typecheck": "tsc --noEmit",
20
+ "prepack": "npm run build"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "devDependencies": {
29
+ "tsup": "^8.5.0",
30
+ "typescript": "^5.8.3"
31
+ }
32
+ }