@bevorai/sdk 0.1.1 → 0.2.0-rc2

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 (125) hide show
  1. package/README.md +18 -15
  2. package/dist/client.d.ts +9 -8
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +21 -19
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +42 -27
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +45 -29
  9. package/dist/errors.js.map +1 -1
  10. package/dist/graph/call-node.d.ts +9 -27
  11. package/dist/graph/call-node.d.ts.map +1 -1
  12. package/dist/graph/call-node.js +75 -41
  13. package/dist/graph/call-node.js.map +1 -1
  14. package/dist/graph/cursor.d.ts +7 -7
  15. package/dist/graph/cursor.d.ts.map +1 -1
  16. package/dist/graph/cursor.js.map +1 -1
  17. package/dist/graph/field-metadata.d.ts +11 -11
  18. package/dist/graph/field-metadata.d.ts.map +1 -1
  19. package/dist/graph/field-metadata.js +2 -18
  20. package/dist/graph/field-metadata.js.map +1 -1
  21. package/dist/graph/graph.d.ts +22 -22
  22. package/dist/graph/graph.d.ts.map +1 -1
  23. package/dist/graph/graph.js.map +1 -1
  24. package/dist/helpers/sarif.d.ts +7 -7
  25. package/dist/helpers/sarif.d.ts.map +1 -1
  26. package/dist/helpers/sarif.js.map +1 -1
  27. package/dist/index.d.ts +3 -7
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +0 -3
  30. package/dist/index.js.map +1 -1
  31. package/dist/node.js +1 -1
  32. package/dist/pagination.d.ts +1 -1
  33. package/dist/pagination.d.ts.map +1 -1
  34. package/dist/resources/analyses.d.ts +204 -76
  35. package/dist/resources/analyses.d.ts.map +1 -1
  36. package/dist/resources/analyses.js +147 -33
  37. package/dist/resources/analyses.js.map +1 -1
  38. package/dist/resources/chats.d.ts +52 -27
  39. package/dist/resources/chats.d.ts.map +1 -1
  40. package/dist/resources/chats.js +45 -9
  41. package/dist/resources/chats.js.map +1 -1
  42. package/dist/resources/codes.d.ts +102 -41
  43. package/dist/resources/codes.d.ts.map +1 -1
  44. package/dist/resources/codes.js +78 -18
  45. package/dist/resources/codes.js.map +1 -1
  46. package/dist/resources/files.d.ts +22 -12
  47. package/dist/resources/files.d.ts.map +1 -1
  48. package/dist/resources/files.js +12 -2
  49. package/dist/resources/files.js.map +1 -1
  50. package/dist/resources/findings.d.ts +68 -32
  51. package/dist/resources/findings.d.ts.map +1 -1
  52. package/dist/resources/findings.js +49 -10
  53. package/dist/resources/findings.js.map +1 -1
  54. package/dist/resources/nodes.d.ts +28 -18
  55. package/dist/resources/nodes.d.ts.map +1 -1
  56. package/dist/resources/nodes.js +12 -2
  57. package/dist/resources/nodes.js.map +1 -1
  58. package/dist/resources/projects.d.ts +7 -3
  59. package/dist/resources/projects.d.ts.map +1 -1
  60. package/dist/resources/projects.js +5 -1
  61. package/dist/resources/projects.js.map +1 -1
  62. package/dist/resources/summary.d.ts +4 -3
  63. package/dist/resources/summary.d.ts.map +1 -1
  64. package/dist/resources/summary.js.map +1 -1
  65. package/dist/resources/transitions.d.ts +16 -12
  66. package/dist/resources/transitions.d.ts.map +1 -1
  67. package/dist/resources/transitions.js +9 -2
  68. package/dist/resources/transitions.js.map +1 -1
  69. package/dist/resources/users.d.ts +14 -9
  70. package/dist/resources/users.d.ts.map +1 -1
  71. package/dist/resources/users.js +6 -1
  72. package/dist/resources/users.js.map +1 -1
  73. package/dist/resources/versions.d.ts +29 -13
  74. package/dist/resources/versions.d.ts.map +1 -1
  75. package/dist/resources/versions.js +24 -5
  76. package/dist/resources/versions.js.map +1 -1
  77. package/dist/streaming.d.ts +1 -2
  78. package/dist/streaming.d.ts.map +1 -1
  79. package/dist/streaming.js +2 -2
  80. package/dist/streaming.js.map +1 -1
  81. package/dist/types/events.d.ts +53 -0
  82. package/dist/types/events.d.ts.map +1 -0
  83. package/dist/types/events.js +2 -0
  84. package/dist/types/events.js.map +1 -0
  85. package/dist/types/generics.d.ts +18 -0
  86. package/dist/types/generics.d.ts.map +1 -0
  87. package/dist/types/generics.js +2 -0
  88. package/dist/types/generics.js.map +1 -0
  89. package/dist/types/graph_data.d.ts +137 -0
  90. package/dist/types/graph_data.d.ts.map +1 -0
  91. package/dist/types/graph_data.js +3 -0
  92. package/dist/types/graph_data.js.map +1 -0
  93. package/dist/types/literals.d.ts +11 -22
  94. package/dist/types/literals.d.ts.map +1 -1
  95. package/dist/types/literals.js +2 -15
  96. package/dist/types/literals.js.map +1 -1
  97. package/dist/types/requests.d.ts +246 -177
  98. package/dist/types/requests.d.ts.map +1 -1
  99. package/dist/types/requests.js +2 -2
  100. package/dist/types/requests.js.map +1 -1
  101. package/dist/types/responses.d.ts +592 -381
  102. package/dist/types/responses.d.ts.map +1 -1
  103. package/dist/types/responses.js +2 -10
  104. package/dist/types/responses.js.map +1 -1
  105. package/dist/types/shared.d.ts +8 -0
  106. package/dist/types/shared.d.ts.map +1 -0
  107. package/dist/types/shared.js +2 -0
  108. package/dist/types/shared.js.map +1 -0
  109. package/package.json +1 -1
  110. package/dist/helpers/call-chain.d.ts +0 -11
  111. package/dist/helpers/call-chain.d.ts.map +0 -1
  112. package/dist/helpers/call-chain.js +0 -79
  113. package/dist/helpers/call-chain.js.map +0 -1
  114. package/dist/helpers/static-analysis.d.ts +0 -18
  115. package/dist/helpers/static-analysis.d.ts.map +0 -1
  116. package/dist/helpers/static-analysis.js +0 -89
  117. package/dist/helpers/static-analysis.js.map +0 -1
  118. package/dist/types/graph-data.d.ts +0 -62
  119. package/dist/types/graph-data.d.ts.map +0 -1
  120. package/dist/types/graph-data.js +0 -2
  121. package/dist/types/graph-data.js.map +0 -1
  122. package/dist/types/static-analysis.d.ts +0 -28
  123. package/dist/types/static-analysis.d.ts.map +0 -1
  124. package/dist/types/static-analysis.js +0 -93
  125. package/dist/types/static-analysis.js.map +0 -1
