@bevorai/sdk 0.2.0-rc1 → 0.2.0-rc3

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