@superblocksteam/shared 0.9603.2 → 0.9604.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/dist/database-lifecycle/capacityPolicy.d.ts +51 -0
- package/dist/database-lifecycle/capacityPolicy.d.ts.map +1 -0
- package/dist/database-lifecycle/capacityPolicy.js +159 -0
- package/dist/database-lifecycle/capacityPolicy.js.map +1 -0
- package/dist/database-lifecycle/capacityPolicy.test.d.ts +2 -0
- package/dist/database-lifecycle/capacityPolicy.test.d.ts.map +1 -0
- package/dist/database-lifecycle/capacityPolicy.test.js +159 -0
- package/dist/database-lifecycle/capacityPolicy.test.js.map +1 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.d.ts +18 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.d.ts.map +1 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.js +32 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.js.map +1 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.test.d.ts +2 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.test.d.ts.map +1 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.test.js +91 -0
- package/dist/database-lifecycle/edit-lifecycle-capability.test.js.map +1 -0
- package/dist/database-lifecycle/index.d.ts +50 -27
- package/dist/database-lifecycle/index.d.ts.map +1 -1
- package/dist/database-lifecycle/index.js +78 -54
- package/dist/database-lifecycle/index.js.map +1 -1
- package/dist/database-lifecycle/index.test.js +120 -77
- package/dist/database-lifecycle/index.test.js.map +1 -1
- package/dist/database-lifecycle/physicalPoolIdentity.d.ts +29 -0
- package/dist/database-lifecycle/physicalPoolIdentity.d.ts.map +1 -0
- package/dist/database-lifecycle/physicalPoolIdentity.js +64 -0
- package/dist/database-lifecycle/physicalPoolIdentity.js.map +1 -0
- package/dist/database-lifecycle/physicalPoolIdentity.test.d.ts +2 -0
- package/dist/database-lifecycle/physicalPoolIdentity.test.d.ts.map +1 -0
- package/dist/database-lifecycle/physicalPoolIdentity.test.js +51 -0
- package/dist/database-lifecycle/physicalPoolIdentity.test.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/audit/ocsf.d.ts +60 -6
- package/dist/types/audit/ocsf.d.ts.map +1 -1
- package/dist/types/audit/ocsf.js +12 -1
- package/dist/types/audit/ocsf.js.map +1 -1
- package/dist/types/deployment/deployQueueStatus.d.ts +13 -0
- package/dist/types/deployment/deployQueueStatus.d.ts.map +1 -1
- package/dist/types/deployment/index.d.ts +1 -1
- package/dist/types/deployment/index.d.ts.map +1 -1
- package/dist/types/deployment/index.js.map +1 -1
- package/dist/types/policyGate/index.d.ts +5 -0
- package/dist/types/policyGate/index.d.ts.map +1 -1
- package/dist/types/policyGate/index.js +5 -1
- package/dist/types/policyGate/index.js.map +1 -1
- package/dist/types/publishPipeline/plan.js +1 -1
- package/dist/types/publishPipeline/plan.js.map +1 -1
- package/dist/types/publishPipeline/plan.test.js +3 -3
- package/dist/types/publishPipeline/plan.test.js.map +1 -1
- package/dist/types/rbac/index.d.ts +2 -0
- package/dist/types/rbac/index.d.ts.map +1 -1
- package/dist/types/rbac/index.js +3 -1
- package/dist/types/rbac/index.js.map +1 -1
- package/dist/types/reviewPolicy/index.d.ts +30 -4
- package/dist/types/reviewPolicy/index.d.ts.map +1 -1
- package/dist/types/reviewPolicy/index.js +8 -1
- package/dist/types/reviewPolicy/index.js.map +1 -1
- package/dist-esm/database-lifecycle/capacityPolicy.d.ts +51 -0
- package/dist-esm/database-lifecycle/capacityPolicy.d.ts.map +1 -0
- package/dist-esm/database-lifecycle/capacityPolicy.js +150 -0
- package/dist-esm/database-lifecycle/capacityPolicy.js.map +1 -0
- package/dist-esm/database-lifecycle/capacityPolicy.test.d.ts +2 -0
- package/dist-esm/database-lifecycle/capacityPolicy.test.d.ts.map +1 -0
- package/dist-esm/database-lifecycle/capacityPolicy.test.js +157 -0
- package/dist-esm/database-lifecycle/capacityPolicy.test.js.map +1 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.d.ts +18 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.d.ts.map +1 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.js +29 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.js.map +1 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.test.d.ts +2 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.test.d.ts.map +1 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.test.js +89 -0
- package/dist-esm/database-lifecycle/edit-lifecycle-capability.test.js.map +1 -0
- package/dist-esm/database-lifecycle/index.d.ts +50 -27
- package/dist-esm/database-lifecycle/index.d.ts.map +1 -1
- package/dist-esm/database-lifecycle/index.js +62 -51
- package/dist-esm/database-lifecycle/index.js.map +1 -1
- package/dist-esm/database-lifecycle/index.test.js +90 -47
- package/dist-esm/database-lifecycle/index.test.js.map +1 -1
- package/dist-esm/database-lifecycle/physicalPoolIdentity.d.ts +29 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.d.ts.map +1 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.js +59 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.js.map +1 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.test.d.ts +2 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.test.d.ts.map +1 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.test.js +49 -0
- package/dist-esm/database-lifecycle/physicalPoolIdentity.test.js.map +1 -0
- package/dist-esm/index.d.ts +1 -0
- package/dist-esm/index.d.ts.map +1 -1
- package/dist-esm/index.js +1 -0
- package/dist-esm/index.js.map +1 -1
- package/dist-esm/types/audit/ocsf.d.ts +60 -6
- package/dist-esm/types/audit/ocsf.d.ts.map +1 -1
- package/dist-esm/types/audit/ocsf.js +12 -1
- package/dist-esm/types/audit/ocsf.js.map +1 -1
- package/dist-esm/types/deployment/deployQueueStatus.d.ts +13 -0
- package/dist-esm/types/deployment/deployQueueStatus.d.ts.map +1 -1
- package/dist-esm/types/deployment/index.d.ts +1 -1
- package/dist-esm/types/deployment/index.d.ts.map +1 -1
- package/dist-esm/types/deployment/index.js.map +1 -1
- package/dist-esm/types/policyGate/index.d.ts +5 -0
- package/dist-esm/types/policyGate/index.d.ts.map +1 -1
- package/dist-esm/types/policyGate/index.js +5 -1
- package/dist-esm/types/policyGate/index.js.map +1 -1
- package/dist-esm/types/publishPipeline/plan.js +1 -1
- package/dist-esm/types/publishPipeline/plan.js.map +1 -1
- package/dist-esm/types/publishPipeline/plan.test.js +3 -3
- package/dist-esm/types/publishPipeline/plan.test.js.map +1 -1
- package/dist-esm/types/rbac/index.d.ts +2 -0
- package/dist-esm/types/rbac/index.d.ts.map +1 -1
- package/dist-esm/types/rbac/index.js +3 -1
- package/dist-esm/types/rbac/index.js.map +1 -1
- package/dist-esm/types/reviewPolicy/index.d.ts +30 -4
- package/dist-esm/types/reviewPolicy/index.d.ts.map +1 -1
- package/dist-esm/types/reviewPolicy/index.js +7 -0
- package/dist-esm/types/reviewPolicy/index.js.map +1 -1
- package/package.json +1 -1
- package/src/database-lifecycle/capacityPolicy.test.ts +209 -0
- package/src/database-lifecycle/capacityPolicy.ts +197 -0
- package/src/database-lifecycle/edit-lifecycle-capability.test.ts +116 -0
- package/src/database-lifecycle/edit-lifecycle-capability.ts +34 -0
- package/src/database-lifecycle/index.test.ts +105 -48
- package/src/database-lifecycle/index.ts +157 -90
- package/src/database-lifecycle/physicalPoolIdentity.test.ts +64 -0
- package/src/database-lifecycle/physicalPoolIdentity.ts +75 -0
- package/src/index.ts +1 -0
- package/src/types/audit/ocsf.ts +73 -7
- package/src/types/deployment/deployQueueStatus.ts +14 -0
- package/src/types/deployment/index.ts +2 -1
- package/src/types/policyGate/index.ts +5 -1
- package/src/types/publishPipeline/plan.test.ts +3 -3
- package/src/types/publishPipeline/plan.ts +1 -1
- package/src/types/rbac/index.ts +3 -1
- package/src/types/reviewPolicy/index.ts +44 -5
package/src/types/audit/ocsf.ts
CHANGED
|
@@ -163,6 +163,10 @@ export const AUDIT_EVENT_TYPE_CATALOG: AuditEventTypeEntry[] = [
|
|
|
163
163
|
'application.git.connect',
|
|
164
164
|
'application.git.disconnect',
|
|
165
165
|
'application.metadata.update',
|
|
166
|
+
'application.npm_install.blocked',
|
|
167
|
+
'application.npm_install.overridden',
|
|
168
|
+
'application.npm_install.substituted',
|
|
169
|
+
'application.npm_install.triaged',
|
|
166
170
|
'application.policy_gate_check.start',
|
|
167
171
|
'application.settings.update',
|
|
168
172
|
'application.undeploy'
|
|
@@ -238,7 +242,6 @@ export const AUDIT_EVENT_TYPE_CATALOG: AuditEventTypeEntry[] = [
|
|
|
238
242
|
resource_type: 'Organization',
|
|
239
243
|
operations: [
|
|
240
244
|
'organization.npm_allow_install_scripts_changed',
|
|
241
|
-
'organization.npm_install.blocked',
|
|
242
245
|
'organization.npm_registry.create',
|
|
243
246
|
'organization.npm_registry.delete',
|
|
244
247
|
'organization.npm_registry.update',
|
|
@@ -268,6 +271,14 @@ export const AUDIT_EVENT_TYPE_CATALOG: AuditEventTypeEntry[] = [
|
|
|
268
271
|
'repository.update'
|
|
269
272
|
]
|
|
270
273
|
},
|
|
274
|
+
{
|
|
275
|
+
class_uid: OCSFClassUid.ENTITY_MANAGEMENT,
|
|
276
|
+
class_name: 'ENTITY_MANAGEMENT',
|
|
277
|
+
category_uid: OCSFCategoryUid.APPLICATION_ACTIVITY,
|
|
278
|
+
category_name: 'APPLICATION_ACTIVITY',
|
|
279
|
+
resource_type: 'ReviewPolicy',
|
|
280
|
+
operations: ['reviewpolicy.allowlist.applications.added', 'reviewpolicy.allowlist.applications.removed']
|
|
281
|
+
},
|
|
271
282
|
{
|
|
272
283
|
class_uid: OCSFClassUid.ENTITY_MANAGEMENT,
|
|
273
284
|
class_name: 'ENTITY_MANAGEMENT',
|
|
@@ -347,14 +358,33 @@ export function buildOCSFMetadata(logName: string): OCSFMetadata {
|
|
|
347
358
|
// ---------------------------------------------------------------------------
|
|
348
359
|
|
|
349
360
|
/**
|
|
350
|
-
*
|
|
361
|
+
* Provisional install-time exploitability decision for a CVE finding.
|
|
362
|
+
* Shared by the agent triage path and `NpmInstallBlockedAuditReport.triage`.
|
|
363
|
+
*/
|
|
364
|
+
export interface TriageVerdict {
|
|
365
|
+
advisoryId: string;
|
|
366
|
+
confidence: 'high' | 'low' | 'medium';
|
|
367
|
+
evaluatedAt: string;
|
|
368
|
+
factors?: {
|
|
369
|
+
appExposure?: string;
|
|
370
|
+
intendedUse?: string;
|
|
371
|
+
vulnerableFunctionalityInPlay?: boolean;
|
|
372
|
+
};
|
|
373
|
+
model: string;
|
|
374
|
+
package: string;
|
|
375
|
+
reasoning: string;
|
|
376
|
+
stage: 'install';
|
|
377
|
+
verdict: 'exploitable' | 'not_exploitable' | 'uncertain';
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Wire payload for the historical `v1.audit.npmInstallBlocked` socket method.
|
|
351
382
|
*
|
|
352
|
-
* Emitted by the Clark dev-server runtime
|
|
353
|
-
*
|
|
354
|
-
*
|
|
383
|
+
* Emitted by the Clark dev-server runtime for blocked installs and successful
|
|
384
|
+
* security decisions such as substitutions, triage, and user overrides. The
|
|
385
|
+
* server derives org, actor, and app from the authenticated connection,
|
|
355
386
|
* throttles per-org and globally, sanitizes via the P6.1 telemetry helpers,
|
|
356
|
-
* and writes an OCSF `audit_event` row
|
|
357
|
-
* `organization.npm_install.blocked`.
|
|
387
|
+
* and writes an application-scoped OCSF `audit_event` row.
|
|
358
388
|
*
|
|
359
389
|
* Carries only structured, low-risk fields — deliberately NO free-text error
|
|
360
390
|
* message, so a registry token embedded in CLI output can never reach the wire.
|
|
@@ -377,6 +407,42 @@ export interface NpmInstallBlockedAuditReport {
|
|
|
377
407
|
runner?: string;
|
|
378
408
|
/** Epoch ms when the block occurred (client clock). */
|
|
379
409
|
occurredAt: number;
|
|
410
|
+
/**
|
|
411
|
+
* Vulnerability-index findings when `reason === "vulnerable_package"`. One
|
|
412
|
+
* block can name several advisories across several packages, so each finding
|
|
413
|
+
* carries its own package spec and a SIEM query on `advisory_id` matches
|
|
414
|
+
* every row it should. Server allowlists `kind`, scrubs string fields, drops
|
|
415
|
+
* off-shape entries rather than coercing them, and caps the array length.
|
|
416
|
+
*/
|
|
417
|
+
vulnerabilities?: Array<{
|
|
418
|
+
advisoryId: string;
|
|
419
|
+
kind: 'cve' | 'malware';
|
|
420
|
+
package: string;
|
|
421
|
+
severity?: string;
|
|
422
|
+
suggestedVersion?: string;
|
|
423
|
+
}>;
|
|
424
|
+
/**
|
|
425
|
+
* Silent version substitution when `reason === "package_substituted"`
|
|
426
|
+
* (CVE safe-swap or quarantine hold-back). Server scrubs versions and
|
|
427
|
+
* allowlists `reason`. One row per substitution — the client reports each
|
|
428
|
+
* one separately with `packages` naming the swapped package, which is why
|
|
429
|
+
* this object carries no name of its own.
|
|
430
|
+
*/
|
|
431
|
+
substitution?: {
|
|
432
|
+
fromVersion: string;
|
|
433
|
+
toVersion: string;
|
|
434
|
+
reason: 'cve_swap' | 'quarantine';
|
|
435
|
+
};
|
|
436
|
+
/** Provisional install-time exploitability decision for a CVE finding. */
|
|
437
|
+
triage?: TriageVerdict;
|
|
438
|
+
/**
|
|
439
|
+
* Builder-approved proceed-with-reason override when `reason ===
|
|
440
|
+
* "vulnerability_user_override"`. Server scrubs `reason` and caps lengths.
|
|
441
|
+
*/
|
|
442
|
+
userOverride?: {
|
|
443
|
+
packages: string[];
|
|
444
|
+
reason: string;
|
|
445
|
+
};
|
|
380
446
|
// application attribution: NOT a wire field. The server derives it from the
|
|
381
447
|
// trusted scoped-JWT claim (`ctx.jwtClaims.app_id`) — a payload-controlled
|
|
382
448
|
// value would let any authenticated caller forge audit rows against another
|
|
@@ -24,11 +24,25 @@ export type LifecycleStageKind = 'provisioning' | 'migrating';
|
|
|
24
24
|
*/
|
|
25
25
|
export type LifecycleStageState = 'pending' | 'in_progress' | 'complete' | 'failed';
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Per-datatag row under a parent lifecycle stage when deploy fanned out
|
|
29
|
+
* across multiple deployed Environments profiles.
|
|
30
|
+
*/
|
|
31
|
+
export interface LifecycleStageTargetProgress {
|
|
32
|
+
bindingKey: string;
|
|
33
|
+
profile: string;
|
|
34
|
+
state: LifecycleStageState;
|
|
35
|
+
errorCode?: string;
|
|
36
|
+
errorMessage?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
27
39
|
export interface LifecycleStageProgress {
|
|
28
40
|
kind: LifecycleStageKind;
|
|
29
41
|
state: LifecycleStageState;
|
|
30
42
|
errorCode?: string;
|
|
31
43
|
errorMessage?: string;
|
|
44
|
+
/** Present when multiple profile-scoped bindings participate in this stage. */
|
|
45
|
+
targets?: LifecycleStageTargetProgress[];
|
|
32
46
|
}
|
|
33
47
|
|
|
34
48
|
/**
|
|
@@ -4,7 +4,8 @@ export {
|
|
|
4
4
|
type DeployStatusResponseStatus,
|
|
5
5
|
type LifecycleStageKind,
|
|
6
6
|
type LifecycleStageProgress,
|
|
7
|
-
type LifecycleStageState
|
|
7
|
+
type LifecycleStageState,
|
|
8
|
+
type LifecycleStageTargetProgress
|
|
8
9
|
} from './deployQueueStatus.js';
|
|
9
10
|
|
|
10
11
|
export interface DeploymentDto {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use the `superblocks.policy-gates.security-scans.enabled` LaunchDarkly flag instead.
|
|
3
|
+
* Kept as `false` to match the fail-closed LD default; create and enable the
|
|
4
|
+
* LD flag to turn built-in scans on.
|
|
5
|
+
*/
|
|
2
6
|
export const SECURITY_SCANS_ENABLED: boolean = false;
|
|
3
7
|
|
|
4
8
|
export type PolicyGateReadinessAction =
|
|
@@ -106,7 +106,7 @@ describe('applyBlockedByEligibility', () => {
|
|
|
106
106
|
id: 'policy_gates:before_deploy',
|
|
107
107
|
kind: 'policy_gates',
|
|
108
108
|
status: 'in_progress',
|
|
109
|
-
displayName: '
|
|
109
|
+
displayName: 'Pre-Publish Policies'
|
|
110
110
|
}),
|
|
111
111
|
step({
|
|
112
112
|
id: 'publish',
|
|
@@ -135,12 +135,12 @@ describe('applyBlockedByEligibility', () => {
|
|
|
135
135
|
id: 'policy_gates:before_deploy',
|
|
136
136
|
kind: 'policy_gates',
|
|
137
137
|
status: 'in_progress',
|
|
138
|
-
displayName: '
|
|
138
|
+
displayName: 'Pre-Publish Policies'
|
|
139
139
|
})
|
|
140
140
|
]);
|
|
141
141
|
expect(steps[1].blockedBy).toBeUndefined();
|
|
142
142
|
expect(steps[1].status).toBe('in_progress');
|
|
143
|
-
expect(steps[1].displayName).toBe('
|
|
143
|
+
expect(steps[1].displayName).toBe('Pre-Publish Policies');
|
|
144
144
|
});
|
|
145
145
|
|
|
146
146
|
test('keeps a pending policy gate idle rather than waiting on the build', () => {
|
|
@@ -51,7 +51,7 @@ const PENDING_DISPLAY_NAMES: Record<PublishStepKind, string> = {
|
|
|
51
51
|
build: 'Build',
|
|
52
52
|
database_migration: 'Database migration',
|
|
53
53
|
database_provisioning: 'Database provisioning',
|
|
54
|
-
policy_gates: '
|
|
54
|
+
policy_gates: 'Pre-Publish Policies',
|
|
55
55
|
publish: 'Publish'
|
|
56
56
|
};
|
|
57
57
|
|
package/src/types/rbac/index.ts
CHANGED
|
@@ -187,6 +187,7 @@ export enum ActionTypeEnum {
|
|
|
187
187
|
RUN = 'run',
|
|
188
188
|
SHARE = 'share',
|
|
189
189
|
UPDATE = 'update',
|
|
190
|
+
USE = 'use',
|
|
190
191
|
VIEW = 'view'
|
|
191
192
|
}
|
|
192
193
|
|
|
@@ -285,7 +286,8 @@ export const ActionTypeByResourceType = {
|
|
|
285
286
|
READ: ActionTypeEnum.READ
|
|
286
287
|
},
|
|
287
288
|
NATIVE_DATABASES: {
|
|
288
|
-
MANAGE: ActionTypeEnum.MANAGE
|
|
289
|
+
MANAGE: ActionTypeEnum.MANAGE,
|
|
290
|
+
USE: ActionTypeEnum.USE
|
|
289
291
|
},
|
|
290
292
|
NPM_REGISTRY: {
|
|
291
293
|
MANAGE: ActionTypeEnum.MANAGE
|
|
@@ -3,6 +3,14 @@ export const AI_AGENT_STATUSES = ['active', 'disabled'] as const;
|
|
|
3
3
|
export const REVIEW_POLICY_NAME_MAX_LENGTH = 120;
|
|
4
4
|
export const REVIEW_POLICY_PROMPT_MAX_LENGTH = 10000;
|
|
5
5
|
|
|
6
|
+
// Display name of the Superblocks-managed built-in security scan. One per organization.
|
|
7
|
+
export const BUILT_IN_SECURITY_SCAN_NAME = 'Security Scan';
|
|
8
|
+
|
|
9
|
+
// Display name of the Superblocks-managed security agent. One per organization; its prompt is owned
|
|
10
|
+
// by the platform, so admins can only enable it and choose its mode. No "Superblocks" / "Built-in"
|
|
11
|
+
// prefix until custom policies exist (APPS-5379).
|
|
12
|
+
export const SUPERBLOCKS_SECURITY_AGENT_NAME = 'Security Agent';
|
|
13
|
+
|
|
6
14
|
export const REVIEW_POLICY_TYPES = ['built_in_security_scan', 'security_agent'] as const;
|
|
7
15
|
export const REVIEW_POLICY_SOURCES = ['admin_configured', 'superblocks_managed'] as const;
|
|
8
16
|
export const REVIEW_POLICY_TRIGGERS = ['before_deploy', 'after_checkpoint', 'manual'] as const;
|
|
@@ -22,6 +30,7 @@ export const REVIEW_FINDING_CATEGORIES = [
|
|
|
22
30
|
'security_agent',
|
|
23
31
|
'secret',
|
|
24
32
|
'sensitive_data',
|
|
33
|
+
'static_analysis',
|
|
25
34
|
'vulnerability'
|
|
26
35
|
] as const;
|
|
27
36
|
|
|
@@ -67,6 +76,10 @@ export type ReviewRunTriggeredBy = (typeof REVIEW_RUN_TRIGGERED_BYS)[number];
|
|
|
67
76
|
|
|
68
77
|
export type ReviewPolicyScopeType = 'all_apps' | 'limited';
|
|
69
78
|
|
|
79
|
+
export type ReviewPolicyScopeDto = { type: 'all_apps' } | { type: 'limited'; applicationIds: string[] };
|
|
80
|
+
|
|
81
|
+
export type ReviewPolicyScopeInput = { type: 'all_apps' } | { type: 'limited'; applicationIds: string[] };
|
|
82
|
+
|
|
70
83
|
export interface ReviewPolicyLastRunDto {
|
|
71
84
|
id: string;
|
|
72
85
|
status: ReviewRunStatus;
|
|
@@ -84,7 +97,7 @@ export interface ReviewPolicyDto {
|
|
|
84
97
|
name: string;
|
|
85
98
|
status: AiAgentStatus;
|
|
86
99
|
mode: ReviewPolicyMode;
|
|
87
|
-
scope:
|
|
100
|
+
scope: ReviewPolicyScopeDto;
|
|
88
101
|
lastRun: ReviewPolicyLastRunDto | null;
|
|
89
102
|
freshPendingApprovalRunCount: number;
|
|
90
103
|
createdBy: string | null;
|
|
@@ -164,10 +177,36 @@ export interface ReviewPolicySummaryDto {
|
|
|
164
177
|
}
|
|
165
178
|
|
|
166
179
|
export type CreateReviewPolicyBody =
|
|
167
|
-
| { policyType: 'built_in_security_scan'; mode?: ReviewPolicyMode }
|
|
168
|
-
| { policyType: 'security_agent';
|
|
180
|
+
| { policyType: 'built_in_security_scan'; mode?: ReviewPolicyMode; scope?: ReviewPolicyScopeInput }
|
|
181
|
+
| { policyType: 'security_agent'; source: 'superblocks_managed'; scope?: ReviewPolicyScopeInput }
|
|
182
|
+
| {
|
|
183
|
+
policyType: 'security_agent';
|
|
184
|
+
mode: ReviewPolicyMode;
|
|
185
|
+
name: string;
|
|
186
|
+
prompt: string;
|
|
187
|
+
scope?: ReviewPolicyScopeInput;
|
|
188
|
+
};
|
|
169
189
|
|
|
170
190
|
export type UpdateReviewPolicyBody = { status: AiAgentStatus };
|
|
171
191
|
export type UpdateReviewPolicyConfigBody =
|
|
172
|
-
| {
|
|
173
|
-
|
|
192
|
+
| {
|
|
193
|
+
activeVersionId: string;
|
|
194
|
+
policyType: 'built_in_security_scan';
|
|
195
|
+
mode: ReviewPolicyMode;
|
|
196
|
+
scope?: ReviewPolicyScopeInput;
|
|
197
|
+
}
|
|
198
|
+
| {
|
|
199
|
+
activeVersionId: string;
|
|
200
|
+
policyType: 'security_agent';
|
|
201
|
+
source: 'superblocks_managed';
|
|
202
|
+
mode: ReviewPolicyMode;
|
|
203
|
+
scope?: ReviewPolicyScopeInput;
|
|
204
|
+
}
|
|
205
|
+
| {
|
|
206
|
+
activeVersionId: string;
|
|
207
|
+
policyType: 'security_agent';
|
|
208
|
+
mode: ReviewPolicyMode;
|
|
209
|
+
name: string;
|
|
210
|
+
prompt: string;
|
|
211
|
+
scope?: ReviewPolicyScopeInput;
|
|
212
|
+
};
|