@dynamic-labs/logger 5.6.1 → 5.8.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/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
|
|
2
|
+
## [5.8.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.7.0...v5.8.0) (2026-09-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **solana-core:** standalone sponsored ATA creation ([#12365](https://github.com/dynamic-labs/dynamic-auth/issues/12365)) ([ac2e776](https://github.com/dynamic-labs/dynamic-auth/commit/ac2e7769fcf91c868e961a227b8acb6347bf3f13))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* do not report wallets installed from a provider selection router ([#12340](https://github.com/dynamic-labs/dynamic-auth/issues/12340)) ([dac5546](https://github.com/dynamic-labs/dynamic-auth/commit/dac5546edf6004c37bd84dd2089d94952949230b))
|
|
13
|
+
* **screening:** soften the blocked-wallet copy to be provider-neutral ([#12358](https://github.com/dynamic-labs/dynamic-auth/issues/12358)) ([b4854d8](https://github.com/dynamic-labs/dynamic-auth/commit/b4854d88fa67f684be0e133edd5fd4a4bf5c7f37))
|
|
14
|
+
* show transaction amount when simulation returns no transfers ([#12355](https://github.com/dynamic-labs/dynamic-auth/issues/12355)) ([bfaf337](https://github.com/dynamic-labs/dynamic-auth/commit/bfaf337e5350970f71255baff065e0cdbccdc7ca))
|
|
15
|
+
|
|
16
|
+
## [5.7.0](https://github.com/dynamic-labs/dynamic-auth/compare/v5.6.1...v5.7.0) (2026-09-08)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **social:** add gemini social provider ([#12292](https://github.com/dynamic-labs/dynamic-auth/issues/12292)) ([fa72cb0](https://github.com/dynamic-labs/dynamic-auth/commit/fa72cb09f678506a5f34188eb7d62415bcb7073b))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **locale:** add missing dyn_upgrade_wallet.no_legacy_wallets and .close keys ([#12350](https://github.com/dynamic-labs/dynamic-auth/issues/12350)) ([50da3fa](https://github.com/dynamic-labs/dynamic-auth/commit/50da3fa3078de4ecbd88031a3e533a4ff6ced89b))
|
|
27
|
+
* **sdk-react-core:** expose SDK i18next instance for extension packages ([#12351](https://github.com/dynamic-labs/dynamic-auth/issues/12351)) ([f3d95b1](https://github.com/dynamic-labs/dynamic-auth/commit/f3d95b1bb1c30114d32d93dec4e9c2455ab4fdbb))
|
|
28
|
+
* **sdk-react-core:** publish ./icons and ./components subpath exports ([#12334](https://github.com/dynamic-labs/dynamic-auth/issues/12334)) ([519487c](https://github.com/dynamic-labs/dynamic-auth/commit/519487cf5f4f7abe895a125c5bf38800cae04bb5))
|
|
29
|
+
|
|
2
30
|
### [5.6.1](https://github.com/dynamic-labs/dynamic-auth/compare/v5.6.0...v5.6.1) (2026-09-01)
|
|
3
31
|
|
|
4
32
|
|
package/package.json
CHANGED
package/src/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var EventEmitter = require('eventemitter3');
|
|
|
8
8
|
var MetaData = require('./MetaData/MetaData.cjs');
|
|
9
9
|
var types = require('./types.cjs');
|
|
10
10
|
var createCircularReferenceReplacer = require('./utils/createCircularReferenceReplacer.cjs');
|
|
11
|
+
var createLogPayloadReplacer = require('./utils/createLogPayloadReplacer.cjs');
|
|
11
12
|
var mapLogLevel = require('./utils/mapLogLevel.cjs');
|
|
12
13
|
var processArgs = require('./utils/processArgs.cjs');
|
|
13
14
|
var getStack = require('./utils/getStack.cjs');
|
|
@@ -196,7 +197,7 @@ class Logger {
|
|
|
196
197
|
throw new Error('Environment ID not set');
|
|
197
198
|
}
|
|
198
199
|
yield fetch(`https://logs.dynamicauth.com/api/v1/${globalState.keys.environmentId}`, {
|
|
199
|
-
body: JSON.stringify(messages),
|
|
200
|
+
body: JSON.stringify(messages, createLogPayloadReplacer.createLogPayloadReplacer()),
|
|
200
201
|
headers: {
|
|
201
202
|
'Content-Type': 'application/json',
|
|
202
203
|
},
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { MetaData } from './MetaData/MetaData.js';
|
|
|
5
5
|
import { LogLevel } from './types.js';
|
|
6
6
|
export { LogLevel } from './types.js';
|
|
7
7
|
import { createCircularReferenceReplacer } from './utils/createCircularReferenceReplacer.js';
|
|
8
|
+
import { createLogPayloadReplacer } from './utils/createLogPayloadReplacer.js';
|
|
8
9
|
import { mapLogLevel } from './utils/mapLogLevel.js';
|
|
9
10
|
import { processArgs } from './utils/processArgs.js';
|
|
10
11
|
import { getStack } from './utils/getStack.js';
|
|
@@ -189,7 +190,7 @@ class Logger {
|
|
|
189
190
|
throw new Error('Environment ID not set');
|
|
190
191
|
}
|
|
191
192
|
yield fetch(`https://logs.dynamicauth.com/api/v1/${globalState.keys.environmentId}`, {
|
|
192
|
-
body: JSON.stringify(messages),
|
|
193
|
+
body: JSON.stringify(messages, createLogPayloadReplacer()),
|
|
193
194
|
headers: {
|
|
194
195
|
'Content-Type': 'application/json',
|
|
195
196
|
},
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var createCircularReferenceReplacer = require('./createCircularReferenceReplacer.cjs');
|
|
7
|
+
|
|
8
|
+
const getSerializableFields = (value) => {
|
|
9
|
+
const isRecord = typeof value === 'object' && value !== null;
|
|
10
|
+
if (isRecord) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
return {};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Returns a JSON.stringify replacer for outgoing log payloads: it skips
|
|
17
|
+
* circular references and serializes Error instances, whose own fields are not
|
|
18
|
+
* enumerable and would otherwise be sent as `{}`.
|
|
19
|
+
*
|
|
20
|
+
* Errors are shaped like CustomError.toJSON (`error` holds the message) so a
|
|
21
|
+
* plain Error and a DynamicError land on the same log attributes.
|
|
22
|
+
*/
|
|
23
|
+
const createLogPayloadReplacer = () => {
|
|
24
|
+
const skipCircularReferences = createCircularReferenceReplacer.createCircularReferenceReplacer();
|
|
25
|
+
// `JSON.stringify` walks the payload depth first, and the value it hands back
|
|
26
|
+
// to the replacer becomes the holder of that value's own keys, so the holders
|
|
27
|
+
// leading to the current key are tracked to tell an error already on the
|
|
28
|
+
// current path from one merely serialized earlier somewhere else.
|
|
29
|
+
const holders = [];
|
|
30
|
+
const errorsByHolder = new WeakMap();
|
|
31
|
+
const isOnCurrentPath = (error) => holders.some((holder) => typeof holder === 'object' &&
|
|
32
|
+
holder !== null &&
|
|
33
|
+
errorsByHolder.get(holder) === error);
|
|
34
|
+
return function (key, value) {
|
|
35
|
+
while (holders.length > 0 && holders[holders.length - 1] !== this) {
|
|
36
|
+
holders.pop();
|
|
37
|
+
}
|
|
38
|
+
// `JSON.stringify` applies `toJSON` before handing the value to a replacer,
|
|
39
|
+
// so errors are read from the holder to reach the fields they do not
|
|
40
|
+
// expose through `toJSON`.
|
|
41
|
+
const rawValue = this[key];
|
|
42
|
+
if (rawValue instanceof Error) {
|
|
43
|
+
if (isOnCurrentPath(rawValue)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const { code } = rawValue;
|
|
47
|
+
const serializedError = Object.assign(Object.assign({}, getSerializableFields(value)), { code, error: rawValue.message, name: rawValue.name, stack: rawValue.stack });
|
|
48
|
+
errorsByHolder.set(serializedError, rawValue);
|
|
49
|
+
holders.push(serializedError);
|
|
50
|
+
return serializedError;
|
|
51
|
+
}
|
|
52
|
+
const serialized = skipCircularReferences(key, value);
|
|
53
|
+
if (typeof serialized === 'object' && serialized !== null) {
|
|
54
|
+
holders.push(serialized);
|
|
55
|
+
}
|
|
56
|
+
return serialized;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.createLogPayloadReplacer = createLogPayloadReplacer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a JSON.stringify replacer for outgoing log payloads: it skips
|
|
3
|
+
* circular references and serializes Error instances, whose own fields are not
|
|
4
|
+
* enumerable and would otherwise be sent as `{}`.
|
|
5
|
+
*
|
|
6
|
+
* Errors are shaped like CustomError.toJSON (`error` holds the message) so a
|
|
7
|
+
* plain Error and a DynamicError land on the same log attributes.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createLogPayloadReplacer: () => (this: Record<string, unknown>, key: string, value: unknown) => unknown;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { createCircularReferenceReplacer } from './createCircularReferenceReplacer.js';
|
|
3
|
+
|
|
4
|
+
const getSerializableFields = (value) => {
|
|
5
|
+
const isRecord = typeof value === 'object' && value !== null;
|
|
6
|
+
if (isRecord) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
return {};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Returns a JSON.stringify replacer for outgoing log payloads: it skips
|
|
13
|
+
* circular references and serializes Error instances, whose own fields are not
|
|
14
|
+
* enumerable and would otherwise be sent as `{}`.
|
|
15
|
+
*
|
|
16
|
+
* Errors are shaped like CustomError.toJSON (`error` holds the message) so a
|
|
17
|
+
* plain Error and a DynamicError land on the same log attributes.
|
|
18
|
+
*/
|
|
19
|
+
const createLogPayloadReplacer = () => {
|
|
20
|
+
const skipCircularReferences = createCircularReferenceReplacer();
|
|
21
|
+
// `JSON.stringify` walks the payload depth first, and the value it hands back
|
|
22
|
+
// to the replacer becomes the holder of that value's own keys, so the holders
|
|
23
|
+
// leading to the current key are tracked to tell an error already on the
|
|
24
|
+
// current path from one merely serialized earlier somewhere else.
|
|
25
|
+
const holders = [];
|
|
26
|
+
const errorsByHolder = new WeakMap();
|
|
27
|
+
const isOnCurrentPath = (error) => holders.some((holder) => typeof holder === 'object' &&
|
|
28
|
+
holder !== null &&
|
|
29
|
+
errorsByHolder.get(holder) === error);
|
|
30
|
+
return function (key, value) {
|
|
31
|
+
while (holders.length > 0 && holders[holders.length - 1] !== this) {
|
|
32
|
+
holders.pop();
|
|
33
|
+
}
|
|
34
|
+
// `JSON.stringify` applies `toJSON` before handing the value to a replacer,
|
|
35
|
+
// so errors are read from the holder to reach the fields they do not
|
|
36
|
+
// expose through `toJSON`.
|
|
37
|
+
const rawValue = this[key];
|
|
38
|
+
if (rawValue instanceof Error) {
|
|
39
|
+
if (isOnCurrentPath(rawValue)) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
const { code } = rawValue;
|
|
43
|
+
const serializedError = Object.assign(Object.assign({}, getSerializableFields(value)), { code, error: rawValue.message, name: rawValue.name, stack: rawValue.stack });
|
|
44
|
+
errorsByHolder.set(serializedError, rawValue);
|
|
45
|
+
holders.push(serializedError);
|
|
46
|
+
return serializedError;
|
|
47
|
+
}
|
|
48
|
+
const serialized = skipCircularReferences(key, value);
|
|
49
|
+
if (typeof serialized === 'object' && serialized !== null) {
|
|
50
|
+
holders.push(serialized);
|
|
51
|
+
}
|
|
52
|
+
return serialized;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { createLogPayloadReplacer };
|