@@ -1,303 +1,447 @@
1
- import type { CallNodeDict } from "../graph/call-node.js";
2
- import type { CallBinding, FieldMetadataItem, JsonObject, ParameterStorageMetadata, ReturnStorageMetadata } from "./graph-data.js";
3
- import type { AnalysisRunStatus, AnalysisTrigger, ChatRole, ChatType, CodeVersionStatus, EdgeDirection, EdgeType, FindingDraftOperation, FindingLevel, FindingTransitionReason, ID, Language, MemberRole, Network, OnboardingPersona, OnboardingUseType, ProjectKind, VersionMethod, Visibility } from "./literals.js";
4
- /** ISO 8601 timestamp, as sent by the API. */
5
- export type DateTime = string;
6
- export interface Pagination<T> {
7
- results: T[];
8
- page: number;
9
- page_size: number;
10
- more: boolean;
11
- total_observations: number;
12
- total_pages: number;
13
- }
14
- export interface ResultsResponse<T> {
15
- results: T[];
16
- }
17
- export interface BooleanResponse {
18
- success: boolean;
19
- }
20
- export interface ExistsResponse<T> {
21
- exists: boolean;
22
- data: T | null;
23
- }
24
- export interface InlineRef {
25
- id: ID;
26
- type: string;
27
- source: string;
28
- ref_ind: number;
29
- name: string | null;
30
- is_stale: boolean;
31
- }
1
+ import type { GraphSnapshotNode } from "./graph_data.js";
2
+ import type { AnalysisEntrypointStatus, AnalysisTrigger, BlockchainNetwork, ChatMessageRole, ChatType, CodeVersionMethod, CodeVersionStatus, FindingDraftOperation, FindingLevel, FindingTransitionReason, ProjectKind } from "./literals.js";
32
3
  export interface ActionDetails {
4
+ /**
5
+ * Whether the caller can perform the action.
6
+ */
33
7
  is_allowed: boolean;
34
- /** reasons why action is not allowed, if applicable. */
8
+ /**
9
+ * reasons why action is not allowed, if applicable.
10
+ */
35
11
  reasons: string[];
36
12
  }
