@rawdash/connector-drata 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -0
- package/dist/index.d.ts +569 -0
- package/dist/index.js +653 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
import { BaseConnector, ConnectorContext, SyncOptions, StorageHandle, SyncResult, ConnectorDoc } from '@rawdash/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const configFields: z.ZodObject<{
|
|
5
|
+
apiKey: z.ZodObject<{
|
|
6
|
+
$secret: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
10
|
+
controls: "controls";
|
|
11
|
+
tests: "tests";
|
|
12
|
+
personnel: "personnel";
|
|
13
|
+
findings: "findings";
|
|
14
|
+
}>>>;
|
|
15
|
+
findingsLookbackDays: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
declare const doc: ConnectorDoc;
|
|
18
|
+
type DrataResource = 'controls' | 'tests' | 'personnel' | 'findings';
|
|
19
|
+
interface DrataSettings {
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
resources?: readonly DrataResource[];
|
|
22
|
+
findingsLookbackDays?: number;
|
|
23
|
+
}
|
|
24
|
+
declare const drataCredentials: {
|
|
25
|
+
apiKey: {
|
|
26
|
+
description: string;
|
|
27
|
+
auth: "required";
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type DrataCredentials = typeof drataCredentials;
|
|
31
|
+
declare const drataResources: {
|
|
32
|
+
readonly drata_control: {
|
|
33
|
+
readonly shape: "entity";
|
|
34
|
+
readonly filterable: [{
|
|
35
|
+
readonly field: "status";
|
|
36
|
+
readonly ops: ["eq"];
|
|
37
|
+
readonly values: ["PASSING", "FAILING", "NEEDS_ATTENTION", "DEACTIVATED"];
|
|
38
|
+
}, {
|
|
39
|
+
readonly field: "framework";
|
|
40
|
+
readonly ops: ["eq"];
|
|
41
|
+
}];
|
|
42
|
+
readonly description: "Drata controls keyed by id. Each control belongs to one or more frameworks (SOC 2, HIPAA, ISO 27001, etc.) and has a roll-up status of PASSING, FAILING, or NEEDS_ATTENTION.";
|
|
43
|
+
readonly endpoint: "GET /v1/controls";
|
|
44
|
+
readonly notes: "Cursor pagination via cursor / limit. Controls are a full-snapshot resource: a full sync rewrites the scope on first page.";
|
|
45
|
+
readonly fields: [{
|
|
46
|
+
readonly name: "name";
|
|
47
|
+
readonly description: "Human-readable control name.";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "status";
|
|
50
|
+
readonly description: "Roll-up status (PASSING, FAILING, NEEDS_ATTENTION, or DEACTIVATED).";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "framework";
|
|
53
|
+
readonly description: "Name of the first framework the control is mapped to (e.g. \"SOC 2\"). Use the framework dimension for distributions when a control maps to several frameworks.";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "frameworks";
|
|
56
|
+
readonly description: "Comma-separated list of every framework the control is mapped to.";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "lastEvaluated";
|
|
59
|
+
readonly description: "When Drata last evaluated the control (Unix ms).";
|
|
60
|
+
}];
|
|
61
|
+
readonly responses: {
|
|
62
|
+
readonly controls: z.ZodObject<{
|
|
63
|
+
data: z.ZodArray<z.ZodObject<{
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
+
frameworks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
69
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
matchingId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
}, z.core.$strip>>>>;
|
|
72
|
+
lastEvaluatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
77
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly drata_test: {
|
|
84
|
+
readonly shape: "entity";
|
|
85
|
+
readonly filterable: [{
|
|
86
|
+
readonly field: "status";
|
|
87
|
+
readonly ops: ["eq"];
|
|
88
|
+
readonly values: ["OK", "NEEDS_ATTENTION", "DEACTIVATED", "IN_PROGRESS"];
|
|
89
|
+
}];
|
|
90
|
+
readonly description: "Drata tests keyed by id. A test is the smallest unit of evaluation in Drata and may be mapped to multiple controls.";
|
|
91
|
+
readonly endpoint: "GET /v1/tests";
|
|
92
|
+
readonly notes: "Cursor pagination via cursor / limit. Tests are a full-snapshot resource.";
|
|
93
|
+
readonly fields: [{
|
|
94
|
+
readonly name: "name";
|
|
95
|
+
readonly description: "Human-readable test name.";
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "status";
|
|
98
|
+
readonly description: "Test status (OK, NEEDS_ATTENTION, DEACTIVATED, or IN_PROGRESS).";
|
|
99
|
+
}, {
|
|
100
|
+
readonly name: "controlId";
|
|
101
|
+
readonly description: "First control id the test is mapped to (a test may be mapped to several controls).";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "controlCount";
|
|
104
|
+
readonly description: "Number of controls the test is mapped to.";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "evidenceCount";
|
|
107
|
+
readonly description: "Number of distinct evidence rows backing the test (counter maintained by Drata).";
|
|
108
|
+
}, {
|
|
109
|
+
readonly name: "lastTested";
|
|
110
|
+
readonly description: "When Drata last ran the test (Unix ms).";
|
|
111
|
+
}];
|
|
112
|
+
readonly responses: {
|
|
113
|
+
readonly tests: z.ZodObject<{
|
|
114
|
+
data: z.ZodArray<z.ZodObject<{
|
|
115
|
+
id: z.ZodString;
|
|
116
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
117
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
controlIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
120
|
+
controls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
}, z.core.$strip>>>>;
|
|
123
|
+
evidenceCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
124
|
+
lastTestedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
|
+
}, z.core.$strip>>;
|
|
128
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
129
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
130
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
131
|
+
}, z.core.$strip>>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
readonly drata_personnel: {
|
|
136
|
+
readonly shape: "entity";
|
|
137
|
+
readonly filterable: [{
|
|
138
|
+
readonly field: "employmentStatus";
|
|
139
|
+
readonly ops: ["eq"];
|
|
140
|
+
}, {
|
|
141
|
+
readonly field: "trainingStatus";
|
|
142
|
+
readonly ops: ["eq"];
|
|
143
|
+
}];
|
|
144
|
+
readonly description: "Drata personnel records keyed by id. Surfaces employment status, role, training completion, and training-completed timestamp for compliance-training dashboards.";
|
|
145
|
+
readonly endpoint: "GET /v1/personnel";
|
|
146
|
+
readonly notes: "Cursor pagination via cursor / limit. Personnel is a full-snapshot resource.";
|
|
147
|
+
readonly fields: [{
|
|
148
|
+
readonly name: "email";
|
|
149
|
+
readonly description: "Work email address.";
|
|
150
|
+
}, {
|
|
151
|
+
readonly name: "name";
|
|
152
|
+
readonly description: "Full name (\"firstName lastName\").";
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "role";
|
|
155
|
+
readonly description: "Reported role / job title.";
|
|
156
|
+
}, {
|
|
157
|
+
readonly name: "employmentStatus";
|
|
158
|
+
readonly description: "Reported employment status (e.g. ACTIVE, ONBOARDING, OFFBOARDED).";
|
|
159
|
+
}, {
|
|
160
|
+
readonly name: "trainingStatus";
|
|
161
|
+
readonly description: "Reported security-training status (e.g. COMPLETED, IN_PROGRESS, NOT_STARTED, OVERDUE).";
|
|
162
|
+
}, {
|
|
163
|
+
readonly name: "trainingCompleted";
|
|
164
|
+
readonly description: "When the most recent training was marked completed (Unix ms).";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "startDate";
|
|
167
|
+
readonly description: "Reported employment start date (Unix ms).";
|
|
168
|
+
}];
|
|
169
|
+
readonly responses: {
|
|
170
|
+
readonly personnel: z.ZodObject<{
|
|
171
|
+
data: z.ZodArray<z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
174
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
175
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
176
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
employmentStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
179
|
+
trainingStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
|
+
trainingCompletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
185
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
186
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
187
|
+
}, z.core.$strip>>>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
readonly drata_test_finding: {
|
|
192
|
+
readonly shape: "event";
|
|
193
|
+
readonly filterable: [{
|
|
194
|
+
readonly field: "severity";
|
|
195
|
+
readonly ops: ["eq"];
|
|
196
|
+
readonly values: ["LOW", "MEDIUM", "HIGH", "CRITICAL"];
|
|
197
|
+
}, {
|
|
198
|
+
readonly field: "status";
|
|
199
|
+
readonly ops: ["eq"];
|
|
200
|
+
readonly values: ["OPEN", "RESOLVED", "DEFERRED", "WONT_FIX"];
|
|
201
|
+
}];
|
|
202
|
+
readonly description: "Test findings (one event per finding row), with severity, the test it came from, and resolved-at when applicable. Useful for open-finding counts and MTTR-to-resolution timeseries.";
|
|
203
|
+
readonly endpoint: "GET /v1/findings";
|
|
204
|
+
readonly notes: "Cursor pagination via cursor / limit. Full syncs walk back findingsLookbackDays days; incremental syncs use the sync `since` watermark.";
|
|
205
|
+
readonly fields: [{
|
|
206
|
+
readonly name: "findingId";
|
|
207
|
+
readonly description: "Drata finding id.";
|
|
208
|
+
}, {
|
|
209
|
+
readonly name: "severity";
|
|
210
|
+
readonly description: "Finding severity (LOW, MEDIUM, HIGH, CRITICAL).";
|
|
211
|
+
}, {
|
|
212
|
+
readonly name: "status";
|
|
213
|
+
readonly description: "Finding status (OPEN, RESOLVED, DEFERRED, WONT_FIX).";
|
|
214
|
+
}, {
|
|
215
|
+
readonly name: "testId";
|
|
216
|
+
readonly description: "Id of the test that produced the finding.";
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "controlId";
|
|
219
|
+
readonly description: "First control id the finding is mapped to (via its test).";
|
|
220
|
+
}, {
|
|
221
|
+
readonly name: "resolvedAt";
|
|
222
|
+
readonly description: "Resolution timestamp (Unix ms) when resolved.";
|
|
223
|
+
}];
|
|
224
|
+
readonly responses: {
|
|
225
|
+
readonly findings: z.ZodObject<{
|
|
226
|
+
data: z.ZodArray<z.ZodObject<{
|
|
227
|
+
id: z.ZodString;
|
|
228
|
+
testId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
controlId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
230
|
+
severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
232
|
+
createdAt: z.ZodString;
|
|
233
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
234
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
238
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
240
|
+
}, z.core.$strip>>>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
declare const id = "drata";
|
|
246
|
+
declare class DrataConnector extends BaseConnector<DrataSettings, DrataCredentials> {
|
|
247
|
+
static readonly id = "drata";
|
|
248
|
+
static readonly resources: {
|
|
249
|
+
readonly drata_control: {
|
|
250
|
+
readonly shape: "entity";
|
|
251
|
+
readonly filterable: [{
|
|
252
|
+
readonly field: "status";
|
|
253
|
+
readonly ops: ["eq"];
|
|
254
|
+
readonly values: ["PASSING", "FAILING", "NEEDS_ATTENTION", "DEACTIVATED"];
|
|
255
|
+
}, {
|
|
256
|
+
readonly field: "framework";
|
|
257
|
+
readonly ops: ["eq"];
|
|
258
|
+
}];
|
|
259
|
+
readonly description: "Drata controls keyed by id. Each control belongs to one or more frameworks (SOC 2, HIPAA, ISO 27001, etc.) and has a roll-up status of PASSING, FAILING, or NEEDS_ATTENTION.";
|
|
260
|
+
readonly endpoint: "GET /v1/controls";
|
|
261
|
+
readonly notes: "Cursor pagination via cursor / limit. Controls are a full-snapshot resource: a full sync rewrites the scope on first page.";
|
|
262
|
+
readonly fields: [{
|
|
263
|
+
readonly name: "name";
|
|
264
|
+
readonly description: "Human-readable control name.";
|
|
265
|
+
}, {
|
|
266
|
+
readonly name: "status";
|
|
267
|
+
readonly description: "Roll-up status (PASSING, FAILING, NEEDS_ATTENTION, or DEACTIVATED).";
|
|
268
|
+
}, {
|
|
269
|
+
readonly name: "framework";
|
|
270
|
+
readonly description: "Name of the first framework the control is mapped to (e.g. \"SOC 2\"). Use the framework dimension for distributions when a control maps to several frameworks.";
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "frameworks";
|
|
273
|
+
readonly description: "Comma-separated list of every framework the control is mapped to.";
|
|
274
|
+
}, {
|
|
275
|
+
readonly name: "lastEvaluated";
|
|
276
|
+
readonly description: "When Drata last evaluated the control (Unix ms).";
|
|
277
|
+
}];
|
|
278
|
+
readonly responses: {
|
|
279
|
+
readonly controls: z.ZodObject<{
|
|
280
|
+
data: z.ZodArray<z.ZodObject<{
|
|
281
|
+
id: z.ZodString;
|
|
282
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
frameworks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
286
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
+
matchingId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
|
+
}, z.core.$strip>>>>;
|
|
289
|
+
lastEvaluatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
290
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
292
|
+
}, z.core.$strip>>;
|
|
293
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
294
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
295
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
296
|
+
}, z.core.$strip>>>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
readonly drata_test: {
|
|
301
|
+
readonly shape: "entity";
|
|
302
|
+
readonly filterable: [{
|
|
303
|
+
readonly field: "status";
|
|
304
|
+
readonly ops: ["eq"];
|
|
305
|
+
readonly values: ["OK", "NEEDS_ATTENTION", "DEACTIVATED", "IN_PROGRESS"];
|
|
306
|
+
}];
|
|
307
|
+
readonly description: "Drata tests keyed by id. A test is the smallest unit of evaluation in Drata and may be mapped to multiple controls.";
|
|
308
|
+
readonly endpoint: "GET /v1/tests";
|
|
309
|
+
readonly notes: "Cursor pagination via cursor / limit. Tests are a full-snapshot resource.";
|
|
310
|
+
readonly fields: [{
|
|
311
|
+
readonly name: "name";
|
|
312
|
+
readonly description: "Human-readable test name.";
|
|
313
|
+
}, {
|
|
314
|
+
readonly name: "status";
|
|
315
|
+
readonly description: "Test status (OK, NEEDS_ATTENTION, DEACTIVATED, or IN_PROGRESS).";
|
|
316
|
+
}, {
|
|
317
|
+
readonly name: "controlId";
|
|
318
|
+
readonly description: "First control id the test is mapped to (a test may be mapped to several controls).";
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "controlCount";
|
|
321
|
+
readonly description: "Number of controls the test is mapped to.";
|
|
322
|
+
}, {
|
|
323
|
+
readonly name: "evidenceCount";
|
|
324
|
+
readonly description: "Number of distinct evidence rows backing the test (counter maintained by Drata).";
|
|
325
|
+
}, {
|
|
326
|
+
readonly name: "lastTested";
|
|
327
|
+
readonly description: "When Drata last ran the test (Unix ms).";
|
|
328
|
+
}];
|
|
329
|
+
readonly responses: {
|
|
330
|
+
readonly tests: z.ZodObject<{
|
|
331
|
+
data: z.ZodArray<z.ZodObject<{
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
334
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
335
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
336
|
+
controlIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
337
|
+
controls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
338
|
+
id: z.ZodString;
|
|
339
|
+
}, z.core.$strip>>>>;
|
|
340
|
+
evidenceCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
341
|
+
lastTestedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
343
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
344
|
+
}, z.core.$strip>>;
|
|
345
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
346
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
347
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
348
|
+
}, z.core.$strip>>>;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
readonly drata_personnel: {
|
|
353
|
+
readonly shape: "entity";
|
|
354
|
+
readonly filterable: [{
|
|
355
|
+
readonly field: "employmentStatus";
|
|
356
|
+
readonly ops: ["eq"];
|
|
357
|
+
}, {
|
|
358
|
+
readonly field: "trainingStatus";
|
|
359
|
+
readonly ops: ["eq"];
|
|
360
|
+
}];
|
|
361
|
+
readonly description: "Drata personnel records keyed by id. Surfaces employment status, role, training completion, and training-completed timestamp for compliance-training dashboards.";
|
|
362
|
+
readonly endpoint: "GET /v1/personnel";
|
|
363
|
+
readonly notes: "Cursor pagination via cursor / limit. Personnel is a full-snapshot resource.";
|
|
364
|
+
readonly fields: [{
|
|
365
|
+
readonly name: "email";
|
|
366
|
+
readonly description: "Work email address.";
|
|
367
|
+
}, {
|
|
368
|
+
readonly name: "name";
|
|
369
|
+
readonly description: "Full name (\"firstName lastName\").";
|
|
370
|
+
}, {
|
|
371
|
+
readonly name: "role";
|
|
372
|
+
readonly description: "Reported role / job title.";
|
|
373
|
+
}, {
|
|
374
|
+
readonly name: "employmentStatus";
|
|
375
|
+
readonly description: "Reported employment status (e.g. ACTIVE, ONBOARDING, OFFBOARDED).";
|
|
376
|
+
}, {
|
|
377
|
+
readonly name: "trainingStatus";
|
|
378
|
+
readonly description: "Reported security-training status (e.g. COMPLETED, IN_PROGRESS, NOT_STARTED, OVERDUE).";
|
|
379
|
+
}, {
|
|
380
|
+
readonly name: "trainingCompleted";
|
|
381
|
+
readonly description: "When the most recent training was marked completed (Unix ms).";
|
|
382
|
+
}, {
|
|
383
|
+
readonly name: "startDate";
|
|
384
|
+
readonly description: "Reported employment start date (Unix ms).";
|
|
385
|
+
}];
|
|
386
|
+
readonly responses: {
|
|
387
|
+
readonly personnel: z.ZodObject<{
|
|
388
|
+
data: z.ZodArray<z.ZodObject<{
|
|
389
|
+
id: z.ZodString;
|
|
390
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
391
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
392
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
393
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
394
|
+
employmentStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
395
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
396
|
+
trainingStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
397
|
+
trainingCompletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
398
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
399
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
402
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
403
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
404
|
+
}, z.core.$strip>>>;
|
|
405
|
+
}, z.core.$strip>;
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
readonly drata_test_finding: {
|
|
409
|
+
readonly shape: "event";
|
|
410
|
+
readonly filterable: [{
|
|
411
|
+
readonly field: "severity";
|
|
412
|
+
readonly ops: ["eq"];
|
|
413
|
+
readonly values: ["LOW", "MEDIUM", "HIGH", "CRITICAL"];
|
|
414
|
+
}, {
|
|
415
|
+
readonly field: "status";
|
|
416
|
+
readonly ops: ["eq"];
|
|
417
|
+
readonly values: ["OPEN", "RESOLVED", "DEFERRED", "WONT_FIX"];
|
|
418
|
+
}];
|
|
419
|
+
readonly description: "Test findings (one event per finding row), with severity, the test it came from, and resolved-at when applicable. Useful for open-finding counts and MTTR-to-resolution timeseries.";
|
|
420
|
+
readonly endpoint: "GET /v1/findings";
|
|
421
|
+
readonly notes: "Cursor pagination via cursor / limit. Full syncs walk back findingsLookbackDays days; incremental syncs use the sync `since` watermark.";
|
|
422
|
+
readonly fields: [{
|
|
423
|
+
readonly name: "findingId";
|
|
424
|
+
readonly description: "Drata finding id.";
|
|
425
|
+
}, {
|
|
426
|
+
readonly name: "severity";
|
|
427
|
+
readonly description: "Finding severity (LOW, MEDIUM, HIGH, CRITICAL).";
|
|
428
|
+
}, {
|
|
429
|
+
readonly name: "status";
|
|
430
|
+
readonly description: "Finding status (OPEN, RESOLVED, DEFERRED, WONT_FIX).";
|
|
431
|
+
}, {
|
|
432
|
+
readonly name: "testId";
|
|
433
|
+
readonly description: "Id of the test that produced the finding.";
|
|
434
|
+
}, {
|
|
435
|
+
readonly name: "controlId";
|
|
436
|
+
readonly description: "First control id the finding is mapped to (via its test).";
|
|
437
|
+
}, {
|
|
438
|
+
readonly name: "resolvedAt";
|
|
439
|
+
readonly description: "Resolution timestamp (Unix ms) when resolved.";
|
|
440
|
+
}];
|
|
441
|
+
readonly responses: {
|
|
442
|
+
readonly findings: z.ZodObject<{
|
|
443
|
+
data: z.ZodArray<z.ZodObject<{
|
|
444
|
+
id: z.ZodString;
|
|
445
|
+
testId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
446
|
+
controlId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
447
|
+
severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
448
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
449
|
+
createdAt: z.ZodString;
|
|
450
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
451
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
452
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
453
|
+
}, z.core.$strip>>;
|
|
454
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
455
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
456
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
457
|
+
}, z.core.$strip>>>;
|
|
458
|
+
}, z.core.$strip>;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
static readonly schemas: {
|
|
463
|
+
readonly controls: z.ZodObject<{
|
|
464
|
+
data: z.ZodArray<z.ZodObject<{
|
|
465
|
+
id: z.ZodString;
|
|
466
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
467
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
468
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
469
|
+
frameworks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
470
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
471
|
+
matchingId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
472
|
+
}, z.core.$strip>>>>;
|
|
473
|
+
lastEvaluatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
474
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
475
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
476
|
+
}, z.core.$strip>>;
|
|
477
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
478
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
479
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
480
|
+
}, z.core.$strip>>>;
|
|
481
|
+
}, z.core.$strip>;
|
|
482
|
+
} & {
|
|
483
|
+
readonly tests: z.ZodObject<{
|
|
484
|
+
data: z.ZodArray<z.ZodObject<{
|
|
485
|
+
id: z.ZodString;
|
|
486
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
487
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
488
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
489
|
+
controlIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
490
|
+
controls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
491
|
+
id: z.ZodString;
|
|
492
|
+
}, z.core.$strip>>>>;
|
|
493
|
+
evidenceCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
494
|
+
lastTestedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
495
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
497
|
+
}, z.core.$strip>>;
|
|
498
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
499
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
500
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
501
|
+
}, z.core.$strip>>>;
|
|
502
|
+
}, z.core.$strip>;
|
|
503
|
+
} & {
|
|
504
|
+
readonly personnel: z.ZodObject<{
|
|
505
|
+
data: z.ZodArray<z.ZodObject<{
|
|
506
|
+
id: z.ZodString;
|
|
507
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
508
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
509
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
510
|
+
role: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
511
|
+
employmentStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
512
|
+
startDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
513
|
+
trainingStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
514
|
+
trainingCompletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
515
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
516
|
+
createdAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
517
|
+
}, z.core.$strip>>;
|
|
518
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
519
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
520
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
521
|
+
}, z.core.$strip>>>;
|
|
522
|
+
}, z.core.$strip>;
|
|
523
|
+
} & {
|
|
524
|
+
readonly findings: z.ZodObject<{
|
|
525
|
+
data: z.ZodArray<z.ZodObject<{
|
|
526
|
+
id: z.ZodString;
|
|
527
|
+
testId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
528
|
+
controlId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
529
|
+
severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
530
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
531
|
+
createdAt: z.ZodString;
|
|
532
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
533
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
534
|
+
resourceId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
535
|
+
}, z.core.$strip>>;
|
|
536
|
+
pagination: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
537
|
+
nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
538
|
+
hasMore: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
539
|
+
}, z.core.$strip>>>;
|
|
540
|
+
}, z.core.$strip>;
|
|
541
|
+
} & Readonly<Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
542
|
+
static create(input: unknown, ctx?: ConnectorContext): DrataConnector;
|
|
543
|
+
readonly id = "drata";
|
|
544
|
+
readonly credentials: {
|
|
545
|
+
apiKey: {
|
|
546
|
+
description: string;
|
|
547
|
+
auth: "required";
|
|
548
|
+
};
|
|
549
|
+
};
|
|
550
|
+
private baseUrl;
|
|
551
|
+
private apiGet;
|
|
552
|
+
private buildListUrl;
|
|
553
|
+
private nextCursor;
|
|
554
|
+
private fetchControlsPage;
|
|
555
|
+
private fetchTestsPage;
|
|
556
|
+
private fetchPersonnelPage;
|
|
557
|
+
private findingsSinceIso;
|
|
558
|
+
private fetchFindingsPage;
|
|
559
|
+
private writeControls;
|
|
560
|
+
private writeTests;
|
|
561
|
+
private writePersonnel;
|
|
562
|
+
private writeFindings;
|
|
563
|
+
private writePhase;
|
|
564
|
+
private clearScopeOnFirstPage;
|
|
565
|
+
private resolveCursor;
|
|
566
|
+
sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<SyncResult>;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export { DrataConnector, type DrataResource, type DrataSettings, configFields, DrataConnector as default, doc, id, drataResources as resources };
|