@aa-sdk/core 4.84.0 → 4.86.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/dist/esm/utils/traceHeader.d.ts +8 -4
- package/dist/esm/utils/traceHeader.js +8 -4
- package/dist/esm/utils/traceHeader.js.map +1 -1
- package/dist/esm/utils/types.d.ts +4 -3
- package/dist/esm/utils/types.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/utils/traceHeader.d.ts +8 -4
- package/dist/types/utils/traceHeader.d.ts.map +1 -1
- package/dist/types/utils/types.d.ts +4 -3
- package/dist/types/utils/types.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/utils/traceHeader.ts +8 -4
- package/src/utils/types.ts +4 -3
- package/src/version.ts +1 -1
|
@@ -33,7 +33,8 @@ export declare class TraceHeader {
|
|
|
33
33
|
/**
|
|
34
34
|
* Creating a default trace id that is a random setup for both trace id and parent id
|
|
35
35
|
*
|
|
36
|
-
* @example
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
37
38
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
38
39
|
* ```
|
|
39
40
|
*
|
|
@@ -43,7 +44,8 @@ export declare class TraceHeader {
|
|
|
43
44
|
/**
|
|
44
45
|
* Should be able to consume a trace header from the headers of an http request
|
|
45
46
|
*
|
|
46
|
-
* @example
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
47
49
|
* const traceHeader = TraceHeader.fromTraceHeader(headers);
|
|
48
50
|
* ```
|
|
49
51
|
*
|
|
@@ -54,7 +56,8 @@ export declare class TraceHeader {
|
|
|
54
56
|
/**
|
|
55
57
|
* Should be able to convert the trace header to the format that is used in the headers of an http request
|
|
56
58
|
*
|
|
57
|
-
* @example
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
58
61
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
59
62
|
* const headers = traceHeader.toTraceHeader();
|
|
60
63
|
* ```
|
|
@@ -70,7 +73,8 @@ export declare class TraceHeader {
|
|
|
70
73
|
* as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the
|
|
71
74
|
* trace parent gets updated as according to the docs
|
|
72
75
|
*
|
|
73
|
-
* @example
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
74
78
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
75
79
|
* const newTraceHeader = traceHeader.withEvent("newEvent");
|
|
76
80
|
* ```
|
|
@@ -65,7 +65,8 @@ export class TraceHeader {
|
|
|
65
65
|
/**
|
|
66
66
|
* Creating a default trace id that is a random setup for both trace id and parent id
|
|
67
67
|
*
|
|
68
|
-
* @example
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
69
70
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
70
71
|
* ```
|
|
71
72
|
*
|
|
@@ -78,7 +79,8 @@ export class TraceHeader {
|
|
|
78
79
|
/**
|
|
79
80
|
* Should be able to consume a trace header from the headers of an http request
|
|
80
81
|
*
|
|
81
|
-
* @example
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
82
84
|
* const traceHeader = TraceHeader.fromTraceHeader(headers);
|
|
83
85
|
* ```
|
|
84
86
|
*
|
|
@@ -104,7 +106,8 @@ export class TraceHeader {
|
|
|
104
106
|
/**
|
|
105
107
|
* Should be able to convert the trace header to the format that is used in the headers of an http request
|
|
106
108
|
*
|
|
107
|
-
* @example
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
108
111
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
109
112
|
* const headers = traceHeader.toTraceHeader();
|
|
110
113
|
* ```
|
|
@@ -124,7 +127,8 @@ export class TraceHeader {
|
|
|
124
127
|
* as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the
|
|
125
128
|
* trace parent gets updated as according to the docs
|
|
126
129
|
*
|
|
127
|
-
* @example
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
128
132
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
129
133
|
* const newTraceHeader = traceHeader.withEvent("newEvent");
|
|
130
134
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceHeader.js","sourceRoot":"","sources":["../../../src/utils/traceHeader.ts"],"names":[],"mappings":"AAAA,SAAS,uBAAuB,CAAC,QAAgB;IAC/C,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CACpD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;SAC3B,QAAQ,CAAC,EAAE,CAAC;SACZ,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CACpB,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAC/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE/C,MAAM,aAAa,GAAG,uBAAuB,CAAC,EAAE,CAAC,CAAC;AAClD;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAMtB;;;;;;;OAOG;IACH,YACE,OAAe,EACf,QAAgB,EAChB,UAAkB,EAClB,UAAqC;QAjB9B;;;;;WAAgB;QAChB;;;;;WAAiB;QACjB;;;;;WAAmB;QACnB;;;;;WAAmC;QAgB1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACz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C,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;iBACxC,IAAI,CAAC,GAAG,CAAC;SACJ,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,SAAiB;QACzB,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW;YAC7C,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,IAAI,SAAS,EAAE;YAC/C,CAAC,CAAC,SAAS,CAAC;QACd,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,EAAE;YACnE,GAAG,IAAI,CAAC,UAAU;YAClB,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["function generateRandomHexString(numBytes: number) {\n const hexPairs = new Array(numBytes).fill(0).map(() =>\n Math.floor(Math.random() * 16)\n .toString(16)\n .padStart(2, \"0\"),\n );\n return hexPairs.join(\"\");\n}\n\n/**\n * These are the headers that are used in the trace headers, could be found in the spec\n *\n * @see https://www.w3.org/TR/trace-context/#design-overview\n */\n\nexport const TRACE_HEADER_NAME = \"traceparent\";\n/**\n * These are the headers that are used in the trace headers, could be found in the spec\n *\n * @see https://www.w3.org/TR/trace-context/#design-overview\n */\nexport const TRACE_HEADER_STATE = \"tracestate\";\n\nconst clientTraceId = generateRandomHexString(16);\n/**\n * Some tools that are useful when dealing with the values\n * of the trace header. Follows the W3C trace context standard.\n *\n * @see https://www.w3.org/TR/trace-context/\n */\nexport class TraceHeader {\n readonly traceId: string;\n readonly parentId: string;\n readonly traceFlags: string;\n readonly traceState: Record<string, string>;\n\n /**\n * Initializes a new instance with the provided trace identifiers and state information.\n *\n * @param {string} traceId The unique identifier for the trace\n * @param {string} parentId The identifier of the parent trace\n * @param {string} traceFlags Flags containing trace-related options\n * @param {TraceHeader[\"traceState\"]} traceState The trace state information for additional trace context\n */\n constructor(\n traceId: string,\n parentId: string,\n traceFlags: string,\n traceState: TraceHeader[\"traceState\"],\n ) {\n this.traceId = traceId;\n this.parentId = parentId;\n this.traceFlags = traceFlags;\n this.traceState = traceState;\n }\n\n /**\n * Creating a default trace id that is a random setup for both trace id and parent id\n *\n * @example\n * ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();\n * ```\n *\n * @returns {TraceHeader} A default trace header\n */\n static default() {\n return new TraceHeader(\n clientTraceId,\n generateRandomHexString(8),\n \"00\", //Means no flag have been set, and no sampled state https://www.w3.org/TR/trace-context/#trace-flags\n {},\n );\n }\n /**\n * Should be able to consume a trace header from the headers of an http request\n *\n * @example\n * ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers);\n * ```\n *\n * @param {Record<string,string>} headers The headers from the http request\n * @returns {TraceHeader | undefined} The trace header object, or nothing if not found\n */\n static fromTraceHeader(\n headers: Record<string, string>,\n ): TraceHeader | undefined {\n if (!headers[TRACE_HEADER_NAME]) {\n return undefined;\n }\n const [version, traceId, parentId, traceFlags] =\n headers[TRACE_HEADER_NAME]?.split(\"-\");\n\n const traceState =\n headers[TRACE_HEADER_STATE]?.split(\",\").reduce(\n (acc, curr) => {\n const [key, value] = curr.split(\"=\");\n acc[key] = value;\n return acc;\n },\n {} as Record<string, string>,\n ) || {};\n if (version !== \"00\") {\n console.debug(\n new Error(\n `Invalid version for traceheader: ${headers[TRACE_HEADER_NAME]}`,\n ),\n );\n return undefined;\n }\n return new TraceHeader(traceId, parentId, traceFlags, traceState);\n }\n\n /**\n * Should be able to convert the trace header to the format that is used in the headers of an http request\n *\n * @example\n * ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();\n * const headers = traceHeader.toTraceHeader();\n * ```\n *\n * @returns {{traceparent: string, tracestate: string}} The trace header in the format of a record, used in our http client\n */\n toTraceHeader() {\n return {\n [TRACE_HEADER_NAME]: `00-${this.traceId}-${this.parentId}-${this.traceFlags}`,\n [TRACE_HEADER_STATE]: Object.entries(this.traceState)\n .map(([key, value]) => `${key}=${value}`)\n .join(\",\"),\n } as const;\n }\n\n /**\n * Should be able to create a new trace header with a new event in the trace state,\n * as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the\n * trace parent gets updated as according to the docs\n *\n * @example\n * ```ts\n * const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();\n * const newTraceHeader = traceHeader.withEvent(\"newEvent\");\n * ```\n *\n * @param {string} eventName The key of the new event\n * @returns {TraceHeader} The new trace header\n */\n withEvent(eventName: string): TraceHeader {\n const breadcrumbs = this.traceState.breadcrumbs\n ? `${this.traceState.breadcrumbs}-${eventName}`\n : eventName;\n return new TraceHeader(this.traceId, this.parentId, this.traceFlags, {\n ...this.traceState,\n breadcrumbs,\n });\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Constructs a type by excluding `undefined` from `T`.
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* NoUndefined<string | undefined>
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type NoUndefined<T> = T extends undefined ? never : T;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Checks if T is `undefined`
|
|
11
|
+
*
|
|
11
12
|
* @param T - Type to check
|
|
12
13
|
* @example
|
|
13
14
|
* type Result = IsUndefined<undefined>
|
|
@@ -19,7 +20,7 @@ export type Never<T> = T extends object ? {
|
|
|
19
20
|
} : never;
|
|
20
21
|
export type RequiredBy<TType, TKeys extends keyof TType> = Required<Pick<TType, TKeys>> & Omit<TType, TKeys>;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
* Combines members of an intersection into a readable type.
|
|
23
24
|
*
|
|
24
25
|
* @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
25
26
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,qBAAqB","sourcesContent":["// borrowed from viem\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,qBAAqB","sourcesContent":["// borrowed from viem\n\n/**\n * Constructs a type by excluding `undefined` from `T`.\n *\n * @example\n * NoUndefined<string | undefined>\n * => string\n */\nexport type NoUndefined<T> = T extends undefined ? never : T;\n// borrowed from viem\n/**\n * Checks if T is `undefined`\n *\n * @param T - Type to check\n * @example\n * type Result = IsUndefined<undefined>\n * // ^? type Result = true\n */\n\nexport type IsUndefined<T> = [undefined] extends [T] ? true : false;\n\nexport type Never<T> = T extends object\n ? {\n [K in keyof T]?: never;\n }\n : never;\n\nexport type RequiredBy<TType, TKeys extends keyof TType> = Required<\n Pick<TType, TKeys>\n> &\n Omit<TType, TKeys>;\n\n/**\n * Combines members of an intersection into a readable type.\n *\n * @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg\n * @example\n * Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>\n * => { a: string, b: string, c: number, d: bigint }\n */\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\n\nexport type WithRequired<T, K extends keyof T> = Required<Pick<T, K>>;\nexport type WithOptional<T, K extends keyof T> = Pick<Partial<T>, K>;\n\n// Checks for type equivalence, evaluates always to either `true` or `false`.\n// Semantics: (EQ<A, B> = true) <==> (A <==> B)\nexport type EQ<A, B> = [A] extends [B]\n ? [B] extends [A]\n ? true\n : false\n : false;\n\n// Auxiliary type for `IsMemberOrSubtypeOfAComponent`\n// Evaluates to `true` or `boolean` if one of the explicit components (according to the TypeScript distribution\n// mechanism for union types) of the union type equals the other given type.\n// Examples:\n// EqualsOneOfTheComponents<string, string | boolean> ⟶ boolean\n// EqualsOneOfTheComponents<string, string> ⟶ true\n// EqualsOneOfTheComponents<number, string | boolean> ⟶ false\nexport type EqualsOneOfTheComponents<T, Union> = Union extends infer Component // enforce distribution\n ? EQ<T, Component>\n : never;\n\n// Auxiliary type for `IsOneOf`\nexport type IsMemberOrSubtypeOfAComponent<\n T,\n Union,\n ConjunctionOfExplicitComponentChecks extends boolean,\n> = [T] extends [Union]\n ? true extends ConjunctionOfExplicitComponentChecks\n ? true\n : false\n : false;\n\n// Checks whether the given type equals one of the explicit components of the union type. Note that in this respect we\n// consider the members of the infinite types number and string as implicit since the inbuilt distribution mechanism of\n// TypeScript does not (cannot) distribute over the infinite number of strings or numbers. However, `boolean` is treated\n// by TypeScript (and accordingly here) as the explicit union `true | false`.\n//\n// In particular, the evaluation result is `false` if the type is a proper union of components of the union type. It also\n// evaluates to false if the given type is a proper subtype of one of its explicit components.\n// It always evaluates to either `true` or `false`.\n// Examples:\n// IsOneOf<number, string | number | boolean> ⟶ true\n// IsOneOf<2 | 4, 0 | 1 | 2 | 3 | 4 | 5 | 6> ⟶ false\n// IsOneOf<'text', string> ⟶ false // only implicit but not explicit component\nexport type IsOneOf<T, Union> = IsMemberOrSubtypeOfAComponent<\n T,\n Union,\n EqualsOneOfTheComponents<T, Union>\n>;\n\nexport type OneOf<T1, T2> = IsOneOf<T1, T2> extends true ? T1 : never;\n\nexport type RecordableKeys<T> = {\n [K in keyof T]: T[K] extends string | number | symbol ? K : never;\n}[keyof T];\n\n// Marks a subset of the fields of T as optional.\nexport type OptionalFields<T, K extends keyof T> = Pick<Partial<T>, K> &\n Omit<T, K>;\n"]}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.86.0";
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.86.0\";\n"]}
|
|
@@ -33,7 +33,8 @@ export declare class TraceHeader {
|
|
|
33
33
|
/**
|
|
34
34
|
* Creating a default trace id that is a random setup for both trace id and parent id
|
|
35
35
|
*
|
|
36
|
-
* @example
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
37
38
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
38
39
|
* ```
|
|
39
40
|
*
|
|
@@ -43,7 +44,8 @@ export declare class TraceHeader {
|
|
|
43
44
|
/**
|
|
44
45
|
* Should be able to consume a trace header from the headers of an http request
|
|
45
46
|
*
|
|
46
|
-
* @example
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
47
49
|
* const traceHeader = TraceHeader.fromTraceHeader(headers);
|
|
48
50
|
* ```
|
|
49
51
|
*
|
|
@@ -54,7 +56,8 @@ export declare class TraceHeader {
|
|
|
54
56
|
/**
|
|
55
57
|
* Should be able to convert the trace header to the format that is used in the headers of an http request
|
|
56
58
|
*
|
|
57
|
-
* @example
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
58
61
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
59
62
|
* const headers = traceHeader.toTraceHeader();
|
|
60
63
|
* ```
|
|
@@ -70,7 +73,8 @@ export declare class TraceHeader {
|
|
|
70
73
|
* as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the
|
|
71
74
|
* trace parent gets updated as according to the docs
|
|
72
75
|
*
|
|
73
|
-
* @example
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
74
78
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
75
79
|
* const newTraceHeader = traceHeader.withEvent("newEvent");
|
|
76
80
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceHeader.d.ts","sourceRoot":"","sources":["../../../src/utils/traceHeader.ts"],"names":[],"mappings":"AASA;;;;GAIG;AAEH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAG/C;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5C;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC;IAQvC
|
|
1
|
+
{"version":3,"file":"traceHeader.d.ts","sourceRoot":"","sources":["../../../src/utils/traceHeader.ts"],"names":[],"mappings":"AASA;;;;GAIG;AAEH,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAG/C;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE5C;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC;IAQvC;;;;;;;;;OASG;IACH,MAAM,CAAC,OAAO;IAQd;;;;;;;;;;OAUG;IACH,MAAM,CAAC,eAAe,CACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,WAAW,GAAG,SAAS;IA2B1B;;;;;;;;;;OAUG;IACH,aAAa;;;;IASb;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;CAS1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Constructs a type by excluding `undefined` from `T`.
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* NoUndefined<string | undefined>
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type NoUndefined<T> = T extends undefined ? never : T;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Checks if T is `undefined`
|
|
11
|
+
*
|
|
11
12
|
* @param T - Type to check
|
|
12
13
|
* @example
|
|
13
14
|
* type Result = IsUndefined<undefined>
|
|
@@ -19,7 +20,7 @@ export type Never<T> = T extends object ? {
|
|
|
19
20
|
} : never;
|
|
20
21
|
export type RequiredBy<TType, TKeys extends keyof TType> = Required<Pick<TType, TKeys>> & Omit<TType, TKeys>;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
* Combines members of an intersection into a readable type.
|
|
23
24
|
*
|
|
24
25
|
* @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
25
26
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAE7D;;;;;;;GAOG;AAEH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAEpE,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACnC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK;CACvB,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,UAAU,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,KAAK,IAAI,QAAQ,CACjE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CACnB,GACC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAErB;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAC;AAEP,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtE,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAA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
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.86.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aa-sdk/core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.86.0",
|
|
5
5
|
"description": "viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts",
|
|
6
6
|
"author": "Alchemy",
|
|
7
7
|
"type": "module",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"url": "https://github.com/alchemyplatform/aa-sdk/issues"
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c25907d482458844554ad9333656fd82d1668f4f"
|
|
65
65
|
}
|
package/src/utils/traceHeader.ts
CHANGED
|
@@ -57,7 +57,8 @@ export class TraceHeader {
|
|
|
57
57
|
/**
|
|
58
58
|
* Creating a default trace id that is a random setup for both trace id and parent id
|
|
59
59
|
*
|
|
60
|
-
* @example
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
61
62
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
62
63
|
* ```
|
|
63
64
|
*
|
|
@@ -74,7 +75,8 @@ export class TraceHeader {
|
|
|
74
75
|
/**
|
|
75
76
|
* Should be able to consume a trace header from the headers of an http request
|
|
76
77
|
*
|
|
77
|
-
* @example
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
78
80
|
* const traceHeader = TraceHeader.fromTraceHeader(headers);
|
|
79
81
|
* ```
|
|
80
82
|
*
|
|
@@ -113,7 +115,8 @@ export class TraceHeader {
|
|
|
113
115
|
/**
|
|
114
116
|
* Should be able to convert the trace header to the format that is used in the headers of an http request
|
|
115
117
|
*
|
|
116
|
-
* @example
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
117
120
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
118
121
|
* const headers = traceHeader.toTraceHeader();
|
|
119
122
|
* ```
|
|
@@ -134,7 +137,8 @@ export class TraceHeader {
|
|
|
134
137
|
* as the key of the eventName as breadcrumbs appending onto previous breadcrumbs with the - infix if exists. And the
|
|
135
138
|
* trace parent gets updated as according to the docs
|
|
136
139
|
*
|
|
137
|
-
* @example
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
138
142
|
* const traceHeader = TraceHeader.fromTraceHeader(headers) || TraceHeader.default();
|
|
139
143
|
* const newTraceHeader = traceHeader.withEvent("newEvent");
|
|
140
144
|
* ```
|
package/src/utils/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// borrowed from viem
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Constructs a type by excluding `undefined` from `T`.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* NoUndefined<string | undefined>
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
export type NoUndefined<T> = T extends undefined ? never : T;
|
|
11
11
|
// borrowed from viem
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Checks if T is `undefined`
|
|
14
|
+
*
|
|
14
15
|
* @param T - Type to check
|
|
15
16
|
* @example
|
|
16
17
|
* type Result = IsUndefined<undefined>
|
|
@@ -31,7 +32,7 @@ export type RequiredBy<TType, TKeys extends keyof TType> = Required<
|
|
|
31
32
|
Omit<TType, TKeys>;
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
+
* Combines members of an intersection into a readable type.
|
|
35
36
|
*
|
|
36
37
|
* @see https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
37
38
|
* @example
|
package/src/version.ts
CHANGED