37
- export interface CodeStatusEventData {
38
- type: "code.status";
39
- id: ID;
40
- workspace_id: ID;
41
- project_id: ID;
42
- payload: {
43
- status: CodeVersionStatus;
44
- };
45
- }
46
- export interface CodeStepEventData {
47
- type: "code.step";
48
- id: ID;
49
- workspace_id: ID;
50
- project_id: ID;
51
- payload: {
52
- step: string;
53
- is_complete: boolean;
54
- };
55
- }
56
- export type CodeEventData = CodeStatusEventData | CodeStepEventData;
57
- export interface AnalysisRunStatusEventData {
58
- type: "analysis.run";
59
- id: ID;
60
- workspace_id: ID;
61
- project_id: ID;
62
- payload: {
63
- status: AnalysisRunStatus;
64
- analysis_id: ID;
65
- node_id: ID;
66
- };
67
- }
68
- export interface AnalysisPipelineStatusEventData {
69
- type: "analysis.pipeline";
70
- id: ID;
71
- workspace_id: ID;
72
- project_id: ID;
73
- payload: {
74
- status: "processing" | "complete";
75
- analysis_id: ID;
76
- };
77
- }
78
- export type AnalysisEventData = AnalysisRunStatusEventData | AnalysisPipelineStatusEventData;
79
- export interface UserSchema {
80
- id: ID;
81
- is_self: boolean;
82
- created_at: DateTime;
83
- username: string;
84
- }
85
- export interface MemberActions {
86
- remove: ActionDetails;
87
- update: ActionDetails;
88
- }
89
- export interface MemberSchema extends UserSchema {
90
- role: MemberRole;
91
- seat_type: string;
92
- is_creator: boolean;
93
- actions: MemberActions;
13
+ export interface Analysis {
14
+ id: string;
15
+ name: string;
16
+ created_at: string;
17
+ /**
18
+ * The analysis owner.
19
+ */
20
+ user: User;
21
+ /**
22
+ * Whether the caller owns this analysis.
23
+ */
24
+ is_owner: boolean;
25
+ /**
26
+ * The requested version, HEAD by default.
27
+ */
28
+ version: AnalysisVersion;
29
+ }
30
+ /**
31
+ * Operations the caller can perform on this version.
32
+ */
33
+ export interface AnalysisActions {
34
+ fork: ActionDetails;
35
+ /**
36
+ * Add a version for new code on top of this one.
37
+ */
38
+ create_child: ActionDetails;
39
+ commit_changes: ActionDetails;
40
+ delete: ActionDetails;
41
+ /**
42
+ * Run every entrypoint, including dependencies.
43
+ */
44
+ run_pipeline: ActionDetails;
45
+ /**
46
+ * Run first-party entrypoints only.
47
+ */
48
+ run_first_party_pipeline: ActionDetails;
49
+ retry_pipeline: ActionDetails;
50
+ merge_to: ActionDetails;
51
+ merge_from: ActionDetails;
52
+ /**
53
+ * Add, edit, or delete findings.
54
+ */
55
+ stage_changes: ActionDetails;
56
+ set_as_head: ActionDetails;
94
57
  }
95
- export interface ProjectUserSchema extends UserSchema {
96
- external_id: string | null;
97
- metadata: JsonObject;
58
+ export interface AnalysisCollisionResult {
59
+ is_created: false;
60
+ /**
61
+ * Existing versions of this code in the project.
62
+ */
63
+ candidates: CollisionVersion[];
64
+ }
65
+ /**
66
+ * The created analysis, or the existing versions this code collided with.
67
+ */
68
+ export type AnalysisCreate = AnalysisCreatedResult | AnalysisCollisionResult;
69
+ export interface AnalysisCreatedResult {
70
+ is_created: true;
71
+ /**
72
+ * The created analysis.
73
+ */
74
+ analysis: Analysis;
98
75
  }
99
- export interface GithubAccountSchema {
100
- id: number;
101
- login: string;
102
- type: string;
103
- avatar_url: string;
76
+ export interface AnalysisExpanded {
77
+ id: string;
78
+ name: string;
79
+ created_at: string;
80
+ /**
81
+ * The analysis owner.
82
+ */
83
+ user: User;
84
+ /**
85
+ * Whether the caller owns this analysis.
86
+ */
87
+ is_owner: boolean;
88
+ /**
89
+ * The requested version, HEAD by default.
90
+ */
91
+ version: AnalysisVersion;
92
+ findings: Finding[];
93
+ }
94
+ export interface AnalysisFindingPoint {
95
+ id: string;
96
+ created_at: string;
97
+ trigger: AnalysisTrigger;
98
+ analysis_meta: AnalysisMetadata;
99
+ n_added: number;
100
+ n_updated: number;
101
+ n_removed: number;
102
+ n_remediated: number;
103
+ n_dismissed: number;
104
+ ind: number;
104
105
  }
105
- export interface GithubRepositorySchema {
106
- id: number;
106
+ export interface AnalysisMetadata {
107
+ id: string;
107
108
  name: string;
108
- is_private: boolean;
109
- account: GithubAccountSchema;
110
- /** owner/repo-name */
111
- full_name: string;
112
- url: string;
109
+ created_at: string;
110
+ /**
111
+ * The analysis owner.
112
+ */
113
+ user: User;
114
+ /**
115
+ * Whether the caller owns this analysis.
116
+ */
117
+ is_owner: boolean;
113
118
  }
114
- export interface GithubBranchFilterMap {
115
- /** exact match or glob: "main" or "feat/**" */
116
- pattern: string;
117
- is_enabled: boolean;
119
+ export interface AnalysisNetworkPoint {
120
+ id: string;
121
+ created_at: string;
122
+ trigger: AnalysisTrigger;
123
+ analysis_meta: AnalysisMetadata;
124
+ ind: number;
125
+ merged_from_version: AnalysisVersionRef | null;
126
+ forked_from_version: AnalysisVersionRef | null;
127
+ parent_version: AnalysisVersionRef | null;
118
128
  }
119
- export interface GithubLinkSchema extends GithubRepositorySchema {
120
- push_events_enabled: boolean;
121
- branch_filters: GithubBranchFilterMap[];
129
+ /**
130
+ * An immutable snapshot of an analysis's findings on one code version.
131
+ */
132
+ export interface AnalysisVersion {
133
+ id: string;
134
+ created_at: string;
135
+ /**
136
+ * How this version was created.
137
+ */
138
+ trigger: AnalysisTrigger;
139
+ /**
140
+ * Findings on this version, including staged changes.
141
+ */
142
+ n_findings: number;
143
+ /**
144
+ * Uncommitted finding changes on this version.
145
+ */
146
+ n_staged: number;
147
+ /**
148
+ * Findings from the parent version dropped because their code changed.
149
+ */
150
+ n_remediations: number;
151
+ /**
152
+ * Whether this is the analysis's HEAD.
153
+ */
154
+ is_head: boolean;
155
+ /**
156
+ * Whether any entrypoint is still being analyzed.
157
+ */
158
+ has_pipeline_processing: boolean;
159
+ /**
160
+ * Whether any entrypoint failed in the latest run.
161
+ */
162
+ has_pipeline_failed: boolean;
163
+ /**
164
+ * The code this version analyzes.
165
+ */
166
+ code_version: CodeVersion;
167
+ /**
168
+ * The version merged into this one.
169
+ */
170
+ merged_from_version: AnalysisVersionRef | null;
171
+ /**
172
+ * The version this one was forked from.
173
+ */
174
+ forked_from_version: AnalysisVersionRef | null;
175
+ /**
176
+ * The previous version in this analysis.
177
+ */
178
+ parent_version: AnalysisVersionRef | null;
179
+ /**
180
+ * Versions built on this one.
181
+ */
182
+ child_versions: AnalysisVersionRef[];
183
+ /**
184
+ * Versions this one was merged into.
185
+ */
186
+ merged_versions: AnalysisVersionRef[];
187
+ /**
188
+ * Forks of this version.
189
+ */
190
+ forked_versions: AnalysisVersionRef[];
191
+ actions: AnalysisActions;
122
192
  }
123
- export interface ProjectSlimSchema {
124
- id: ID;
125
- created_at: DateTime;
126
- name: string;
127
- description: string | null;
128
- is_default: boolean;
129
- kind: ProjectKind;
193
+ export interface AnalysisVersionDirect {
194
+ id: string;
195
+ created_at: string;
196
+ /**
197
+ * How this version was created.
198
+ */
199
+ trigger: AnalysisTrigger;
200
+ /**
201
+ * Findings on this version, including staged changes.
202
+ */
203
+ n_findings: number;
204
+ /**
205
+ * Uncommitted finding changes on this version.
206
+ */
207
+ n_staged: number;
208
+ /**
209
+ * Findings from the parent version dropped because their code changed.
210
+ */
211
+ n_remediations: number;
212
+ /**
213
+ * Whether this is the analysis's HEAD.
214
+ */
215
+ is_head: boolean;
216
+ /**
217
+ * Whether any entrypoint is still being analyzed.
218
+ */
219
+ has_pipeline_processing: boolean;
220
+ /**
221
+ * Whether any entrypoint failed in the latest run.
222
+ */
223
+ has_pipeline_failed: boolean;
224
+ /**
225
+ * The code this version analyzes.
226
+ */
227
+ code_version: CodeVersion;
228
+ /**
229
+ * The version merged into this one.
230
+ */
231
+ merged_from_version: AnalysisVersionRef | null;
232
+ /**
233
+ * The version this one was forked from.
234
+ */
235
+ forked_from_version: AnalysisVersionRef | null;
236
+ /**
237
+ * The previous version in this analysis.
238
+ */
239
+ parent_version: AnalysisVersionRef | null;
240
+ /**
241
+ * Versions built on this one.
242
+ */
243
+ child_versions: AnalysisVersionRef[];
244
+ /**
245
+ * Versions this one was merged into.
246
+ */
247
+ merged_versions: AnalysisVersionRef[];
248
+ /**
249
+ * Forks of this version.
250
+ */
251
+ forked_versions: AnalysisVersionRef[];
252
+ actions: AnalysisActions;
253
+ /**
254
+ * The analysis this version belongs to.
255
+ */
256
+ analysis_meta: AnalysisMetadata;
130
257
  }
131
- export interface ProjectSchema extends ProjectSlimSchema {
132
- created_by_user: UserSchema;
133
- n_codes: number;
134
- n_analyses: number;
135
- n_users: number;
136
- github_link: GithubLinkSchema | null;
258
+ export interface AnalysisVersionRef {
259
+ id: string;
260
+ analysis_id: string;
137
261
  }
138
- export interface WorkspaceSlimSchema {
139
- id: ID;
140
- created_at: DateTime;
141
- name: string;
142
- is_default: boolean;
262
+ export interface BooleanResponse {
263
+ success: boolean;
143
264
  }
144
- export interface WorkspaceSchema extends WorkspaceSlimSchema {
145
- created_by_user: UserSchema;
146
- }
147
- export interface WorkspaceDetailedSchema extends WorkspaceSchema {
148
- n_projects: number;
149
- n_members: number;
150
- role: MemberRole;
151
- seat_type: string;
152
- plan_status: string;
153
- product_tier: string;
154
- plan_cadence: string | null;
155
- can_leave: boolean;
156
- }
157
- export interface UserOauthMethod {
158
- provider: "google" | "github";
159
- can_disconnect: boolean;
160
- }
161
- export interface UserDetailedSchema extends UserSchema {
162
- email: string;
163
- onboarding_persona: OnboardingPersona | null;
164
- onboarding_use_type: OnboardingUseType | null;
165
- is_onboarded: boolean;
166
- oauth_methods: UserOauthMethod[];
167
- require_paid_workspace: boolean;
168
- default_workspace_id: ID | null;
169
- default_project_id: ID | null;
170
- }
171
- export interface InviteSchema {
172
- id: ID;
173
- created_at: DateTime;
174
- user_id: ID | null;
175
- identifier: string;
176
- role: MemberRole;
177
- seat_type: string;
178
- workspace: WorkspaceSchema;
179
- can_update: boolean;
180
- }
181
- export interface ChatMessageSchema {
182
- id: ID;
183
- created_at: DateTime;
184
- chat_id: ID;
185
- chat_role: ChatRole;
265
+ export interface Chat {
266
+ id: string;
267
+ created_at: string;
268
+ code_id: string;
269
+ version_id: string | null;
270
+ title: string | null;
271
+ chat_type: ChatType;
272
+ total_messages: number;
273
+ }
274
+ export interface ChatMessage {
275
+ id: string;
276
+ created_at: string;
277
+ chat_id: string;
278
+ chat_role: ChatMessageRole;
186
279
  message: string;
187
280
  refs: InlineRef[];
188
281
  has_proposal: boolean;
189
282
  proposal_status: string | null;
190
283
  }
191
- export interface ChatSchema {
192
- id: ID;
193
- created_at: DateTime;
194
- code_id: ID;
195
- version_id: ID | null;
196
- title: string | null;
197
- chat_type: ChatType;
198
- total_messages: number;
199
- }
200
- export declare const STREAMED_MESSAGE_EVENT_TYPES: readonly ["text", "tool-call", "thinking", "approval", "failure", "reference"];
201
- export interface StreamedMessageType {
284
+ export interface ChatMessageStream {
202
285
  id: string | null;
203
- event_type: (typeof STREAMED_MESSAGE_EVENT_TYPES)[number];
286
+ event_type: "text" | "tool-call" | "thinking" | "approval" | "failure" | "reference";
204
287
  content: string | null;
205
288
  }
206
- export declare const GRAPH_SNAPSHOT_SCHEMA_VERSION = 1;
207
- export interface GithubCommitSchema {
208
- sha: string;
209
- author: string;
210
- message: string;
211
- timestamp: DateTime;
212
- }
213
- export interface CodeVersionSchema {
214
- id: ID;
215
- network: Network | null;
216
- version_method: VersionMethod;
289
+ export interface CodeContent {
290
+ content: string;
291
+ }
292
+ export interface CodeVersion {
293
+ id: string;
294
+ /**
295
+ * The chain the contract is deployed on.
296
+ */
297
+ network: BlockchainNetwork | null;
298
+ /**
299
+ * How the code was sourced.
300
+ */
301
+ version_method: CodeVersionMethod;
302
+ /**
303
+ * Uniquely identifies this code.
304
+ */
217
305
  version_fingerprint: string;
306
+ /**
307
+ * Processing status of the code.
308
+ */
218
309
  status: CodeVersionStatus;
219
310
  branch: string | null;
220
- commit: GithubCommitSchema | null;
221
- repository: GithubRepositorySchema | null;
222
- }
223
- export interface CodeMappingSchema extends CodeVersionSchema {
224
- created_at: DateTime;
225
- }
226
- export interface GraphSnapshotFile {
227
- id: ID;
228
- language: Language;
229
- path: string;
230
- content_hash: string;
231
- is_dependency?: boolean;
232
- is_config?: boolean;
233
- is_test?: boolean;
234
- is_script?: boolean;
235
- labels?: string[];
236
- include_in_graph?: boolean;
237
- }
238
- export interface GraphSnapshotNode {
239
- id: ID;
240
- file_id: ID;
241
- file_path: string;
242
- short_id: string;
243
- node_type: string;
244
- sub_type?: string | null;
245
- src_start_pos: number;
246
- src_end_pos: number;
247
- path: string;
248
- docstring?: string | null;
249
- name: string;
250
- merkle_hash: string;
251
- dm_hash?: string | null;
252
- visibility?: Visibility | null;
253
- mutability?: string | null;
254
- is_virtual?: boolean;
255
- is_implemented?: boolean;
256
- signature?: string | null;
257
- is_callable: boolean;
258
- is_declaration: boolean;
259
- is_container: boolean;
260
- is_entrypoint: boolean;
261
- fields?: FieldMetadataItem[];
262
- parameters?: ParameterStorageMetadata[];
263
- returns?: ReturnStorageMetadata[];
264
- }
265
- export interface GraphSnapshotEdge {
266
- id: ID;
267
- src_id: ID;
268
- dst_id?: ID | null;
269
- short_src_id: string;
270
- short_dst_id?: string | null;
271
- edge_type: EdgeType;
272
- src_start_pos: number;
273
- call_bindings?: CallBinding[];
274
- src_field_names?: string[];
275
- dst_field_names?: string[];
276
- /** Only set on edges returned by `Graph.getEdgesForNode`, relative to the queried node. */
277
- direction?: EdgeDirection | null;
278
- is_conditional: boolean;
279
- target_effect_id?: ID | null;
280
- low_level_name?: string | null;
281
- src_node_type: string;
282
- dst_node_type?: string | null;
283
- /** True when the edge has no destination node. */
284
- is_synthetic?: boolean;
285
- }
286
- export interface CallChainSchema {
287
- node_id: ID;
288
- short_id: string;
289
- is_resolved: boolean;
290
- response_type: "json" | "text";
291
- call_chain: CallNodeDict | string | null;
311
+ commit: GithubCommit | null;
312
+ repository: GithubRepository | null;
313
+ }
314
+ export interface CodeVersionInstance {
315
+ id: string;
316
+ /**
317
+ * The chain the contract is deployed on.
318
+ */
319
+ network: BlockchainNetwork | null;
320
+ /**
321
+ * How the code was sourced.
322
+ */
323
+ version_method: CodeVersionMethod;
324
+ /**
325
+ * Uniquely identifies this code.
326
+ */
327
+ version_fingerprint: string;
328
+ /**
329
+ * Processing status of the code.
330
+ */
331
+ status: CodeVersionStatus;
332
+ branch: string | null;
333
+ commit: GithubCommit | null;
334
+ repository: GithubRepository | null;
335
+ created_at: string;
336
+ }
337
+ export interface CollisionVersion {
338
+ id: string;
339
+ created_at: string;
340
+ /**
341
+ * How this version was created.
342
+ */
343
+ trigger: AnalysisTrigger;
344
+ /**
345
+ * Findings on this version, including staged changes.
346
+ */
347
+ n_findings: number;
348
+ /**
349
+ * Uncommitted finding changes on this version.
350
+ */
351
+ n_staged: number;
352
+ /**
353
+ * Findings from the parent version dropped because their code changed.
354
+ */
355
+ n_remediations: number;
356
+ /**
357
+ * Whether this is the analysis's HEAD.
358
+ */
359
+ is_head: boolean;
360
+ /**
361
+ * Whether any entrypoint is still being analyzed.
362
+ */
363
+ has_pipeline_processing: boolean;
364
+ /**
365
+ * Whether any entrypoint failed in the latest run.
366
+ */
367
+ has_pipeline_failed: boolean;
368
+ /**
369
+ * The code this version analyzes.
370
+ */
371
+ code_version: CodeVersion;
372
+ /**
373
+ * The version merged into this one.
374
+ */
375
+ merged_from_version: AnalysisVersionRef | null;
376
+ /**
377
+ * The version this one was forked from.
378
+ */
379
+ forked_from_version: AnalysisVersionRef | null;
380
+ /**
381
+ * The previous version in this analysis.
382
+ */
383
+ parent_version: AnalysisVersionRef | null;
384
+ /**
385
+ * Versions built on this one.
386
+ */
387
+ child_versions: AnalysisVersionRef[];
388
+ /**
389
+ * Versions this one was merged into.
390
+ */
391
+ merged_versions: AnalysisVersionRef[];
392
+ /**
393
+ * Forks of this version.
394
+ */
395
+ forked_versions: AnalysisVersionRef[];
396
+ actions: AnalysisActions;
397
+ /**
398
+ * The analysis this version belongs to.
399
+ */
400
+ analysis_meta: AnalysisMetadata;
401
+ /**
402
+ * The suggested way to reuse this version.
403
+ */
404
+ on_collision: "fork" | "merge" | "view";
292
405
  }
293
- export interface AnalysisVersionRef {
294
- id: ID;
295
- analysis_id: ID;
406
+ /**
407
+ * An externally callable function: the unit the security pipeline analyzes.
408
+ */
409
+ export interface EntryPoint {
410
+ /**
411
+ * The entrypoint's node in the code graph.
412
+ */
413
+ node: GraphSnapshotNode;
414
+ /**
415
+ * Whether it was ever analyzed.
416
+ */
417
+ is_analyzed: boolean;
418
+ /**
419
+ * Whether it was inherited from a parent.
420
+ */
421
+ is_inherited: boolean;
422
+ /**
423
+ * Whether it was analyzed in this version.
424
+ */
425
+ is_analyzed_in_current: boolean;
426
+ /**
427
+ * Most recent bevor security pipeline status
428
+ */
429
+ pipeline_status: AnalysisEntrypointStatus;
430
+ /**
431
+ * Number of indings on this entrypoint.
432
+ */
433
+ n_findings: number;
296
434
  }
297
- export interface FindingBareSchema {
298
- id: ID;
299
- created_at: DateTime;
300
- origin_finding_id: ID;
435
+ export interface Finding {
436
+ id: string;
437
+ created_at: string;
438
+ /**
439
+ * The finding's original ID, stable across versions and edits.
440
+ */
441
+ origin_finding_id: string;
442
+ /**
443
+ * Whether a user acknowledged the finding.
444
+ */
301
445
  is_acknowledged: boolean;
302
446
  type: string;
303
447
  level: FindingLevel;
@@ -305,145 +449,212 @@ export interface FindingBareSchema {
305
449
  explanation: string;
306
450
  recommendation: string | null;
307
451
  poc: string | null;
452
+ /**
453
+ * What produced the finding.
454
+ */
308
455
  tool: string;
456
+ /**
457
+ * The code graph node the finding is on.
458
+ */
459
+ node_id: string;
460
+ /**
461
+ * Whether the finding was carried over from an earlier version.
462
+ */
463
+ is_borrowed: boolean;
464
+ /**
465
+ * The source location within the node.
466
+ */
467
+ location_id: string | null;
468
+ /**
469
+ * Who created the finding.
470
+ */
471
+ created_by_user: User;
472
+ /**
473
+ * The code version the finding is on.
474
+ */
475
+ code_id: string;
476
+ /**
477
+ * The finding's staged change, if any.
478
+ */
479
+ operation: FindingDraftOperation | null;
480
+ /**
481
+ * The analysis version the finding belongs to.
482
+ */
483
+ version: AnalysisVersionRef;
484
+ actions: FindingActions;
309
485
  }
310
486
  export interface FindingActions {
311
487
  edit: ActionDetails;
312
488
  revert: ActionDetails;
313
489
  delete: ActionDetails;
314
490
  }
315
- export interface FindingSchema extends FindingBareSchema {
316
- node_id: ID;
317
- is_borrowed: boolean;
318
- location_id: ID | null;
319
- created_by_user: UserSchema;
320
- code_id: ID;
321
- operation: FindingDraftOperation | null;
322
- version: AnalysisVersionRef;
323
- actions: FindingActions;
491
+ export interface FindingBare {
492
+ id: string;
493
+ created_at: string;
494
+ /**
495
+ * The finding's original ID, stable across versions and edits.
496
+ */
497
+ origin_finding_id: string;
498
+ /**
499
+ * Whether a user acknowledged the finding.
500
+ */
501
+ is_acknowledged: boolean;
502
+ type: string;
503
+ level: FindingLevel;
504
+ name: string;
505
+ explanation: string;
506
+ recommendation: string | null;
507
+ poc: string | null;
508
+ /**
509
+ * What produced the finding.
510
+ */
511
+ tool: string;
324
512
  }
325
- export interface FindingCommentSchema {
326
- id: ID;
327
- created_at: DateTime;
513
+ export interface FindingComment {
514
+ id: string;
515
+ created_at: string;
328
516
  message: string;
329
517
  refs: InlineRef[];
330
- user: UserSchema;
518
+ user: User;
331
519
  }
332
- export interface AnalysisActions {
333
- fork: ActionDetails;
334
- create_child: ActionDetails;
335
- commit_changes: ActionDetails;
336
- delete: ActionDetails;
337
- run_pipeline: ActionDetails;
338
- run_first_party_pipeline: ActionDetails;
339
- retry_pipeline: ActionDetails;
340
- merge_to: ActionDetails;
341
- merge_from: ActionDetails;
342
- stage_changes: ActionDetails;
343
- set_as_head: ActionDetails;
520
+ export interface FindingTransition {
521
+ id: string;
522
+ created_at: string;
523
+ before_version: AnalysisVersionRef;
524
+ after_version: AnalysisVersionRef;
525
+ /**
526
+ * How the finding changed.
527
+ */
528
+ reason: FindingTransitionReason;
529
+ /**
530
+ * The finding before the change.
531
+ */
532
+ before_finding: FindingBare | null;
533
+ /**
534
+ * The finding after the change.
535
+ */
536
+ after_finding: FindingBare | null;
537
+ /**
538
+ * used when comparing staged changes
539
+ */
540
+ changed_fields: string[];
344
541
  }
345
- export interface AnalysisMetadataSchema {
346
- id: ID;
347
- name: string;
348
- created_at: DateTime;
349
- user: UserSchema;
350
- is_owner: boolean;
542
+ export interface GithubAccount {
543
+ id: number;
544
+ login: string;
545
+ type: string;
546
+ avatar_url: string;
351
547
  }
352
- export interface AnalysisVersionSlimSchema {
353
- id: ID;
354
- created_at: DateTime;
355
- trigger: AnalysisTrigger;
356
- analysis_meta: AnalysisMetadataSchema;
548
+ export interface GithubBranchFilterMap {
549
+ pattern: string;
550
+ is_enabled: boolean;
357
551
  }
358
- export interface AnalysisVersionSchema {
359
- id: ID;
360
- created_at: DateTime;
361
- trigger: AnalysisTrigger;
362
- n_findings: number;
363
- n_staged: number;
364
- n_remediations: number;
365
- is_head: boolean;
366
- has_pipeline_processing: boolean;
367
- has_pipeline_failed: boolean;
368
- code_version: CodeVersionSchema;
369
- merged_from_version: AnalysisVersionRef | null;
370
- forked_from_version: AnalysisVersionRef | null;
371
- parent_version: AnalysisVersionRef | null;
372
- child_versions: AnalysisVersionRef[];
373
- merged_versions: AnalysisVersionRef[];
374
- forked_versions: AnalysisVersionRef[];
375
- actions: AnalysisActions;
552
+ export interface GithubCommit {
553
+ sha: string;
554
+ author: string;
555
+ message: string;
556
+ timestamp: string;
376
557
  }
377
- /** A version retrieved directly, not through an analysis. */
378
- export interface VersionSchema extends AnalysisVersionSchema {
379
- analysis_meta: AnalysisMetadataSchema;
558
+ export interface GithubLink {
559
+ id: number;
560
+ name: string;
561
+ is_private: boolean;
562
+ account: GithubAccount;
563
+ push_events_enabled: boolean;
564
+ branch_filters: GithubBranchFilterMap[];
565
+ /**
566
+ * Full repository name: owner/repo-name
567
+ */
568
+ full_name: string;
569
+ /**
570
+ * GitHub repository URL
571
+ */
572
+ url: string;
380
573
  }
381
- export interface AnalysisSchema extends AnalysisMetadataSchema {
382
- version: AnalysisVersionSchema;
574
+ export interface GithubRepository {
575
+ id: number;
576
+ name: string;
577
+ is_private: boolean;
578
+ account: GithubAccount;
579
+ /**
580
+ * Full repository name: owner/repo-name
581
+ */
582
+ full_name: string;
583
+ /**
584
+ * GitHub repository URL
585
+ */
586
+ url: string;
383
587
  }
384
- export interface AnalysisExpandedSchema extends AnalysisSchema {
385
- findings: FindingSchema[];
588
+ export interface InlineRef {
589
+ id: string;
590
+ type: string;
591
+ source: string;
592
+ ref_ind: number;
593
+ name: string | null;
594
+ is_stale: boolean;
386
595
  }
387
- export interface EntryPointSchema {
388
- node: GraphSnapshotNode;
389
- is_analyzed: boolean;
390
- is_inherited: boolean;
391
- is_analyzed_in_current: boolean;
392
- pipeline_status: AnalysisRunStatus;
393
- n_findings: number;
596
+ export interface Project {
597
+ id: string;
598
+ created_at: string;
599
+ name: string;
600
+ description: string | null;
601
+ is_default: boolean;
602
+ kind: ProjectKind;
603
+ created_by_user: User;
604
+ n_codes: number;
605
+ n_analyses: number;
606
+ n_users: number;
607
+ github_link: GithubLink | null;
394
608
  }
395
- export interface AnalysisCreatedResult {
396
- is_created: true;
397
- analysis: AnalysisSchema;
609
+ export interface ProjectUser {
610
+ id: string;
611
+ is_self: boolean;
612
+ created_at: string;
613
+ username: string;
614
+ external_id: string | null;
615
+ metadata: {
616
+ [k: string]: unknown;
617
+ };
398
618
  }
399
- export interface CollisionVersionSchema extends VersionSchema {
400
- on_collision: "fork" | "merge" | "view";
619
+ export interface SigningKey {
620
+ key: string;
401
621
  }
402
- export interface AnalysisCollisionResult {
403
- is_created: false;
404
- candidates: CollisionVersionSchema[];
622
+ export interface SigningToken {
623
+ token: string;
405
624
  }
406
- /** Discriminated on `is_created`. */
407
- export type AnalysisCreateSchema = AnalysisCreatedResult | AnalysisCollisionResult;
408
- interface BaseSummarySchema {
625
+ export interface ToolBreakdown {
409
626
  n_added: number;
410
627
  n_updated: number;
411
628
  n_removed: number;
412
629
  n_remediated: number;
413
630
  n_dismissed: number;
414
- }
415
- export interface AnalysisNetworkPoint extends AnalysisVersionSlimSchema {
416
- ind: number;
417
- merged_from_version: AnalysisVersionRef | null;
418
- forked_from_version: AnalysisVersionRef | null;
419
- parent_version: AnalysisVersionRef | null;
420
- }
421
- export interface AnalysisFindingPoint extends BaseSummarySchema, AnalysisVersionSlimSchema {
422
- ind: number;
423
- }
424
- export interface UserBreakdownSchema extends BaseSummarySchema {
425
- user: UserSchema;
426
- n_versions: number;
427
- last_analysis_at: DateTime | null;
428
- }
429
- export interface ToolBreakdownSchema extends BaseSummarySchema {
430
631
  tool: string;
431
632
  }
432
- export interface ToolHistoryPoint extends ToolBreakdownSchema {
633
+ export interface ToolHistoryPoint {
634
+ n_added: number;
635
+ n_updated: number;
636
+ n_removed: number;
637
+ n_remediated: number;
638
+ n_dismissed: number;
639
+ tool: string;
433
640
  version: AnalysisVersionRef;
434
641
  analysis_name: string;
435
- created_at: DateTime;
642
+ created_at: string;
436
643
  }
437
- export interface FindingTransitionSchema {
438
- id: ID;
439
- created_at: DateTime;
440
- before_version: AnalysisVersionRef;
441
- after_version: AnalysisVersionRef;
442
- reason: FindingTransitionReason;
443
- before_finding: FindingBareSchema | null;
444
- after_finding: FindingBareSchema | null;
445
- /** used when comparing staged changes */
446
- changed_fields: string[];
644
+ export interface User {
645
+ id: string;
646
+ is_self: boolean;
647
+ created_at: string;
648
+ username: string;
649
+ }
650
+ export interface UserBreakdown {
651
+ n_added: number;
652
+ n_updated: number;
653
+ n_removed: number;
654
+ n_remediated: number;
655
+ n_dismissed: number;
656
+ user: User;
657
+ n_versions: number;
658
+ last_analysis_at: string | null;
447
659
  }
448
- export {};
449
660
  //# sourceMappingURL=responses.d.ts.map