@dynamic-labs/utils 4.86.0 → 4.87.1
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/CHANGELOG.md +15 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +5 -5
- package/src/tracing/tracing.cjs +27 -4
- package/src/tracing/tracing.d.ts +16 -0
- package/src/tracing/tracing.js +27 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.87.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.87.0...v4.87.1) (2026-06-03)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## [4.87.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.86.0...v4.87.0) (2026-06-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **sdk-react-core:** instrument logout reason for Datadog observability DYNT-870 ([#11429](https://github.com/dynamic-labs/dynamic-auth/issues/11429)) ([8f9b3f3](https://github.com/dynamic-labs/dynamic-auth/commit/8f9b3f364dc711414ae59642c36f5f0a4cc4576a))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **sdk-react-core:** only flag auto-wallet abandoned on a sustained exit, not transient webview hide DYNT-870 ([#11428](https://github.com/dynamic-labs/dynamic-auth/issues/11428)) ([5984cdd](https://github.com/dynamic-labs/dynamic-auth/commit/5984cddb4ac04b226f6dd6ebe44340186902b012))
|
|
16
|
+
|
|
2
17
|
## [4.86.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.85.0...v4.86.0) (2026-06-01)
|
|
3
18
|
|
|
4
19
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.87.1",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.1015",
|
|
22
22
|
"tldts": "6.0.16",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
24
|
-
"@dynamic-labs/logger": "4.
|
|
25
|
-
"@dynamic-labs/types": "4.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.87.1",
|
|
24
|
+
"@dynamic-labs/logger": "4.87.1",
|
|
25
|
+
"@dynamic-labs/types": "4.87.1",
|
|
26
26
|
"buffer": "6.0.3",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
package/src/tracing/tracing.cjs
CHANGED
|
@@ -13,7 +13,33 @@ ${trace.payload.join('\n')}
|
|
|
13
13
|
*/
|
|
14
14
|
const createTracing = () => {
|
|
15
15
|
const traces = [];
|
|
16
|
+
const pack = (scopes) => traces
|
|
17
|
+
.filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
|
|
18
|
+
.map(formatTrace)
|
|
19
|
+
.join('\n\n');
|
|
16
20
|
return {
|
|
21
|
+
/**
|
|
22
|
+
* Ships the buffered traces to `sink` and clears them. Otherwise traces are
|
|
23
|
+
* only collected in memory and never leave the device. Logger-agnostic
|
|
24
|
+
* (caller supplies the sink) so this stays dependency-free.
|
|
25
|
+
* @param sink - Receives the packed trace string (e.g. logger.instrument)
|
|
26
|
+
* @param scopes - Optional array of scopes to flush
|
|
27
|
+
*/
|
|
28
|
+
flush: (sink, scopes) => {
|
|
29
|
+
const packed = pack(scopes);
|
|
30
|
+
if (packed) {
|
|
31
|
+
sink(packed);
|
|
32
|
+
}
|
|
33
|
+
if (scopes) {
|
|
34
|
+
// Only remove the flushed scopes
|
|
35
|
+
const scopeSet = new Set(scopes);
|
|
36
|
+
traces.splice(0, traces.length, ...traces.filter((t) => !scopeSet.has(t.scope)));
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// No scopes specified, clear all
|
|
40
|
+
traces.length = 0;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
17
43
|
/**
|
|
18
44
|
* Formats an object as a pretty-printed JSON string
|
|
19
45
|
* @param object - The object to format
|
|
@@ -37,10 +63,7 @@ const createTracing = () => {
|
|
|
37
63
|
* @param scopes - Optional array of scopes to filter traces
|
|
38
64
|
* @returns Formatted trace output as a string
|
|
39
65
|
*/
|
|
40
|
-
packScopes: (scopes) =>
|
|
41
|
-
.filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
|
|
42
|
-
.map(formatTrace)
|
|
43
|
-
.join('\n\n'),
|
|
66
|
+
packScopes: (scopes) => pack(scopes),
|
|
44
67
|
};
|
|
45
68
|
};
|
|
46
69
|
const tracing = createTracing();
|
package/src/tracing/tracing.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ type Payload = string[];
|
|
|
4
4
|
* @returns Tracing utility object
|
|
5
5
|
*/
|
|
6
6
|
export declare const createTracing: () => {
|
|
7
|
+
/**
|
|
8
|
+
* Ships the buffered traces to `sink` and clears them. Otherwise traces are
|
|
9
|
+
* only collected in memory and never leave the device. Logger-agnostic
|
|
10
|
+
* (caller supplies the sink) so this stays dependency-free.
|
|
11
|
+
* @param sink - Receives the packed trace string (e.g. logger.instrument)
|
|
12
|
+
* @param scopes - Optional array of scopes to flush
|
|
13
|
+
*/
|
|
14
|
+
flush: (sink: (packed: string) => void, scopes?: string[]) => void;
|
|
7
15
|
/**
|
|
8
16
|
* Formats an object as a pretty-printed JSON string
|
|
9
17
|
* @param object - The object to format
|
|
@@ -24,6 +32,14 @@ export declare const createTracing: () => {
|
|
|
24
32
|
packScopes: (scopes?: string[] | undefined) => string;
|
|
25
33
|
};
|
|
26
34
|
export declare const tracing: {
|
|
35
|
+
/**
|
|
36
|
+
* Ships the buffered traces to `sink` and clears them. Otherwise traces are
|
|
37
|
+
* only collected in memory and never leave the device. Logger-agnostic
|
|
38
|
+
* (caller supplies the sink) so this stays dependency-free.
|
|
39
|
+
* @param sink - Receives the packed trace string (e.g. logger.instrument)
|
|
40
|
+
* @param scopes - Optional array of scopes to flush
|
|
41
|
+
*/
|
|
42
|
+
flush: (sink: (packed: string) => void, scopes?: string[]) => void;
|
|
27
43
|
/**
|
|
28
44
|
* Formats an object as a pretty-printed JSON string
|
|
29
45
|
* @param object - The object to format
|
package/src/tracing/tracing.js
CHANGED
|
@@ -9,7 +9,33 @@ ${trace.payload.join('\n')}
|
|
|
9
9
|
*/
|
|
10
10
|
const createTracing = () => {
|
|
11
11
|
const traces = [];
|
|
12
|
+
const pack = (scopes) => traces
|
|
13
|
+
.filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
|
|
14
|
+
.map(formatTrace)
|
|
15
|
+
.join('\n\n');
|
|
12
16
|
return {
|
|
17
|
+
/**
|
|
18
|
+
* Ships the buffered traces to `sink` and clears them. Otherwise traces are
|
|
19
|
+
* only collected in memory and never leave the device. Logger-agnostic
|
|
20
|
+
* (caller supplies the sink) so this stays dependency-free.
|
|
21
|
+
* @param sink - Receives the packed trace string (e.g. logger.instrument)
|
|
22
|
+
* @param scopes - Optional array of scopes to flush
|
|
23
|
+
*/
|
|
24
|
+
flush: (sink, scopes) => {
|
|
25
|
+
const packed = pack(scopes);
|
|
26
|
+
if (packed) {
|
|
27
|
+
sink(packed);
|
|
28
|
+
}
|
|
29
|
+
if (scopes) {
|
|
30
|
+
// Only remove the flushed scopes
|
|
31
|
+
const scopeSet = new Set(scopes);
|
|
32
|
+
traces.splice(0, traces.length, ...traces.filter((t) => !scopeSet.has(t.scope)));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// No scopes specified, clear all
|
|
36
|
+
traces.length = 0;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
13
39
|
/**
|
|
14
40
|
* Formats an object as a pretty-printed JSON string
|
|
15
41
|
* @param object - The object to format
|
|
@@ -33,10 +59,7 @@ const createTracing = () => {
|
|
|
33
59
|
* @param scopes - Optional array of scopes to filter traces
|
|
34
60
|
* @returns Formatted trace output as a string
|
|
35
61
|
*/
|
|
36
|
-
packScopes: (scopes) =>
|
|
37
|
-
.filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
|
|
38
|
-
.map(formatTrace)
|
|
39
|
-
.join('\n\n'),
|
|
62
|
+
packScopes: (scopes) => pack(scopes),
|
|
40
63
|
};
|
|
41
64
|
};
|
|
42
65
|
const tracing = createTracing();
|