@vertesia/common 1.6.0-dev.20261004.085740Z → 1.6.0-dev.20261008.064737Z
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/lib/api-contract/components.generated.json +566 -403
- package/lib/api-contract/engine.d.ts +65 -0
- package/lib/api-contract/engine.d.ts.map +1 -0
- package/lib/api-contract/engine.js +569 -0
- package/lib/api-contract/engine.js.map +1 -0
- package/lib/api-contract/index.d.ts +21 -182
- package/lib/api-contract/index.d.ts.map +1 -1
- package/lib/api-contract/index.js +13 -551
- package/lib/api-contract/index.js.map +1 -1
- package/lib/api-schemas/account.d.ts +0 -5
- package/lib/api-schemas/account.d.ts.map +1 -1
- package/lib/api-schemas/account.js +0 -7
- package/lib/api-schemas/account.js.map +1 -1
- package/lib/api-schemas/audit-trail.d.ts +255 -0
- package/lib/api-schemas/audit-trail.d.ts.map +1 -1
- package/lib/api-schemas/audit-trail.js +150 -1
- package/lib/api-schemas/audit-trail.js.map +1 -1
- package/lib/api-schemas/cost-analytics.d.ts +1 -0
- package/lib/api-schemas/cost-analytics.d.ts.map +1 -1
- package/lib/api-schemas/cost-analytics.js +7 -0
- package/lib/api-schemas/cost-analytics.js.map +1 -1
- package/lib/api-schemas/index.d.ts +1 -0
- package/lib/api-schemas/index.d.ts.map +1 -1
- package/lib/api-schemas/index.js +1 -0
- package/lib/api-schemas/index.js.map +1 -1
- package/lib/api-schemas/registry.d.ts +256 -109
- package/lib/api-schemas/registry.d.ts.map +1 -1
- package/lib/api-schemas/registry.js +26 -29
- package/lib/api-schemas/registry.js.map +1 -1
- package/lib/api-schemas/run-budget.d.ts +0 -36
- package/lib/api-schemas/run-budget.d.ts.map +1 -1
- package/lib/api-schemas/run-budget.js +0 -33
- package/lib/api-schemas/run-budget.js.map +1 -1
- package/lib/api-schemas/secrets.d.ts +0 -71
- package/lib/api-schemas/secrets.d.ts.map +1 -1
- package/lib/api-schemas/secrets.js +0 -73
- package/lib/api-schemas/secrets.js.map +1 -1
- package/lib/audit-trail.d.ts +14 -2
- package/lib/audit-trail.d.ts.map +1 -1
- package/lib/audit-trail.js +4 -0
- package/lib/audit-trail.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/platform-event.d.ts +0 -20
- package/lib/platform-event.d.ts.map +1 -1
- package/lib/run-budget.d.ts +0 -4
- package/lib/run-budget.d.ts.map +1 -1
- package/lib/secrets.d.ts +0 -10
- package/lib/secrets.d.ts.map +1 -1
- package/lib/user.d.ts +0 -1
- package/lib/user.d.ts.map +1 -1
- package/lib/vertesia-common.js +1 -1
- package/lib/vertesia-common.js.map +1 -1
- package/lib/wire-types.generated.d.ts +101 -105
- package/lib/wire-types.generated.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/api-contract/components.generated.json +566 -403
- package/src/api-contract/engine.ts +641 -0
- package/src/api-contract/index.ts +30 -661
- package/src/api-schemas/account.ts +0 -8
- package/src/api-schemas/audit-trail.ts +169 -1
- package/src/api-schemas/cost-analytics.ts +8 -0
- package/src/api-schemas/index.ts +1 -0
- package/src/api-schemas/registry.ts +37 -33
- package/src/api-schemas/run-budget.ts +0 -37
- package/src/api-schemas/secrets.ts +0 -84
- package/src/audit-trail.ts +17 -0
- package/src/index.ts +0 -4
- package/src/platform-event.ts +0 -25
- package/src/run-budget.ts +0 -4
- package/src/secrets.ts +0 -11
- package/src/user.ts +0 -2
- package/src/wire-types.generated.ts +102 -103
|
@@ -2,7 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
// From the values module, never from `user.ts`: `user.ts` derives its public types from the schemas
|
|
3
3
|
// below, so importing it here would invert the dependency and make the source of truth circular.
|
|
4
4
|
import { ACCOUNT_APP_ACCESS_MESSAGE_MAX_LENGTH, AccountType, BillingMethod, QuotaTier } from '../account-values.js';
|
|
5
|
-
import { ApiVersions } from '../versions.js';
|
|
6
5
|
import type * as Wire from '../wire-types.generated.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -146,10 +145,3 @@ export type AccountBillingFromSchema = Wire.AccountBillingFromSchema;
|
|
|
146
145
|
export type AccountFromSchema = Wire.AccountFromSchema;
|
|
147
146
|
export type UpdateAccountPayloadFromSchema = Wire.UpdateAccountPayloadFromSchema;
|
|
148
147
|
export type StripeBillingStatusResponseFromSchema = Wire.StripeBillingStatusResponseFromSchema;
|
|
149
|
-
|
|
150
|
-
/** Account-wide defaults for request API version negotiation. */
|
|
151
|
-
export const AccountApiVersionPolicySchema = z
|
|
152
|
-
.strictObject({
|
|
153
|
-
default_api_version: z.enum(ApiVersions).optional(),
|
|
154
|
-
})
|
|
155
|
-
.meta({ id: 'AccountApiVersionPolicy' });
|
|
@@ -41,6 +41,10 @@ export const AuditAggregationDimensionMapSchema = z
|
|
|
41
41
|
project_id: z.string().nullable().optional(),
|
|
42
42
|
principal_id: z.string().nullable().optional(),
|
|
43
43
|
actor_id: z.string().nullable().optional(),
|
|
44
|
+
user_id: z.string().nullable().optional().meta({
|
|
45
|
+
description:
|
|
46
|
+
'Originating user identity, including delegated and scheduled activity with a recorded user owner. Non-user principals without a user origin are excluded.',
|
|
47
|
+
}),
|
|
44
48
|
'details.pipeline': z.string().nullable().optional(),
|
|
45
49
|
'details.verdict': z.string().nullable().optional(),
|
|
46
50
|
'details.workflow_type': z.string().nullable().optional(),
|
|
@@ -50,7 +54,7 @@ export const AuditAggregationDimensionMapSchema = z
|
|
|
50
54
|
.meta({ id: 'AuditAggregationDimensionMap' });
|
|
51
55
|
|
|
52
56
|
export const AuditAggregationDistinctFieldSchema = z
|
|
53
|
-
.enum(['resource_id', 'request_id', 'principal_id', 'actor_id'])
|
|
57
|
+
.enum(['resource_id', 'request_id', 'principal_id', 'actor_id', 'user_id'])
|
|
54
58
|
.meta({ id: 'AuditAggregationDistinctField' });
|
|
55
59
|
|
|
56
60
|
export const AuditAggregationOperationSchema = z
|
|
@@ -247,3 +251,167 @@ export const AuditTrailQuerySchema = z
|
|
|
247
251
|
offset: z.number().meta({ description: 'Pagination: offset' }).optional(),
|
|
248
252
|
})
|
|
249
253
|
.meta({ id: 'AuditTrailQuery' });
|
|
254
|
+
|
|
255
|
+
export const AuditAdoptionFilterSchema = z
|
|
256
|
+
.strictObject({
|
|
257
|
+
actions: z.array(AuditActionSchema).max(32).optional(),
|
|
258
|
+
resourceTypes: z.array(z.string().max(128)).max(16).optional(),
|
|
259
|
+
eventCategories: z.array(EventCategorySchema).max(6).optional(),
|
|
260
|
+
})
|
|
261
|
+
.meta({ id: 'AuditAdoptionFilter' });
|
|
262
|
+
|
|
263
|
+
export const AuditAdoptionQuerySchema = z
|
|
264
|
+
.strictObject({
|
|
265
|
+
projectId: z.string().optional(),
|
|
266
|
+
from: z
|
|
267
|
+
.string()
|
|
268
|
+
.meta({ format: 'date-time', description: 'Inclusive start; defaults to 30 days before to.' })
|
|
269
|
+
.optional(),
|
|
270
|
+
to: z
|
|
271
|
+
.string()
|
|
272
|
+
.meta({ format: 'date-time', description: 'Exclusive end; defaults to now. Maximum duration: 366 days.' })
|
|
273
|
+
.optional(),
|
|
274
|
+
filter: AuditAdoptionFilterSchema.optional(),
|
|
275
|
+
})
|
|
276
|
+
.meta({
|
|
277
|
+
id: 'AuditAdoptionQuery',
|
|
278
|
+
description:
|
|
279
|
+
'Productive direct authenticated user activity, including user OAuth/MCP calls. Scope is enforced by the server.',
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
export const AuditAdoptionPeriodSchema = z
|
|
283
|
+
.strictObject({
|
|
284
|
+
from: z.string().meta({ format: 'date-time' }),
|
|
285
|
+
to: z.string().meta({ format: 'date-time' }),
|
|
286
|
+
})
|
|
287
|
+
.meta({ id: 'AuditAdoptionPeriod' });
|
|
288
|
+
|
|
289
|
+
export const AuditAdoptionBucketSchema = z
|
|
290
|
+
.strictObject({
|
|
291
|
+
from: z.string().meta({ format: 'date-time' }),
|
|
292
|
+
to: z.string().meta({ format: 'date-time' }),
|
|
293
|
+
partial: z.boolean(),
|
|
294
|
+
active_users: z.number().int().nonnegative(),
|
|
295
|
+
})
|
|
296
|
+
.meta({ id: 'AuditAdoptionBucket' });
|
|
297
|
+
|
|
298
|
+
export const AuditAdoptionActiveDaysSchema = z
|
|
299
|
+
.strictObject({
|
|
300
|
+
days: z.number().int().min(1).max(367),
|
|
301
|
+
users: z.number().int().nonnegative(),
|
|
302
|
+
})
|
|
303
|
+
.meta({ id: 'AuditAdoptionActiveDays' });
|
|
304
|
+
|
|
305
|
+
export const AuditAdoptionProjectSchema = z
|
|
306
|
+
.strictObject({
|
|
307
|
+
project_id: z.string(),
|
|
308
|
+
project_name: z.string().nullable(),
|
|
309
|
+
active_users: z.number().int().nonnegative(),
|
|
310
|
+
active_user_days: z.number().int().nonnegative(),
|
|
311
|
+
})
|
|
312
|
+
.meta({ id: 'AuditAdoptionProject' });
|
|
313
|
+
|
|
314
|
+
export const AuditAdoptionHistorySchema = z
|
|
315
|
+
.strictObject({
|
|
316
|
+
earliest_observed_at: z.string().meta({ format: 'date-time' }).nullable(),
|
|
317
|
+
coverage_from: z
|
|
318
|
+
.string()
|
|
319
|
+
.meta({
|
|
320
|
+
format: 'date-time',
|
|
321
|
+
description:
|
|
322
|
+
'Authoritative complete-history boundary, if known. Earliest observation is not a coverage boundary.',
|
|
323
|
+
})
|
|
324
|
+
.nullable(),
|
|
325
|
+
completeness: z.enum(['unknown', 'insufficient', 'verified']),
|
|
326
|
+
retention_unavailable_reason: z.enum(['no_previous_users', 'insufficient_history']).nullable(),
|
|
327
|
+
})
|
|
328
|
+
.meta({ id: 'AuditAdoptionHistory' });
|
|
329
|
+
|
|
330
|
+
export const AuditAdoptionResponseSchema = z
|
|
331
|
+
.strictObject({
|
|
332
|
+
period: AuditAdoptionPeriodSchema,
|
|
333
|
+
previous_period: AuditAdoptionPeriodSchema,
|
|
334
|
+
resolution: z.enum(['day', 'week']),
|
|
335
|
+
active_users: z.number().int().nonnegative(),
|
|
336
|
+
previous_active_users: z.number().int().nonnegative(),
|
|
337
|
+
retained_users: z.number().int().nonnegative(),
|
|
338
|
+
observed_retention: z.number().min(0).max(1).nullable(),
|
|
339
|
+
returning_user_share: z.number().min(0).max(1).nullable(),
|
|
340
|
+
repeat_user_share: z.number().min(0).max(1).nullable(),
|
|
341
|
+
median_active_days: z.number().nonnegative().nullable(),
|
|
342
|
+
active_projects: z.number().int().nonnegative().nullable(),
|
|
343
|
+
timeline: z.array(AuditAdoptionBucketSchema),
|
|
344
|
+
active_day_distribution: z.array(AuditAdoptionActiveDaysSchema),
|
|
345
|
+
top_projects: z.array(AuditAdoptionProjectSchema).max(10),
|
|
346
|
+
history: AuditAdoptionHistorySchema,
|
|
347
|
+
})
|
|
348
|
+
.meta({
|
|
349
|
+
id: 'AuditAdoptionResponse',
|
|
350
|
+
description:
|
|
351
|
+
'Distinct user adoption sets over two equal-duration half-open periods. Ratios use available audit history, not guaranteed historical coverage. No user identities are returned.',
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
export const AuditUsageQuerySchema = AuditAdoptionQuerySchema.omit({ filter: true })
|
|
355
|
+
.extend({
|
|
356
|
+
resolution: z.enum(['day', 'week', 'month']).optional().meta({
|
|
357
|
+
description: 'UTC calendar buckets. Weeks start Monday. Omitted: daily up to 200 dates, otherwise weekly.',
|
|
358
|
+
}),
|
|
359
|
+
})
|
|
360
|
+
.meta({
|
|
361
|
+
id: 'AuditUsageQuery',
|
|
362
|
+
description: 'Usage trends for an authorized account or project over a half-open interval of at most 366 days.',
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
export const AuditUsageCountsSchema = z
|
|
366
|
+
.strictObject({
|
|
367
|
+
active_users: z.number().int().nonnegative(),
|
|
368
|
+
agent_runs: z
|
|
369
|
+
.number()
|
|
370
|
+
.int()
|
|
371
|
+
.nonnegative()
|
|
372
|
+
.meta({ description: 'All audited run creations and marked restarts, including automated runs.' }),
|
|
373
|
+
user_agent_runs: z
|
|
374
|
+
.number()
|
|
375
|
+
.int()
|
|
376
|
+
.nonnegative()
|
|
377
|
+
.meta({ description: 'Run operations initiated directly by authenticated users, including OAuth/MCP.' }),
|
|
378
|
+
automated_agent_runs: z.number().int().nonnegative().meta({
|
|
379
|
+
description: 'Other run operations, including schedules, delegated agents, services and API keys.',
|
|
380
|
+
}),
|
|
381
|
+
agent_users: z.number().int().nonnegative().meta({
|
|
382
|
+
description:
|
|
383
|
+
'Distinct identifiable user initiators or owners of run operations, including scheduled and delegated runs.',
|
|
384
|
+
}),
|
|
385
|
+
direct_calls: z.number().int().nonnegative(),
|
|
386
|
+
direct_call_users: z.number().int().nonnegative(),
|
|
387
|
+
content_objects: z.number().int().nonnegative(),
|
|
388
|
+
user_content_objects: z.number().int().nonnegative(),
|
|
389
|
+
other_content_objects: z.number().int().nonnegative(),
|
|
390
|
+
})
|
|
391
|
+
.meta({
|
|
392
|
+
id: 'AuditUsageCounts',
|
|
393
|
+
description:
|
|
394
|
+
'Direct productive users, run initiators/owners, all run operations and standalone inference audit events.',
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
export const AuditUsageBucketSchema = z
|
|
398
|
+
.strictObject({
|
|
399
|
+
from: z.string().meta({ format: 'date-time' }),
|
|
400
|
+
to: z.string().meta({ format: 'date-time' }),
|
|
401
|
+
partial: z.boolean(),
|
|
402
|
+
counts: AuditUsageCountsSchema,
|
|
403
|
+
})
|
|
404
|
+
.meta({ id: 'AuditUsageBucket' });
|
|
405
|
+
|
|
406
|
+
export const AuditUsageResponseSchema = z
|
|
407
|
+
.strictObject({
|
|
408
|
+
period: AuditAdoptionPeriodSchema,
|
|
409
|
+
resolution: z.enum(['day', 'week', 'month']),
|
|
410
|
+
totals: AuditUsageCountsSchema,
|
|
411
|
+
timeline: z.array(AuditUsageBucketSchema),
|
|
412
|
+
})
|
|
413
|
+
.meta({
|
|
414
|
+
id: 'AuditUsageResponse',
|
|
415
|
+
description:
|
|
416
|
+
'UTC usage trends. Period-wide distinct users are not sums of bucket populations. No user identities are returned.',
|
|
417
|
+
});
|
|
@@ -66,6 +66,14 @@ export const CostAnalyticsQuerySchema = z
|
|
|
66
66
|
workflow_run_id: z.string().meta({ description: 'Filter by Temporal workflow run ID' }).optional(),
|
|
67
67
|
run_id: z.string().meta({ description: 'Filter by interaction execution run ID' }).optional(),
|
|
68
68
|
agent_run_id: z.string().meta({ description: 'Filter by agent run ID' }).optional(),
|
|
69
|
+
agent_only: z
|
|
70
|
+
.boolean()
|
|
71
|
+
.meta({
|
|
72
|
+
description:
|
|
73
|
+
'Restrict usage to agent runs and their attributed nested/background inference. ' +
|
|
74
|
+
'Excludes standalone interactions and non-agent workflows. Defaults to false.',
|
|
75
|
+
})
|
|
76
|
+
.optional(),
|
|
69
77
|
interaction_id: z
|
|
70
78
|
.string()
|
|
71
79
|
.meta({ description: 'Filter by interaction id: stored ObjectId or namespaced in-code id' })
|
package/src/api-schemas/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './agent-runs.js';
|
|
|
16
16
|
export * from './analytics.js';
|
|
17
17
|
export * from './apikey.js';
|
|
18
18
|
export * from './app-runtime.js';
|
|
19
|
+
export { EventCategorySchema } from './audit-trail.js';
|
|
19
20
|
export * from './bulk-operation.js';
|
|
20
21
|
export * from './content.js';
|
|
21
22
|
export * from './content-query.js';
|
|
@@ -78,12 +78,7 @@ import {
|
|
|
78
78
|
RoleDefinitionArraySchema,
|
|
79
79
|
SystemRoleDefinitionArraySchema,
|
|
80
80
|
} from './access-control.js';
|
|
81
|
-
import {
|
|
82
|
-
AccountApiVersionPolicySchema,
|
|
83
|
-
AccountSchema,
|
|
84
|
-
StripeBillingStatusResponseSchema,
|
|
85
|
-
UpdateAccountPayloadSchema,
|
|
86
|
-
} from './account.js';
|
|
81
|
+
import { AccountSchema, StripeBillingStatusResponseSchema, UpdateAccountPayloadSchema } from './account.js';
|
|
87
82
|
import { type JsonObject, toOpenApiComponents } from './adapter.js';
|
|
88
83
|
import * as AgentCommunicationSchemas from './agent-communication.js';
|
|
89
84
|
import * as AgentRunSchemas from './agent-runs.js';
|
|
@@ -209,6 +204,14 @@ import {
|
|
|
209
204
|
} from './apps.js';
|
|
210
205
|
import {
|
|
211
206
|
AuditActionSchema,
|
|
207
|
+
AuditAdoptionActiveDaysSchema,
|
|
208
|
+
AuditAdoptionBucketSchema,
|
|
209
|
+
AuditAdoptionFilterSchema,
|
|
210
|
+
AuditAdoptionHistorySchema,
|
|
211
|
+
AuditAdoptionPeriodSchema,
|
|
212
|
+
AuditAdoptionProjectSchema,
|
|
213
|
+
AuditAdoptionQuerySchema,
|
|
214
|
+
AuditAdoptionResponseSchema,
|
|
212
215
|
AuditAggregationDetailFieldSchema,
|
|
213
216
|
AuditAggregationDetailFilterSchema,
|
|
214
217
|
AuditAggregationDimensionMapSchema,
|
|
@@ -226,6 +229,10 @@ import {
|
|
|
226
229
|
AuditTrailEventSchema,
|
|
227
230
|
AuditTrailQuerySchema,
|
|
228
231
|
AuditTrailResponseSchema,
|
|
232
|
+
AuditUsageBucketSchema,
|
|
233
|
+
AuditUsageCountsSchema,
|
|
234
|
+
AuditUsageQuerySchema,
|
|
235
|
+
AuditUsageResponseSchema,
|
|
229
236
|
EventCategorySchema,
|
|
230
237
|
KnownAuditActionSchema,
|
|
231
238
|
} from './audit-trail.js';
|
|
@@ -862,7 +869,6 @@ import * as WorkflowRunSchemas from './workflow-runs.js';
|
|
|
862
869
|
* group approaches the proven-safe size.
|
|
863
870
|
*/
|
|
864
871
|
const IAM_AND_ACCOUNT_SCHEMAS = {
|
|
865
|
-
AccountApiVersionPolicy: AccountApiVersionPolicySchema,
|
|
866
872
|
Account: AccountSchema,
|
|
867
873
|
UpdateAccountPayload: UpdateAccountPayloadSchema,
|
|
868
874
|
StripeBillingStatusResponse: StripeBillingStatusResponseSchema,
|
|
@@ -2116,6 +2122,18 @@ const REMOTE_MCP_SCHEMAS = {
|
|
|
2116
2122
|
} as const satisfies Record<string, z.ZodType>;
|
|
2117
2123
|
|
|
2118
2124
|
const AUDIT_TRAIL_SCHEMAS = {
|
|
2125
|
+
AuditAdoptionActiveDays: AuditAdoptionActiveDaysSchema,
|
|
2126
|
+
AuditAdoptionBucket: AuditAdoptionBucketSchema,
|
|
2127
|
+
AuditAdoptionFilter: AuditAdoptionFilterSchema,
|
|
2128
|
+
AuditAdoptionHistory: AuditAdoptionHistorySchema,
|
|
2129
|
+
AuditAdoptionPeriod: AuditAdoptionPeriodSchema,
|
|
2130
|
+
AuditAdoptionProject: AuditAdoptionProjectSchema,
|
|
2131
|
+
AuditAdoptionQuery: AuditAdoptionQuerySchema,
|
|
2132
|
+
AuditAdoptionResponse: AuditAdoptionResponseSchema,
|
|
2133
|
+
AuditUsageQuery: AuditUsageQuerySchema,
|
|
2134
|
+
AuditUsageCounts: AuditUsageCountsSchema,
|
|
2135
|
+
AuditUsageBucket: AuditUsageBucketSchema,
|
|
2136
|
+
AuditUsageResponse: AuditUsageResponseSchema,
|
|
2119
2137
|
// The audit trail: the events the endpoint pages through and the aggregation it
|
|
2120
2138
|
// computes over them.
|
|
2121
2139
|
AuditMeter: AuditMeterSchema,
|
|
@@ -2297,17 +2315,6 @@ const SECRET_SCHEMAS = {
|
|
|
2297
2315
|
SecretProjectQuery: SecretSchemas.SecretProjectQuerySchema,
|
|
2298
2316
|
ListSecretsQuery: SecretSchemas.ListSecretsQuerySchema,
|
|
2299
2317
|
SecretLookupQuery: SecretSchemas.SecretLookupQuerySchema,
|
|
2300
|
-
EventWebhookSigningSecretRequest: SecretSchemas.EventWebhookSigningSecretRequestSchema,
|
|
2301
|
-
EventWebhookSigningSecretResponse: SecretSchemas.EventWebhookSigningSecretResponseSchema,
|
|
2302
|
-
SignEventWebhookRequest: SecretSchemas.SignEventWebhookRequestSchema,
|
|
2303
|
-
SignEventWebhookResponse: SecretSchemas.SignEventWebhookResponseSchema,
|
|
2304
|
-
EventIngestSigningSecretRequest: SecretSchemas.EventIngestSigningSecretRequestSchema,
|
|
2305
|
-
EventIngestSigningSecretResponse: SecretSchemas.EventIngestSigningSecretResponseSchema,
|
|
2306
|
-
VerifyEventIngestSignatureRequest: SecretSchemas.VerifyEventIngestSignatureRequestSchema,
|
|
2307
|
-
VerifyEventIngestSignatureResponse: SecretSchemas.VerifyEventIngestSignatureResponseSchema,
|
|
2308
|
-
GithubInstallationTokenRequest: SecretSchemas.GithubInstallationTokenRequestSchema,
|
|
2309
|
-
GithubInstallationTokenResponse: SecretSchemas.GithubInstallationTokenResponseSchema,
|
|
2310
|
-
InternalSecretDeleteResponse: SecretSchemas.InternalSecretDeleteResponseSchema,
|
|
2311
2318
|
} as const satisfies Record<string, z.ZodType>;
|
|
2312
2319
|
|
|
2313
2320
|
const INTEGRATION_SCHEMAS = {
|
|
@@ -2441,10 +2448,6 @@ const DELEGATION_SCHEMAS = {
|
|
|
2441
2448
|
DelegationGrantArray: DelegationGrantArraySchema,
|
|
2442
2449
|
};
|
|
2443
2450
|
const RUN_BUDGET_SCHEMAS = {
|
|
2444
|
-
RunBudgetOwner: RunBudgetSchemas.RunBudgetOwnerSchema,
|
|
2445
|
-
RunBudgetUsage: RunBudgetSchemas.RunBudgetUsageSchema,
|
|
2446
|
-
ReadRunBudgetUsagePayload: RunBudgetSchemas.ReadRunBudgetUsagePayloadSchema,
|
|
2447
|
-
RunBudgetTotals: RunBudgetSchemas.RunBudgetTotalsSchema,
|
|
2448
2451
|
RunBudgetCapability: RunBudgetSchemas.RunBudgetCapabilitySchema,
|
|
2449
2452
|
RunBudgetCapabilityQuery: RunBudgetSchemas.RunBudgetCapabilityQuerySchema,
|
|
2450
2453
|
};
|
|
@@ -3418,6 +3421,18 @@ const STRICT_COMPONENTS: ReadonlySet<string> = new Set<string>([
|
|
|
3418
3421
|
'AuditAggregationFilter',
|
|
3419
3422
|
'AuditTrailResponse',
|
|
3420
3423
|
'AuditAggregationQuery',
|
|
3424
|
+
'AuditAdoptionActiveDays',
|
|
3425
|
+
'AuditAdoptionBucket',
|
|
3426
|
+
'AuditAdoptionFilter',
|
|
3427
|
+
'AuditAdoptionHistory',
|
|
3428
|
+
'AuditAdoptionPeriod',
|
|
3429
|
+
'AuditAdoptionProject',
|
|
3430
|
+
'AuditAdoptionQuery',
|
|
3431
|
+
'AuditAdoptionResponse',
|
|
3432
|
+
'AuditUsageQuery',
|
|
3433
|
+
'AuditUsageCounts',
|
|
3434
|
+
'AuditUsageBucket',
|
|
3435
|
+
'AuditUsageResponse',
|
|
3421
3436
|
'ViewSortClause',
|
|
3422
3437
|
'ViewResultMedia',
|
|
3423
3438
|
'ViewBoardColumn',
|
|
@@ -3584,17 +3599,6 @@ const STRICT_COMPONENTS: ReadonlySet<string> = new Set<string>([
|
|
|
3584
3599
|
'ActivityCatalog',
|
|
3585
3600
|
'WorkflowInteractionVars',
|
|
3586
3601
|
'ListWorkflowInteractionsResponse',
|
|
3587
|
-
'EventWebhookSigningSecretRequest',
|
|
3588
|
-
'EventWebhookSigningSecretResponse',
|
|
3589
|
-
'SignEventWebhookRequest',
|
|
3590
|
-
'SignEventWebhookResponse',
|
|
3591
|
-
'EventIngestSigningSecretRequest',
|
|
3592
|
-
'EventIngestSigningSecretResponse',
|
|
3593
|
-
'VerifyEventIngestSignatureRequest',
|
|
3594
|
-
'VerifyEventIngestSignatureResponse',
|
|
3595
|
-
'GithubInstallationTokenRequest',
|
|
3596
|
-
'GithubInstallationTokenResponse',
|
|
3597
|
-
'InternalSecretDeleteResponse',
|
|
3598
3602
|
]);
|
|
3599
3603
|
|
|
3600
3604
|
/**
|
|
@@ -1,42 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
export const RunBudgetOwnerSchema = z
|
|
4
|
-
.strictObject({
|
|
5
|
-
workflow_id: z.string().min(1),
|
|
6
|
-
first_run_id: z.string().min(1),
|
|
7
|
-
})
|
|
8
|
-
.meta({ id: 'RunBudgetOwner' });
|
|
9
|
-
|
|
10
|
-
/** Cumulative counters are read from existing execution runs, never from an audit cursor. */
|
|
11
|
-
export const RunBudgetUsageSchema = z
|
|
12
|
-
.strictObject({
|
|
13
|
-
input: z.number().nonnegative(),
|
|
14
|
-
cached_input: z.number().nonnegative(),
|
|
15
|
-
output: z.number().nonnegative(),
|
|
16
|
-
})
|
|
17
|
-
.meta({ id: 'RunBudgetUsage' });
|
|
18
|
-
|
|
19
|
-
export const RunBudgetTotalsSchema = z
|
|
20
|
-
.strictObject({
|
|
21
|
-
measured: RunBudgetUsageSchema,
|
|
22
|
-
unpriced: RunBudgetUsageSchema,
|
|
23
|
-
reported_nano_usd: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
24
|
-
estimated_nano_usd: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
25
|
-
unmeasured_calls: z.number().int().nonnegative(),
|
|
26
|
-
missing_usage_calls: z.number().int().nonnegative(),
|
|
27
|
-
})
|
|
28
|
-
.meta({ id: 'RunBudgetTotals' });
|
|
29
|
-
|
|
30
|
-
export const ReadRunBudgetUsagePayloadSchema = z
|
|
31
|
-
.strictObject({
|
|
32
|
-
account_id: z.string().min(1),
|
|
33
|
-
project_id: z.string().min(1),
|
|
34
|
-
agent_run_id: z.string().min(1),
|
|
35
|
-
owner: RunBudgetOwnerSchema,
|
|
36
|
-
require_estimates: z.boolean().optional(),
|
|
37
|
-
})
|
|
38
|
-
.meta({ id: 'ReadRunBudgetUsagePayload' });
|
|
39
|
-
|
|
40
3
|
export const RunBudgetCapabilitySchema = z
|
|
41
4
|
.strictObject({
|
|
42
5
|
supported: z.boolean(),
|
|
@@ -1,89 +1,5 @@
|
|
|
1
1
|
// Runtime schemas for the secrets API domain.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { EventCategorySchema } from './audit-trail.js';
|
|
4
|
-
|
|
5
|
-
export const EventWebhookSigningSecretRequestSchema = z
|
|
6
|
-
.strictObject({
|
|
7
|
-
account_id: z.string().optional(),
|
|
8
|
-
project_id: z.string(),
|
|
9
|
-
})
|
|
10
|
-
.meta({ id: 'EventWebhookSigningSecretRequest' });
|
|
11
|
-
|
|
12
|
-
export const EventWebhookSigningSecretResponseSchema = z
|
|
13
|
-
.strictObject({
|
|
14
|
-
subscription_id: z.string(),
|
|
15
|
-
secret: z.string(),
|
|
16
|
-
secret_label: z.string(),
|
|
17
|
-
})
|
|
18
|
-
.meta({ id: 'EventWebhookSigningSecretResponse' });
|
|
19
|
-
|
|
20
|
-
export const SignEventWebhookRequestSchema = EventWebhookSigningSecretRequestSchema.extend({
|
|
21
|
-
delivery_id: z.string(),
|
|
22
|
-
body: z.string(),
|
|
23
|
-
event_id: z.string(),
|
|
24
|
-
event_category: EventCategorySchema,
|
|
25
|
-
action: z.string(),
|
|
26
|
-
timestamp: z.number().optional(),
|
|
27
|
-
}).meta({ id: 'SignEventWebhookRequest' });
|
|
28
|
-
|
|
29
|
-
export const SignEventWebhookResponseSchema = z
|
|
30
|
-
.strictObject({
|
|
31
|
-
headers: z.record(z.string(), z.string()),
|
|
32
|
-
timestamp: z.number(),
|
|
33
|
-
signature: z.string(),
|
|
34
|
-
})
|
|
35
|
-
.meta({ id: 'SignEventWebhookResponse' });
|
|
36
|
-
|
|
37
|
-
export const EventIngestSigningSecretRequestSchema = z
|
|
38
|
-
.strictObject({
|
|
39
|
-
account_id: z.string().optional(),
|
|
40
|
-
project_id: z.string(),
|
|
41
|
-
})
|
|
42
|
-
.meta({ id: 'EventIngestSigningSecretRequest' });
|
|
43
|
-
|
|
44
|
-
export const EventIngestSigningSecretResponseSchema = z
|
|
45
|
-
.strictObject({
|
|
46
|
-
channel_id: z.string(),
|
|
47
|
-
secret: z.string(),
|
|
48
|
-
secret_label: z.string(),
|
|
49
|
-
})
|
|
50
|
-
.meta({ id: 'EventIngestSigningSecretResponse' });
|
|
51
|
-
|
|
52
|
-
export const VerifyEventIngestSignatureRequestSchema = EventIngestSigningSecretRequestSchema.extend({
|
|
53
|
-
body: z.string(),
|
|
54
|
-
signature_header: z.string(),
|
|
55
|
-
algorithm: z.enum(['sha256', 'sha1']).optional(),
|
|
56
|
-
encoding: z.enum(['hex', 'base64']).optional(),
|
|
57
|
-
prefix: z.string().optional(),
|
|
58
|
-
}).meta({ id: 'VerifyEventIngestSignatureRequest' });
|
|
59
|
-
|
|
60
|
-
export const VerifyEventIngestSignatureResponseSchema = z
|
|
61
|
-
.strictObject({
|
|
62
|
-
valid: z.boolean(),
|
|
63
|
-
})
|
|
64
|
-
.meta({ id: 'VerifyEventIngestSignatureResponse' });
|
|
65
|
-
|
|
66
|
-
export const GithubInstallationTokenRequestSchema = z
|
|
67
|
-
.strictObject({
|
|
68
|
-
account_id: z.string().optional(),
|
|
69
|
-
project_id: z.string(),
|
|
70
|
-
installation_id: z.string(),
|
|
71
|
-
repo: z.string(),
|
|
72
|
-
})
|
|
73
|
-
.meta({ id: 'GithubInstallationTokenRequest' });
|
|
74
|
-
|
|
75
|
-
export const GithubInstallationTokenResponseSchema = z
|
|
76
|
-
.strictObject({
|
|
77
|
-
token: z.string(),
|
|
78
|
-
expires_at: z.string().optional(),
|
|
79
|
-
})
|
|
80
|
-
.meta({ id: 'GithubInstallationTokenResponse' });
|
|
81
|
-
|
|
82
|
-
export const InternalSecretDeleteResponseSchema = z
|
|
83
|
-
.strictObject({
|
|
84
|
-
deleted: z.literal(true),
|
|
85
|
-
})
|
|
86
|
-
.meta({ id: 'InternalSecretDeleteResponse' });
|
|
87
3
|
|
|
88
4
|
export const WebsiteCredentialTotpAlgorithmSchema = z
|
|
89
5
|
.enum(['SHA1', 'SHA256', 'SHA512'])
|
package/src/audit-trail.ts
CHANGED
|
@@ -15,6 +15,9 @@ export const AUDIT_ACTIONS = [
|
|
|
15
15
|
'credentials_totp_generation',
|
|
16
16
|
'publish',
|
|
17
17
|
'unpublish',
|
|
18
|
+
// Content access (retrieval is not proof of a human reading the document)
|
|
19
|
+
'search',
|
|
20
|
+
'read',
|
|
18
21
|
// Billable operations
|
|
19
22
|
'inference',
|
|
20
23
|
'embedding',
|
|
@@ -56,6 +59,7 @@ export const AUDIT_AGGREGATION_DIMENSIONS = [
|
|
|
56
59
|
'project_id',
|
|
57
60
|
'principal_id',
|
|
58
61
|
'actor_id',
|
|
62
|
+
'user_id',
|
|
59
63
|
'details.pipeline',
|
|
60
64
|
'details.verdict',
|
|
61
65
|
'details.workflow_type',
|
|
@@ -87,5 +91,18 @@ export type AuditAggregationRow = Wire.AuditAggregationRow;
|
|
|
87
91
|
|
|
88
92
|
export type AuditAggregationResponse = Wire.AuditAggregationResponse;
|
|
89
93
|
|
|
94
|
+
export type AuditAdoptionFilter = Wire.AuditAdoptionFilter;
|
|
95
|
+
export type AuditAdoptionQuery = Wire.AuditAdoptionQuery;
|
|
96
|
+
export type AuditAdoptionPeriod = Wire.AuditAdoptionPeriod;
|
|
97
|
+
export type AuditAdoptionBucket = Wire.AuditAdoptionBucket;
|
|
98
|
+
export type AuditAdoptionActiveDays = Wire.AuditAdoptionActiveDays;
|
|
99
|
+
export type AuditAdoptionProject = Wire.AuditAdoptionProject;
|
|
100
|
+
export type AuditAdoptionHistory = Wire.AuditAdoptionHistory;
|
|
101
|
+
export type AuditAdoptionResponse = Wire.AuditAdoptionResponse;
|
|
102
|
+
export type AuditUsageQuery = Wire.AuditUsageQuery;
|
|
103
|
+
export type AuditUsageCounts = Wire.AuditUsageCounts;
|
|
104
|
+
export type AuditUsageBucket = Wire.AuditUsageBucket;
|
|
105
|
+
export type AuditUsageResponse = Wire.AuditUsageResponse;
|
|
106
|
+
|
|
90
107
|
/** Billable audit actions for cost analytics queries */
|
|
91
108
|
export const BILLABLE_AUDIT_ACTIONS = ['inference', 'embedding', 'image_generation'] satisfies KnownAuditAction[];
|
package/src/index.ts
CHANGED
|
@@ -79,12 +79,8 @@ export * from './rate-limiter.js';
|
|
|
79
79
|
export * from './refs.js';
|
|
80
80
|
export * from './roles/types.js';
|
|
81
81
|
export type {
|
|
82
|
-
ReadRunBudgetUsagePayload,
|
|
83
82
|
RunBudgetCapability,
|
|
84
83
|
RunBudgetCapabilityQuery,
|
|
85
|
-
RunBudgetOwner,
|
|
86
|
-
RunBudgetTotals,
|
|
87
|
-
RunBudgetUsage,
|
|
88
84
|
} from './run-budget.js';
|
|
89
85
|
export * from './runs.js';
|
|
90
86
|
export * from './schema-for-extraction.js';
|
package/src/platform-event.ts
CHANGED
|
@@ -242,31 +242,6 @@ export interface ListEventSubscriptionsQuery {
|
|
|
242
242
|
app_installation_id?: string;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
/** Trusted Studio -> Zeno request used to provision subscriptions declared by an installed app. */
|
|
246
|
-
export interface ProvisionAppEventSubscriptionsRequest {
|
|
247
|
-
account_id: string;
|
|
248
|
-
project_id: string;
|
|
249
|
-
subscriptions: Array<
|
|
250
|
-
CreateEventSubscriptionPayload & {
|
|
251
|
-
target: AppEventDeliveryTargetInput;
|
|
252
|
-
app_installation_id: string;
|
|
253
|
-
app_id: string;
|
|
254
|
-
app_subscription_id: string;
|
|
255
|
-
}
|
|
256
|
-
>;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/** Trusted Studio -> Zeno request used to remove every subscription owned by an app installation. */
|
|
260
|
-
export interface RemoveAppEventSubscriptionsRequest {
|
|
261
|
-
account_id: string;
|
|
262
|
-
project_id: string;
|
|
263
|
-
app_installation_id: string;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export interface AppEventSubscriptionsMutationResponse {
|
|
267
|
-
subscription_ids: string[];
|
|
268
|
-
}
|
|
269
|
-
|
|
270
245
|
export type EventIngestChannelSortField = 'name' | 'source' | 'enabled' | 'updated_at';
|
|
271
246
|
|
|
272
247
|
export interface ListEventIngestChannelsQuery {
|
package/src/run-budget.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type * as Wire from './wire-types.generated.js';
|
|
2
2
|
|
|
3
|
-
export type RunBudgetOwner = Wire.RunBudgetOwner;
|
|
4
|
-
export type RunBudgetUsage = Wire.RunBudgetUsage;
|
|
5
|
-
export type ReadRunBudgetUsagePayload = Wire.ReadRunBudgetUsagePayload;
|
|
6
|
-
export type RunBudgetTotals = Wire.RunBudgetTotals;
|
|
7
3
|
export type RunBudgetCapability = Wire.RunBudgetCapability;
|
|
8
4
|
export type RunBudgetCapabilityQuery = Wire.RunBudgetCapabilityQuery;
|
package/src/secrets.ts
CHANGED
|
@@ -18,15 +18,4 @@ export type CreateSecretRequest = Wire.CreateSecretRequest;
|
|
|
18
18
|
|
|
19
19
|
export type UpdateSecretRequest = Wire.UpdateSecretRequest;
|
|
20
20
|
|
|
21
|
-
export type EventWebhookSigningSecretRequest = Wire.EventWebhookSigningSecretRequest;
|
|
22
|
-
export type EventWebhookSigningSecretResponse = Wire.EventWebhookSigningSecretResponse;
|
|
23
|
-
export type SignEventWebhookRequest = Wire.SignEventWebhookRequest;
|
|
24
|
-
export type SignEventWebhookResponse = Wire.SignEventWebhookResponse;
|
|
25
|
-
export type EventIngestSigningSecretRequest = Wire.EventIngestSigningSecretRequest;
|
|
26
|
-
export type EventIngestSigningSecretResponse = Wire.EventIngestSigningSecretResponse;
|
|
27
|
-
export type VerifyEventIngestSignatureRequest = Wire.VerifyEventIngestSignatureRequest;
|
|
28
|
-
export type VerifyEventIngestSignatureResponse = Wire.VerifyEventIngestSignatureResponse;
|
|
29
|
-
export type GithubInstallationTokenRequest = Wire.GithubInstallationTokenRequest;
|
|
30
|
-
export type GithubInstallationTokenResponse = Wire.GithubInstallationTokenResponse;
|
|
31
|
-
|
|
32
21
|
export type DeleteSecretResponse = Wire.DeleteSecretResponse;
|