@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.cjs
CHANGED
|
@@ -6214,7 +6214,7 @@ var JsonSchema$Type = class extends import_commonjs$7.MessageType {
|
|
|
6214
6214
|
const JsonSchema = new JsonSchema$Type();
|
|
6215
6215
|
|
|
6216
6216
|
//#endregion
|
|
6217
|
-
//#region node_modules/@use-tusk/drift-schemas/dist/span-
|
|
6217
|
+
//#region node_modules/@use-tusk/drift-schemas/dist/span-CXrr1reB.js
|
|
6218
6218
|
var import_commonjs$6 = /* @__PURE__ */ __toESM(require_commonjs$2(), 1);
|
|
6219
6219
|
/**
|
|
6220
6220
|
* Package type classification enum
|
|
@@ -6361,6 +6361,62 @@ let StatusCode = /* @__PURE__ */ function(StatusCode$1) {
|
|
|
6361
6361
|
StatusCode$1[StatusCode$1["ERROR"] = 2] = "ERROR";
|
|
6362
6362
|
return StatusCode$1;
|
|
6363
6363
|
}({});
|
|
6364
|
+
/**
|
|
6365
|
+
* Match scope - where the match was found
|
|
6366
|
+
*
|
|
6367
|
+
* @generated from protobuf enum tusk.drift.core.v1.MatchScope
|
|
6368
|
+
*/
|
|
6369
|
+
let MatchScope = /* @__PURE__ */ function(MatchScope$1) {
|
|
6370
|
+
/**
|
|
6371
|
+
* @generated from protobuf enum value: MATCH_SCOPE_UNSPECIFIED = 0;
|
|
6372
|
+
*/
|
|
6373
|
+
MatchScope$1[MatchScope$1["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6374
|
+
/**
|
|
6375
|
+
* @generated from protobuf enum value: MATCH_SCOPE_TRACE = 1;
|
|
6376
|
+
*/
|
|
6377
|
+
MatchScope$1[MatchScope$1["TRACE"] = 1] = "TRACE";
|
|
6378
|
+
/**
|
|
6379
|
+
* @generated from protobuf enum value: MATCH_SCOPE_GLOBAL = 2;
|
|
6380
|
+
*/
|
|
6381
|
+
MatchScope$1[MatchScope$1["GLOBAL"] = 2] = "GLOBAL";
|
|
6382
|
+
return MatchScope$1;
|
|
6383
|
+
}({});
|
|
6384
|
+
/**
|
|
6385
|
+
* Match type - how the match was found
|
|
6386
|
+
*
|
|
6387
|
+
* @generated from protobuf enum tusk.drift.core.v1.MatchType
|
|
6388
|
+
*/
|
|
6389
|
+
let MatchType = /* @__PURE__ */ function(MatchType$1) {
|
|
6390
|
+
/**
|
|
6391
|
+
* @generated from protobuf enum value: MATCH_TYPE_UNSPECIFIED = 0;
|
|
6392
|
+
*/
|
|
6393
|
+
MatchType$1[MatchType$1["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
6394
|
+
/**
|
|
6395
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_VALUE_HASH = 1;
|
|
6396
|
+
*/
|
|
6397
|
+
MatchType$1[MatchType$1["INPUT_VALUE_HASH"] = 1] = "INPUT_VALUE_HASH";
|
|
6398
|
+
/**
|
|
6399
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_VALUE_HASH_REDUCED_SCHEMA = 2;
|
|
6400
|
+
*/
|
|
6401
|
+
MatchType$1[MatchType$1["INPUT_VALUE_HASH_REDUCED_SCHEMA"] = 2] = "INPUT_VALUE_HASH_REDUCED_SCHEMA";
|
|
6402
|
+
/**
|
|
6403
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_SCHEMA_HASH = 3;
|
|
6404
|
+
*/
|
|
6405
|
+
MatchType$1[MatchType$1["INPUT_SCHEMA_HASH"] = 3] = "INPUT_SCHEMA_HASH";
|
|
6406
|
+
/**
|
|
6407
|
+
* @generated from protobuf enum value: MATCH_TYPE_INPUT_SCHEMA_HASH_REDUCED_SCHEMA = 4;
|
|
6408
|
+
*/
|
|
6409
|
+
MatchType$1[MatchType$1["INPUT_SCHEMA_HASH_REDUCED_SCHEMA"] = 4] = "INPUT_SCHEMA_HASH_REDUCED_SCHEMA";
|
|
6410
|
+
/**
|
|
6411
|
+
* @generated from protobuf enum value: MATCH_TYPE_FUZZY = 5;
|
|
6412
|
+
*/
|
|
6413
|
+
MatchType$1[MatchType$1["FUZZY"] = 5] = "FUZZY";
|
|
6414
|
+
/**
|
|
6415
|
+
* @generated from protobuf enum value: MATCH_TYPE_FALLBACK = 6;
|
|
6416
|
+
*/
|
|
6417
|
+
MatchType$1[MatchType$1["FALLBACK"] = 6] = "FALLBACK";
|
|
6418
|
+
return MatchType$1;
|
|
6419
|
+
}({});
|
|
6364
6420
|
var Span$Type = class extends import_commonjs$6.MessageType {
|
|
6365
6421
|
constructor() {
|
|
6366
6422
|
super("tusk.drift.core.v1.Span", [
|
|
@@ -7007,6 +7063,157 @@ var Trace$Type = class extends import_commonjs$6.MessageType {
|
|
|
7007
7063
|
* @generated MessageType for protobuf message tusk.drift.core.v1.Trace
|
|
7008
7064
|
*/
|
|
7009
7065
|
const Trace = new Trace$Type();
|
|
7066
|
+
var SimilarityCandidate$Type = class extends import_commonjs$6.MessageType {
|
|
7067
|
+
constructor() {
|
|
7068
|
+
super("tusk.drift.core.v1.SimilarityCandidate", [{
|
|
7069
|
+
no: 1,
|
|
7070
|
+
name: "span_id",
|
|
7071
|
+
kind: "scalar",
|
|
7072
|
+
T: 9
|
|
7073
|
+
}, {
|
|
7074
|
+
no: 2,
|
|
7075
|
+
name: "score",
|
|
7076
|
+
kind: "scalar",
|
|
7077
|
+
T: 2
|
|
7078
|
+
}]);
|
|
7079
|
+
}
|
|
7080
|
+
create(value) {
|
|
7081
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
7082
|
+
message.spanId = "";
|
|
7083
|
+
message.score = 0;
|
|
7084
|
+
if (value !== void 0) (0, import_commonjs$6.reflectionMergePartial)(this, message, value);
|
|
7085
|
+
return message;
|
|
7086
|
+
}
|
|
7087
|
+
internalBinaryRead(reader, length, options, target) {
|
|
7088
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
7089
|
+
while (reader.pos < end) {
|
|
7090
|
+
let [fieldNo, wireType] = reader.tag();
|
|
7091
|
+
switch (fieldNo) {
|
|
7092
|
+
case 1:
|
|
7093
|
+
message.spanId = reader.string();
|
|
7094
|
+
break;
|
|
7095
|
+
case 2:
|
|
7096
|
+
message.score = reader.float();
|
|
7097
|
+
break;
|
|
7098
|
+
default:
|
|
7099
|
+
let u = options.readUnknownField;
|
|
7100
|
+
if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
7101
|
+
let d = reader.skip(wireType);
|
|
7102
|
+
if (u !== false) (u === true ? import_commonjs$6.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
7103
|
+
}
|
|
7104
|
+
}
|
|
7105
|
+
return message;
|
|
7106
|
+
}
|
|
7107
|
+
internalBinaryWrite(message, writer, options) {
|
|
7108
|
+
if (message.spanId !== "") writer.tag(1, import_commonjs$6.WireType.LengthDelimited).string(message.spanId);
|
|
7109
|
+
if (message.score !== 0) writer.tag(2, import_commonjs$6.WireType.Bit32).float(message.score);
|
|
7110
|
+
let u = options.writeUnknownFields;
|
|
7111
|
+
if (u !== false) (u == true ? import_commonjs$6.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
7112
|
+
return writer;
|
|
7113
|
+
}
|
|
7114
|
+
};
|
|
7115
|
+
/**
|
|
7116
|
+
* @generated MessageType for protobuf message tusk.drift.core.v1.SimilarityCandidate
|
|
7117
|
+
*/
|
|
7118
|
+
const SimilarityCandidate = new SimilarityCandidate$Type();
|
|
7119
|
+
var MatchLevel$Type = class extends import_commonjs$6.MessageType {
|
|
7120
|
+
constructor() {
|
|
7121
|
+
super("tusk.drift.core.v1.MatchLevel", [
|
|
7122
|
+
{
|
|
7123
|
+
no: 1,
|
|
7124
|
+
name: "match_type",
|
|
7125
|
+
kind: "enum",
|
|
7126
|
+
T: () => [
|
|
7127
|
+
"tusk.drift.core.v1.MatchType",
|
|
7128
|
+
MatchType,
|
|
7129
|
+
"MATCH_TYPE_"
|
|
7130
|
+
]
|
|
7131
|
+
},
|
|
7132
|
+
{
|
|
7133
|
+
no: 2,
|
|
7134
|
+
name: "match_scope",
|
|
7135
|
+
kind: "enum",
|
|
7136
|
+
T: () => [
|
|
7137
|
+
"tusk.drift.core.v1.MatchScope",
|
|
7138
|
+
MatchScope,
|
|
7139
|
+
"MATCH_SCOPE_"
|
|
7140
|
+
]
|
|
7141
|
+
},
|
|
7142
|
+
{
|
|
7143
|
+
no: 3,
|
|
7144
|
+
name: "match_description",
|
|
7145
|
+
kind: "scalar",
|
|
7146
|
+
T: 9
|
|
7147
|
+
},
|
|
7148
|
+
{
|
|
7149
|
+
no: 4,
|
|
7150
|
+
name: "similarity_score",
|
|
7151
|
+
kind: "scalar",
|
|
7152
|
+
opt: true,
|
|
7153
|
+
T: 2
|
|
7154
|
+
},
|
|
7155
|
+
{
|
|
7156
|
+
no: 5,
|
|
7157
|
+
name: "top_candidates",
|
|
7158
|
+
kind: "message",
|
|
7159
|
+
repeat: 2,
|
|
7160
|
+
T: () => SimilarityCandidate
|
|
7161
|
+
}
|
|
7162
|
+
]);
|
|
7163
|
+
}
|
|
7164
|
+
create(value) {
|
|
7165
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
7166
|
+
message.matchType = 0;
|
|
7167
|
+
message.matchScope = 0;
|
|
7168
|
+
message.matchDescription = "";
|
|
7169
|
+
message.topCandidates = [];
|
|
7170
|
+
if (value !== void 0) (0, import_commonjs$6.reflectionMergePartial)(this, message, value);
|
|
7171
|
+
return message;
|
|
7172
|
+
}
|
|
7173
|
+
internalBinaryRead(reader, length, options, target) {
|
|
7174
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
7175
|
+
while (reader.pos < end) {
|
|
7176
|
+
let [fieldNo, wireType] = reader.tag();
|
|
7177
|
+
switch (fieldNo) {
|
|
7178
|
+
case 1:
|
|
7179
|
+
message.matchType = reader.int32();
|
|
7180
|
+
break;
|
|
7181
|
+
case 2:
|
|
7182
|
+
message.matchScope = reader.int32();
|
|
7183
|
+
break;
|
|
7184
|
+
case 3:
|
|
7185
|
+
message.matchDescription = reader.string();
|
|
7186
|
+
break;
|
|
7187
|
+
case 4:
|
|
7188
|
+
message.similarityScore = reader.float();
|
|
7189
|
+
break;
|
|
7190
|
+
case 5:
|
|
7191
|
+
message.topCandidates.push(SimilarityCandidate.internalBinaryRead(reader, reader.uint32(), options));
|
|
7192
|
+
break;
|
|
7193
|
+
default:
|
|
7194
|
+
let u = options.readUnknownField;
|
|
7195
|
+
if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
7196
|
+
let d = reader.skip(wireType);
|
|
7197
|
+
if (u !== false) (u === true ? import_commonjs$6.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
7198
|
+
}
|
|
7199
|
+
}
|
|
7200
|
+
return message;
|
|
7201
|
+
}
|
|
7202
|
+
internalBinaryWrite(message, writer, options) {
|
|
7203
|
+
if (message.matchType !== 0) writer.tag(1, import_commonjs$6.WireType.Varint).int32(message.matchType);
|
|
7204
|
+
if (message.matchScope !== 0) writer.tag(2, import_commonjs$6.WireType.Varint).int32(message.matchScope);
|
|
7205
|
+
if (message.matchDescription !== "") writer.tag(3, import_commonjs$6.WireType.LengthDelimited).string(message.matchDescription);
|
|
7206
|
+
if (message.similarityScore !== void 0) writer.tag(4, import_commonjs$6.WireType.Bit32).float(message.similarityScore);
|
|
7207
|
+
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();
|
|
7208
|
+
let u = options.writeUnknownFields;
|
|
7209
|
+
if (u !== false) (u == true ? import_commonjs$6.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
7210
|
+
return writer;
|
|
7211
|
+
}
|
|
7212
|
+
};
|
|
7213
|
+
/**
|
|
7214
|
+
* @generated MessageType for protobuf message tusk.drift.core.v1.MatchLevel
|
|
7215
|
+
*/
|
|
7216
|
+
const MatchLevel = new MatchLevel$Type();
|
|
7010
7217
|
|
|
7011
7218
|
//#endregion
|
|
7012
7219
|
//#region src/core/utils/protobufUtils.ts
|
|
@@ -7068,6 +7275,50 @@ function valueToProtobufValue(value) {
|
|
|
7068
7275
|
stringValue: String(value)
|
|
7069
7276
|
} });
|
|
7070
7277
|
}
|
|
7278
|
+
/**
|
|
7279
|
+
* Human-readable labels for MatchType enum values
|
|
7280
|
+
*/
|
|
7281
|
+
const MATCH_TYPE_LABELS = {
|
|
7282
|
+
[MatchType.UNSPECIFIED]: "UNSPECIFIED",
|
|
7283
|
+
[MatchType.INPUT_VALUE_HASH]: "INPUT_VALUE_HASH",
|
|
7284
|
+
[MatchType.INPUT_VALUE_HASH_REDUCED_SCHEMA]: "INPUT_VALUE_HASH_REDUCED_SCHEMA",
|
|
7285
|
+
[MatchType.INPUT_SCHEMA_HASH]: "INPUT_SCHEMA_HASH",
|
|
7286
|
+
[MatchType.INPUT_SCHEMA_HASH_REDUCED_SCHEMA]: "INPUT_SCHEMA_HASH_REDUCED_SCHEMA",
|
|
7287
|
+
[MatchType.FUZZY]: "FUZZY",
|
|
7288
|
+
[MatchType.FALLBACK]: "FALLBACK"
|
|
7289
|
+
};
|
|
7290
|
+
/**
|
|
7291
|
+
* Human-readable labels for MatchScope enum values
|
|
7292
|
+
*/
|
|
7293
|
+
const MATCH_SCOPE_LABELS = {
|
|
7294
|
+
[MatchScope.UNSPECIFIED]: "UNSPECIFIED",
|
|
7295
|
+
[MatchScope.TRACE]: "TRACE",
|
|
7296
|
+
[MatchScope.GLOBAL]: "GLOBAL"
|
|
7297
|
+
};
|
|
7298
|
+
/**
|
|
7299
|
+
* Converts a MatchType enum to a human-readable label
|
|
7300
|
+
*/
|
|
7301
|
+
function getMatchTypeLabel(matchType) {
|
|
7302
|
+
return MATCH_TYPE_LABELS[matchType] ?? `UNKNOWN(${matchType})`;
|
|
7303
|
+
}
|
|
7304
|
+
/**
|
|
7305
|
+
* Converts a MatchScope enum to a human-readable label
|
|
7306
|
+
*/
|
|
7307
|
+
function getMatchScopeLabel(matchScope) {
|
|
7308
|
+
return MATCH_SCOPE_LABELS[matchScope] ?? `UNKNOWN(${matchScope})`;
|
|
7309
|
+
}
|
|
7310
|
+
/**
|
|
7311
|
+
* Formats a matchLevel object as a concise, readable string for logging
|
|
7312
|
+
*/
|
|
7313
|
+
function formatMatchLevelForLog(matchLevel) {
|
|
7314
|
+
if (!matchLevel) return "No match level info";
|
|
7315
|
+
const matchType = matchLevel.matchType ?? MatchType.UNSPECIFIED;
|
|
7316
|
+
const matchScope = matchLevel.matchScope ?? MatchScope.UNSPECIFIED;
|
|
7317
|
+
let result = `[${getMatchTypeLabel(matchType)}] scope=${getMatchScopeLabel(matchScope)}`;
|
|
7318
|
+
if (matchLevel.matchDescription) result += ` - "${matchLevel.matchDescription}"`;
|
|
7319
|
+
if (matchLevel.similarityScore !== void 0) result += ` (score: ${matchLevel.similarityScore})`;
|
|
7320
|
+
return result;
|
|
7321
|
+
}
|
|
7071
7322
|
|
|
7072
7323
|
//#endregion
|
|
7073
7324
|
//#region src/core/utils/OriginalGlobalUtils.ts
|
|
@@ -8335,7 +8586,7 @@ async function findMockResponseAsync({ mockRequestData, tuskDrift, inputValueSch
|
|
|
8335
8586
|
return null;
|
|
8336
8587
|
}
|
|
8337
8588
|
const responseBody = mockResponse.response?.response?.body;
|
|
8338
|
-
logger.debug(`Found ${outboundSpan.traceId} mock response
|
|
8589
|
+
logger.debug(`Found ${outboundSpan.traceId} mock response:`);
|
|
8339
8590
|
if (mockResponse.response?.timestamp) DateTracker.updateLatestTimestamp(replayTraceId || "", mockResponse.response.timestamp);
|
|
8340
8591
|
return { result: responseBody };
|
|
8341
8592
|
} catch (error) {
|
|
@@ -8357,7 +8608,7 @@ function findMockResponseSync({ mockRequestData, tuskDrift, inputValueSchemaMerg
|
|
|
8357
8608
|
return null;
|
|
8358
8609
|
}
|
|
8359
8610
|
const responseBody = mockResponse.response?.response?.body;
|
|
8360
|
-
logger.debug(`Found ${outboundSpan.traceId} mock response
|
|
8611
|
+
logger.debug(`Found ${outboundSpan.traceId} mock response:`);
|
|
8361
8612
|
if (mockResponse.response?.timestamp) DateTracker.updateLatestTimestamp(replayTraceId || "", mockResponse.response.timestamp);
|
|
8362
8613
|
return { result: responseBody };
|
|
8363
8614
|
} catch (error) {
|
|
@@ -8523,6 +8774,19 @@ var TdMockClientRequest = class TdMockClientRequest extends events.EventEmitter
|
|
|
8523
8774
|
port: this.options.port || void 0,
|
|
8524
8775
|
timeout: this.options.timeout || void 0
|
|
8525
8776
|
};
|
|
8777
|
+
if (this.path && (this.path.startsWith("http://") || this.path.startsWith("https://"))) {
|
|
8778
|
+
const hasProxyEnv = process.env.HTTP_PROXY || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.https_proxy;
|
|
8779
|
+
try {
|
|
8780
|
+
const targetUrl = new URL(this.path);
|
|
8781
|
+
rawInputValue.hostname = targetUrl.hostname;
|
|
8782
|
+
rawInputValue.path = targetUrl.pathname + targetUrl.search;
|
|
8783
|
+
rawInputValue.port = targetUrl.port ? parseInt(targetUrl.port) : void 0;
|
|
8784
|
+
rawInputValue.protocol = targetUrl.protocol.replace(":", "");
|
|
8785
|
+
logger.debug(`[TdMockClientRequest] Detected proxy request (proxy env: ${hasProxyEnv ? "set" : "not set"}), extracted target: ${rawInputValue.hostname}${rawInputValue.path}`);
|
|
8786
|
+
} catch (e) {
|
|
8787
|
+
logger.debug("[TdMockClientRequest] Failed to parse proxy URL from path:", e);
|
|
8788
|
+
}
|
|
8789
|
+
}
|
|
8526
8790
|
if (this.requestBodyBuffers.length > 0) {
|
|
8527
8791
|
const bodyBuffer = Buffer.concat(this.requestBodyBuffers.map((chunk) => Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)));
|
|
8528
8792
|
rawInputValue.body = await httpBodyEncoder({ bodyBuffer });
|
|
@@ -9968,7 +10232,7 @@ var require_commonjs$1 = /* @__PURE__ */ __commonJS({ "node_modules/@protobuf-ts
|
|
|
9968
10232
|
}) });
|
|
9969
10233
|
|
|
9970
10234
|
//#endregion
|
|
9971
|
-
//#region node_modules/@use-tusk/drift-schemas/dist/span_export_service-
|
|
10235
|
+
//#region node_modules/@use-tusk/drift-schemas/dist/span_export_service-RmRqNxn1.js
|
|
9972
10236
|
var import_commonjs$4 = /* @__PURE__ */ __toESM(require_commonjs$1(), 1);
|
|
9973
10237
|
var import_commonjs$5 = /* @__PURE__ */ __toESM(require_commonjs$2(), 1);
|
|
9974
10238
|
var ExportSpansRequest$Type = class extends import_commonjs$5.MessageType {
|
|
@@ -33464,7 +33728,7 @@ var require_src = /* @__PURE__ */ __commonJS({ "node_modules/@opentelemetry/sdk-
|
|
|
33464
33728
|
//#endregion
|
|
33465
33729
|
//#region package.json
|
|
33466
33730
|
var import_src$1 = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
33467
|
-
var version = "0.1.
|
|
33731
|
+
var version = "0.1.26";
|
|
33468
33732
|
|
|
33469
33733
|
//#endregion
|
|
33470
33734
|
//#region src/version.ts
|
|
@@ -33472,7 +33736,7 @@ const SDK_VERSION = version;
|
|
|
33472
33736
|
const MIN_CLI_VERSION = "0.1.0";
|
|
33473
33737
|
|
|
33474
33738
|
//#endregion
|
|
33475
|
-
//#region node_modules/@use-tusk/drift-schemas/dist/communication-
|
|
33739
|
+
//#region node_modules/@use-tusk/drift-schemas/dist/communication-CVqe2frO.js
|
|
33476
33740
|
var import_commonjs = /* @__PURE__ */ __toESM(require_commonjs$1(), 1);
|
|
33477
33741
|
var import_commonjs$1 = /* @__PURE__ */ __toESM(require_commonjs$2(), 1);
|
|
33478
33742
|
/**
|
|
@@ -33814,6 +34078,12 @@ var GetMockResponse$Type = class extends import_commonjs$1.MessageType {
|
|
|
33814
34078
|
name: "matched_at",
|
|
33815
34079
|
kind: "message",
|
|
33816
34080
|
T: () => Timestamp
|
|
34081
|
+
},
|
|
34082
|
+
{
|
|
34083
|
+
no: 9,
|
|
34084
|
+
name: "match_level",
|
|
34085
|
+
kind: "message",
|
|
34086
|
+
T: () => MatchLevel
|
|
33817
34087
|
}
|
|
33818
34088
|
]);
|
|
33819
34089
|
}
|
|
@@ -33856,6 +34126,9 @@ var GetMockResponse$Type = class extends import_commonjs$1.MessageType {
|
|
|
33856
34126
|
case 8:
|
|
33857
34127
|
message.matchedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.matchedAt);
|
|
33858
34128
|
break;
|
|
34129
|
+
case 9:
|
|
34130
|
+
message.matchLevel = MatchLevel.internalBinaryRead(reader, reader.uint32(), options, message.matchLevel);
|
|
34131
|
+
break;
|
|
33859
34132
|
default:
|
|
33860
34133
|
let u = options.readUnknownField;
|
|
33861
34134
|
if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
@@ -33874,6 +34147,7 @@ var GetMockResponse$Type = class extends import_commonjs$1.MessageType {
|
|
|
33874
34147
|
if (message.errorCode !== "") writer.tag(6, import_commonjs$1.WireType.LengthDelimited).string(message.errorCode);
|
|
33875
34148
|
if (message.matchedSpanId !== "") writer.tag(7, import_commonjs$1.WireType.LengthDelimited).string(message.matchedSpanId);
|
|
33876
34149
|
if (message.matchedAt) Timestamp.internalBinaryWrite(message.matchedAt, writer.tag(8, import_commonjs$1.WireType.LengthDelimited).fork(), options).join();
|
|
34150
|
+
if (message.matchLevel) MatchLevel.internalBinaryWrite(message.matchLevel, writer.tag(9, import_commonjs$1.WireType.LengthDelimited).fork(), options).join();
|
|
33877
34151
|
let u = options.writeUnknownFields;
|
|
33878
34152
|
if (u !== false) (u == true ? import_commonjs$1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33879
34153
|
return writer;
|
|
@@ -34939,7 +35213,7 @@ var ProtobufCommunicator = class ProtobufCommunicator {
|
|
|
34939
35213
|
if (struct.fields && struct.fields["response"]) {
|
|
34940
35214
|
const responseValue = Value.toJson(struct.fields["response"]);
|
|
34941
35215
|
if (responseValue) {
|
|
34942
|
-
logger.debug("[ProtobufCommunicator] Extracted response data:", JSON.stringify(responseValue, null, 2));
|
|
35216
|
+
logger.debug("[ProtobufCommunicator] Extracted response data:", JSON.stringify(responseValue, null, 2), "\nMatch level:", formatMatchLevelForLog(mockResponse.matchLevel));
|
|
34943
35217
|
return responseValue;
|
|
34944
35218
|
}
|
|
34945
35219
|
}
|
|
@@ -35410,7 +35684,7 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35410
35684
|
logger.error("Failed to send inbound replay span:", e);
|
|
35411
35685
|
}
|
|
35412
35686
|
}
|
|
35413
|
-
createMockRequestCore(
|
|
35687
|
+
createMockRequestCore() {
|
|
35414
35688
|
if (!this.communicator || this.mode !== TuskDriftMode.REPLAY) {
|
|
35415
35689
|
logger.error("Cannot request mock: not in replay mode or no CLI connection", this.mode, this.communicator);
|
|
35416
35690
|
return {
|
|
@@ -35425,7 +35699,7 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35425
35699
|
logger.debug("Waiting for CLI connection to be established");
|
|
35426
35700
|
await this.cliConnectionPromise;
|
|
35427
35701
|
}
|
|
35428
|
-
const mockRequestCore = this.createMockRequestCore(
|
|
35702
|
+
const mockRequestCore = this.createMockRequestCore();
|
|
35429
35703
|
if (mockRequestCore) return mockRequestCore;
|
|
35430
35704
|
return this.requestMockFromCLIAsync(mockRequest);
|
|
35431
35705
|
}
|
|
@@ -35439,12 +35713,10 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35439
35713
|
}
|
|
35440
35714
|
try {
|
|
35441
35715
|
logger.debug("Sending protobuf request to CLI (async)", JSON.stringify(mockRequest, null, 2));
|
|
35442
|
-
|
|
35716
|
+
return await this.communicator.requestMockAsync({
|
|
35443
35717
|
testId: mockRequest.testId,
|
|
35444
35718
|
outboundSpan: mockRequest.outboundSpan
|
|
35445
35719
|
});
|
|
35446
|
-
logger.debug("Received protobuf response from CLI", JSON.stringify(response, null, 2));
|
|
35447
|
-
return response;
|
|
35448
35720
|
} catch (error) {
|
|
35449
35721
|
logger.error("Error sending protobuf request to CLI:", error);
|
|
35450
35722
|
return {
|
|
@@ -35458,7 +35730,7 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35458
35730
|
logger.error("Requesting sync mock but CLI is not ready yet");
|
|
35459
35731
|
throw new Error("Requesting sync mock but CLI is not ready yet");
|
|
35460
35732
|
}
|
|
35461
|
-
const mockRequestCore = this.createMockRequestCore(
|
|
35733
|
+
const mockRequestCore = this.createMockRequestCore();
|
|
35462
35734
|
if (mockRequestCore) return mockRequestCore;
|
|
35463
35735
|
return this.requestMockFromCLISync(mockRequest);
|
|
35464
35736
|
}
|
|
@@ -35472,12 +35744,10 @@ var TuskDriftCore = class TuskDriftCore {
|
|
|
35472
35744
|
}
|
|
35473
35745
|
try {
|
|
35474
35746
|
logger.debug("Sending protobuf request to CLI (sync)", mockRequest);
|
|
35475
|
-
|
|
35747
|
+
return this.communicator.requestMockSync({
|
|
35476
35748
|
testId: mockRequest.testId,
|
|
35477
35749
|
outboundSpan: mockRequest.outboundSpan
|
|
35478
35750
|
});
|
|
35479
|
-
logger.debug("Received protobuf response from CLI", response);
|
|
35480
|
-
return response;
|
|
35481
35751
|
} catch (error) {
|
|
35482
35752
|
logger.error("Error sending protobuf request to CLI:", error);
|
|
35483
35753
|
return {
|