@company-semantics/contracts 0.104.1 → 0.105.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/package.json +1 -1
- package/src/api/generated.ts +63 -4
- package/src/index.ts +4 -0
- package/src/types/analytics.ts +14 -0
package/package.json
CHANGED
package/src/api/generated.ts
CHANGED
|
@@ -1986,12 +1986,16 @@ export interface components {
|
|
|
1986
1986
|
};
|
|
1987
1987
|
UserOrgMembership: {
|
|
1988
1988
|
/** Format: uuid */
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1989
|
+
userId: string;
|
|
1990
|
+
/** Format: uuid */
|
|
1991
|
+
orgId: string;
|
|
1992
|
+
orgName: string;
|
|
1993
|
+
orgSlug: string;
|
|
1992
1994
|
role: components["schemas"]["WorkspaceRole"];
|
|
1993
1995
|
/** Format: date-time */
|
|
1994
1996
|
joinedAt: string;
|
|
1997
|
+
isActive: boolean;
|
|
1998
|
+
orgType: components["schemas"]["OrgType"];
|
|
1995
1999
|
};
|
|
1996
2000
|
SetActiveOrgRequest: {
|
|
1997
2001
|
/**
|
|
@@ -2178,7 +2182,60 @@ export interface components {
|
|
|
2178
2182
|
};
|
|
2179
2183
|
/** @description AI usage summary for an organization */
|
|
2180
2184
|
OrgExecutionSummary: {
|
|
2181
|
-
|
|
2185
|
+
period: {
|
|
2186
|
+
/** Format: date-time */
|
|
2187
|
+
start: string;
|
|
2188
|
+
/** Format: date-time */
|
|
2189
|
+
end: string;
|
|
2190
|
+
};
|
|
2191
|
+
summary: components["schemas"]["UnifiedUsageSummary"];
|
|
2192
|
+
daily: components["schemas"]["UnifiedDailyUsage"][];
|
|
2193
|
+
byProfile: components["schemas"]["UnifiedProfileUsage"][];
|
|
2194
|
+
byUser: components["schemas"]["UnifiedUserUsage"][];
|
|
2195
|
+
byModel: components["schemas"]["UnifiedModelUsage"][];
|
|
2196
|
+
byFeature: components["schemas"]["UnifiedFeatureUsage"][];
|
|
2197
|
+
};
|
|
2198
|
+
UnifiedUsageSummary: {
|
|
2199
|
+
executions: number;
|
|
2200
|
+
totalCostUsd: string;
|
|
2201
|
+
totalTokens: number;
|
|
2202
|
+
avgDurationMs: number;
|
|
2203
|
+
failureRate: number;
|
|
2204
|
+
};
|
|
2205
|
+
UnifiedDailyUsage: {
|
|
2206
|
+
date: string;
|
|
2207
|
+
executions: number;
|
|
2208
|
+
totalCostUsd: string;
|
|
2209
|
+
};
|
|
2210
|
+
UnifiedProfileUsage: {
|
|
2211
|
+
profile: string;
|
|
2212
|
+
executions: number;
|
|
2213
|
+
percentOfTotal: number;
|
|
2214
|
+
totalCostUsd: string;
|
|
2215
|
+
avgDurationMs: number;
|
|
2216
|
+
failureRate: number;
|
|
2217
|
+
};
|
|
2218
|
+
UnifiedUserUsage: {
|
|
2219
|
+
/** Format: uuid */
|
|
2220
|
+
userId: string;
|
|
2221
|
+
email: string;
|
|
2222
|
+
executions: number;
|
|
2223
|
+
totalCostUsd: string;
|
|
2224
|
+
totalTokens: number;
|
|
2225
|
+
favoriteProfile: string;
|
|
2226
|
+
};
|
|
2227
|
+
UnifiedModelUsage: {
|
|
2228
|
+
model: string;
|
|
2229
|
+
provider: string;
|
|
2230
|
+
totalTokens: number;
|
|
2231
|
+
estimatedCostUsd: string;
|
|
2232
|
+
requestCount: number;
|
|
2233
|
+
};
|
|
2234
|
+
UnifiedFeatureUsage: {
|
|
2235
|
+
feature: string;
|
|
2236
|
+
totalTokens: number;
|
|
2237
|
+
estimatedCostUsd: string;
|
|
2238
|
+
requestCount: number;
|
|
2182
2239
|
};
|
|
2183
2240
|
ErrorResponse: {
|
|
2184
2241
|
error: string;
|
|
@@ -2504,6 +2561,8 @@ export interface components {
|
|
|
2504
2561
|
OrgAuthPolicy: {
|
|
2505
2562
|
requireSSO: boolean;
|
|
2506
2563
|
allowedProviders: string[];
|
|
2564
|
+
/** @description True when the requesting admin's own SSO session was revoked by this operation */
|
|
2565
|
+
selfRevoked?: boolean;
|
|
2507
2566
|
};
|
|
2508
2567
|
CreateInviteRequest: {
|
|
2509
2568
|
/**
|
package/src/index.ts
CHANGED
|
@@ -554,3 +554,7 @@ export { openApiRoutes, type OpenApiRoute, type OpenApiMethod } from './generate
|
|
|
554
554
|
// Secret wrapper (multi-surface redaction for sensitive values)
|
|
555
555
|
export type { Secret } from './security/index'
|
|
556
556
|
export { wrapSecret, unwrapSecret } from './security/index'
|
|
557
|
+
|
|
558
|
+
// Analytics response metadata (shared vocabulary for OLTP/OLAP separation)
|
|
559
|
+
// @see ADR-CTRL-053 for design rationale
|
|
560
|
+
export type { AnalyticsResponseMeta } from './types/analytics'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata included in every analytics-backed API response.
|
|
3
|
+
* Enables consumers to know data freshness and which backend served the query.
|
|
4
|
+
*
|
|
5
|
+
* See ADR-CTRL-053 D8: Data Freshness Contract.
|
|
6
|
+
*/
|
|
7
|
+
export interface AnalyticsResponseMeta {
|
|
8
|
+
/** Replication lag from OLTP in milliseconds. 0 when source is 'oltp'. */
|
|
9
|
+
readonly dataFreshnessMs: number;
|
|
10
|
+
/** Which backend served this response. */
|
|
11
|
+
readonly source: 'oltp' | 'olap';
|
|
12
|
+
/** ISO 8601 timestamp: when the data was current as of. */
|
|
13
|
+
readonly timestamp: string;
|
|
14
|
+
}
|