@ancplua/qyl-api-schema 11.0.1 → 11.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/common/types.tsp +2 -13
- package/generated/json-schema/qyl-api-schema.json +12 -24
- package/generated/openapi/qyl.openapi.json +15 -27
- package/generated/runtime/index.d.ts +1 -0
- package/generated/runtime/index.js +1 -0
- package/generated/runtime/time.d.ts +12 -0
- package/generated/runtime/time.js +29 -0
- package/generated/ts-runtime/api.d.ts +6 -0
- package/generated/ts-runtime/api.js +28 -1
- package/generated/ts-runtime/schemas.d.ts +662 -0
- package/generated/ts-runtime/schemas.js +658 -0
- package/generated/zod-runtime/index.d.ts +12 -0
- package/generated/zod-runtime/index.js +12 -0
- package/models/session.tsp +0 -1
- package/package.json +3 -1
package/common/types.tsp
CHANGED
|
@@ -38,9 +38,10 @@ scalar TraceParent extends string;
|
|
|
38
38
|
@example("rojo=00f067aa0ba902b7,congo=t61rcWkgMzE")
|
|
39
39
|
scalar TraceState extends string;
|
|
40
40
|
|
|
41
|
-
@doc("Unique session identifier")
|
|
41
|
+
@doc("Unique session identifier: URL-safe characters, at least one, at most 128, not only dots. The same rule the SDK enforces on the baggage header.")
|
|
42
42
|
@minLength(1)
|
|
43
43
|
@maxLength(128)
|
|
44
|
+
@pattern("^(?!\\.+$)[A-Za-z0-9._~-]{1,128}$")
|
|
44
45
|
scalar SessionId extends string;
|
|
45
46
|
|
|
46
47
|
@doc("User identifier (pseudonymized for privacy)")
|
|
@@ -64,18 +65,15 @@ scalar Timestamp extends utcDateTime;
|
|
|
64
65
|
@doc("Unsigned Unix timestamp in nanoseconds since epoch, encoded as a decimal string")
|
|
65
66
|
@minValue(0)
|
|
66
67
|
@encode(string)
|
|
67
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "ulong")
|
|
68
68
|
scalar UnixNanos extends uint64;
|
|
69
69
|
|
|
70
70
|
@doc("Duration in nanoseconds, encoded as a decimal string")
|
|
71
71
|
@minValue(0)
|
|
72
72
|
@encode(string)
|
|
73
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "ulong")
|
|
74
73
|
scalar DurationNs extends uint64;
|
|
75
74
|
|
|
76
75
|
@doc("Duration in milliseconds")
|
|
77
76
|
@minValue(0)
|
|
78
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "double")
|
|
79
77
|
scalar DurationMs extends float64;
|
|
80
78
|
|
|
81
79
|
@doc("Duration in seconds")
|
|
@@ -105,7 +103,6 @@ scalar IpAddress extends string;
|
|
|
105
103
|
@doc("Network port number (1-65535)")
|
|
106
104
|
@minValue(1)
|
|
107
105
|
@maxValue(65535)
|
|
108
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "int")
|
|
109
106
|
scalar Port extends int32;
|
|
110
107
|
|
|
111
108
|
@doc("MAC address in colon-separated hex notation")
|
|
@@ -119,29 +116,24 @@ scalar MacAddress extends string;
|
|
|
119
116
|
|
|
120
117
|
@doc("Size in bytes")
|
|
121
118
|
@minValue(0)
|
|
122
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "long")
|
|
123
119
|
scalar ByteSize extends int64;
|
|
124
120
|
|
|
125
121
|
@doc("Token count (for LLM operations)")
|
|
126
122
|
@minValue(0)
|
|
127
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "long")
|
|
128
123
|
scalar TokenCount extends int64;
|
|
129
124
|
|
|
130
125
|
@doc("Generic non-negative counter")
|
|
131
126
|
@minValue(0)
|
|
132
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "long")
|
|
133
127
|
scalar Count extends int64;
|
|
134
128
|
|
|
135
129
|
@doc("Percentage value (0.0 to 100.0)")
|
|
136
130
|
@minValue(0.0)
|
|
137
131
|
@maxValue(100.0)
|
|
138
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "double")
|
|
139
132
|
scalar Percentage extends float64;
|
|
140
133
|
|
|
141
134
|
@doc("Ratio value (0.0 to 1.0)")
|
|
142
135
|
@minValue(0.0)
|
|
143
136
|
@maxValue(1.0)
|
|
144
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "double")
|
|
145
137
|
scalar Ratio extends float64;
|
|
146
138
|
|
|
147
139
|
// =============================================================================
|
|
@@ -150,13 +142,11 @@ scalar Ratio extends float64;
|
|
|
150
142
|
|
|
151
143
|
@doc("Cost in USD (floating point)")
|
|
152
144
|
@minValue(0)
|
|
153
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "double")
|
|
154
145
|
scalar CostUsd extends float64;
|
|
155
146
|
|
|
156
147
|
@doc("Temperature setting for LLM requests (0.0-2.0)")
|
|
157
148
|
@minValue(0)
|
|
158
149
|
@maxValue(2)
|
|
159
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "double")
|
|
160
150
|
scalar Temperature extends float64;
|
|
161
151
|
|
|
162
152
|
// =============================================================================
|
|
@@ -226,7 +216,6 @@ model AttributeBytesValue {
|
|
|
226
216
|
|
|
227
217
|
@doc("An OTLP signed 64-bit attribute integer encoded without JavaScript precision loss.")
|
|
228
218
|
@encode(string)
|
|
229
|
-
@TypeSpec.OpenAPI.extension("x-csharp-type", "long")
|
|
230
219
|
scalar AttributeInt64 extends int64;
|
|
231
220
|
|
|
232
221
|
@doc("An OTLP attribute double encoded as a JSON number when finite or a canonical named string when non-finite.")
|
|
@@ -91,7 +91,6 @@
|
|
|
91
91
|
"type": "string",
|
|
92
92
|
"format": "int64",
|
|
93
93
|
"description": "An OTLP signed 64-bit attribute integer encoded without JavaScript precision loss.",
|
|
94
|
-
"x-csharp-type": "long",
|
|
95
94
|
"pattern": "^(0|-?[1-9][0-9]*)$",
|
|
96
95
|
"maxLength": 20
|
|
97
96
|
},
|
|
@@ -215,8 +214,7 @@
|
|
|
215
214
|
"type": "integer",
|
|
216
215
|
"format": "int64",
|
|
217
216
|
"minimum": 0,
|
|
218
|
-
"description": "Size in bytes"
|
|
219
|
-
"x-csharp-type": "long"
|
|
217
|
+
"description": "Size in bytes"
|
|
220
218
|
},
|
|
221
219
|
"Common.ContentType": {
|
|
222
220
|
"type": "string",
|
|
@@ -239,28 +237,24 @@
|
|
|
239
237
|
"type": "number",
|
|
240
238
|
"format": "double",
|
|
241
239
|
"minimum": 0,
|
|
242
|
-
"description": "Cost in USD (floating point)"
|
|
243
|
-
"x-csharp-type": "double"
|
|
240
|
+
"description": "Cost in USD (floating point)"
|
|
244
241
|
},
|
|
245
242
|
"Common.Count": {
|
|
246
243
|
"type": "integer",
|
|
247
244
|
"format": "int64",
|
|
248
245
|
"minimum": 0,
|
|
249
|
-
"description": "Generic non-negative counter"
|
|
250
|
-
"x-csharp-type": "long"
|
|
246
|
+
"description": "Generic non-negative counter"
|
|
251
247
|
},
|
|
252
248
|
"Common.DurationMs": {
|
|
253
249
|
"type": "number",
|
|
254
250
|
"format": "double",
|
|
255
251
|
"minimum": 0,
|
|
256
|
-
"description": "Duration in milliseconds"
|
|
257
|
-
"x-csharp-type": "double"
|
|
252
|
+
"description": "Duration in milliseconds"
|
|
258
253
|
},
|
|
259
254
|
"Common.DurationNs": {
|
|
260
255
|
"type": "string",
|
|
261
256
|
"format": "uint64",
|
|
262
257
|
"description": "Duration in nanoseconds, encoded as a decimal string",
|
|
263
|
-
"x-csharp-type": "ulong",
|
|
264
258
|
"pattern": "^(0|[1-9][0-9]*)$",
|
|
265
259
|
"maxLength": 20
|
|
266
260
|
},
|
|
@@ -898,24 +892,21 @@
|
|
|
898
892
|
"format": "double",
|
|
899
893
|
"minimum": 0,
|
|
900
894
|
"maximum": 100,
|
|
901
|
-
"description": "Percentage value (0.0 to 100.0)"
|
|
902
|
-
"x-csharp-type": "double"
|
|
895
|
+
"description": "Percentage value (0.0 to 100.0)"
|
|
903
896
|
},
|
|
904
897
|
"Common.Port": {
|
|
905
898
|
"type": "integer",
|
|
906
899
|
"format": "int32",
|
|
907
900
|
"minimum": 1,
|
|
908
901
|
"maximum": 65535,
|
|
909
|
-
"description": "Network port number (1-65535)"
|
|
910
|
-
"x-csharp-type": "int"
|
|
902
|
+
"description": "Network port number (1-65535)"
|
|
911
903
|
},
|
|
912
904
|
"Common.Ratio": {
|
|
913
905
|
"type": "number",
|
|
914
906
|
"format": "double",
|
|
915
907
|
"minimum": 0,
|
|
916
908
|
"maximum": 1,
|
|
917
|
-
"description": "Ratio value (0.0 to 1.0)"
|
|
918
|
-
"x-csharp-type": "double"
|
|
909
|
+
"description": "Ratio value (0.0 to 1.0)"
|
|
919
910
|
},
|
|
920
911
|
"Common.SemVer": {
|
|
921
912
|
"type": "string",
|
|
@@ -929,7 +920,8 @@
|
|
|
929
920
|
"type": "string",
|
|
930
921
|
"minLength": 1,
|
|
931
922
|
"maxLength": 128,
|
|
932
|
-
"
|
|
923
|
+
"pattern": "^(?!\\.+$)[A-Za-z0-9._~-]{1,128}$",
|
|
924
|
+
"description": "Unique session identifier: URL-safe characters, at least one, at most 128, not only dots. The same rule the SDK enforces on the baggage header."
|
|
933
925
|
},
|
|
934
926
|
"Common.Sha256Hash": {
|
|
935
927
|
"type": "string",
|
|
@@ -953,8 +945,7 @@
|
|
|
953
945
|
"format": "double",
|
|
954
946
|
"minimum": 0,
|
|
955
947
|
"maximum": 2,
|
|
956
|
-
"description": "Temperature setting for LLM requests (0.0-2.0)"
|
|
957
|
-
"x-csharp-type": "double"
|
|
948
|
+
"description": "Temperature setting for LLM requests (0.0-2.0)"
|
|
958
949
|
},
|
|
959
950
|
"Common.Timestamp": {
|
|
960
951
|
"type": "string",
|
|
@@ -965,8 +956,7 @@
|
|
|
965
956
|
"type": "integer",
|
|
966
957
|
"format": "int64",
|
|
967
958
|
"minimum": 0,
|
|
968
|
-
"description": "Token count (for LLM operations)"
|
|
969
|
-
"x-csharp-type": "long"
|
|
959
|
+
"description": "Token count (for LLM operations)"
|
|
970
960
|
},
|
|
971
961
|
"Common.TraceId": {
|
|
972
962
|
"type": "string",
|
|
@@ -997,7 +987,6 @@
|
|
|
997
987
|
"type": "string",
|
|
998
988
|
"format": "uint64",
|
|
999
989
|
"description": "Unsigned Unix timestamp in nanoseconds since epoch, encoded as a decimal string",
|
|
1000
|
-
"x-csharp-type": "ulong",
|
|
1001
990
|
"pattern": "^(0|[1-9][0-9]*)$",
|
|
1002
991
|
"maxLength": 20
|
|
1003
992
|
},
|
|
@@ -1180,8 +1169,7 @@
|
|
|
1180
1169
|
"unevaluatedProperties": {
|
|
1181
1170
|
"not": {}
|
|
1182
1171
|
},
|
|
1183
|
-
"description": "Complete session entity with aggregated data"
|
|
1184
|
-
"x-csharp-type": "SessionEntity"
|
|
1172
|
+
"description": "Complete session entity with aggregated data"
|
|
1185
1173
|
},
|
|
1186
1174
|
"Domains.Observe.Session.SessionEvent": {
|
|
1187
1175
|
"type": "object",
|
|
@@ -13074,8 +13074,7 @@
|
|
|
13074
13074
|
"Common.AttributeInt64": {
|
|
13075
13075
|
"type": "string",
|
|
13076
13076
|
"format": "int64",
|
|
13077
|
-
"description": "An OTLP signed 64-bit attribute integer encoded without JavaScript precision loss."
|
|
13078
|
-
"x-csharp-type": "long"
|
|
13077
|
+
"description": "An OTLP signed 64-bit attribute integer encoded without JavaScript precision loss."
|
|
13079
13078
|
},
|
|
13080
13079
|
"Common.AttributeIntValue": {
|
|
13081
13080
|
"type": "object",
|
|
@@ -13197,8 +13196,7 @@
|
|
|
13197
13196
|
"type": "integer",
|
|
13198
13197
|
"format": "int64",
|
|
13199
13198
|
"minimum": 0,
|
|
13200
|
-
"description": "Size in bytes"
|
|
13201
|
-
"x-csharp-type": "long"
|
|
13199
|
+
"description": "Size in bytes"
|
|
13202
13200
|
},
|
|
13203
13201
|
"Common.ContentType": {
|
|
13204
13202
|
"type": "string",
|
|
@@ -13221,29 +13219,25 @@
|
|
|
13221
13219
|
"type": "number",
|
|
13222
13220
|
"format": "double",
|
|
13223
13221
|
"minimum": 0,
|
|
13224
|
-
"description": "Cost in USD (floating point)"
|
|
13225
|
-
"x-csharp-type": "double"
|
|
13222
|
+
"description": "Cost in USD (floating point)"
|
|
13226
13223
|
},
|
|
13227
13224
|
"Common.Count": {
|
|
13228
13225
|
"type": "integer",
|
|
13229
13226
|
"format": "int64",
|
|
13230
13227
|
"minimum": 0,
|
|
13231
|
-
"description": "Generic non-negative counter"
|
|
13232
|
-
"x-csharp-type": "long"
|
|
13228
|
+
"description": "Generic non-negative counter"
|
|
13233
13229
|
},
|
|
13234
13230
|
"Common.DurationMs": {
|
|
13235
13231
|
"type": "number",
|
|
13236
13232
|
"format": "double",
|
|
13237
13233
|
"minimum": 0,
|
|
13238
|
-
"description": "Duration in milliseconds"
|
|
13239
|
-
"x-csharp-type": "double"
|
|
13234
|
+
"description": "Duration in milliseconds"
|
|
13240
13235
|
},
|
|
13241
13236
|
"Common.DurationNs": {
|
|
13242
13237
|
"type": "string",
|
|
13243
13238
|
"format": "uint64",
|
|
13244
13239
|
"minimum": 0,
|
|
13245
|
-
"description": "Duration in nanoseconds, encoded as a decimal string"
|
|
13246
|
-
"x-csharp-type": "ulong"
|
|
13240
|
+
"description": "Duration in nanoseconds, encoded as a decimal string"
|
|
13247
13241
|
},
|
|
13248
13242
|
"Common.DurationS": {
|
|
13249
13243
|
"type": "number",
|
|
@@ -13879,24 +13873,21 @@
|
|
|
13879
13873
|
"format": "double",
|
|
13880
13874
|
"minimum": 0,
|
|
13881
13875
|
"maximum": 100,
|
|
13882
|
-
"description": "Percentage value (0.0 to 100.0)"
|
|
13883
|
-
"x-csharp-type": "double"
|
|
13876
|
+
"description": "Percentage value (0.0 to 100.0)"
|
|
13884
13877
|
},
|
|
13885
13878
|
"Common.Port": {
|
|
13886
13879
|
"type": "integer",
|
|
13887
13880
|
"format": "int32",
|
|
13888
13881
|
"minimum": 1,
|
|
13889
13882
|
"maximum": 65535,
|
|
13890
|
-
"description": "Network port number (1-65535)"
|
|
13891
|
-
"x-csharp-type": "int"
|
|
13883
|
+
"description": "Network port number (1-65535)"
|
|
13892
13884
|
},
|
|
13893
13885
|
"Common.Ratio": {
|
|
13894
13886
|
"type": "number",
|
|
13895
13887
|
"format": "double",
|
|
13896
13888
|
"minimum": 0,
|
|
13897
13889
|
"maximum": 1,
|
|
13898
|
-
"description": "Ratio value (0.0 to 1.0)"
|
|
13899
|
-
"x-csharp-type": "double"
|
|
13890
|
+
"description": "Ratio value (0.0 to 1.0)"
|
|
13900
13891
|
},
|
|
13901
13892
|
"Common.SemVer": {
|
|
13902
13893
|
"type": "string",
|
|
@@ -13910,7 +13901,8 @@
|
|
|
13910
13901
|
"type": "string",
|
|
13911
13902
|
"minLength": 1,
|
|
13912
13903
|
"maxLength": 128,
|
|
13913
|
-
"
|
|
13904
|
+
"pattern": "^(?!\\.+$)[A-Za-z0-9._~-]{1,128}$",
|
|
13905
|
+
"description": "Unique session identifier: URL-safe characters, at least one, at most 128, not only dots. The same rule the SDK enforces on the baggage header."
|
|
13914
13906
|
},
|
|
13915
13907
|
"Common.Sha256Hash": {
|
|
13916
13908
|
"type": "string",
|
|
@@ -13934,8 +13926,7 @@
|
|
|
13934
13926
|
"format": "double",
|
|
13935
13927
|
"minimum": 0,
|
|
13936
13928
|
"maximum": 2,
|
|
13937
|
-
"description": "Temperature setting for LLM requests (0.0-2.0)"
|
|
13938
|
-
"x-csharp-type": "double"
|
|
13929
|
+
"description": "Temperature setting for LLM requests (0.0-2.0)"
|
|
13939
13930
|
},
|
|
13940
13931
|
"Common.Timestamp": {
|
|
13941
13932
|
"type": "string",
|
|
@@ -13946,8 +13937,7 @@
|
|
|
13946
13937
|
"type": "integer",
|
|
13947
13938
|
"format": "int64",
|
|
13948
13939
|
"minimum": 0,
|
|
13949
|
-
"description": "Token count (for LLM operations)"
|
|
13950
|
-
"x-csharp-type": "long"
|
|
13940
|
+
"description": "Token count (for LLM operations)"
|
|
13951
13941
|
},
|
|
13952
13942
|
"Common.TraceId": {
|
|
13953
13943
|
"type": "string",
|
|
@@ -13978,8 +13968,7 @@
|
|
|
13978
13968
|
"type": "string",
|
|
13979
13969
|
"format": "uint64",
|
|
13980
13970
|
"minimum": 0,
|
|
13981
|
-
"description": "Unsigned Unix timestamp in nanoseconds since epoch, encoded as a decimal string"
|
|
13982
|
-
"x-csharp-type": "ulong"
|
|
13971
|
+
"description": "Unsigned Unix timestamp in nanoseconds since epoch, encoded as a decimal string"
|
|
13983
13972
|
},
|
|
13984
13973
|
"Common.UrlPath": {
|
|
13985
13974
|
"type": "string",
|
|
@@ -14160,8 +14149,7 @@
|
|
|
14160
14149
|
"unevaluatedProperties": {
|
|
14161
14150
|
"not": {}
|
|
14162
14151
|
},
|
|
14163
|
-
"description": "Complete session entity with aggregated data"
|
|
14164
|
-
"x-csharp-type": "SessionEntity"
|
|
14152
|
+
"description": "Complete session entity with aggregated data"
|
|
14165
14153
|
},
|
|
14166
14154
|
"Domains.Observe.Session.SessionEvent": {
|
|
14167
14155
|
"type": "object",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AttributeValue } from "@ancplua/qyl-api-schema/types";
|
|
2
|
+
export * from "./time.js";
|
|
2
3
|
export { AttributeObjectValueTags, isAttributeObjectValue, matchAttributeValue, } from "../../generated/ts-runtime/runtime.js";
|
|
3
4
|
export type { AttributeObjectValueTag, AttributeValueHandlers } from "../../generated/ts-runtime/runtime.js";
|
|
4
5
|
/** An AttributeValue with the wire tags removed: what a reader sees, not how it travelled. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { matchAttributeValue } from "../../generated/ts-runtime/runtime.js";
|
|
2
|
+
export * from "./time.js";
|
|
2
3
|
export { AttributeObjectValueTags, isAttributeObjectValue, matchAttributeValue, } from "../../generated/ts-runtime/runtime.js";
|
|
3
4
|
/** Strip the tags. int64 stays text so no digit is lost; bytes stay marked so they never read as a string. */
|
|
4
5
|
export function decodeAttributeValue(value) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The exact nanosecond count. */
|
|
2
|
+
export declare function parseUnixNanos(nanos: string): bigint;
|
|
3
|
+
/** Ascending comparator, exact at nanosecond resolution. */
|
|
4
|
+
export declare function compareUnixNanos(a: string, b: string): number;
|
|
5
|
+
/** Exact nanosecond delta as a number; safe for any span shorter than about 104 days. */
|
|
6
|
+
export declare function unixNanosDelta(fromNanos: string, toNanos: string): number;
|
|
7
|
+
/** Epoch milliseconds, floored in BigInt so no precision is assumed. */
|
|
8
|
+
export declare function unixNanosToEpochMs(nanos: string): number;
|
|
9
|
+
/** ISO-8601 at millisecond resolution. */
|
|
10
|
+
export declare function unixNanosToIso(nanos: string): string;
|
|
11
|
+
/** The wire form of an epoch-millisecond instant. */
|
|
12
|
+
export declare function epochMsToUnixNanos(epochMs: number): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Absolute wire timestamps are unsigned 64-bit nanosecond counts encoded as decimal strings.
|
|
2
|
+
// They exceed Number.MAX_SAFE_INTEGER, so every operation goes through BigInt and only the
|
|
3
|
+
// millisecond result is a number.
|
|
4
|
+
/** The exact nanosecond count. */
|
|
5
|
+
export function parseUnixNanos(nanos) {
|
|
6
|
+
return BigInt(nanos);
|
|
7
|
+
}
|
|
8
|
+
/** Ascending comparator, exact at nanosecond resolution. */
|
|
9
|
+
export function compareUnixNanos(a, b) {
|
|
10
|
+
const left = BigInt(a);
|
|
11
|
+
const right = BigInt(b);
|
|
12
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
13
|
+
}
|
|
14
|
+
/** Exact nanosecond delta as a number; safe for any span shorter than about 104 days. */
|
|
15
|
+
export function unixNanosDelta(fromNanos, toNanos) {
|
|
16
|
+
return Number(BigInt(toNanos) - BigInt(fromNanos));
|
|
17
|
+
}
|
|
18
|
+
/** Epoch milliseconds, floored in BigInt so no precision is assumed. */
|
|
19
|
+
export function unixNanosToEpochMs(nanos) {
|
|
20
|
+
return Number(BigInt(nanos) / 1000000n);
|
|
21
|
+
}
|
|
22
|
+
/** ISO-8601 at millisecond resolution. */
|
|
23
|
+
export function unixNanosToIso(nanos) {
|
|
24
|
+
return new Date(unixNanosToEpochMs(nanos)).toISOString();
|
|
25
|
+
}
|
|
26
|
+
/** The wire form of an epoch-millisecond instant. */
|
|
27
|
+
export function epochMsToUnixNanos(epochMs) {
|
|
28
|
+
return (BigInt(Math.round(epochMs)) * 1000000n).toString();
|
|
29
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
export type TraceId = string & {
|
|
2
2
|
readonly __brand: "TraceId";
|
|
3
3
|
};
|
|
4
|
+
export declare function isTraceId(value: string): value is TraceId;
|
|
5
|
+
export declare function parseTraceId(value: string): TraceId;
|
|
4
6
|
export type SpanId = string & {
|
|
5
7
|
readonly __brand: "SpanId";
|
|
6
8
|
};
|
|
9
|
+
export declare function isSpanId(value: string): value is SpanId;
|
|
10
|
+
export declare function parseSpanId(value: string): SpanId;
|
|
7
11
|
export type SessionId = string & {
|
|
8
12
|
readonly __brand: "SessionId";
|
|
9
13
|
};
|
|
14
|
+
export declare function isSessionId(value: string): value is SessionId;
|
|
15
|
+
export declare function parseSessionId(value: string): SessionId;
|
|
10
16
|
export type UserId = string & {
|
|
11
17
|
readonly __brand: "UserId";
|
|
12
18
|
};
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
// <auto-generated/>
|
|
2
2
|
// Copyright (c) 2025-2026 ancplua
|
|
3
|
+
const TraceIdPattern = new RegExp("^[a-f0-9]{32}$", "u");
|
|
4
|
+
export function isTraceId(value) {
|
|
5
|
+
return TraceIdPattern.test(value);
|
|
6
|
+
}
|
|
7
|
+
export function parseTraceId(value) {
|
|
8
|
+
if (!isTraceId(value))
|
|
9
|
+
throw new TypeError(`Not a TraceId: ${JSON.stringify(value)}`);
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
const SpanIdPattern = new RegExp("^[a-f0-9]{16}$", "u");
|
|
13
|
+
export function isSpanId(value) {
|
|
14
|
+
return SpanIdPattern.test(value);
|
|
15
|
+
}
|
|
16
|
+
export function parseSpanId(value) {
|
|
17
|
+
if (!isSpanId(value))
|
|
18
|
+
throw new TypeError(`Not a SpanId: ${JSON.stringify(value)}`);
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
const SessionIdPattern = new RegExp("^(?!\\.+$)[A-Za-z0-9._~-]{1,128}$", "u");
|
|
22
|
+
export function isSessionId(value) {
|
|
23
|
+
return SessionIdPattern.test(value);
|
|
24
|
+
}
|
|
25
|
+
export function parseSessionId(value) {
|
|
26
|
+
if (!isSessionId(value))
|
|
27
|
+
throw new TypeError(`Not a SessionId: ${JSON.stringify(value)}`);
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
3
30
|
export const ProblemDetailsMediaType = "application/problem+json";
|
|
4
31
|
export const SortOrderValues = {
|
|
5
32
|
"asc": "asc",
|
|
@@ -320,4 +347,4 @@ export const FetchTelemetryViewValues = {
|
|
|
320
347
|
};
|
|
321
348
|
// --- contract revision (scripts/emit-contract-revision.mjs) ---
|
|
322
349
|
/** Revision of the API contract these types were emitted from; compare against HealthReport.contract_revision. */
|
|
323
|
-
export const CONTRACT_REVISION = "sha256:
|
|
350
|
+
export const CONTRACT_REVISION = "sha256:75278211aa54def8";
|