@use-tusk/drift-node-sdk 0.1.24 → 0.1.26
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/dist/index.cjs +286 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +286 -16
- package/dist/index.js.map +1 -1
- package/dist/instrumentation-manifest.json +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6203,7 +6203,7 @@ var JsonSchema$Type = class extends import_commonjs$7.MessageType {
|
|
|
6203
6203
|
const JsonSchema = new JsonSchema$Type();
|
|
6204
6204
|
|
|
6205
6205
|
//#endregion
|
|
6206
|
-
//#region node_modules/@use-tusk/drift-schemas/dist/span-
|
|
6206
|
+
//#region node_modules/@use-tusk/drift-schemas/dist/span-CXrr1reB.js
|
|
6207
6207
|
var import_commonjs$6 = /* @__PURE__ */ __toESM(require_commonjs$2(), 1);
|
|
6208
6208
|
/**
|
|
6209
6209
|
* Package type classification enum
|
|
@@ -6350,6 +6350,62 @@ let StatusCode = /* @__PURE__ */ function(StatusCode$1) {
|
|
|
6350
6350
|
StatusCode$1[StatusCode$1["ERROR"] = 2] = "ERROR";
|
|
6351
6351
|
return StatusCode$1;
|
|
6352
6352
|
}({});
|
|
6353
|
+
/**
|
|
6354
|
+
* Match scope - where the match was found
|
|
6355
|
+
*
|
|
6356
|
+
* @generated from protobuf enum tusk.drift.core.v1.MatchScope
|
|
6357
|
+
*/
|
|
6358
|
+
let MatchScope = /* @__PURE__ */ function(MatchScope$1) {
|
|
6359
|
+
/**
|
|
6360
|
+
* @generated from protobuf enum value: MATCH_SCOPE_UNSPECIFIED = 0;
|
|
6361
|
+
*/
|
|
6362
|
+
MatchScope$1[MatchScope$1["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6363
|
+
/**
|
|
6364
|
+
* @generated from protobuf enum value: MATCH_SCOPE_TRACE = 1;
|
|
6365
|
+
*/
|
|
6366
|
+
MatchScope$1[MatchScope$1["TRACE"] = 1] = "TRACE";
|
|
6367
|
+
/**
|
|
6368
|
+
* @generated from protobuf enum value: MATCH_SCOPE_GLOBAL = 2;
|
|
6369
|
+
*/
|
|
6370
|
+
MatchScope$1[MatchScope$1["GLOBAL"] = 2] = "GLOBAL";
|
|
6371
|
+
return MatchScope$1;
|
|
6372
|
+
}({});
|
|
6373
|
+
/**
|
|
6374
|
+
* Match type - how the match was found
|
|
6375
|
+
*
|
|
6376
|
+
* @generated from protobuf enum tusk.drift.core.v1.MatchType
|
|
6377
|
+
*/
|
|
6378
|
+
let MatchType = /* @__PURE__ */ function(MatchType$1) {
|
|
6379
|
+
/**
|
|
6380
|
+
* @generated from protobuf enum value: MATCH_TYPE_UNSPECIFIED = 0;
|
|
6381
|
+
*/
|
|
6382
|
+
MatchType$1[MatchType$1["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6383
|
+
/**
|
|
6384
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_VALUE_HASH = 1;
|
|
6385
|
+
*/
|
|
6386
|
+
MatchType$1[MatchType$1["INPUT_VALUE_HASH"] = 1] = "INPUT_VALUE_HASH";
|
|
6387
|
+
/**
|
|
6388
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_VALUE_HASH_REDUCED_SCHEMA = 2;
|
|
6389
|
+
*/
|
|
6390
|
+
MatchType$1[MatchType$1["INPUT_VALUE_HASH_REDUCED_SCHEMA"] = 2] = "INPUT_VALUE_HASH_REDUCED_SCHEMA";
|
|
6391
|
+
/**
|
|
6392
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_SCHEMA_HASH = 3;
|
|
6393
|
+
*/
|
|
6394
|
+
MatchType$1[MatchType$1["INPUT_SCHEMA_HASH"] = 3] = "INPUT_SCHEMA_HASH";
|
|
6395
|
+
/**
|
|
6396
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_SCHEMA_HASH_REDUCED_SCHEMA = 4;
|
|
6397
|
+
*/
|
|
6398
|
+
MatchType$1[MatchType$1["INPUT_SCHEMA_HASH_REDUCED_SCHEMA"] = 4] = "INPUT_SCHEMA_HASH_REDUCED_SCHEMA";
|
|
6399
|
+
/**
|
|
6400
|
+
* @generated from protobuf enum value: MATCH_TYPE_FUZZY = 5;
|
|
6401
|
+
*/
|
|
6402
|
+
MatchType$1[MatchType$1["FUZZY"] = 5] = "FUZZY";
|
|
6403
|
+
/**
|
|
6404
|
+
* @generated from protobuf enum value: MATCH_TYPE_FALLBACK = 6;
|
|
6405
|
+
*/
|
|
6406
|
+
MatchType$1[MatchType$1["FALLBACK"] = 6] = "FALLBACK";
|
|
6407
|
+
return MatchType$1;
|
|
6408
|
+
}({});
|
|
6353
6409
|
var Span$Type = class extends import_commonjs$6.MessageType {
|
|
6354
6410
|
constructor() {
|
|
6355
6411
|
super("tusk.drift.core.v1.Span", [
|
|
@@ -6996,6 +7052,157 @@ var Trace$Type = class extends import_commonjs$6.MessageType {
|
|
|
6996
7052
|
* @generated MessageType for protobuf message tusk.drift.core.v1.Trace
|
|
6997
7053
|
*/
|
|
6998
7054
|
const Trace = new Trace$Type();
|
|
7055
|
+
var SimilarityCandidate$Type = class extends import_commonjs$6.MessageType {
|
|
7056
|
+
constructor() {
|
|
7057
|
+
super("tusk.drift.core.v1.SimilarityCandidate", [{
|
|
7058
|
+
no: 1,
|
|
7059
|
+
name: "span_id",
|
|
7060
|
+
kind: "scalar",
|
|
7061
|
+
T: 9
|
|
7062
|
+
}, {
|
|
7063
|
+
no: 2,
|
|
7064
|
+
name: "score",
|
|
7065
|
+
kind: "scalar",
|
|
7066
|
+
T: 2
|
|
7067
|
+
}]);
|
|
7068
|
+
}
|
|
7069
|
+
create(value) {
|
|
7070
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
7071
|
+
message.spanId = "";
|
|
7072
|
+
message.score = 0;
|
|
7073
|
+
if (value !== void 0) (0, import_commonjs$6.reflectionMergePartial)(this, message, value);
|
|
7074
|
+
return message;
|
|
7075
|
+
}
|
|
7076
|
+
internalBinaryRead(reader, length, options, target) {
|
|
7077
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
7078
|
+
while (reader.pos < end) {
|
|
7079
|
+
let [fieldNo, wireType] = reader.tag();
|
|
7080
|
+
switch (fieldNo) {
|
|
7081
|
+
case 1:
|
|
7082
|
+
message.spanId = reader.string();
|
|
7083
|
+
break;
|
|
7084
|
+
case 2:
|
|
7085
|
+
message.score = reader.float();
|
|
7086
|
+
break;
|
|
7087
|
+
default:
|
|
7088
|
+
let u = options.readUnknownField;
|
|
7089
|
+
if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
7090
|
+
let d = reader.skip(wireType);
|
|
7091
|
+
if (u !== false) (u === true ? import_commonjs$6.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
7092
|
+
}
|
|
7093
|
+
}
|
|
7094
|
+
return message;
|
|
7095
|
+
}
|
|
7096
|
+
internalBinaryWrite(message, writer, options) {
|
|
7097
|
+
if (message.spanId !== "") writer.tag(1, import_commonjs$6.WireType.LengthDelimited).string(message.spanId);
|
|
7098
|
+
if (message.score !== 0) writer.tag(2, import_commonjs$6.WireType.Bit32).float(message.score);
|
|
7099
|
+
let u = options.writeUnknownFields;
|
|
7100
|
+
if (u !== false) (u == true ? import_commonjs$6.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
7101
|
+
return writer;
|
|
7102
|
+
}
|
|
7103
|
+
};
|
|
7104
|
+
/**
|
|
7105
|
+
* @generated MessageType for protobuf message tusk.drift.core.v1.SimilarityCandidate
|
|
7106
|
+
*/
|
|
7107
|
+
const SimilarityCandidate = new SimilarityCandidate$Type();
|
|
7108
|
+
var MatchLevel$Type = class extends import_commonjs$6.MessageType {
|
|
7109
|
+
constructor() {
|
|
7110
|
+
super("tusk.drift.core.v1.MatchLevel", [
|
|
7111
|
+
{
|
|
7112
|
+
no: 1,
|
|
7113
|
+
name: "match_type",
|
|
7114
|
+
kind: "enum",
|
|
7115
|
+
T: () => [
|
|
7116
|
+
"tusk.drift.core.v1.MatchType",
|
|
7117
|
+
MatchType,
|
|
7118
|
+
"MATCH_TYPE_"
|
|
7119
|
+
]
|
|
7120
|
+
},
|
|
7121
|
+
{
|
|
7122
|
+
no: 2,
|
|
7123
|
+
name: "match_scope",
|
|
7124
|
+
kind: "enum",
|
|
7125
|
+
T: () => [
|
|
7126
|
+
"tusk.drift.core.v1.MatchScope",
|
|
7127
|
+
MatchScope,
|
|
7128
|
+
"MATCH_SCOPE_"
|
|
7129
|
+
]
|
|
7130
|
+
},
|
|
7131
|
+
{
|
|
7132
|
+
no: 3,
|
|
7133
|
+
name: "match_description",
|
|
7134
|
+
kind: "scalar",
|
|
7135
|
+
T: 9
|
|
7136
|
+
},
|
|
7137
|
+
{
|
|
7138
|
+
no: 4,
|
|
7139
|
+
name: "similarity_score",
|
|
7140
|
+
kind: "scalar",
|
|
7141
|
+
opt: true,
|
|
7142
|
+
T: 2
|
|
7143
|
+
},
|
|
7144
|
+
{
|
|
7145
|
+
no: 5,
|
|
7146
|
+
name: "top_candidates",
|
|
7147
|
+
kind: "message",
|
|
7148
|
+
repeat: 2,
|
|
7149
|
+
T: () => SimilarityCandidate
|
|
7150
|
+
}
|
|
7151
|
+
]);
|
|
7152
|
+
}
|
|
7153
|
+
create(value) {
|
|
7154
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
7155
|
+
message.matchType = 0;
|
|
7156
|
+
message.matchScope = 0;
|
|
7157
|
+
message.matchDescription = "";
|
|
7158
|
+
message.topCandidates = [];
|
|
7159
|
+
if (value !== void 0) (0, import_commonjs$6.reflectionMergePartial)(this, message, value);
|
|
7160
|
+
return message;
|
|
7161
|
+
}
|
|
7162
|
+
internalBinaryRead(reader, length, options, target) {
|
|
7163
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
7164
|
+
while (reader.pos < end) {
|
|
7165
|
+
let [fieldNo, wireType] = reader.tag();
|
|
7166
|
+
switch (fieldNo) {
|
|
7167
|
+
case 1:
|
|
7168
|
+
message.matchType = reader.int32();
|
|
7169
|
+
break;
|
|
7170
|
+
case 2:
|
|
7171
|
+
message.matchScope = reader.int32();
|
|
7172
|
+
break;
|
|
7173
|
+
case 3:
|
|
7174
|
+
message.matchDescription = reader.string();
|
|
7175
|
+
break;
|
|
7176
|
+
case 4:
|
|
7177
|
+
message.similarityScore = reader.float();
|
|
7178
|
+
break;
|
|
7179
|
+
case 5:
|
|
7180
|
+
message.topCandidates.push(SimilarityCandidate.internalBinaryRead(reader, reader.uint32(), options));
|
|
7181
|
+
break;
|
|
7182
|
+
default:
|
|
7183
|
+
let u = options.readUnknownField;
|
|
7184
|
+
if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
7185
|
+
let d = reader.skip(wireType);
|
|
7186
|
+
if (u !== false) (u === true ? import_commonjs$6.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
7187
|
+
}
|
|
7188
|
+
}
|
|
7189
|
+
return message;
|
|
7190
|
+
}
|
|
7191
|
+
internalBinaryWrite(message, writer, options) {
|
|
7192
|
+
if (message.matchType !== 0) writer.tag(1, import_commonjs$6.WireType.Varint).int32(message.matchType);
|
|
7193
|
+
if (message.matchScope !== 0) writer.tag(2, import_commonjs$6.WireType.Varint).int32(message.matchScope);
|
|
7194
|
+
if (message.matchDescription !== "") writer.tag(3, import_commonjs$6.WireType.LengthDelimited).string(message.matchDescription);
|
|
7195
|
+
if (message.similarityScore !== void 0) writer.tag(4, import_commonjs$6.WireType.Bit32).float(message.similarityScore);
|
|
7196
|
+
for (let i = 0; i < message.topCandidates.length; i++) SimilarityCandidate.internalBinaryWrite(message.topCandidates[i], writer.tag(5, import_commonjs$6.WireType.LengthDelimited).fork(), options).join();
|
|
7197
|
+
let u = options.writeUnknownFields;
|
|
7198
|
+
if (u !== false) (u == true ? import_commonjs$6.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
7199
|
+
return writer;
|
|
7200
|
+
}
|
|
7201
|
+
};
|
|
7202
|
+
/**
|
|
7203
|
+
* @generated MessageType for protobuf message tusk.drift.core.v1.MatchLevel
|
|
7204
|
+
*/
|
|
7205
|
+
const MatchLevel = new MatchLevel$Type();
|
|
6999
7206
|
|
|
7000
7207
|
//#endregion
|
|
7001
7208
|
//#region src/core/utils/protobufUtils.ts
|
|
@@ -7057,6 +7264,50 @@ function valueToProtobufValue(value) {
|
|
|
7057
7264
|
stringValue: String(value)
|
|
7058
7265
|
} });
|
|
7059
7266
|
}
|
|
7267
|
+
/**
|
|
7268
|
+
* Human-readable labels for MatchType enum values
|
|
7269
|
+
*/
|
|
7270
|
+
const MATCH_TYPE_LABELS = {
|
|
7271
|
+
[MatchType.UNSPECIFIED]: "UNSPECIFIED",
|
|
7272
|
+
[MatchType.INPUT_VALUE_HASH]: "INPUT_VALUE_HASH",
|
|
7273
|
+
[MatchType.INPUT_VALUE_HASH_REDUCED_SCHEMA]: "INPUT_VALUE_HASH_REDUCED_SCHEMA",
|
|
7274
|
+
[MatchType.INPUT_SCHEMA_HASH]: "INPUT_SCHEMA_HASH",
|
|
7275
|
+
[MatchType.INPUT_SCHEMA_HASH_REDUCED_SCHEMA]: "INPUT_SCHEMA_HASH_REDUCED_SCHEMA",
|
|
7276
|
+
[MatchType.FUZZY]: "FUZZY",
|
|
7277
|
+
[MatchType.FALLBACK]: "FALLBACK"
|
|
7278
|
+
};
|
|
7279
|
+
/**
|
|
7280
|
+
* Human-readable labels for MatchScope enum values
|
|
7281
|
+
*/
|
|
7282
|
+
const MATCH_SCOPE_LABELS = {
|
|
7283
|
+
[MatchScope.UNSPECIFIED]: "UNSPECIFIED",
|
|
7284
|
+
[MatchScope.TRACE]: "TRACE",
|
|
7285
|
+
[MatchScope.GLOBAL]: "GLOBAL"
|
|
7286
|
+
};
|
|
7287
|
+
/**
|
|
7288
|
+
* Converts a MatchType enum to a human-readable label
|
|
7289
|
+
*/
|
|
7290
|
+
function getMatchTypeLabel(matchType) {
|
|
7291
|
+
return MATCH_TYPE_LABELS[matchType] ?? `UNKNOWN(${matchType})`;
|
|
7292
|
+
}
|
|
7293
|
+
/**
|
|
7294
|
+
* Converts a MatchScope enum to a human-readable label
|
|
7295
|
+
*/
|
|
7296
|
+
function getMatchScopeLabel(matchScope) {
|
|
7297
|
+
return MATCH_SCOPE_LABELS[matchScope] ?? `UNKNOWN(${matchScope})`;
|
|
7298
|
+
}
|
|
7299
|
+
/**
|
|
7300
|
+
* Formats a matchLevel object as a concise, readable string for logging
|
|
7301
|
+
*/
|
|
7302
|
+
function formatMatchLevelForLog(matchLevel) {
|
|
7303
|
+
if (!matchLevel) return "No match level info";
|
|
7304
|
+
const matchType = matchLevel.matchType ?? MatchType.UNSPECIFIED;
|
|
7305
|
+
const matchScope = matchLevel.matchScope ?? MatchScope.UNSPECIFIED;
|
|
7306
|
+
let result = `[${getMatchTypeLabel(matchType)}] scope=${getMatchScopeLabel(matchScope)}`;
|
|
7307
|
+
if (matchLevel.matchDescription) result += ` - "${matchLevel.matchDescription}"`;
|
|
7308
|
+
if (matchLevel.similarityScore !== void 0) result += ` (score: ${matchLevel.similarityScore})`;
|
|
7309
|
+
return result;
|
|
7310
|
+
}
|
|
7060
7311
|
|
|
7061
7312
|
//#endregion
|
|
7062
7313
|
//#region src/core/utils/OriginalGlobalUtils.ts
|
|
@@ -8324,7 +8575,7 @@ async function findMockResponseAsync({ mockRequestData, tuskDrift, inputValueSch
|
|
|
8324
8575
|
return null;
|
|
8325
8576
|
}
|
|
8326
8577
|
const responseBody = mockResponse.response?.response?.body;
|
|
8327
|
-
logger.debug(`Found ${outboundSpan.traceId} mock response
|
|
8578
|
+
logger.debug(`Found ${outboundSpan.traceId} mock response:`);
|
|
8328
8579
|
if (mockResponse.response?.timestamp) DateTracker.updateLatestTimestamp(replayTraceId || "", mockResponse.response.timestamp);
|
|
8329
8580
|
return { result: responseBody };
|
|
8330
8581
|
} catch (error) {
|
|
@@ -8346,7 +8597,7 @@ function findMockResponseSync({ mockRequestData, tuskDrift, inputValueSchemaMerg
|
|
|
8346
8597
|
return null;
|
|
8347
8598
|
}
|
|
8348
8599
|
const responseBody = mockResponse.response?.response?.body;
|
|
8349
|
-
logger.debug(`Found ${outboundSpan.traceId} mock response
|
|
8600
|
+
logger.debug(`Found ${outboundSpan.traceId} mock response:`);
|
|
8350
8601
|
if (mockResponse.response?.timestamp) DateTracker.updateLatestTimestamp(replayTraceId || "", mockResponse.response.timestamp);
|
|
8351
8602
|
return { result: responseBody };
|
|
8352
8603
|
} catch (error) {
|
|
@@ -8512,6 +8763,19 @@ var TdMockClientRequest = class TdMockClientRequest extends EventEmitter {
|
|
|
8512
8763
|
port: this.options.port || void 0,
|
|
8513
8764
|
timeout: this.options.timeout || void 0
|
|
8514
8765
|
};
|
|
8766
|
+
if (this.path && (this.path.startsWith("http://") || this.path.startsWith("https://"))) {
|
|
8767
|
+
const hasProxyEnv = process.env.HTTP_PROXY || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.https_proxy;
|
|
8768
|
+
try {
|
|
8769
|
+
const targetUrl = new URL(this.path);
|
|
8770
|
+
rawInputValue.hostname = targetUrl.hostname;
|
|
8771
|
+
rawInputValue.path = targetUrl.pathname + targetUrl.search;
|
|
8772
|
+
rawInputValue.port = targetUrl.port ? parseInt(targetUrl.port) : void 0;
|
|
8773
|
+
rawInputValue.protocol = targetUrl.protocol.replace(":", "");
|
|
8774
|
+
logger.debug(`[TdMockClientRequest] Detected proxy request (proxy env: ${hasProxyEnv ? "set" : "not set"}), extracted target: ${rawInputValue.hostname}${rawInputValue.path}`);
|
|
8775
|
+
} catch (e) {
|
|
8776
|
+
logger.debug("[TdMockClientRequest] Failed to parse proxy URL from path:", e);
|
|
8777
|
+
}
|
|
8778
|
+
}
|
|
8515
8779
|
if (this.requestBodyBuffers.length > 0) {
|
|
8516
8780
|
const bodyBuffer = Buffer.concat(this.requestBodyBuffers.map((chunk) => Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)));
|
|
8517
8781
|
rawInputValue.body = await httpBodyEncoder({ bodyBuffer });
|
|
@@ -9957,7 +10221,7 @@ var require_commonjs$1 = /* @__PURE__ */ __commonJS({ "node_modules/@protobuf-ts
|
|
|
9957
10221
|
}) });
|
|
9958
10222
|
|
|
9959
10223
|
//#endregion
|
|
9960
|
-
//#region node_modules/@use-tusk/drift-schemas/dist/span_export_service-
|
|
10224
|
+
//#region node_modules/@use-tusk/drift-schemas/dist/span_export_service-RmRqNxn1.js
|
|
9961
10225
|
var import_commonjs$4 = /* @__PURE__ */ __toESM(require_commonjs$1(), 1);
|
|
9962
10226
|
var import_commonjs$5 = /* @__PURE__ */ __toESM(require_commonjs$2(), 1);
|
|
9963
10227
|
var ExportSpansRequest$Type = class extends import_commonjs$5.MessageType {
|
|
@@ -33453,7 +33717,7 @@ var require_src = /* @__PURE__ */ __commonJS({ "node_modules/@opentelemetry/sdk-
|
|
|
33453
33717
|
//#endregion
|
|
33454
33718
|
//#region package.json
|
|
33455
33719
|
var import_src$1 = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
33456
|
-
var version = "0.1.
|
|
33720
|
+
var version = "0.1.26";
|
|
33457
33721
|
|
|
33458
33722
|
//#endregion
|
|
33459
33723
|
//#region src/version.ts
|
|
@@ -33461,7 +33725,7 @@ const SDK_VERSION = version;
|
|
|
33461
33725
|
const MIN_CLI_VERSION = "0.1.0";
|
|
33462
33726
|
|
|
33463
33727
|
//#endregion
|
|
33464
|
-
//#region node_modules/@use-tusk/drift-schemas/dist/communication-
|
|
33728
|
+
//#region node_modules/@use-tusk/drift-schemas/dist/communication-CVqe2frO.js
|
|
33465
33729
|
var import_commonjs = /* @__PURE__ */ __toESM(require_commonjs$1(), 1);
|
|
33466
33730
|
var import_commonjs$1 = /* @__PURE__ */ __toESM(require_commonjs$2(), 1);
|
|
33467
33731
|
/**
|
|
@@ -33803,6 +34067,12 @@ var GetMockResponse$Type = class extends import_commonjs$1.MessageType {
|
|
|
33803
34067
|
name: "matched_at",
|
|
33804
34068
|
kind: "message",
|
|
33805
34069
|
T: () => Timestamp
|
|
34070
|
+
},
|
|
34071
|
+
{
|
|
34072
|
+
no: 9,
|
|
34073
|
+
name: "match_level",
|
|
34074
|
+
kind: "message",
|
|
34075
|
+
T: () => MatchLevel
|
|
33806
34076
|
}
|
|
33807
34077
|
]);
|
|
33808
34078
|
}
|
|
@@ -33845,6 +34115,9 @@ var GetMockResponse$Type = class extends import_commonjs$1.MessageType {
|
|
|
33845
34115
|
case 8:
|
|
33846
34116
|
message.matchedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.matchedAt);
|
|
33847
34117
|
break;
|
|
34118
|
+
case 9:
|
|
34119
|
+
message.matchLevel = MatchLevel.internalBinaryRead(reader, reader.uint32(), options, message.matchLevel);
|
|
34120
|
+
break;
|
|
33848
34121
|
default:
|
|
33849
34122
|
let u = options.readUnknownField;
|
|
33850
34123
|
if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
@@ -33863,6 +34136,7 @@ var GetMockResponse$Type = class extends import_commonjs$1.MessageType {
|
|
|
33863
34136
|
if (message.errorCode !== "") writer.tag(6, import_commonjs$1.WireType.LengthDelimited).string(message.errorCode);
|
|
33864
34137
|
if (message.matchedSpanId !== "") writer.tag(7, import_commonjs$1.WireType.LengthDelimited).string(message.matchedSpanId);
|
|
33865
34138
|
if (message.matchedAt) Timestamp.internalBinaryWrite(message.matchedAt, writer.tag(8, import_commonjs$1.WireType.LengthDelimited).fork(), options).join();
|
|
34139
|
+
if (message.matchLevel) MatchLevel.internalBinaryWrite(message.matchLevel, writer.tag(9, import_commonjs$1.WireType.LengthDelimited).fork(), options).join();
|
|
33866
34140
|
let u = options.writeUnknownFields;
|
|
33867
34141
|
if (u !== false) (u == true ? import_commonjs$1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33868
34142
|
return writer;
|
|
@@ -34928,7 +35202,7 @@ var ProtobufCommunicator = class ProtobufCommunicator {
|
|
|
34928
35202
|
if (struct.fields && struct.fields["response"]) {
|
|
34929
35203
|
const responseValue = Value.toJson(struct.fields["response"]);
|
|
34930
35204
|
if (responseValue) {
|
|
34931
|
-
logger.debug("[ProtobufCommunicator] Extracted response data:", JSON.stringify(responseValue, null, 2));
|
|
35205
|
+
logger.debug("[ProtobufCommunicator] Extracted response data:", JSON.stringify(responseValue, null, 2), "\nMatch level:", formatMatchLevelForLog(mockResponse.matchLevel));
|
|
34932
35206
|
return responseValue;
|
|
34933
35207
|
}
|
|
34934
35208
|
}
|
|
@@ -35399,7 +35673,7 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35399
35673
|
logger.error("Failed to send inbound replay span:", e);
|
|
35400
35674
|
}
|
|
35401
35675
|
}
|
|
35402
|
-
createMockRequestCore(
|
|
35676
|
+
createMockRequestCore() {
|
|
35403
35677
|
if (!this.communicator || this.mode !== TuskDriftMode.REPLAY) {
|
|
35404
35678
|
logger.error("Cannot request mock: not in replay mode or no CLI connection", this.mode, this.communicator);
|
|
35405
35679
|
return {
|
|
@@ -35414,7 +35688,7 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35414
35688
|
logger.debug("Waiting for CLI connection to be established");
|
|
35415
35689
|
await this.cliConnectionPromise;
|
|
35416
35690
|
}
|
|
35417
|
-
const mockRequestCore = this.createMockRequestCore(
|
|
35691
|
+
const mockRequestCore = this.createMockRequestCore();
|
|
35418
35692
|
if (mockRequestCore) return mockRequestCore;
|
|
35419
35693
|
return this.requestMockFromCLIAsync(mockRequest);
|
|
35420
35694
|
}
|
|
@@ -35428,12 +35702,10 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35428
35702
|
}
|
|
35429
35703
|
try {
|
|
35430
35704
|
logger.debug("Sending protobuf request to CLI (async)", JSON.stringify(mockRequest, null, 2));
|
|
35431
|
-
|
|
35705
|
+
return await this.communicator.requestMockAsync({
|
|
35432
35706
|
testId: mockRequest.testId,
|
|
35433
35707
|
outboundSpan: mockRequest.outboundSpan
|
|
35434
35708
|
});
|
|
35435
|
-
logger.debug("Received protobuf response from CLI", JSON.stringify(response, null, 2));
|
|
35436
|
-
return response;
|
|
35437
35709
|
} catch (error) {
|
|
35438
35710
|
logger.error("Error sending protobuf request to CLI:", error);
|
|
35439
35711
|
return {
|
|
@@ -35447,7 +35719,7 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35447
35719
|
logger.error("Requesting sync mock but CLI is not ready yet");
|
|
35448
35720
|
throw new Error("Requesting sync mock but CLI is not ready yet");
|
|
35449
35721
|
}
|
|
35450
|
-
const mockRequestCore = this.createMockRequestCore(
|
|
35722
|
+
const mockRequestCore = this.createMockRequestCore();
|
|
35451
35723
|
if (mockRequestCore) return mockRequestCore;
|
|
35452
35724
|
return this.requestMockFromCLISync(mockRequest);
|
|
35453
35725
|
}
|
|
@@ -35461,12 +35733,10 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35461
35733
|
}
|
|
35462
35734
|
try {
|
|
35463
35735
|
logger.debug("Sending protobuf request to CLI (sync)", mockRequest);
|
|
35464
|
-
|
|
35736
|
+
return this.communicator.requestMockSync({
|
|
35465
35737
|
testId: mockRequest.testId,
|
|
35466
35738
|
outboundSpan: mockRequest.outboundSpan
|
|
35467
35739
|
});
|
|
35468
|
-
logger.debug("Received protobuf response from CLI", response);
|
|
35469
|
-
return response;
|
|
35470
35740
|
} catch (error) {
|
|
35471
35741
|
logger.error("Error sending protobuf request to CLI:", error);
|
|
35472
35742
|
return {
|