@zysec-ai/cpod-sdk 0.1.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/CHANGELOG.md +96 -0
- package/README.md +315 -0
- package/bin/.env.example +21 -0
- package/bin/cpod-mcp-server.mjs +134 -0
- package/dist/client-BRW4z8Ls.d.mts +1073 -0
- package/dist/client-BRW4z8Ls.d.ts +1073 -0
- package/dist/events/index.d.mts +139 -0
- package/dist/events/index.d.ts +139 -0
- package/dist/events/index.js +112 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/index.mjs +109 -0
- package/dist/events/index.mjs.map +1 -0
- package/dist/index.d.mts +6224 -0
- package/dist/index.d.ts +6224 -0
- package/dist/index.js +8272 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8081 -0
- package/dist/index.mjs.map +1 -0
- package/dist/pods/index.d.mts +116 -0
- package/dist/pods/index.d.ts +116 -0
- package/dist/pods/index.js +108 -0
- package/dist/pods/index.js.map +1 -0
- package/dist/pods/index.mjs +106 -0
- package/dist/pods/index.mjs.map +1 -0
- package/dist/tenants/index.d.mts +69 -0
- package/dist/tenants/index.d.ts +69 -0
- package/dist/tenants/index.js +85 -0
- package/dist/tenants/index.js.map +1 -0
- package/dist/tenants/index.mjs +82 -0
- package/dist/tenants/index.mjs.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,1073 @@
|
|
|
1
|
+
interface TokenBundle {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
refreshToken?: string;
|
|
4
|
+
}
|
|
5
|
+
interface AuthOptions extends TokenBundle {
|
|
6
|
+
/**
|
|
7
|
+
* Fires when a new access token is minted (after a refresh). Use it to
|
|
8
|
+
* persist the updated bundle back to your store (localStorage, cookie,
|
|
9
|
+
* server-side cache, …). Sync or async — the SDK does not await it.
|
|
10
|
+
*/
|
|
11
|
+
onTokenRefreshed?: (bundle: TokenBundle) => void;
|
|
12
|
+
}
|
|
13
|
+
declare class TokenManager {
|
|
14
|
+
private bundle;
|
|
15
|
+
private readonly baseUrl;
|
|
16
|
+
private readonly onRefreshed?;
|
|
17
|
+
private inflight;
|
|
18
|
+
constructor(baseUrl: string, opts: AuthOptions);
|
|
19
|
+
/** Current access token. Synchronous — no expiry check. */
|
|
20
|
+
getAccessToken(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Trade refresh_token for a new access_token. Mutex-protected so a
|
|
23
|
+
* thundering-herd burst all awaits the same network round-trip. Throws
|
|
24
|
+
* if no refresh_token is set or the backend rejects the refresh —
|
|
25
|
+
* caller's responsibility to fall back to a fresh login at that point.
|
|
26
|
+
*/
|
|
27
|
+
refresh(): Promise<TokenBundle>;
|
|
28
|
+
/** True iff a refresh attempt is possible (a refresh_token is set). */
|
|
29
|
+
canRefresh(): boolean;
|
|
30
|
+
/** Snapshot of the current bundle. */
|
|
31
|
+
getBundle(): TokenBundle;
|
|
32
|
+
/**
|
|
33
|
+
* Replace the bundle externally — e.g. after the host app runs its own
|
|
34
|
+
* login flow and wants the SDK to pick up the new tokens.
|
|
35
|
+
*/
|
|
36
|
+
setBundle(b: TokenBundle): void;
|
|
37
|
+
private doRefresh;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Configuration for the CpodClient. */
|
|
41
|
+
interface CpodConfig {
|
|
42
|
+
/**
|
|
43
|
+
* cPod access token (JWT). Use this for the simple one-token case —
|
|
44
|
+
* the SDK uses it for every call and surfaces 401s to your code.
|
|
45
|
+
*
|
|
46
|
+
* For long-lived sessions, prefer `auth` instead: it carries a refresh
|
|
47
|
+
* token and the SDK transparently swaps an expired access token without
|
|
48
|
+
* your code seeing the 401.
|
|
49
|
+
*
|
|
50
|
+
* Exactly one of `apiKey` or `auth` is required.
|
|
51
|
+
*/
|
|
52
|
+
apiKey?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Auth bundle for sessions that should outlive a single access token.
|
|
55
|
+
* Pass the tokens you obtained from `client.auth.login(…)` (or your own
|
|
56
|
+
* login flow). When `refreshToken` is provided, the SDK refreshes the
|
|
57
|
+
* access token transparently on 401 and fires `onTokenRefreshed` so you
|
|
58
|
+
* can persist the new bundle.
|
|
59
|
+
*
|
|
60
|
+
* Exactly one of `apiKey` or `auth` is required.
|
|
61
|
+
*/
|
|
62
|
+
auth?: AuthOptions;
|
|
63
|
+
/** Base URL origin for the cPod API. Defaults to https://api.cyberpod.app. Do not include /api/v1. */
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
/** Request timeout in milliseconds. Defaults to 30000. */
|
|
66
|
+
timeout?: number;
|
|
67
|
+
/**
|
|
68
|
+
* App ID for MCP tool registration. Obtain by calling POST /api/v1/apps/register
|
|
69
|
+
* once (or read from `GET /api/v1/apps/me`). Falls back to the `CPOD_APP_ID`
|
|
70
|
+
* environment variable when omitted.
|
|
71
|
+
*/
|
|
72
|
+
appId?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Standard API response wrapper for single-resource endpoints.
|
|
76
|
+
*/
|
|
77
|
+
interface ApiResponse<T> {
|
|
78
|
+
data: T;
|
|
79
|
+
requestId: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Standard API response wrapper for paginated list endpoints.
|
|
83
|
+
*/
|
|
84
|
+
interface PaginatedResponse<T> {
|
|
85
|
+
data: T[];
|
|
86
|
+
total: number;
|
|
87
|
+
page: number;
|
|
88
|
+
pageSize: number;
|
|
89
|
+
hasMore: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Per-request options that override client-level defaults.
|
|
93
|
+
*/
|
|
94
|
+
interface RequestOptions {
|
|
95
|
+
/** AbortSignal for request cancellation. */
|
|
96
|
+
signal?: AbortSignal;
|
|
97
|
+
/** Override the request timeout in milliseconds. */
|
|
98
|
+
timeout?: number;
|
|
99
|
+
/** Additional headers to merge into the request. */
|
|
100
|
+
headers?: Record<string, string>;
|
|
101
|
+
}
|
|
102
|
+
/** Classification of a Person's relationship to the organization. */
|
|
103
|
+
type PersonType = 'employee' | 'contractor' | 'vendor' | 'partner' | 'service_account';
|
|
104
|
+
/** Lifecycle status of a Person record. */
|
|
105
|
+
type PersonStatus = 'active' | 'on_leave' | 'terminated' | 'suspended';
|
|
106
|
+
/** Physical or remote location for a Person. */
|
|
107
|
+
interface PersonLocation {
|
|
108
|
+
/** Office site name or identifier. */
|
|
109
|
+
site?: string;
|
|
110
|
+
/** City of the location. */
|
|
111
|
+
city?: string;
|
|
112
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
113
|
+
country?: string;
|
|
114
|
+
/** True if the person works remotely. */
|
|
115
|
+
remote: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** External identity provider binding for a Person. */
|
|
118
|
+
interface PersonIdentity {
|
|
119
|
+
/** Name of the identity provider (e.g., 'okta', 'azure_ad'). */
|
|
120
|
+
provider: string;
|
|
121
|
+
/** Subject ID issued by the external identity provider. */
|
|
122
|
+
externalId: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Represents an individual human or service identity in the organization.
|
|
126
|
+
* Domain: People
|
|
127
|
+
* Schema: data-model/schemas/person.schema.json
|
|
128
|
+
*/
|
|
129
|
+
interface Person {
|
|
130
|
+
/** Globally unique identifier. Read-only. */
|
|
131
|
+
id: string;
|
|
132
|
+
/** Optional external system identifier for cross-system correlation. */
|
|
133
|
+
externalId?: string;
|
|
134
|
+
/** Primary email address. Used as the canonical identifier for login. */
|
|
135
|
+
email: string;
|
|
136
|
+
/** Human-readable display name (e.g., "Jane Doe"). */
|
|
137
|
+
displayName: string;
|
|
138
|
+
/** Given name. */
|
|
139
|
+
firstName: string;
|
|
140
|
+
/** Family name. */
|
|
141
|
+
lastName: string;
|
|
142
|
+
/** HR system employee ID, if applicable. */
|
|
143
|
+
employeeId?: string;
|
|
144
|
+
/** Classification of the person's relationship to the organization. */
|
|
145
|
+
type: PersonType;
|
|
146
|
+
/** Current lifecycle status. */
|
|
147
|
+
status: PersonStatus;
|
|
148
|
+
/** Organizational department (e.g., "Engineering", "Finance"). */
|
|
149
|
+
department?: string;
|
|
150
|
+
/** Job title. */
|
|
151
|
+
title?: string;
|
|
152
|
+
/** Physical or remote work location. */
|
|
153
|
+
location?: PersonLocation;
|
|
154
|
+
/** UUID of the person's direct manager. */
|
|
155
|
+
managerId?: string;
|
|
156
|
+
/** Bound external identity provider accounts. */
|
|
157
|
+
identities: PersonIdentity[];
|
|
158
|
+
/** ISO 8601 date when the person started at the organization. */
|
|
159
|
+
startDate?: string;
|
|
160
|
+
/** ISO 8601 date when the person's employment ended. */
|
|
161
|
+
endDate?: string;
|
|
162
|
+
/** IANA timezone identifier (e.g. 'America/New_York'). */
|
|
163
|
+
timezone?: string;
|
|
164
|
+
/** Typical working hours for this person in their local timezone. */
|
|
165
|
+
workingHours?: {
|
|
166
|
+
start: string;
|
|
167
|
+
end: string;
|
|
168
|
+
};
|
|
169
|
+
/** UUID of the CostCenter to which this person's headcount cost is attributed. */
|
|
170
|
+
costCenterId?: string;
|
|
171
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
172
|
+
createdAt: string;
|
|
173
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
174
|
+
updatedAt: string;
|
|
175
|
+
}
|
|
176
|
+
/** Input payload for creating a new Person record. */
|
|
177
|
+
interface CreatePersonInput {
|
|
178
|
+
email: string;
|
|
179
|
+
displayName: string;
|
|
180
|
+
firstName: string;
|
|
181
|
+
lastName: string;
|
|
182
|
+
type: PersonType;
|
|
183
|
+
department?: string;
|
|
184
|
+
title?: string;
|
|
185
|
+
location?: PersonLocation;
|
|
186
|
+
managerId?: string;
|
|
187
|
+
employeeId?: string;
|
|
188
|
+
externalId?: string;
|
|
189
|
+
}
|
|
190
|
+
/** Filter options for listing Person records. */
|
|
191
|
+
interface ListPeopleOptions {
|
|
192
|
+
type?: PersonType;
|
|
193
|
+
status?: PersonStatus;
|
|
194
|
+
department?: string;
|
|
195
|
+
/** Full-text search across displayName, email, and employeeId. */
|
|
196
|
+
search?: string;
|
|
197
|
+
page?: number;
|
|
198
|
+
pageSize?: number;
|
|
199
|
+
}
|
|
200
|
+
/** Classification of a Group's purpose or source system. */
|
|
201
|
+
type GroupType = 'department' | 'team' | 'ad_group' | 'distribution_list' | 'custom';
|
|
202
|
+
/** A single member record within a Group. */
|
|
203
|
+
interface GroupMember {
|
|
204
|
+
/** UUID of the Person who is a member. */
|
|
205
|
+
personId: string;
|
|
206
|
+
/** Role of this person within the group (e.g., 'member', 'lead'). */
|
|
207
|
+
role: string;
|
|
208
|
+
/** ISO 8601 timestamp when this membership was established. */
|
|
209
|
+
addedAt: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Represents a collection of People, synced from AD/LDAP or managed natively.
|
|
213
|
+
* Domain: People
|
|
214
|
+
* Schema: data-model/schemas/group.schema.json
|
|
215
|
+
*/
|
|
216
|
+
interface Group {
|
|
217
|
+
/** Globally unique identifier. Read-only. */
|
|
218
|
+
id: string;
|
|
219
|
+
/** Human-readable name for the group. */
|
|
220
|
+
name: string;
|
|
221
|
+
/** Classification of the group's purpose. */
|
|
222
|
+
type: GroupType;
|
|
223
|
+
/** Optional description of the group's function. */
|
|
224
|
+
description?: string;
|
|
225
|
+
/** UUID of the Person who owns or is accountable for this group. */
|
|
226
|
+
ownerId: string;
|
|
227
|
+
/** Current members of the group. */
|
|
228
|
+
members: GroupMember[];
|
|
229
|
+
/** UUID of the parent Group, for hierarchical group structures. */
|
|
230
|
+
parentGroupId?: string;
|
|
231
|
+
/** The system that is the source of truth for this group (e.g., 'active_directory'). */
|
|
232
|
+
source: string;
|
|
233
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
234
|
+
createdAt: string;
|
|
235
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
236
|
+
updatedAt: string;
|
|
237
|
+
}
|
|
238
|
+
/** Input payload for creating a new Group. */
|
|
239
|
+
interface CreateGroupInput {
|
|
240
|
+
name: string;
|
|
241
|
+
type: GroupType;
|
|
242
|
+
description?: string;
|
|
243
|
+
ownerId: string;
|
|
244
|
+
parentGroupId?: string;
|
|
245
|
+
source?: string;
|
|
246
|
+
}
|
|
247
|
+
/** Classification of a technology asset. */
|
|
248
|
+
type AssetType = 'application' | 'saas' | 'infrastructure' | 'database' | 'network_device' | 'endpoint' | 'cloud_service' | 'api_service' | 'microservice';
|
|
249
|
+
/** Lifecycle status of a TechnologyAsset. */
|
|
250
|
+
type AssetStatus = 'active' | 'deprecated' | 'decommissioned' | 'planned';
|
|
251
|
+
/** Deployment environment for a TechnologyAsset. */
|
|
252
|
+
type AssetEnvironment = 'production' | 'staging' | 'development' | 'dr';
|
|
253
|
+
/** Business criticality rating. */
|
|
254
|
+
type Criticality = 'critical' | 'high' | 'medium' | 'low';
|
|
255
|
+
/** Data sensitivity classification. */
|
|
256
|
+
type DataClassification = 'public' | 'internal' | 'confidential' | 'restricted';
|
|
257
|
+
/** Ownership reference for a TechnologyAsset. */
|
|
258
|
+
interface AssetOwner {
|
|
259
|
+
/** UUID of the owning Person. */
|
|
260
|
+
personId: string;
|
|
261
|
+
/** UUID of the owning Group, if group-owned. */
|
|
262
|
+
groupId?: string;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Represents a software application, infrastructure component, or service managed by the organization.
|
|
266
|
+
* Domain: Technology
|
|
267
|
+
* Schema: data-model/schemas/technology-asset.schema.json
|
|
268
|
+
*/
|
|
269
|
+
interface TechnologyAsset {
|
|
270
|
+
/** Globally unique identifier. Read-only. */
|
|
271
|
+
id: string;
|
|
272
|
+
/** Canonical system name (e.g., 'salesforce-crm'). */
|
|
273
|
+
name: string;
|
|
274
|
+
/** Human-readable display name. */
|
|
275
|
+
displayName: string;
|
|
276
|
+
/** Optional description of the asset's purpose. */
|
|
277
|
+
description?: string;
|
|
278
|
+
/** Asset type classification. */
|
|
279
|
+
type: AssetType;
|
|
280
|
+
/** Functional category (e.g., 'CRM', 'SIEM', 'API Gateway'). */
|
|
281
|
+
category: string;
|
|
282
|
+
/** Vendor or manufacturer name. */
|
|
283
|
+
vendor: string;
|
|
284
|
+
/** Software version string, if applicable. */
|
|
285
|
+
version?: string;
|
|
286
|
+
/** Lifecycle status. */
|
|
287
|
+
status: AssetStatus;
|
|
288
|
+
/** Ownership reference. */
|
|
289
|
+
owner: AssetOwner;
|
|
290
|
+
/** Deployment environment classification. */
|
|
291
|
+
environment: AssetEnvironment;
|
|
292
|
+
/** Hosting model. */
|
|
293
|
+
hosting: 'cloud' | 'on_premise' | 'hybrid' | 'saas';
|
|
294
|
+
/** Cloud provider name, if cloud-hosted. */
|
|
295
|
+
cloudProvider?: string;
|
|
296
|
+
/** Cloud region, if applicable (e.g., 'us-east-1'). */
|
|
297
|
+
region?: string;
|
|
298
|
+
/** Public or internal URL of the asset. */
|
|
299
|
+
url?: string;
|
|
300
|
+
/** Flat string tags for filtering and grouping. */
|
|
301
|
+
tags: string[];
|
|
302
|
+
/** Business criticality rating. */
|
|
303
|
+
criticality: Criticality;
|
|
304
|
+
/** Highest data classification level handled by this asset. */
|
|
305
|
+
dataClassification: DataClassification;
|
|
306
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
307
|
+
createdAt: string;
|
|
308
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
309
|
+
updatedAt: string;
|
|
310
|
+
}
|
|
311
|
+
/** Input payload for creating a new TechnologyAsset. */
|
|
312
|
+
interface CreateTechnologyAssetInput {
|
|
313
|
+
name: string;
|
|
314
|
+
displayName: string;
|
|
315
|
+
description?: string;
|
|
316
|
+
type: AssetType;
|
|
317
|
+
category: string;
|
|
318
|
+
vendor: string;
|
|
319
|
+
version?: string;
|
|
320
|
+
owner: AssetOwner;
|
|
321
|
+
environment: AssetEnvironment;
|
|
322
|
+
hosting: 'cloud' | 'on_premise' | 'hybrid' | 'saas';
|
|
323
|
+
cloudProvider?: string;
|
|
324
|
+
region?: string;
|
|
325
|
+
url?: string;
|
|
326
|
+
tags?: string[];
|
|
327
|
+
criticality: Criticality;
|
|
328
|
+
dataClassification: DataClassification;
|
|
329
|
+
}
|
|
330
|
+
/** Lifecycle status of an AccessEntitlement. */
|
|
331
|
+
type EntitlementStatus = 'active' | 'expired' | 'revoked' | 'pending_approval';
|
|
332
|
+
/**
|
|
333
|
+
* Represents a grant of access to a TechnologyAsset for a Person or Group.
|
|
334
|
+
* Domain: Technology
|
|
335
|
+
* Schema: data-model/schemas/access-entitlement.schema.json
|
|
336
|
+
*/
|
|
337
|
+
interface AccessEntitlement {
|
|
338
|
+
/** Globally unique identifier. Read-only. */
|
|
339
|
+
id: string;
|
|
340
|
+
/** UUID of the TechnologyAsset this entitlement grants access to. */
|
|
341
|
+
assetId: string;
|
|
342
|
+
/** UUID of the Person or Group being granted access. */
|
|
343
|
+
principalId: string;
|
|
344
|
+
/** Discriminator for the type of principal. */
|
|
345
|
+
principalType: 'person' | 'group';
|
|
346
|
+
/** The specific role or permission level granted (e.g., 'read', 'admin'). */
|
|
347
|
+
entitlementType: string;
|
|
348
|
+
/** ISO 8601 timestamp when access was granted. */
|
|
349
|
+
grantedAt: string;
|
|
350
|
+
/** UUID of the Person who authorized the grant, if applicable. */
|
|
351
|
+
grantedById?: string;
|
|
352
|
+
/** ISO 8601 timestamp when the entitlement expires. Null if it does not expire. */
|
|
353
|
+
expiresAt?: string;
|
|
354
|
+
/** The system that is the authoritative source for this entitlement (e.g., 'okta'). */
|
|
355
|
+
source: string;
|
|
356
|
+
/** Current status of the entitlement. */
|
|
357
|
+
status: EntitlementStatus;
|
|
358
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
359
|
+
createdAt: string;
|
|
360
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
361
|
+
updatedAt: string;
|
|
362
|
+
}
|
|
363
|
+
/** Input payload for granting a new AccessEntitlement. */
|
|
364
|
+
interface GrantEntitlementInput {
|
|
365
|
+
assetId: string;
|
|
366
|
+
principalId: string;
|
|
367
|
+
principalType: 'person' | 'group';
|
|
368
|
+
entitlementType: string;
|
|
369
|
+
expiresAt?: string;
|
|
370
|
+
}
|
|
371
|
+
/** Licensing model type. */
|
|
372
|
+
type LicenseType = 'perpetual' | 'subscription' | 'concurrent' | 'named_user' | 'site' | 'open_source';
|
|
373
|
+
/** Lifecycle status of a SoftwareLicense. */
|
|
374
|
+
type LicenseStatus = 'active' | 'expired' | 'expiring_soon' | 'terminated';
|
|
375
|
+
/** License allocation compliance status. */
|
|
376
|
+
type ComplianceStatus = 'compliant' | 'over_allocated' | 'under_utilized' | 'unknown';
|
|
377
|
+
/** Cost details for a SoftwareLicense. */
|
|
378
|
+
interface LicenseCost {
|
|
379
|
+
/** Monetary amount. */
|
|
380
|
+
amount: number;
|
|
381
|
+
/** ISO 4217 currency code (e.g., 'USD', 'EUR'). */
|
|
382
|
+
currency: string;
|
|
383
|
+
/** Billing frequency. */
|
|
384
|
+
billingCycle: 'monthly' | 'annual' | 'one_time';
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Represents an enterprise software license agreement with seat counts and cost tracking.
|
|
388
|
+
* Domain: Licenses
|
|
389
|
+
* Schema: data-model/schemas/software-license.schema.json
|
|
390
|
+
*/
|
|
391
|
+
interface SoftwareLicense {
|
|
392
|
+
/** Globally unique identifier. Read-only. */
|
|
393
|
+
id: string;
|
|
394
|
+
/** UUID of the TechnologyAsset this license is associated with, if applicable. */
|
|
395
|
+
assetId?: string;
|
|
396
|
+
/** Software vendor name. */
|
|
397
|
+
vendor: string;
|
|
398
|
+
/** Name of the software product. */
|
|
399
|
+
productName: string;
|
|
400
|
+
/** Vendor's SKU or part number for the product. */
|
|
401
|
+
productSku: string;
|
|
402
|
+
/** Licensing model. */
|
|
403
|
+
licenseType: LicenseType;
|
|
404
|
+
/** Total number of licensed seats. Null for site or open-source licenses. */
|
|
405
|
+
totalSeats?: number;
|
|
406
|
+
/** Number of seats currently assigned. Read-only; computed from LicenseAssignment records. */
|
|
407
|
+
usedSeats: number;
|
|
408
|
+
/** Available seats remaining. Read-only; computed as totalSeats - usedSeats. */
|
|
409
|
+
availableSeats: number;
|
|
410
|
+
/** Cost breakdown. */
|
|
411
|
+
cost: LicenseCost;
|
|
412
|
+
/** ISO 8601 date when the license was purchased. */
|
|
413
|
+
purchaseDate: string;
|
|
414
|
+
/** ISO 8601 date when the license expires. Null for perpetual licenses. */
|
|
415
|
+
expiryDate?: string;
|
|
416
|
+
/** ISO 8601 date of the next renewal. */
|
|
417
|
+
renewalDate?: string;
|
|
418
|
+
/** Whether the license is set to auto-renew. */
|
|
419
|
+
autoRenew: boolean;
|
|
420
|
+
/** ID of the supplier or reseller. */
|
|
421
|
+
supplierId?: string;
|
|
422
|
+
/** Contract or purchase order reference number. */
|
|
423
|
+
contractReference?: string;
|
|
424
|
+
/** Vendor list price per seat or billing cycle before any discount. */
|
|
425
|
+
listPrice?: number;
|
|
426
|
+
/** Percentage discount negotiated off the vendor list price (0–100). */
|
|
427
|
+
negotiatedDiscount?: number;
|
|
428
|
+
/** UUID of the CostCenter that funds this license. */
|
|
429
|
+
costCenterId?: string;
|
|
430
|
+
/** UUID of the Contract that governs this license agreement. */
|
|
431
|
+
contractId?: string;
|
|
432
|
+
/** Lifecycle status. */
|
|
433
|
+
status: LicenseStatus;
|
|
434
|
+
/** Allocation compliance status. */
|
|
435
|
+
complianceStatus: ComplianceStatus;
|
|
436
|
+
/** Flat string tags for filtering. */
|
|
437
|
+
tags: string[];
|
|
438
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
439
|
+
createdAt: string;
|
|
440
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
441
|
+
updatedAt: string;
|
|
442
|
+
}
|
|
443
|
+
/** Input payload for creating a new SoftwareLicense. */
|
|
444
|
+
interface CreateLicenseInput {
|
|
445
|
+
assetId?: string;
|
|
446
|
+
vendor: string;
|
|
447
|
+
productName: string;
|
|
448
|
+
productSku: string;
|
|
449
|
+
licenseType: LicenseType;
|
|
450
|
+
totalSeats?: number;
|
|
451
|
+
cost: LicenseCost;
|
|
452
|
+
purchaseDate: string;
|
|
453
|
+
expiryDate?: string;
|
|
454
|
+
renewalDate?: string;
|
|
455
|
+
autoRenew?: boolean;
|
|
456
|
+
supplierId?: string;
|
|
457
|
+
contractReference?: string;
|
|
458
|
+
tags?: string[];
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Represents the assignment of a SoftwareLicense seat to a Person or Group.
|
|
462
|
+
* Domain: Licenses
|
|
463
|
+
* Schema: data-model/schemas/license-assignment.schema.json
|
|
464
|
+
*/
|
|
465
|
+
interface LicenseAssignment {
|
|
466
|
+
/** Globally unique identifier. Read-only. */
|
|
467
|
+
id: string;
|
|
468
|
+
/** UUID of the SoftwareLicense being assigned. */
|
|
469
|
+
licenseId: string;
|
|
470
|
+
/** UUID of the Person or Group receiving the license seat. */
|
|
471
|
+
assigneeId: string;
|
|
472
|
+
/** Discriminator for the type of assignee. */
|
|
473
|
+
assigneeType: 'person' | 'group';
|
|
474
|
+
/** UUID of the specific TechnologyAsset instance, if applicable. */
|
|
475
|
+
assetId?: string;
|
|
476
|
+
/** ISO 8601 timestamp when the assignment was made. */
|
|
477
|
+
assignedAt: string;
|
|
478
|
+
/** UUID of the Person who made the assignment. */
|
|
479
|
+
assignedById: string;
|
|
480
|
+
/** ISO 8601 timestamp when the assignment expires. Null if it does not expire. */
|
|
481
|
+
expiresAt?: string;
|
|
482
|
+
/** ISO 8601 timestamp when the assigned seat was last actively used. Null if usage has never been recorded. */
|
|
483
|
+
lastUsedAt?: string;
|
|
484
|
+
/** Current status of the assignment. */
|
|
485
|
+
status: 'active' | 'revoked' | 'expired';
|
|
486
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
487
|
+
createdAt: string;
|
|
488
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
489
|
+
updatedAt: string;
|
|
490
|
+
}
|
|
491
|
+
/** Classification of a physical hardware asset. */
|
|
492
|
+
type PhysicalAssetType = 'laptop' | 'desktop' | 'server' | 'mobile' | 'tablet' | 'network_device' | 'printer' | 'other';
|
|
493
|
+
/** Lifecycle status of a PhysicalAsset. */
|
|
494
|
+
type PhysicalAssetStatus = 'in_use' | 'available' | 'in_repair' | 'retired' | 'lost_stolen';
|
|
495
|
+
/**
|
|
496
|
+
* Represents a physical hardware device tracked by the organization.
|
|
497
|
+
* Domain: Assets
|
|
498
|
+
* Schema: data-model/schemas/physical-asset.schema.json
|
|
499
|
+
*/
|
|
500
|
+
interface PhysicalAsset {
|
|
501
|
+
/** Globally unique identifier. Read-only. */
|
|
502
|
+
id: string;
|
|
503
|
+
/** Organization's internal asset tag (barcode or RFID label). */
|
|
504
|
+
assetTag: string;
|
|
505
|
+
/** Human-readable name or label for the asset. */
|
|
506
|
+
name: string;
|
|
507
|
+
/** Hardware serial number. */
|
|
508
|
+
serialNumber?: string;
|
|
509
|
+
/** Hardware model name (e.g., 'MacBook Pro 14-inch, 2023'). */
|
|
510
|
+
model: string;
|
|
511
|
+
/** Hardware manufacturer (e.g., 'Apple', 'Dell', 'Cisco'). */
|
|
512
|
+
manufacturer: string;
|
|
513
|
+
/** Hardware type classification. */
|
|
514
|
+
type: PhysicalAssetType;
|
|
515
|
+
/** Lifecycle status. */
|
|
516
|
+
status: PhysicalAssetStatus;
|
|
517
|
+
/** Current assignment of the asset. */
|
|
518
|
+
assignedTo?: {
|
|
519
|
+
/** UUID of the Person currently using this asset. */
|
|
520
|
+
personId?: string;
|
|
521
|
+
/** Physical location description (e.g., 'HQ Floor 3, Desk 12'). */
|
|
522
|
+
location?: string;
|
|
523
|
+
};
|
|
524
|
+
/** ISO 8601 date when the asset was purchased. */
|
|
525
|
+
purchaseDate?: string;
|
|
526
|
+
/** Original purchase cost. */
|
|
527
|
+
purchaseCost?: {
|
|
528
|
+
amount: number;
|
|
529
|
+
/** ISO 4217 currency code. */
|
|
530
|
+
currency: string;
|
|
531
|
+
};
|
|
532
|
+
/** ISO 8601 date when the hardware warranty expires. */
|
|
533
|
+
warrantyExpiry?: string;
|
|
534
|
+
/** Operating system details. */
|
|
535
|
+
os?: {
|
|
536
|
+
name: string;
|
|
537
|
+
version: string;
|
|
538
|
+
};
|
|
539
|
+
/** Name of the MDM or device management system managing this asset. */
|
|
540
|
+
managedBy?: string;
|
|
541
|
+
/** ISO 8601 timestamp when the asset last checked in with its management system. */
|
|
542
|
+
lastSeenAt?: string;
|
|
543
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
544
|
+
createdAt: string;
|
|
545
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
546
|
+
updatedAt: string;
|
|
547
|
+
}
|
|
548
|
+
/** Input payload for creating a new PhysicalAsset record. */
|
|
549
|
+
interface CreatePhysicalAssetInput {
|
|
550
|
+
assetTag: string;
|
|
551
|
+
name: string;
|
|
552
|
+
serialNumber?: string;
|
|
553
|
+
model: string;
|
|
554
|
+
manufacturer: string;
|
|
555
|
+
type: PhysicalAssetType;
|
|
556
|
+
status?: PhysicalAssetStatus;
|
|
557
|
+
assignedTo?: {
|
|
558
|
+
personId?: string;
|
|
559
|
+
location?: string;
|
|
560
|
+
};
|
|
561
|
+
purchaseDate?: string;
|
|
562
|
+
purchaseCost?: {
|
|
563
|
+
amount: number;
|
|
564
|
+
currency: string;
|
|
565
|
+
};
|
|
566
|
+
warrantyExpiry?: string;
|
|
567
|
+
os?: {
|
|
568
|
+
name: string;
|
|
569
|
+
version: string;
|
|
570
|
+
};
|
|
571
|
+
managedBy?: string;
|
|
572
|
+
}
|
|
573
|
+
/** Cloud infrastructure provider. */
|
|
574
|
+
type CloudProvider = 'aws' | 'azure' | 'gcp' | 'other';
|
|
575
|
+
/**
|
|
576
|
+
* Represents a discovered or managed cloud infrastructure resource.
|
|
577
|
+
* Domain: Assets
|
|
578
|
+
* Schema: data-model/schemas/cloud-resource.schema.json
|
|
579
|
+
*/
|
|
580
|
+
interface CloudResource {
|
|
581
|
+
/** Globally unique identifier. Read-only. */
|
|
582
|
+
id: string;
|
|
583
|
+
/** Native provider resource ID (e.g., AWS Resource ID, Azure Resource ID). */
|
|
584
|
+
externalId: string;
|
|
585
|
+
/** Cloud provider where this resource lives. */
|
|
586
|
+
provider: CloudProvider;
|
|
587
|
+
/** Cloud account or subscription ID. */
|
|
588
|
+
accountId: string;
|
|
589
|
+
/** Cloud region identifier (e.g., 'us-east-1', 'eastus'). */
|
|
590
|
+
region: string;
|
|
591
|
+
/** Provider-specific resource type (e.g., 'AWS::EC2::Instance', 'Microsoft.Compute/virtualMachines'). */
|
|
592
|
+
resourceType: string;
|
|
593
|
+
/** Human-readable resource name. */
|
|
594
|
+
resourceName: string;
|
|
595
|
+
/** AWS ARN, if applicable. */
|
|
596
|
+
arn?: string;
|
|
597
|
+
/** Current operational status reported by the cloud provider. */
|
|
598
|
+
status: 'running' | 'stopped' | 'terminated' | 'unknown';
|
|
599
|
+
/** UUID of the linked TechnologyAsset, if this resource is mapped to a known asset. */
|
|
600
|
+
assetId?: string;
|
|
601
|
+
/** Native cloud resource tags as key-value pairs. */
|
|
602
|
+
tags: Record<string, string>;
|
|
603
|
+
/** Cost estimate for this resource. */
|
|
604
|
+
cost?: {
|
|
605
|
+
monthlyCost: number;
|
|
606
|
+
currency: string;
|
|
607
|
+
/** ISO 8601 timestamp when the cost estimate was last updated. */
|
|
608
|
+
lastUpdated: string;
|
|
609
|
+
};
|
|
610
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
611
|
+
createdAt: string;
|
|
612
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
613
|
+
updatedAt: string;
|
|
614
|
+
}
|
|
615
|
+
/** CVSS-aligned severity rating for a Vulnerability. */
|
|
616
|
+
type VulnerabilitySeverity = 'critical' | 'high' | 'medium' | 'low' | 'informational';
|
|
617
|
+
/** Remediation lifecycle status of a Vulnerability. */
|
|
618
|
+
type VulnerabilityStatus = 'open' | 'in_remediation' | 'remediated' | 'accepted_risk' | 'false_positive';
|
|
619
|
+
/**
|
|
620
|
+
* Represents a security vulnerability affecting a managed asset.
|
|
621
|
+
* Domain: Risk & Compliance
|
|
622
|
+
* Schema: data-model/schemas/vulnerability.schema.json
|
|
623
|
+
*/
|
|
624
|
+
interface Vulnerability {
|
|
625
|
+
/** Globally unique identifier. Read-only. */
|
|
626
|
+
id: string;
|
|
627
|
+
/** CVE identifier, if applicable (e.g., 'CVE-2024-12345'). */
|
|
628
|
+
cveId?: string;
|
|
629
|
+
/** Short, descriptive title for the vulnerability. */
|
|
630
|
+
title: string;
|
|
631
|
+
/** Detailed description of the vulnerability, its impact, and affected components. */
|
|
632
|
+
description: string;
|
|
633
|
+
/** CVSS-aligned severity rating. */
|
|
634
|
+
severity: VulnerabilitySeverity;
|
|
635
|
+
/** CVSS base score (0.0–10.0). */
|
|
636
|
+
cvssScore?: number;
|
|
637
|
+
/** CVSS vector string. */
|
|
638
|
+
cvssVector?: string;
|
|
639
|
+
/** UUID of the affected asset. */
|
|
640
|
+
affectedAssetId: string;
|
|
641
|
+
/** Domain type of the affected asset. */
|
|
642
|
+
affectedAssetType: 'technology' | 'physical' | 'cloud';
|
|
643
|
+
/** Current remediation status. */
|
|
644
|
+
status: VulnerabilityStatus;
|
|
645
|
+
/** ISO 8601 timestamp when the vulnerability was first discovered. */
|
|
646
|
+
discoveredAt: string;
|
|
647
|
+
/** ISO 8601 timestamp when remediation was confirmed. */
|
|
648
|
+
remediatedAt?: string;
|
|
649
|
+
/** ISO 8601 deadline for remediation, based on SLA policy. */
|
|
650
|
+
dueDate?: string;
|
|
651
|
+
/** UUID of the Person assigned to remediate this vulnerability. */
|
|
652
|
+
assignedTo?: string;
|
|
653
|
+
/** Scanner or source system that discovered the vulnerability (e.g., 'qualys', 'snyk'). */
|
|
654
|
+
source: string;
|
|
655
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
656
|
+
createdAt: string;
|
|
657
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
658
|
+
updatedAt: string;
|
|
659
|
+
}
|
|
660
|
+
/** Recognized compliance framework identifiers. */
|
|
661
|
+
type ComplianceFramework = 'soc2' | 'iso27001' | 'nist_csf' | 'pci_dss' | 'hipaa' | 'gdpr' | 'cis' | 'custom';
|
|
662
|
+
/** Implementation status of a ComplianceControl. */
|
|
663
|
+
type ControlStatus = 'implemented' | 'partial' | 'not_implemented' | 'not_applicable';
|
|
664
|
+
/** A piece of evidence collected to demonstrate control implementation. */
|
|
665
|
+
interface ControlEvidence {
|
|
666
|
+
/** Evidence type (e.g., 'screenshot', 'policy_document', 'log_export'). */
|
|
667
|
+
type: string;
|
|
668
|
+
/** Description of the evidence and what it demonstrates. */
|
|
669
|
+
description: string;
|
|
670
|
+
/** URL to the evidence artifact, if available. */
|
|
671
|
+
url?: string;
|
|
672
|
+
/** ISO 8601 timestamp when the evidence was collected. */
|
|
673
|
+
collectedAt: string;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Represents a specific control requirement from a compliance framework.
|
|
677
|
+
* Domain: Risk & Compliance
|
|
678
|
+
* Schema: data-model/schemas/compliance-control.schema.json
|
|
679
|
+
*/
|
|
680
|
+
interface ComplianceControl {
|
|
681
|
+
/** Globally unique identifier. Read-only. */
|
|
682
|
+
id: string;
|
|
683
|
+
/** The compliance framework this control belongs to. */
|
|
684
|
+
framework: ComplianceFramework;
|
|
685
|
+
/** Framework-specific control identifier (e.g., 'CC6.1', 'A.9.2.1'). */
|
|
686
|
+
controlId: string;
|
|
687
|
+
/** Short title of the control requirement. */
|
|
688
|
+
title: string;
|
|
689
|
+
/** Full description of the control requirement. */
|
|
690
|
+
description: string;
|
|
691
|
+
/** Control category within the framework (e.g., 'Access Control', 'Cryptography'). */
|
|
692
|
+
category: string;
|
|
693
|
+
/** UUID of the Person responsible for this control. */
|
|
694
|
+
owner: string;
|
|
695
|
+
/** Current implementation status. */
|
|
696
|
+
status: ControlStatus;
|
|
697
|
+
/** Evidence collected to demonstrate implementation. */
|
|
698
|
+
evidence: ControlEvidence[];
|
|
699
|
+
/** ISO 8601 timestamp of the most recent assessment. */
|
|
700
|
+
lastAssessedAt?: string;
|
|
701
|
+
/** ISO 8601 timestamp of the next scheduled review. */
|
|
702
|
+
nextReviewAt?: string;
|
|
703
|
+
/** UUIDs of TechnologyAssets or other assets this control applies to. */
|
|
704
|
+
linkedAssetIds: string[];
|
|
705
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
706
|
+
createdAt: string;
|
|
707
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
708
|
+
updatedAt: string;
|
|
709
|
+
}
|
|
710
|
+
/** Risk domain category. */
|
|
711
|
+
type RiskCategory = 'security' | 'operational' | 'compliance' | 'vendor' | 'data' | 'financial';
|
|
712
|
+
/** Likelihood rating for a RiskItem. */
|
|
713
|
+
type RiskLikelihood = 'rare' | 'unlikely' | 'possible' | 'likely' | 'almost_certain';
|
|
714
|
+
/** Business impact rating for a RiskItem. */
|
|
715
|
+
type RiskImpact = 'negligible' | 'minor' | 'moderate' | 'major' | 'catastrophic';
|
|
716
|
+
/**
|
|
717
|
+
* Represents an identified enterprise risk tracked through the risk management lifecycle.
|
|
718
|
+
* Domain: Risk & Compliance
|
|
719
|
+
* Schema: data-model/schemas/risk-item.schema.json
|
|
720
|
+
*/
|
|
721
|
+
interface RiskItem {
|
|
722
|
+
/** Globally unique identifier. Read-only. */
|
|
723
|
+
id: string;
|
|
724
|
+
/** Short descriptive title for the risk. */
|
|
725
|
+
title: string;
|
|
726
|
+
/** Detailed description of the risk scenario and its potential impact. */
|
|
727
|
+
description: string;
|
|
728
|
+
/** Risk domain category. */
|
|
729
|
+
category: RiskCategory;
|
|
730
|
+
/** Estimated likelihood of the risk occurring. */
|
|
731
|
+
likelihood: RiskLikelihood;
|
|
732
|
+
/** Estimated business impact if the risk materializes. */
|
|
733
|
+
impact: RiskImpact;
|
|
734
|
+
/** Computed risk score (likelihood × impact matrix). Read-only. */
|
|
735
|
+
riskScore: number;
|
|
736
|
+
/** Current treatment status. */
|
|
737
|
+
status: 'open' | 'mitigating' | 'accepted' | 'closed';
|
|
738
|
+
/** UUID of the Person accountable for this risk. */
|
|
739
|
+
owner: string;
|
|
740
|
+
/** UUIDs of linked Vulnerability records that contribute to this risk. */
|
|
741
|
+
linkedVulnerabilityIds: string[];
|
|
742
|
+
/** UUIDs of ComplianceControl records relevant to this risk. */
|
|
743
|
+
linkedControlIds: string[];
|
|
744
|
+
/** Description of the planned or active mitigation strategy. */
|
|
745
|
+
mitigationPlan?: string;
|
|
746
|
+
/** ISO 8601 target date for risk closure or mitigation. */
|
|
747
|
+
dueDate?: string;
|
|
748
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
749
|
+
createdAt: string;
|
|
750
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
751
|
+
updatedAt: string;
|
|
752
|
+
}
|
|
753
|
+
/** Input payload for creating a new RiskItem. */
|
|
754
|
+
interface CreateRiskInput {
|
|
755
|
+
title: string;
|
|
756
|
+
description: string;
|
|
757
|
+
category: RiskCategory;
|
|
758
|
+
likelihood: RiskLikelihood;
|
|
759
|
+
impact: RiskImpact;
|
|
760
|
+
owner: string;
|
|
761
|
+
linkedVulnerabilityIds?: string[];
|
|
762
|
+
linkedControlIds?: string[];
|
|
763
|
+
mitigationPlan?: string;
|
|
764
|
+
dueDate?: string;
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Represents a directed relationship between any two entities in the EDM graph.
|
|
768
|
+
* Relationships power the graph traversal capabilities of the cPod platform.
|
|
769
|
+
* Domain: Common
|
|
770
|
+
* Schema: data-model/schemas/relationship.schema.json
|
|
771
|
+
*/
|
|
772
|
+
interface Relationship {
|
|
773
|
+
/** Globally unique identifier. Read-only. */
|
|
774
|
+
id: string;
|
|
775
|
+
/** UUID of the source entity. */
|
|
776
|
+
sourceId: string;
|
|
777
|
+
/** EDM entity type of the source (e.g., 'Person', 'TechnologyAsset'). */
|
|
778
|
+
sourceType: string;
|
|
779
|
+
/** UUID of the target entity. */
|
|
780
|
+
targetId: string;
|
|
781
|
+
/** EDM entity type of the target. */
|
|
782
|
+
targetType: string;
|
|
783
|
+
/** Semantic type of the relationship (e.g., 'manages', 'owns', 'depends_on'). */
|
|
784
|
+
relationshipType: string;
|
|
785
|
+
/** Arbitrary additional attributes describing the relationship. */
|
|
786
|
+
properties?: Record<string, unknown>;
|
|
787
|
+
/** Confidence score for the relationship (0.0–1.0). Higher = more certain. */
|
|
788
|
+
confidence: number;
|
|
789
|
+
/** Source system that asserted this relationship (e.g., 'active_directory', 'inferred'). */
|
|
790
|
+
source: string;
|
|
791
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
792
|
+
createdAt: string;
|
|
793
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
794
|
+
updatedAt: string;
|
|
795
|
+
}
|
|
796
|
+
/** Input payload for creating a new Relationship. */
|
|
797
|
+
interface CreateRelationshipInput {
|
|
798
|
+
sourceId: string;
|
|
799
|
+
sourceType: string;
|
|
800
|
+
targetId: string;
|
|
801
|
+
targetType: string;
|
|
802
|
+
relationshipType: string;
|
|
803
|
+
properties?: Record<string, unknown>;
|
|
804
|
+
confidence?: number;
|
|
805
|
+
source?: string;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Well-known edge types for the cross-domain relationship spine.
|
|
809
|
+
* These cover the most common directed edges between EDM entities;
|
|
810
|
+
* `relationshipType` on {@link Relationship} remains an open string
|
|
811
|
+
* so callers can use custom values beyond this set.
|
|
812
|
+
*/
|
|
813
|
+
type RelationshipEdgeType = 'owns' | 'manages' | 'reports_to' | 'member_of' | 'related_to' | 'depends_on' | 'responsible_for' | 'approved_by' | 'part_of';
|
|
814
|
+
/**
|
|
815
|
+
* Alias for {@link RelationshipEdgeType} — the common cross-domain edge
|
|
816
|
+
* types used by the relationship spine.
|
|
817
|
+
*/
|
|
818
|
+
type RelationshipType = RelationshipEdgeType;
|
|
819
|
+
/**
|
|
820
|
+
* How a relationship was established.
|
|
821
|
+
* - `manual` — explicitly created by a user or integration
|
|
822
|
+
* - `inferred` — derived by the platform (graph inference, ML, heuristics)
|
|
823
|
+
* - `imported` — bulk-loaded from an external system (HRIS, CMDB, IdP…)
|
|
824
|
+
*/
|
|
825
|
+
type RelationshipProvenance = 'manual' | 'inferred' | 'imported';
|
|
826
|
+
/**
|
|
827
|
+
* Richer cross-domain relationship record. Extends the base {@link Relationship}
|
|
828
|
+
* with provenance, validity window, and actor attribution used by the
|
|
829
|
+
* cross-domain spine. The base type remains backward-compatible — the extra
|
|
830
|
+
* fields are all optional and only populated when the backend supports them.
|
|
831
|
+
*/
|
|
832
|
+
interface ExtendedRelationship extends Relationship {
|
|
833
|
+
/** UUID of the source entity (alias for `sourceId`, useful for spine queries). */
|
|
834
|
+
sourceEntityId?: string;
|
|
835
|
+
/** EDM entity type of the source (alias for `sourceType`). */
|
|
836
|
+
sourceEntityType?: string;
|
|
837
|
+
/** EDM domain of the source entity (e.g., 'people', 'technology', 'assets'). */
|
|
838
|
+
sourceEntityDomain?: string;
|
|
839
|
+
/** UUID of the target entity (alias for `targetId`). */
|
|
840
|
+
targetEntityId?: string;
|
|
841
|
+
/** EDM entity type of the target (alias for `targetType`). */
|
|
842
|
+
targetEntityType?: string;
|
|
843
|
+
/** EDM domain of the target entity. */
|
|
844
|
+
targetEntityDomain?: string;
|
|
845
|
+
/** How the relationship was established. */
|
|
846
|
+
provenance?: RelationshipProvenance;
|
|
847
|
+
/** ISO 8601 timestamp from which this relationship is considered valid. */
|
|
848
|
+
validFrom?: string;
|
|
849
|
+
/** ISO 8601 timestamp until which this relationship is considered valid. */
|
|
850
|
+
validTo?: string;
|
|
851
|
+
/** UUID of the user or system actor that created or last confirmed the edge. */
|
|
852
|
+
actorId?: string;
|
|
853
|
+
/** Human-readable explanation of why this relationship exists. */
|
|
854
|
+
explanation?: string;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Well-known cross-domain relationship bridges in the EDM.
|
|
858
|
+
*
|
|
859
|
+
* These formalize the 5 most common cross-domain traversals that apps need,
|
|
860
|
+
* replacing per-app query-time derivation with first-class SDK methods.
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```ts
|
|
864
|
+
* // Traverse from a customer account to related finance records
|
|
865
|
+
* const edges = await client.relationshipsEdges.traverseBridge(
|
|
866
|
+
* 'customer_finance',
|
|
867
|
+
* { sourceEntityId: 'acc_01HX...' }
|
|
868
|
+
* );
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
type RelationshipBridge =
|
|
872
|
+
/** Customer accounts ↔ finance invoices/payments */
|
|
873
|
+
'customer_finance'
|
|
874
|
+
/** Procurement suppliers ↔ contracts ↔ GRC controls ↔ finance */
|
|
875
|
+
| 'procurement_contracts_grc_finance'
|
|
876
|
+
/** Projects ↔ customer accounts (project-to-customer attribution) */
|
|
877
|
+
| 'projects_customer'
|
|
878
|
+
/** Employee ↔ performance reviews ↔ learning records */
|
|
879
|
+
| 'employee_performance_learning'
|
|
880
|
+
/** Generic first-class relationship (any domain ↔ any domain) */
|
|
881
|
+
| 'generic';
|
|
882
|
+
/**
|
|
883
|
+
* Bridge definition — maps a bridge name to its source and target domains.
|
|
884
|
+
* Used by traverseBridge() to construct the right query.
|
|
885
|
+
*/
|
|
886
|
+
interface BridgeDefinition {
|
|
887
|
+
bridge: RelationshipBridge;
|
|
888
|
+
sourceDomains: string[];
|
|
889
|
+
targetDomains: string[];
|
|
890
|
+
/** Typical edge types for this bridge. */
|
|
891
|
+
edgeTypes: string[];
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Options for traversing a relationship bridge.
|
|
895
|
+
*/
|
|
896
|
+
interface BridgeTraversalOptions {
|
|
897
|
+
/** Filter by source entity ID. */
|
|
898
|
+
sourceEntityId?: string;
|
|
899
|
+
/** Filter by target entity ID. */
|
|
900
|
+
targetEntityId?: string;
|
|
901
|
+
/** Filter by specific edge type within the bridge. */
|
|
902
|
+
edgeType?: string;
|
|
903
|
+
/** Page number (1-based). */
|
|
904
|
+
page?: number;
|
|
905
|
+
/** Page size. */
|
|
906
|
+
pageSize?: number;
|
|
907
|
+
}
|
|
908
|
+
/** Type identifier for an integrated external data source. */
|
|
909
|
+
type DataSourceType = 'active_directory' | 'okta' | 'aws' | 'azure' | 'gcp' | 'servicenow' | 'jira' | 'github' | 'jamf' | 'intune' | 'qualys' | 'tenable' | 'snyk' | 'crowdstrike' | 'custom';
|
|
910
|
+
/** Operational status of a DataSource integration. */
|
|
911
|
+
type DataSourceStatus = 'active' | 'error' | 'paused' | 'disconnected';
|
|
912
|
+
/**
|
|
913
|
+
* Represents an integrated external system that feeds data into the cPod EDM.
|
|
914
|
+
* Domain: Common
|
|
915
|
+
* Schema: data-model/schemas/data-source.schema.json
|
|
916
|
+
*/
|
|
917
|
+
interface DataSource {
|
|
918
|
+
/** Globally unique identifier. Read-only. */
|
|
919
|
+
id: string;
|
|
920
|
+
/** Human-readable name for this integration (e.g., 'Production Okta', 'AWS Prod Account'). */
|
|
921
|
+
name: string;
|
|
922
|
+
/** The type of system being integrated. */
|
|
923
|
+
type: DataSourceType;
|
|
924
|
+
/** Current operational status of the integration. */
|
|
925
|
+
status: DataSourceStatus;
|
|
926
|
+
/** ISO 8601 timestamp of the last successful sync. */
|
|
927
|
+
lastSyncAt?: string;
|
|
928
|
+
/** ISO 8601 timestamp of the next scheduled sync. */
|
|
929
|
+
nextSyncAt?: string;
|
|
930
|
+
/** Count of synced entities per entity type. Read-only. */
|
|
931
|
+
syncedEntities: Record<string, number>;
|
|
932
|
+
/** Integration configuration (credentials, endpoints, etc.). Values are redacted in responses. */
|
|
933
|
+
config: Record<string, unknown>;
|
|
934
|
+
/** ISO 8601 creation timestamp. Read-only. */
|
|
935
|
+
createdAt: string;
|
|
936
|
+
/** ISO 8601 last-updated timestamp. Read-only. */
|
|
937
|
+
updatedAt: string;
|
|
938
|
+
}
|
|
939
|
+
/** Input payload for creating a new DataSource integration. */
|
|
940
|
+
interface CreateDataSourceInput {
|
|
941
|
+
name: string;
|
|
942
|
+
type: DataSourceType;
|
|
943
|
+
config: Record<string, unknown>;
|
|
944
|
+
}
|
|
945
|
+
/** Common pagination parameters shared by list endpoints. */
|
|
946
|
+
interface PaginationOptions {
|
|
947
|
+
/** Maximum number of results to return. */
|
|
948
|
+
limit?: number;
|
|
949
|
+
/** Number of results to skip (for cursor-based pagination). */
|
|
950
|
+
offset?: number;
|
|
951
|
+
}
|
|
952
|
+
/** Lifecycle status of a Pod. */
|
|
953
|
+
type PodStatus = 'provisioning' | 'running' | 'stopping' | 'stopped' | 'failed' | 'terminating' | 'terminated';
|
|
954
|
+
/** Desired-state workload specification for a Pod. */
|
|
955
|
+
interface PodSpec {
|
|
956
|
+
image: string;
|
|
957
|
+
cpu?: string;
|
|
958
|
+
memory?: string;
|
|
959
|
+
replicas?: number;
|
|
960
|
+
env?: Record<string, string>;
|
|
961
|
+
command?: string[];
|
|
962
|
+
args?: string[];
|
|
963
|
+
}
|
|
964
|
+
/** Named network port exposed by a Pod container. */
|
|
965
|
+
interface PodPort {
|
|
966
|
+
name: string;
|
|
967
|
+
port: number;
|
|
968
|
+
protocol?: string;
|
|
969
|
+
}
|
|
970
|
+
/** Network configuration for a Pod. */
|
|
971
|
+
interface PodNetwork {
|
|
972
|
+
ports?: PodPort[];
|
|
973
|
+
clusterIp?: string;
|
|
974
|
+
externalIp?: string;
|
|
975
|
+
}
|
|
976
|
+
/** Health state of a Pod. */
|
|
977
|
+
interface PodHealth {
|
|
978
|
+
ready: boolean;
|
|
979
|
+
liveness?: boolean;
|
|
980
|
+
}
|
|
981
|
+
/** Represents a cPod workload unit. */
|
|
982
|
+
interface Pod {
|
|
983
|
+
id: string;
|
|
984
|
+
workspaceId: string;
|
|
985
|
+
name: string;
|
|
986
|
+
displayName?: string;
|
|
987
|
+
spec: PodSpec;
|
|
988
|
+
status: PodStatus;
|
|
989
|
+
network?: PodNetwork;
|
|
990
|
+
health?: PodHealth;
|
|
991
|
+
labels: Record<string, string>;
|
|
992
|
+
annotations: Record<string, string>;
|
|
993
|
+
createdAt: string;
|
|
994
|
+
updatedAt: string;
|
|
995
|
+
}
|
|
996
|
+
/** Kind of credential. */
|
|
997
|
+
type CredentialType = 'api_key' | 'service_account' | 'webhook_token' | 'virtual_llm';
|
|
998
|
+
/** Lifecycle status of a Credential. */
|
|
999
|
+
type CredentialStatus = 'active' | 'revoked' | 'expired';
|
|
1000
|
+
/** Represents an API key or service account credential. */
|
|
1001
|
+
interface Credential {
|
|
1002
|
+
id: string;
|
|
1003
|
+
organizationId: string;
|
|
1004
|
+
workspaceId?: string;
|
|
1005
|
+
name: string;
|
|
1006
|
+
description?: string;
|
|
1007
|
+
type: CredentialType;
|
|
1008
|
+
status: CredentialStatus;
|
|
1009
|
+
scopes: string[];
|
|
1010
|
+
keyPrefix?: string;
|
|
1011
|
+
expiresAt?: string;
|
|
1012
|
+
lastUsedAt?: string;
|
|
1013
|
+
createdAt: string;
|
|
1014
|
+
updatedAt: string;
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Returned only on creation. The `secret` field is the one-time plaintext value —
|
|
1018
|
+
* store it immediately; it will not be returned again.
|
|
1019
|
+
*/
|
|
1020
|
+
interface CredentialCreateResponse extends Omit<Credential, 'keyPrefix' | 'lastUsedAt'> {
|
|
1021
|
+
secret: string;
|
|
1022
|
+
}
|
|
1023
|
+
/** Role of a user within an Organization. */
|
|
1024
|
+
type UserRole = 'owner' | 'admin' | 'member' | 'viewer';
|
|
1025
|
+
/** Lifecycle status of a user account. */
|
|
1026
|
+
type UserStatus = 'active' | 'suspended' | 'invited' | 'deactivated';
|
|
1027
|
+
/** User-configurable display and notification settings. */
|
|
1028
|
+
interface UserPreferences {
|
|
1029
|
+
theme?: string;
|
|
1030
|
+
timezone?: string;
|
|
1031
|
+
locale?: string;
|
|
1032
|
+
notificationsEnabled?: boolean;
|
|
1033
|
+
}
|
|
1034
|
+
/** Represents a cPod user's profile. */
|
|
1035
|
+
interface UserProfile {
|
|
1036
|
+
id: string;
|
|
1037
|
+
email: string;
|
|
1038
|
+
displayName: string;
|
|
1039
|
+
avatarUrl?: string;
|
|
1040
|
+
role: UserRole;
|
|
1041
|
+
status: UserStatus;
|
|
1042
|
+
preferences?: UserPreferences;
|
|
1043
|
+
createdAt: string;
|
|
1044
|
+
updatedAt: string;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Internal HTTP client that wraps the Fetch API with authentication,
|
|
1049
|
+
* timeout, and retry logic.
|
|
1050
|
+
*
|
|
1051
|
+
* Auth comes through a TokenManager — that's how refresh works
|
|
1052
|
+
* transparently. On 401, the client asks the manager to refresh once,
|
|
1053
|
+
* then retries the request with the new access token.
|
|
1054
|
+
*/
|
|
1055
|
+
declare class HttpClient {
|
|
1056
|
+
private readonly baseUrl;
|
|
1057
|
+
private readonly tokenManager;
|
|
1058
|
+
private readonly timeoutMs;
|
|
1059
|
+
constructor(config: CpodConfig);
|
|
1060
|
+
/** Public accessor — apps can read or replace the bundle. */
|
|
1061
|
+
get tokens(): TokenManager;
|
|
1062
|
+
get<T>(path: string, opts?: RequestOptions): Promise<T>;
|
|
1063
|
+
post<T>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
1064
|
+
put<T>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
1065
|
+
patch<T>(path: string, body?: unknown, opts?: RequestOptions): Promise<T>;
|
|
1066
|
+
delete<T>(path: string, opts?: RequestOptions): Promise<T>;
|
|
1067
|
+
private request;
|
|
1068
|
+
/** Don't try to refresh the refresh endpoint itself (would loop). */
|
|
1069
|
+
private isRefreshPath;
|
|
1070
|
+
private backoffMs;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
export { type PhysicalAsset as $, type AccessEntitlement as A, type BridgeDefinition as B, type CloudProvider as C, type Criticality as D, type DataClassification as E, type DataSource as F, type DataSourceStatus as G, type DataSourceType as H, type EntitlementStatus as I, type ExtendedRelationship as J, type GrantEntitlementInput as K, type Group as L, type GroupMember as M, type GroupType as N, HttpClient as O, type LicenseAssignment as P, type LicenseCost as Q, type LicenseStatus as R, type LicenseType as S, type ListPeopleOptions as T, type PaginatedResponse as U, type PaginationOptions as V, type Person as W, type PersonIdentity as X, type PersonLocation as Y, type PersonStatus as Z, type PersonType as _, type ApiResponse as a, type PhysicalAssetStatus as a0, type PhysicalAssetType as a1, type Pod as a2, type PodHealth as a3, type PodNetwork as a4, type PodSpec as a5, type PodStatus as a6, type Relationship as a7, type RelationshipBridge as a8, type RelationshipEdgeType as a9, type RelationshipProvenance as aa, type RelationshipType as ab, type RequestOptions as ac, type RiskCategory as ad, type RiskImpact as ae, type RiskItem as af, type RiskLikelihood as ag, type SoftwareLicense as ah, type TechnologyAsset as ai, type TokenBundle as aj, TokenManager as ak, type UserPreferences as al, type UserProfile as am, type UserRole as an, type UserStatus as ao, type Vulnerability as ap, type VulnerabilitySeverity as aq, type VulnerabilityStatus as ar, type AssetEnvironment as b, type AssetOwner as c, type AssetStatus as d, type AssetType as e, type AuthOptions as f, type BridgeTraversalOptions as g, type CloudResource as h, type ComplianceControl as i, type ComplianceFramework as j, type ComplianceStatus as k, type ControlEvidence as l, type ControlStatus as m, type CpodConfig as n, type CreateDataSourceInput as o, type CreateGroupInput as p, type CreateLicenseInput as q, type CreatePersonInput as r, type CreatePhysicalAssetInput as s, type CreateRelationshipInput as t, type CreateRiskInput as u, type CreateTechnologyAssetInput as v, type Credential as w, type CredentialCreateResponse as x, type CredentialStatus as y, type CredentialType as z };
|