@ancplua/qyl-api-schema 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,10 @@ The TypeSpec source of truth for Qyl's client-visible product API. This reposito
4
4
  emits the public schema and contract artifacts; it does not implement the server,
5
5
  storage engine, or OTLP receiver.
6
6
 
7
+ Qyl stores and exposes traces and logs. Metrics are accepted and discarded only by
8
+ the collector's OTLP wire-compatibility handlers, so this product contract exposes
9
+ no metric DTOs or routes. Profiles are not supported.
10
+
7
11
  ## Contract pipeline
8
12
 
9
13
  ```text
package/api/routes.tsp CHANGED
@@ -6,11 +6,8 @@ import "../common/errors.tsp";
6
6
  import "../common/pagination.tsp";
7
7
  import "../otel/span.tsp";
8
8
  import "../otel/logs.tsp";
9
- import "../otel/metrics.tsp";
10
- import "../otel/profiles.tsp";
11
9
  import "../models/session.tsp";
12
10
  import "../models/health.tsp";
13
- import "../models/cost-etl-audit.tsp";
14
11
 
15
12
  using TypeSpec.Http;
16
13
  using TypeSpec.OpenAPI;
@@ -20,12 +17,9 @@ using Qyl.Api.Contracts.Common.Errors;
20
17
  using Qyl.Api.Contracts.Common.Pagination;
21
18
  using Qyl.Api.Contracts.OTel.Traces;
22
19
  using Qyl.Api.Contracts.OTel.Logs;
23
- using Qyl.Api.Contracts.OTel.Metrics;
24
20
  using Qyl.Api.Contracts.OTel.Enums;
25
- using Qyl.Api.Contracts.OTel.Profiles;
26
21
  using Qyl.Api.Contracts.Domains.Observe.Session;
27
22
  using Qyl.Api.Contracts.Health;
28
- using Qyl.Api.Contracts.Cost;
29
23
 
30
24
  @service(#{ title: "qyl API" })
31
25
  namespace Qyl.Api.Contracts;
@@ -110,92 +104,6 @@ interface LogsApi {
110
104
  | InternalServerError;
111
105
  }
112
106
 
113
- // -----------------------------------------------------------------------------
114
- // Metrics
115
- // -----------------------------------------------------------------------------
116
-
117
- @route("/api/v1/metrics")
118
- @tag("Metrics")
119
- @useAuth(QylApiKeyHeaderAuth)
120
- interface MetricsApi {
121
- @doc("List persisted OTLP metric data points without re-aggregating producer values.")
122
- @get
123
- list(
124
- ...ProjectScopeHeader,
125
- @query name?: string,
126
- @query type?: MetricType,
127
- @query serviceName?: string,
128
- @query startTime?: utcDateTime,
129
- @query endTime?: utcDateTime,
130
-
131
- @query
132
- @minValue(1)
133
- @maxValue(1000)
134
- limit?: int32 = 100,
135
-
136
- @query cursor?: string,
137
- ):
138
- | CursorPage<MetricPoint>
139
- | ValidationError
140
- | UnauthorizedError
141
- | InternalServerError;
142
- }
143
-
144
- // -----------------------------------------------------------------------------
145
- // Profiles (OpenTelemetry development signal)
146
- // -----------------------------------------------------------------------------
147
-
148
- @route("/api/v1/profiles")
149
- @tag("Profiles")
150
- @useAuth(QylApiKeyHeaderAuth)
151
- interface ProfilesApi {
152
- @get
153
- list(
154
- ...ProjectScopeHeader,
155
- @query sessionId?: SessionId,
156
- @query traceId?: TraceId,
157
- @query serviceName?: string,
158
- @query sampleType?: string,
159
-
160
- @query
161
- @minValue(1)
162
- @maxValue(1000)
163
- limit?: int32 = 100,
164
- ): Profile[] | ValidationError | UnauthorizedError | InternalServerError;
165
-
166
- @get
167
- @route("/{profileId}")
168
- get(...ProjectScopeHeader, @path profileId: string):
169
- | Profile
170
- | NotFoundError
171
- | UnauthorizedError
172
- | InternalServerError;
173
-
174
- @get
175
- @route("/by-trace/{traceId}")
176
- getByTrace(
177
- ...ProjectScopeHeader,
178
- @path traceId: TraceId,
179
-
180
- @query
181
- @minValue(1)
182
- @maxValue(1000)
183
- limit?: int32 = 100,
184
- ): Profile[] | ValidationError | UnauthorizedError | InternalServerError;
185
-
186
- @get
187
- @route("/by-span/{spanId}")
188
- getBySpan(
189
- ...ProjectScopeHeader,
190
- @path spanId: SpanId,
191
-
192
- @query
193
- @minValue(1)
194
- @maxValue(1000)
195
- limit?: int32 = 100,
196
- ): Profile[] | ValidationError | UnauthorizedError | InternalServerError;
197
- }
198
-
199
107
  // -----------------------------------------------------------------------------
200
108
  // Sessions
201
109
  // -----------------------------------------------------------------------------
@@ -248,57 +156,6 @@ interface SessionsApi {
248
156
  ): SessionStats | ValidationError | UnauthorizedError | InternalServerError;
249
157
  }
250
158
 
251
- // -----------------------------------------------------------------------------
252
- // GenAI cost and ETL audit
253
- // -----------------------------------------------------------------------------
254
-
255
- @route("/api/v1/cost/etl-audit")
256
- @tag("GenAI cost")
257
- @useAuth(QylApiKeyHeaderAuth)
258
- interface GenAiEtlAuditApi {
259
- @get
260
- report(
261
- ...ProjectScopeHeader,
262
-
263
- @doc("Optional audit-period start. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
264
- @query
265
- startTime?: utcDateTime,
266
-
267
- @doc("Optional audit-period end. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
268
- @query
269
- endTime?: utcDateTime,
270
-
271
- @query
272
- @minValue(1)
273
- @maxValue(100)
274
- limit?: int32 = 25,
275
- ):
276
- | GenAiEtlAuditReport
277
- | ValidationError
278
- | UnauthorizedError
279
- | InternalServerError;
280
-
281
- @post
282
- @route("/evaluate")
283
- evaluate(
284
- ...ProjectScopeHeader,
285
-
286
- @doc("Optional audit-period start. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
287
- @query
288
- startTime?: utcDateTime,
289
-
290
- @doc("Optional audit-period end. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
291
- @query
292
- endTime?: utcDateTime,
293
-
294
- @body request: GenAiEtlAuditEvaluationRequest,
295
- ):
296
- | GenAiEtlAuditEvaluationResponse
297
- | ValidationError
298
- | UnauthorizedError
299
- | InternalServerError;
300
- }
301
-
302
159
  // -----------------------------------------------------------------------------
303
160
  // Health
304
161
  // -----------------------------------------------------------------------------