@use-tusk/drift-node-sdk 0.1.16 → 0.1.17
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 +7 -0
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,6 +31,13 @@ For comprehensive guides and API reference, visit our [full documentation](https
|
|
|
31
31
|
- [Quick Start Guide](docs/quickstart.md) - Record and replay your first trace
|
|
32
32
|
- [Troubleshooting Guide](docs/troubleshooting.md) - Common issues and solutions
|
|
33
33
|
|
|
34
|
+
<div align="center">
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
|
|
34
41
|
## Requirements
|
|
35
42
|
|
|
36
43
|
Tusk Drift currently supports the following packages and versions:
|
package/dist/index.cjs
CHANGED
|
@@ -7864,7 +7864,10 @@ function getDecodedType(contentType) {
|
|
|
7864
7864
|
logger.debug(`Invalid Content-Type header: ${contentType}`);
|
|
7865
7865
|
return;
|
|
7866
7866
|
}
|
|
7867
|
-
|
|
7867
|
+
const mainType = contentTypeString.toLowerCase().split(";")[0].trim();
|
|
7868
|
+
const decodedType = CONTENT_TYPE_MAPPING[mainType];
|
|
7869
|
+
if (decodedType !== void 0) return decodedType;
|
|
7870
|
+
if (mainType.includes("json")) return DecodedType.JSON;
|
|
7868
7871
|
}
|
|
7869
7872
|
const ACCEPTABLE_CONTENT_TYPES = new Set([DecodedType.JSON, DecodedType.PLAIN_TEXT]);
|
|
7870
7873
|
|
|
@@ -8209,10 +8212,17 @@ var JsonSchemaHelper = class JsonSchemaHelper {
|
|
|
8209
8212
|
static decodeDataWithMerges(data, schemaMerges) {
|
|
8210
8213
|
if (!schemaMerges) return data;
|
|
8211
8214
|
const decodedData = { ...data };
|
|
8212
|
-
for (const [key, schema] of Object.entries(schemaMerges)) if (schema.encoding &&
|
|
8215
|
+
for (const [key, schema] of Object.entries(schemaMerges)) if (schema.encoding && data[key] !== void 0) try {
|
|
8213
8216
|
let decodedValue = data[key];
|
|
8214
|
-
if (
|
|
8215
|
-
|
|
8217
|
+
if (typeof decodedValue === "string") {
|
|
8218
|
+
if (schema.encoding === EncodingType.BASE64) decodedValue = Buffer.from(decodedValue, "base64").toString("utf8");
|
|
8219
|
+
if (schema.decodedType === DecodedType.JSON) decodedValue = JSON.parse(decodedValue);
|
|
8220
|
+
else if (!schema.decodedType) try {
|
|
8221
|
+
decodedValue = JSON.parse(decodedValue);
|
|
8222
|
+
} catch {
|
|
8223
|
+
logger.debug(`[JsonSchemaHelper] Failed to parse JSON for key: ${key}, no decodedType specified`);
|
|
8224
|
+
}
|
|
8225
|
+
}
|
|
8216
8226
|
decodedData[key] = decodedValue;
|
|
8217
8227
|
} catch (error) {
|
|
8218
8228
|
logger.debug(`[JsonSchemaHelper] Failed to decode ${key}:`, error);
|
|
@@ -32057,7 +32067,7 @@ var require_src = /* @__PURE__ */ __commonJS({ "node_modules/@opentelemetry/sdk-
|
|
|
32057
32067
|
//#endregion
|
|
32058
32068
|
//#region package.json
|
|
32059
32069
|
var import_src$1 = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
32060
|
-
var version = "0.1.
|
|
32070
|
+
var version = "0.1.17";
|
|
32061
32071
|
|
|
32062
32072
|
//#endregion
|
|
32063
32073
|
//#region src/version.ts
|