@ancplua/qyl-api-schema 0.3.0 → 0.4.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/VERSIONING.md +9 -5
- package/common/types.tsp +4 -37
- package/models/db.tsp +0 -43
- package/models/genai.tsp +1 -18
- package/models/http.tsp +0 -53
- package/package.json +1 -1
package/VERSIONING.md
CHANGED
|
@@ -30,14 +30,18 @@ namespace Qyl.Api.Contracts.Domains.AI.GenAi;
|
|
|
30
30
|
|
|
31
31
|
enum GenAiVersions {
|
|
32
32
|
v1_27: "1.27.0",
|
|
33
|
-
v1_28: "1.28.0",
|
|
34
|
-
v1_29: "1.29.0",
|
|
35
|
-
v1_37: "1.37.0",
|
|
36
33
|
v1_38: "1.38.0",
|
|
37
|
-
v1_39: "1.39.0",
|
|
38
34
|
v1_40: "1.40.0",
|
|
39
|
-
v1_41: "1.41.0",
|
|
40
35
|
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Keep version enums **minimal**: only the baseline plus versions actually
|
|
39
|
+
referenced by an `@added`/`@removed` annotation. Unreferenced members are
|
|
40
|
+
dead timeline points that rot (an axis with no annotations at all should
|
|
41
|
+
lose `@versioned` entirely — that happened to `HttpVersions`/`DbVersions`
|
|
42
|
+
in 0.4.0).
|
|
43
|
+
|
|
44
|
+
```tsp
|
|
41
45
|
|
|
42
46
|
model GenAiSpanAttributes {
|
|
43
47
|
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsageInputTokens)
|
package/common/types.tsp
CHANGED
|
@@ -16,46 +16,13 @@ using TypeSpec.OpenAPI;
|
|
|
16
16
|
|
|
17
17
|
namespace Qyl.Api.Contracts.Common;
|
|
18
18
|
|
|
19
|
-
// =============================================================================
|
|
20
|
-
// Version Enum - OTel Semantic Convention Versions
|
|
21
|
-
// =============================================================================
|
|
22
|
-
|
|
23
|
-
@doc("OpenTelemetry semantic-convention versions supported by qyl compatibility models")
|
|
24
|
-
enum OTelVersion {
|
|
25
|
-
@doc("OTel Semconv v1.27 - Base version")
|
|
26
|
-
v1_27: "1.27.0",
|
|
27
|
-
|
|
28
|
-
@doc("OTel Semconv v1.28 - GenAI additions")
|
|
29
|
-
v1_28: "1.28.0",
|
|
30
|
-
|
|
31
|
-
@doc("OTel Semconv v1.29 - HTTP improvements")
|
|
32
|
-
v1_29: "1.29.0",
|
|
33
|
-
|
|
34
|
-
@doc("OTel Semconv v1.30 - Database updates")
|
|
35
|
-
v1_30: "1.30.0",
|
|
36
|
-
|
|
37
|
-
@doc("OTel Semconv v1.38 - GenAI.Agent support")
|
|
38
|
-
v1_38: "1.38.0",
|
|
39
|
-
|
|
40
|
-
@doc("OTel Semconv v1.39 - RPC metadata consolidation")
|
|
41
|
-
v1_39: "1.39.0",
|
|
42
|
-
|
|
43
|
-
@doc("OTel Semconv v1.40 - Oracle DB split, RPC cleanup, GenAI cache tokens")
|
|
44
|
-
v1_40: "1.40.0",
|
|
45
|
-
|
|
46
|
-
@doc("OTel Semconv v1.41 - GraphQL doc opt-in, RPC server client.* removal")
|
|
47
|
-
v1_41: "1.41.0",
|
|
48
|
-
|
|
49
|
-
@doc("OTel Semconv v1.42 - GenAI conventions moved to the dedicated GenAI registry; k8s/container registry attrs stable")
|
|
50
|
-
v1_42: "1.42.0",
|
|
51
|
-
|
|
52
|
-
@doc("OTel Semconv v1.43 - Current compatibility pin (core; GenAI keys from the GenAI dev registry)")
|
|
53
|
-
v1_43: "1.43.0",
|
|
54
|
-
}
|
|
55
|
-
|
|
56
19
|
// =============================================================================
|
|
57
20
|
// Identifier Scalars - Strongly Typed IDs
|
|
58
21
|
// =============================================================================
|
|
22
|
+
// (The former OTelVersion enum — a hand-bumped list of semconv releases with
|
|
23
|
+
// zero consumers — was deleted in 0.4.0. The semconv pin lives in the
|
|
24
|
+
// otel-keys.gen.tsp header and .nuke/parameters.json OtelKeysVersion, both
|
|
25
|
+
// machine-checked; a prose enum of upstream releases only rots.)
|
|
59
26
|
|
|
60
27
|
@jsonSchema
|
|
61
28
|
@doc("Unique trace identifier (32 lowercase hex characters)")
|
package/models/db.tsp
CHANGED
|
@@ -10,28 +10,8 @@ import "../common/types.tsp";
|
|
|
10
10
|
using TypeSpec.Versioning;
|
|
11
11
|
using Qyl.Api.Contracts.Common;
|
|
12
12
|
|
|
13
|
-
@versioned(DbVersions)
|
|
14
13
|
namespace Qyl.Api.Contracts.Domains.Data.Db;
|
|
15
14
|
|
|
16
|
-
// =============================================================================
|
|
17
|
-
// Version History
|
|
18
|
-
// =============================================================================
|
|
19
|
-
|
|
20
|
-
@doc("Database semantic convention versions")
|
|
21
|
-
enum DbVersions {
|
|
22
|
-
@doc("Legacy DB semconv")
|
|
23
|
-
v1_20: "1.20.0",
|
|
24
|
-
|
|
25
|
-
@doc("Stable DB semconv with namespace")
|
|
26
|
-
v1_24: "1.24.0",
|
|
27
|
-
|
|
28
|
-
@doc("DB semconv v1.38")
|
|
29
|
-
v1_38: "1.38.0",
|
|
30
|
-
|
|
31
|
-
@doc("Current DB semconv")
|
|
32
|
-
v1_39: "1.39.0",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
15
|
// =============================================================================
|
|
36
16
|
// Database Span Attributes
|
|
37
17
|
// =============================================================================
|
|
@@ -118,29 +98,6 @@ model DbAttributes {
|
|
|
118
98
|
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Db.ClientConnectionState)
|
|
119
99
|
connectionState?: DbConnectionState;
|
|
120
100
|
|
|
121
|
-
// ---------------------------------------------------------------------------
|
|
122
|
-
// Deprecated Attributes (for migration)
|
|
123
|
-
// ---------------------------------------------------------------------------
|
|
124
|
-
|
|
125
|
-
@doc("Database name (deprecated - use db.namespace)")
|
|
126
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Db.Name)
|
|
127
|
-
@removed(DbVersions.v1_24)
|
|
128
|
-
dbName?: string;
|
|
129
|
-
|
|
130
|
-
@doc("Database statement (deprecated - use db.query.text)")
|
|
131
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Db.Statement)
|
|
132
|
-
@removed(DbVersions.v1_24)
|
|
133
|
-
statement?: string;
|
|
134
|
-
|
|
135
|
-
@doc("Database operation (deprecated - use db.operation.name)")
|
|
136
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Db.Operation)
|
|
137
|
-
@removed(DbVersions.v1_24)
|
|
138
|
-
operation?: string;
|
|
139
|
-
|
|
140
|
-
@doc("Database user (deprecated)")
|
|
141
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Db.User)
|
|
142
|
-
@removed(DbVersions.v1_24)
|
|
143
|
-
user?: string;
|
|
144
101
|
}
|
|
145
102
|
|
|
146
103
|
// =============================================================================
|
package/models/genai.tsp
CHANGED
|
@@ -22,26 +22,14 @@ namespace Qyl.Api.Contracts.Domains.AI.GenAi;
|
|
|
22
22
|
// Version History
|
|
23
23
|
// =============================================================================
|
|
24
24
|
|
|
25
|
-
@doc("GenAI semantic convention versions")
|
|
25
|
+
@doc("GenAI semantic convention versions (only versions referenced by @added/@removed annotations are kept)")
|
|
26
26
|
enum GenAiVersions {
|
|
27
27
|
@doc("Initial GenAI semconv (OTel 1.27)")
|
|
28
28
|
v1_27: "1.27.0",
|
|
29
29
|
|
|
30
|
-
@doc("Added agent support (OTel 1.28)")
|
|
31
|
-
v1_28: "1.28.0",
|
|
32
|
-
|
|
33
|
-
@doc("Token type refinements (OTel 1.29)")
|
|
34
|
-
v1_29: "1.29.0",
|
|
35
|
-
|
|
36
|
-
@doc("Deprecated gen_ai.system (OTel 1.37)")
|
|
37
|
-
v1_37: "1.37.0",
|
|
38
|
-
|
|
39
30
|
@doc("GenAI.Agent support (OTel 1.38)")
|
|
40
31
|
v1_38: "1.38.0",
|
|
41
32
|
|
|
42
|
-
@doc("RPC metadata consolidation (OTel 1.39)")
|
|
43
|
-
v1_39: "1.39.0",
|
|
44
|
-
|
|
45
33
|
@doc("Current version (OTel 1.40)")
|
|
46
34
|
v1_40: "1.40.0",
|
|
47
35
|
}
|
|
@@ -154,11 +142,6 @@ model GenAiSpanAttributes {
|
|
|
154
142
|
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsageOutputTokens)
|
|
155
143
|
usageOutputTokens?: TokenCount;
|
|
156
144
|
|
|
157
|
-
@doc("Total tokens (deprecated - use input + output)")
|
|
158
|
-
@encodedName("application/json", "gen_ai.usage.total_tokens")
|
|
159
|
-
@removed(GenAiVersions.v1_38)
|
|
160
|
-
usageTotalTokens?: TokenCount;
|
|
161
|
-
|
|
162
145
|
@doc("Number of cached input tokens (prompt caching)")
|
|
163
146
|
@encodedName("application/json", "gen_ai.usage.input_tokens.cached")
|
|
164
147
|
@added(GenAiVersions.v1_38)
|
package/models/http.tsp
CHANGED
|
@@ -10,28 +10,8 @@ import "../common/types.tsp";
|
|
|
10
10
|
using TypeSpec.Versioning;
|
|
11
11
|
using Qyl.Api.Contracts.Common;
|
|
12
12
|
|
|
13
|
-
@versioned(HttpVersions)
|
|
14
13
|
namespace Qyl.Api.Contracts.Domains.Transport.Http;
|
|
15
14
|
|
|
16
|
-
// =============================================================================
|
|
17
|
-
// Version History
|
|
18
|
-
// =============================================================================
|
|
19
|
-
|
|
20
|
-
@doc("HTTP semantic convention versions")
|
|
21
|
-
enum HttpVersions {
|
|
22
|
-
@doc("Legacy HTTP semconv")
|
|
23
|
-
v1_20: "1.20.0",
|
|
24
|
-
|
|
25
|
-
@doc("Stable HTTP semconv")
|
|
26
|
-
v1_23: "1.23.0",
|
|
27
|
-
|
|
28
|
-
@doc("HTTP semconv v1.38")
|
|
29
|
-
v1_38: "1.38.0",
|
|
30
|
-
|
|
31
|
-
@doc("Current HTTP semconv")
|
|
32
|
-
v1_39: "1.39.0",
|
|
33
|
-
}
|
|
34
|
-
|
|
35
15
|
// =============================================================================
|
|
36
16
|
// HTTP Span Attributes
|
|
37
17
|
// =============================================================================
|
|
@@ -184,39 +164,6 @@ model HttpAttributes {
|
|
|
184
164
|
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestResendCount)
|
|
185
165
|
requestResendCount?: int32;
|
|
186
166
|
|
|
187
|
-
// ---------------------------------------------------------------------------
|
|
188
|
-
// Deprecated Attributes (for migration)
|
|
189
|
-
// ---------------------------------------------------------------------------
|
|
190
|
-
|
|
191
|
-
@doc("Request target (deprecated - use url.path + url.query)")
|
|
192
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Target)
|
|
193
|
-
@removed(HttpVersions.v1_23)
|
|
194
|
-
target?: string;
|
|
195
|
-
|
|
196
|
-
@doc("Request URL (deprecated - use url.full)")
|
|
197
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Url)
|
|
198
|
-
@removed(HttpVersions.v1_23)
|
|
199
|
-
url?: UrlString;
|
|
200
|
-
|
|
201
|
-
@doc("HTTP method (deprecated - use http.request.method)")
|
|
202
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.Method)
|
|
203
|
-
@removed(HttpVersions.v1_23)
|
|
204
|
-
method?: string;
|
|
205
|
-
|
|
206
|
-
@doc("Status code (deprecated - use http.response.status_code)")
|
|
207
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.StatusCode)
|
|
208
|
-
@removed(HttpVersions.v1_23)
|
|
209
|
-
statusCode?: int32;
|
|
210
|
-
|
|
211
|
-
@doc("Request content length (deprecated)")
|
|
212
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.RequestContentLength)
|
|
213
|
-
@removed(HttpVersions.v1_23)
|
|
214
|
-
requestContentLengthLegacy?: ByteSize;
|
|
215
|
-
|
|
216
|
-
@doc("Response content length (deprecated)")
|
|
217
|
-
@encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Http.ResponseContentLength)
|
|
218
|
-
@removed(HttpVersions.v1_23)
|
|
219
|
-
responseContentLengthLegacy?: ByteSize;
|
|
220
167
|
}
|
|
221
168
|
|
|
222
169
|
// =============================================================================
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancplua/qyl-api-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "TypeSpec source of truth for qyl API contracts. Emits OpenAPI, JSON Schema, Qyl.Api.Contracts DTOs, and TypeScript contract types; not an OpenTelemetry package, storage schema, or server implementation.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|