From 35243098f7442f16dd080c3415243bf2eab773fb Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Wed, 29 Jan 2025 14:22:40 +0100
Subject: [PATCH 01/10] sdk-core: add or move http request bodies and responses

---
 packages/sdk-core/src/model/http/index.ts     |   5 +-
 .../src/model/http/model/attachment/index.ts  |   1 +
 .../response}/BacktraceAttachmentResponse.ts  |   4 +-
 .../src/model/http/model/metric/index.ts      |   2 +
 .../request/BacktraceSubmitMetricEventBody.ts |  13 +++
 .../request/BacktraceSubmitMetricsBody.ts     |  22 ++++
 .../src/model/http/model/submit/index.ts      |  10 ++
 .../submit/request/BacktraceSubmitArch.ts     |  16 +++
 .../request/BacktraceSubmitAttributeType.ts   |   1 +
 .../submit/request/BacktraceSubmitBody.ts     | 110 ++++++++++++++++++
 .../submit/request/BacktraceSubmitMemory.ts   |  48 ++++++++
 .../submit/request/BacktraceSubmitModule.ts   |  36 ++++++
 .../request/BacktraceSubmitSourceCode.ts      |  61 ++++++++++
 .../request/BacktraceSubmitStackFrame.ts      |  66 +++++++++++
 .../submit/request/BacktraceSubmitThread.ts   |  22 ++++
 .../response/BacktraceSubmitResponse.ts}      |  10 +-
 16 files changed, 422 insertions(+), 5 deletions(-)
 create mode 100644 packages/sdk-core/src/model/http/model/attachment/index.ts
 rename packages/sdk-core/src/model/http/model/{ => attachment/response}/BacktraceAttachmentResponse.ts (59%)
 create mode 100644 packages/sdk-core/src/model/http/model/metric/index.ts
 create mode 100644 packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricEventBody.ts
 create mode 100644 packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricsBody.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/index.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitArch.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitAttributeType.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitBody.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitModule.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
 create mode 100644 packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitThread.ts
 rename packages/sdk-core/src/model/http/model/{BacktraceSubmissionResponse.ts => submit/response/BacktraceSubmitResponse.ts} (67%)

diff --git a/packages/sdk-core/src/model/http/index.ts b/packages/sdk-core/src/model/http/index.ts
index c2babda5..8de19fe7 100644
--- a/packages/sdk-core/src/model/http/index.ts
+++ b/packages/sdk-core/src/model/http/index.ts
@@ -2,6 +2,7 @@ export * from '../data/BacktraceSubmissionResult.js';
 export * from './BacktraceReportSubmission.js';
 export * from './BacktraceRequestHandler.js';
 export * from './common/ConnectionError.js';
-export * from './model/BacktraceAttachmentResponse.js';
-export * from './model/BacktraceSubmissionResponse.js';
+export * from './model/attachment/index.js';
+export * from './model/metric/index.js';
+export * from './model/submit/index.js';
 export * from './SubmissionUrlInformation.js';
diff --git a/packages/sdk-core/src/model/http/model/attachment/index.ts b/packages/sdk-core/src/model/http/model/attachment/index.ts
new file mode 100644
index 00000000..bdb8a9d7
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/attachment/index.ts
@@ -0,0 +1 @@
+export * from './response/BacktraceAttachmentResponse.js';
diff --git a/packages/sdk-core/src/model/http/model/BacktraceAttachmentResponse.ts b/packages/sdk-core/src/model/http/model/attachment/response/BacktraceAttachmentResponse.ts
similarity index 59%
rename from packages/sdk-core/src/model/http/model/BacktraceAttachmentResponse.ts
rename to packages/sdk-core/src/model/http/model/attachment/response/BacktraceAttachmentResponse.ts
index 1554da30..8454bc9e 100644
--- a/packages/sdk-core/src/model/http/model/BacktraceAttachmentResponse.ts
+++ b/packages/sdk-core/src/model/http/model/attachment/response/BacktraceAttachmentResponse.ts
@@ -1,6 +1,6 @@
-import { BacktraceSubmissionResponse } from './BacktraceSubmissionResponse.js';
+import { BacktraceSubmitResponse } from '../../submit/index.js';
 
-export interface BacktraceAttachmentResponse extends BacktraceSubmissionResponse {
+export interface BacktraceAttachmentResponse extends BacktraceSubmitResponse {
     attachment_name: string;
     attachment_id: string;
     object: string;
diff --git a/packages/sdk-core/src/model/http/model/metric/index.ts b/packages/sdk-core/src/model/http/model/metric/index.ts
new file mode 100644
index 00000000..efa988bc
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/metric/index.ts
@@ -0,0 +1,2 @@
+export * from './request/BacktraceSubmitMetricEventBody.js';
+export * from './request/BacktraceSubmitMetricsBody.js';
diff --git a/packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricEventBody.ts b/packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricEventBody.ts
new file mode 100644
index 00000000..d7b7c7f1
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricEventBody.ts
@@ -0,0 +1,13 @@
+import { AttributeType } from '../../../../data/BacktraceData.js';
+
+export interface BacktraceSubmitSummedMetricEventBody {
+    timestamp: number;
+    attributes: Record<string, AttributeType>;
+    metric_group: string;
+}
+
+export interface BacktraceSubmitUniqueMetricEventBody {
+    timestamp: number;
+    attributes: Record<string, AttributeType>;
+    unique: string[];
+}
diff --git a/packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricsBody.ts b/packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricsBody.ts
new file mode 100644
index 00000000..6114599b
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/metric/request/BacktraceSubmitMetricsBody.ts
@@ -0,0 +1,22 @@
+import {
+    BacktraceSubmitSummedMetricEventBody,
+    BacktraceSubmitUniqueMetricEventBody,
+} from './BacktraceSubmitMetricEventBody.js';
+
+export interface BacktraceSubmitMetricsMetadataBody {
+    dropped_events?: number;
+}
+
+export type BacktraceSubmitSummedMetricsBody = {
+    application: string;
+    appversion: string;
+    metadata?: BacktraceSubmitMetricsMetadataBody;
+    summed_events: BacktraceSubmitSummedMetricEventBody[];
+};
+
+export type BacktraceSubmitUniqueMetricsBody = {
+    application: string;
+    appversion: string;
+    metadata?: BacktraceSubmitMetricsMetadataBody;
+    unique_events: BacktraceSubmitUniqueMetricEventBody[];
+};
diff --git a/packages/sdk-core/src/model/http/model/submit/index.ts b/packages/sdk-core/src/model/http/model/submit/index.ts
new file mode 100644
index 00000000..8949590f
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/index.ts
@@ -0,0 +1,10 @@
+export * from './request/BacktraceSubmitArch.js';
+export * from './request/BacktraceSubmitAttributeType.js';
+export * from './request/BacktraceSubmitBody.js';
+export * from './request/BacktraceSubmitMemory.js';
+export * from './request/BacktraceSubmitModule.js';
+export * from './request/BacktraceSubmitSourceCode.js';
+export * from './request/BacktraceSubmitStackFrame.js';
+export * from './request/BacktraceSubmitThread.js';
+
+export * from './response/BacktraceSubmitResponse.js';
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitArch.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitArch.ts
new file mode 100644
index 00000000..be8231e1
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitArch.ts
@@ -0,0 +1,16 @@
+export interface BacktraceSubmitArch {
+    /**
+     * On some systems the running program can be run with a different arch than the system itself.
+     * `attributes.uname.machine` has to do with the system arch;
+     * this field has to do with the running process arch.
+     */
+    name: string;
+
+    /**
+     * It corresponds with registers in the stack frame. Specifies the names of the registers for this arch.
+     * The values are the types.
+     *
+     * If you use `string`, you can format the value as you want.
+     */
+    registers: 'i32' | 'u32' | 'i64' | 'u64' | 'f32' | 'string';
+}
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitAttributeType.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitAttributeType.ts
new file mode 100644
index 00000000..e864984d
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitAttributeType.ts
@@ -0,0 +1 @@
+export type BacktraceSubmitAttributeType = string | number | boolean | undefined | null;
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitBody.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitBody.ts
new file mode 100644
index 00000000..b51dec87
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitBody.ts
@@ -0,0 +1,110 @@
+import { BacktraceSubmitArch } from './BacktraceSubmitArch.js';
+import { BacktraceSubmitAttributeType } from './BacktraceSubmitAttributeType.js';
+import { BacktraceSubmitMemory } from './BacktraceSubmitMemory.js';
+import { BacktraceSubmitModule } from './BacktraceSubmitModule.js';
+import { BacktraceSubmitSourceCode } from './BacktraceSubmitSourceCode.js';
+import { BacktraceSubmitThread } from './BacktraceSubmitThread.js';
+
+export interface BacktraceSubmitBody {
+    /**
+     * 16 bytes of randomness in human readable UUID format.
+     * The server will reject the request if UUID is already found.
+     */
+    uuid: string;
+
+    /**
+     * The UTC timestamp in seconds.
+     */
+    timestamp: number;
+
+    /**
+     * The name of the programming language/environment this error originates from.
+     */
+    lang: string;
+
+    /**
+     * The version of the programming language/environment this error originates from.
+     */
+    langVersion: string;
+
+    /**
+     * The name of the client that is sending this error report.
+     */
+    agent: string;
+
+    /**
+     * The version of the client that is sending this error report.
+     */
+    agentVersion: string;
+
+    /**
+     * Contains a map of all threads running in the environment. It could be only one.
+     * The object is composed by the `main` object that is the key of the `threads` object
+     * and represents the unique ID of a thread.
+     */
+    threads: Record<string, BacktraceSubmitThread>;
+
+    /**
+     * It represent the thread that either triggered the error or generated this object.
+     * The value of this field should be one of the keys in the threads object and cannot be null.
+     */
+    mainThread: string;
+
+    /**
+     * Specifies the symbolication that needs to be applied.
+     */
+    symbolication?: 'sourcemap' | 'minidump' | 'proguard';
+
+    /**
+     * Specifies which thread is the entry point or the starting thread.
+     * This must correspond to an entry in the threads field.
+     */
+    entryThread?: string;
+
+    /**
+     * Specifies the CPU architecture information. It is required if you want to have registers in the stack frame.
+     */
+    arch?: BacktraceSubmitArch;
+
+    /**
+     * This is a base64 encoded unique ID that groups the report with the same fingerprint (32 bytes).
+     * If omitted, a fingerprint will be generated from the submitted stack trace.
+     */
+    fingerprint?: string;
+
+    /**
+     * List of strings which are report classifications.
+     */
+    classifiers?: string[];
+
+    /**
+     * This is a set of key-value pairs that belong to the error report.
+     * The exact fields are not defined by this specification.
+     * It is up to the JSON consumer how to display or otherwise represent key/value pairs in this object.
+     * The value of a key-value pair can be a string, integer, or boolean.
+     * These attributes are indexed and searchable.
+     */
+    attributes?: Record<string, BacktraceSubmitAttributeType>;
+
+    /**
+     * The object include the source code for better debugging experience.
+     * The object is composed by the `sourceCodeId` object that is the ID of the source code.
+     */
+    sourceCode?: BacktraceSubmitSourceCode;
+
+    /**
+     * Provides arbitrary slices of memory.
+     */
+    memory?: BacktraceSubmitMemory[];
+
+    /**
+     * A generic, non-indexed user-provided property.
+     * The names are free, the values can be of any type, and there is no limit to nesting.
+     */
+    annotations?: Record<string, unknown>;
+
+    /**
+     * A list of modules as loaded in memory, used to symbolicate stack traces.
+     */
+    modules?: BacktraceSubmitModule[];
+}
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
new file mode 100644
index 00000000..518649e7
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
@@ -0,0 +1,48 @@
+export interface DataBacktraceSubmitMemory {
+    /**
+     * An integer offset that this slice of memory starts at. The 64 bit integers are represented as strings.
+     */
+    start: number | string;
+
+    /**
+     * The number of bytes of the slice. Optional if you include `data`.
+     */
+    size?: number;
+
+    /**
+     * Base64 encoded bytes of the slice of memory. If provided, `size` can be inferred from it.
+     */
+    data: string;
+
+    /**
+     * The object that sets of permissions of this slice of memory.
+     */
+    perms?: {
+        read?: boolean;
+        write?: boolean;
+        exec?: boolean;
+    };
+}
+
+export interface SizedBacktraceSubmitMemory {
+    /**
+     * An integer offset that this slice of memory starts at. The 64 bit integers are represented as strings.
+     */
+    start: number | string;
+
+    /**
+     * The number of bytes of the slice. Optional if you include `data`.
+     */
+    size: number;
+
+    /**
+     * The object that sets of permissions of this slice of memory.
+     */
+    perms?: {
+        read?: boolean;
+        write?: boolean;
+        exec?: boolean;
+    };
+}
+
+export type BacktraceSubmitMemory = DataBacktraceSubmitMemory | SizedBacktraceSubmitMemory;
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitModule.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitModule.ts
new file mode 100644
index 00000000..7ca38f17
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitModule.ts
@@ -0,0 +1,36 @@
+export interface BacktraceSubmitModule {
+    /**
+     * An integer offset that the module starts at. 64 bit integers are represented as strings.
+     */
+    start: number | string;
+
+    /**
+     * The number of bytes occupied by the module.
+     */
+    size: number | string;
+
+    /**
+     * A string that indicates the path that the module is loaded from.
+     */
+    code_file?: string;
+
+    /**
+     * The human-readable version string for the module.
+     */
+    version?: string;
+
+    /**
+     * The file containing debug information for the module.
+     */
+    debug_file?: string;
+
+    /**
+     * The debug file identifier.
+     */
+    debug_identifier?: string;
+
+    /**
+     * A boolean value that indicates if symbolication was able to locate the debug file.
+     */
+    debug_file_exists?: boolean;
+}
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts
new file mode 100644
index 00000000..d959a372
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts
@@ -0,0 +1,61 @@
+export interface TextBacktraceSubmitSourceCode {
+    /**
+     * A string that provides the full source file or a subset of it.
+     * If provided, then also `startLine` should be provided. If not provided, then `path` must be provided.
+     */
+    text: string;
+
+    /**
+     * An integer value that provides the line number that the provided text starts on.
+     * It is required if `text` is provided. First line is 1.
+     */
+    startLine: number;
+
+    /**
+     * An integer value that provides the column number that the first byte in the `text` segment is. First column is 1.
+     */
+    startColumn?: number;
+
+    /**
+     * An integer value that provides the absolute byte index in the original file that the provided segment is part of.
+     * First byte is 0.
+     */
+    startPos?: number;
+
+    /**
+     * An integer value that informs source code display how many spaces a tab should represent.
+     */
+    tabWidth?: number;
+}
+
+export interface PathBacktraceSubmitSourceCode {
+    /**
+     * A string value that provides the file system path to the original source code file.
+     * If not provided, then `text` must be provided.
+     */
+    path: string;
+
+    /**
+     * An integer value that provides the line number that the provided text starts on.
+     * It is required if `text` is provided. First line is 1.
+     */
+    startLine?: number;
+
+    /**
+     * An integer value that provides the column number that the first byte in the `text` segment is. First column is 1.
+     */
+    startColumn?: number;
+
+    /**
+     * An integer value that provides the absolute byte index in the original file that the provided segment is part of.
+     * First byte is 0.
+     */
+    startPos?: number;
+
+    /**
+     * An integer value that informs source code display how many spaces a tab should represent.
+     */
+    tabWidth?: number;
+}
+
+export type BacktraceSubmitSourceCode = TextBacktraceSubmitSourceCode | PathBacktraceSubmitSourceCode;
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
new file mode 100644
index 00000000..1642797d
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
@@ -0,0 +1,66 @@
+interface BaseBacktraceSubmitStackFrame {
+    /**
+     * A boolean value that is true if the stack frame is created by hueristic method due to missing CFI,
+     * and false otherwise.
+     */
+    guessed_frame?: boolean;
+
+    /**
+     * A string value that identifies the function, method, or procedure name.
+     * If not provided then `address` must be provided.
+     */
+    funcName?: string;
+
+    /**
+     * A string value that identifies the address of the stack frame. Required if `funcName` is not provided.
+     */
+    address?: string | number;
+
+    /**
+     * A string value that identifies the line number in the source code of the stack frame. First line is 1.
+     */
+    line?: number;
+
+    /**
+     * A string value that identifies the column number in the source code of the stack frame. First column is 1.
+     */
+    column?: number;
+
+    /**
+     * A string value that identifies the ID of the source code file the stack frame is contained in.
+     */
+    sourceCode?: string;
+
+    /**
+     * A string value that identifies the shared object, the library or the module name.
+     */
+    library: string;
+
+    /**
+     * A string value that identifies the debug identifier for the library associated with this frame.
+     */
+    debug_identifier?: string;
+
+    /**
+     * A boolean value that indicates if this frame is known to be the faulting frame.
+     */
+    faulted?: boolean;
+
+    /**
+     * In this object the keys are the register names. Use any names that make sense for the architecture.
+     * These must correspond to the values in the `arch` definition.
+     * JSON does not support 64 bit integers, so you must set the correct type
+     * and then encode the 64 bit integers as a string.
+     */
+    registers?: Record<string, number | string>;
+}
+
+export interface FuncBacktraceSubmitStackFrame extends BaseBacktraceSubmitStackFrame {
+    funcName: string;
+}
+
+export interface AddressBacktraceSubmitStackFrame extends BaseBacktraceSubmitStackFrame {
+    address: string;
+}
+
+export type BacktraceSubmitStackFrame = FuncBacktraceSubmitStackFrame | AddressBacktraceSubmitStackFrame;
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitThread.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitThread.ts
new file mode 100644
index 00000000..15da582e
--- /dev/null
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitThread.ts
@@ -0,0 +1,22 @@
+import { BacktraceSubmitStackFrame } from './BacktraceSubmitStackFrame.js';
+
+/**
+ * Contains a map of all threads running in the environment. It could be only one.
+ * The object is composed by the `main` object that is the key of the `threads` object
+ * and represents the unique ID of a thread.
+ */
+export interface BacktraceSubmitThread {
+    /**
+     * A string that provides a small description of what the thread does.
+     */
+    name: string;
+
+    /**
+     * A boolean value that denotes if a thread is a faulting thread.
+     * Rarely two faulted threads can be seen, if it happens,
+     * the first faulting thread listed gets the status of `mainThread`.
+     */
+    fault: boolean;
+
+    stack: BacktraceSubmitStackFrame[];
+}
diff --git a/packages/sdk-core/src/model/http/model/BacktraceSubmissionResponse.ts b/packages/sdk-core/src/model/http/model/submit/response/BacktraceSubmitResponse.ts
similarity index 67%
rename from packages/sdk-core/src/model/http/model/BacktraceSubmissionResponse.ts
rename to packages/sdk-core/src/model/http/model/submit/response/BacktraceSubmitResponse.ts
index 13952956..7b16af8b 100644
--- a/packages/sdk-core/src/model/http/model/BacktraceSubmissionResponse.ts
+++ b/packages/sdk-core/src/model/http/model/submit/response/BacktraceSubmitResponse.ts
@@ -1,17 +1,25 @@
-export interface BacktraceSubmissionResponse {
+export interface BacktraceSubmitResponse {
     response?: string;
+
     /**
      * Report ID
      */
     _rxid?: string;
+
     /**
      * Object Id - id of a submitted report.
      * Option available only in the synchronous upload.
      */
     object?: string;
+
     /**
      * Submitted report fingerprint.
      * Option available only in the synchronous upload.
      */
     fingerprint?: string;
 }
+
+/**
+ * @deprecated use `BacktraceSubmitResponse`
+ */
+export type BacktraceSubmissionResponse = BacktraceSubmitResponse;

From 38d5c08945b3cb3d526ac19ef7bb572acda3397e Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Wed, 29 Jan 2025 14:23:45 +0100
Subject: [PATCH 02/10] sdk-core: change RequestBacktraceReportSubmission to
 use new http bodies

---
 .../src/model/http/BacktraceReportSubmission.ts     | 13 ++++++-------
 .../src/model/http/BacktraceRequestHandler.ts       |  6 +++---
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/packages/sdk-core/src/model/http/BacktraceReportSubmission.ts b/packages/sdk-core/src/model/http/BacktraceReportSubmission.ts
index 724b4763..d53b82c8 100644
--- a/packages/sdk-core/src/model/http/BacktraceReportSubmission.ts
+++ b/packages/sdk-core/src/model/http/BacktraceReportSubmission.ts
@@ -1,16 +1,15 @@
 import { jsonEscaper } from '../../common/jsonEscaper.js';
 import { BacktraceAttachment } from '../attachment/index.js';
-import { BacktraceConfiguration } from '../configuration/BacktraceConfiguration.js';
-import { BacktraceData } from '../data/BacktraceData.js';
 import { BacktraceReportSubmissionResult } from '../data/BacktraceSubmissionResult.js';
 import { BacktraceRequestHandler } from './BacktraceRequestHandler.js';
-import { BacktraceAttachmentResponse } from './model/BacktraceAttachmentResponse.js';
-import { BacktraceSubmissionResponse } from './model/BacktraceSubmissionResponse.js';
+import { BacktraceAttachmentResponse } from './model/attachment/response/BacktraceAttachmentResponse.js';
+import { BacktraceSubmissionResponse } from './model/submit/index.js';
+import { BacktraceSubmitBody } from './model/submit/request/BacktraceSubmitBody.js';
 import { SubmissionUrlInformation } from './SubmissionUrlInformation.js';
 
 export interface BacktraceReportSubmission {
     send(
-        data: BacktraceData,
+        data: BacktraceSubmitBody,
         attachments: BacktraceAttachment[],
         abortSignal?: AbortSignal,
     ): Promise<BacktraceReportSubmissionResult<BacktraceSubmissionResponse>>;
@@ -25,13 +24,13 @@ export interface BacktraceReportSubmission {
 export class RequestBacktraceReportSubmission implements BacktraceReportSubmission {
     private readonly _submissionUrl: string;
     constructor(
-        options: BacktraceConfiguration,
+        options: { url: string; token?: string },
         private readonly _requestHandler: BacktraceRequestHandler,
     ) {
         this._submissionUrl = SubmissionUrlInformation.toJsonReportSubmissionUrl(options.url, options.token);
     }
 
-    public send(data: BacktraceData, attachments: BacktraceAttachment[], abortSignal?: AbortSignal) {
+    public send(data: BacktraceSubmitBody, attachments: BacktraceAttachment[], abortSignal?: AbortSignal) {
         const json = JSON.stringify(data, jsonEscaper());
         return this._requestHandler.postError(this._submissionUrl, json, attachments, abortSignal);
     }
diff --git a/packages/sdk-core/src/model/http/BacktraceRequestHandler.ts b/packages/sdk-core/src/model/http/BacktraceRequestHandler.ts
index d885dd4d..7d19a1e5 100644
--- a/packages/sdk-core/src/model/http/BacktraceRequestHandler.ts
+++ b/packages/sdk-core/src/model/http/BacktraceRequestHandler.ts
@@ -1,7 +1,7 @@
 import { BacktraceAttachment } from '../attachment/index.js';
 import { BacktraceReportSubmissionResult } from '../data/BacktraceSubmissionResult.js';
-import { BacktraceAttachmentResponse } from './model/BacktraceAttachmentResponse.js';
-import { BacktraceSubmissionResponse } from './model/BacktraceSubmissionResponse.js';
+import { BacktraceAttachmentResponse } from './model/attachment/response/BacktraceAttachmentResponse.js';
+import { BacktraceSubmitResponse } from './model/submit/index.js';
 export const DEFAULT_TIMEOUT = 15_000;
 export interface BacktraceRequestHandler {
     /**
@@ -17,7 +17,7 @@ export interface BacktraceRequestHandler {
         dataJson: string,
         attachments: BacktraceAttachment[],
         abortSignal?: AbortSignal,
-    ): Promise<BacktraceReportSubmissionResult<BacktraceSubmissionResponse>>;
+    ): Promise<BacktraceReportSubmissionResult<BacktraceSubmitResponse>>;
 
     /**
      * Post data to Backtrace API

From 7d18b0abf1c7efb34ee57b68972c1220805e20a7 Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Wed, 29 Jan 2025 14:24:05 +0100
Subject: [PATCH 03/10] sdk-core: add BacktraceCoreApi

---
 packages/sdk-core/src/BacktraceCoreApi.ts | 97 +++++++++++++++++++++++
 packages/sdk-core/src/index.ts            |  1 +
 2 files changed, 98 insertions(+)
 create mode 100644 packages/sdk-core/src/BacktraceCoreApi.ts

diff --git a/packages/sdk-core/src/BacktraceCoreApi.ts b/packages/sdk-core/src/BacktraceCoreApi.ts
new file mode 100644
index 00000000..9e323cf4
--- /dev/null
+++ b/packages/sdk-core/src/BacktraceCoreApi.ts
@@ -0,0 +1,97 @@
+import { BacktraceAttachment } from './model/attachment/BacktraceAttachment.js';
+import {
+    BacktraceAttachmentResponse,
+    BacktraceReportSubmissionResult,
+    BacktraceRequestHandler,
+    BacktraceSubmitBody,
+    BacktraceSubmitResponse,
+    RequestBacktraceReportSubmission,
+} from './model/http/index.js';
+import {
+    BacktraceSubmitSummedMetricsBody,
+    BacktraceSubmitUniqueMetricsBody,
+} from './model/http/model/metric/request/BacktraceSubmitMetricsBody.js';
+import { MetricsUrlInformation } from './modules/metrics/MetricsUrlInformation.js';
+
+export interface BacktraceCoreApiOptions {
+    readonly url: string;
+    readonly token?: string;
+
+    readonly metrics?: {
+        readonly url?: string;
+    };
+
+    readonly requestHandler?: BacktraceRequestHandler;
+    readonly requestBacktraceReportSubmission?: RequestBacktraceReportSubmission;
+}
+
+export class BacktraceCoreApi {
+    private readonly _summedMetricsSubmissionUrl?: string;
+    private readonly _uniqueMetricsSubmissionUrl?: string;
+
+    private readonly _requestHandler: BacktraceRequestHandler;
+    private readonly _requestBacktraceReportSubmission: RequestBacktraceReportSubmission;
+
+    constructor(options: BacktraceCoreApiOptions, requestHandler: BacktraceRequestHandler) {
+        this._summedMetricsSubmissionUrl = MetricsUrlInformation.generateSummedEventsUrl(
+            options.metrics?.url ?? 'https://events.backtrace.io',
+            options.url,
+            options.token,
+        );
+
+        this._uniqueMetricsSubmissionUrl = MetricsUrlInformation.generateUniqueEventsUrl(
+            options.metrics?.url ?? 'https://events.backtrace.io',
+            options.url,
+            options.token,
+        );
+
+        this._requestHandler = options.requestHandler ?? requestHandler;
+
+        this._requestBacktraceReportSubmission =
+            options.requestBacktraceReportSubmission ??
+            new RequestBacktraceReportSubmission(
+                {
+                    url: options.url,
+                },
+                this._requestHandler,
+            );
+    }
+
+    public sendReport(
+        data: BacktraceSubmitBody,
+        attachments: BacktraceAttachment[],
+        abortSignal?: AbortSignal,
+    ): Promise<BacktraceReportSubmissionResult<BacktraceSubmitResponse>> {
+        return this._requestBacktraceReportSubmission.send(data, attachments, abortSignal);
+    }
+
+    public sendAttachment(
+        rxid: string,
+        attachment: BacktraceAttachment,
+        abortSignal?: AbortSignal,
+    ): Promise<BacktraceReportSubmissionResult<BacktraceAttachmentResponse>> {
+        return this._requestBacktraceReportSubmission.sendAttachment(rxid, attachment, abortSignal);
+    }
+
+    public sendUniqueMetrics(
+        metrics: BacktraceSubmitUniqueMetricsBody,
+        abortSignal?: AbortSignal,
+    ): Promise<BacktraceReportSubmissionResult<unknown>> {
+        if (!this._uniqueMetricsSubmissionUrl) {
+            throw new Error('Unique metrics URL is not available.');
+        }
+
+        return this._requestHandler.post(this._uniqueMetricsSubmissionUrl, JSON.stringify(metrics), abortSignal);
+    }
+
+    public sendSummedMetrics(
+        metrics: BacktraceSubmitSummedMetricsBody,
+        abortSignal?: AbortSignal,
+    ): Promise<BacktraceReportSubmissionResult<unknown>> {
+        if (!this._summedMetricsSubmissionUrl) {
+            throw new Error('Summed metrics URL is not available.');
+        }
+
+        return this._requestHandler.post(this._summedMetricsSubmissionUrl, JSON.stringify(metrics), abortSignal);
+    }
+}
diff --git a/packages/sdk-core/src/index.ts b/packages/sdk-core/src/index.ts
index 4457e868..c98ec8be 100644
--- a/packages/sdk-core/src/index.ts
+++ b/packages/sdk-core/src/index.ts
@@ -1,3 +1,4 @@
+export * from './BacktraceCoreApi.js';
 export * from './BacktraceCoreClient.js';
 export * from './builder/BacktraceCoreClientBuilder.js';
 export * from './builder/CoreClientSetup.js';

From d07b0aa6e961095bc9cacfe00795c2c2f5bcff41 Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Wed, 29 Jan 2025 14:24:28 +0100
Subject: [PATCH 04/10] node: add BacktraceApi

---
 packages/node/src/BacktraceApi.ts             | 12 +++++++++++
 .../node/src/BacktraceNodeRequestHandler.ts   | 21 +++++++++----------
 packages/node/src/index.ts                    |  1 +
 3 files changed, 23 insertions(+), 11 deletions(-)
 create mode 100644 packages/node/src/BacktraceApi.ts

diff --git a/packages/node/src/BacktraceApi.ts b/packages/node/src/BacktraceApi.ts
new file mode 100644
index 00000000..6d2becd4
--- /dev/null
+++ b/packages/node/src/BacktraceApi.ts
@@ -0,0 +1,12 @@
+import { BacktraceCoreApi, BacktraceCoreApiOptions } from '@backtrace/sdk-core';
+import { BacktraceNodeRequestHandler, BacktraceNodeRequestHandlerOptions } from './BacktraceNodeRequestHandler.js';
+
+export interface BacktraceApiOptions extends BacktraceCoreApiOptions {
+    readonly requestHandlerOptions?: BacktraceNodeRequestHandlerOptions;
+}
+
+export class BacktraceApi extends BacktraceCoreApi {
+    constructor(options: BacktraceApiOptions) {
+        super(options, options.requestHandler ?? new BacktraceNodeRequestHandler(options.requestHandlerOptions));
+    }
+}
diff --git a/packages/node/src/BacktraceNodeRequestHandler.ts b/packages/node/src/BacktraceNodeRequestHandler.ts
index 5c6045cc..5fef8a51 100644
--- a/packages/node/src/BacktraceNodeRequestHandler.ts
+++ b/packages/node/src/BacktraceNodeRequestHandler.ts
@@ -11,6 +11,12 @@ import FormData from 'form-data';
 import http, { ClientRequest, IncomingMessage } from 'http';
 import https from 'https';
 import { Readable } from 'stream';
+
+export interface BacktraceNodeRequestHandlerOptions {
+    readonly timeout?: number;
+    readonly ignoreSslCertificate?: boolean;
+}
+
 export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
     private readonly UPLOAD_FILE_NAME = 'upload_file';
     private readonly _timeout: number;
@@ -24,15 +30,8 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
         'Transfer-Encoding': 'chunked',
     };
 
-    constructor(
-        private readonly _options: {
-            url: string;
-            token?: string;
-            timeout?: number;
-            ignoreSslCertificate?: boolean;
-        },
-    ) {
-        this._timeout = this._options.timeout ?? DEFAULT_TIMEOUT;
+    constructor(private readonly _options?: BacktraceNodeRequestHandlerOptions) {
+        this._timeout = this._options?.timeout ?? DEFAULT_TIMEOUT;
     }
 
     public async postError(
@@ -71,7 +70,7 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
                 const request = httpClient.request(
                     url,
                     {
-                        rejectUnauthorized: this._options.ignoreSslCertificate === true,
+                        rejectUnauthorized: this._options?.ignoreSslCertificate === true,
                         timeout: this._timeout,
                         method: 'POST',
                     },
@@ -129,7 +128,7 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
                 const request = httpClient.request(
                     url,
                     {
-                        rejectUnauthorized: this._options.ignoreSslCertificate === true,
+                        rejectUnauthorized: this._options?.ignoreSslCertificate === true,
                         timeout: this._timeout,
                         method: 'POST',
                         headers:
diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts
index e6019894..8837d1a5 100644
--- a/packages/node/src/index.ts
+++ b/packages/node/src/index.ts
@@ -12,6 +12,7 @@ export {
     RawBreadcrumb,
 } from '@backtrace/sdk-core';
 export * from './attachment/index.js';
+export * from './BacktraceApi.js';
 export * from './BacktraceClient.js';
 export * from './BacktraceConfiguration.js';
 export * from './BacktraceNodeRequestHandler.js';

From e1afa769738e9f3b5f416f0378523e626b43fc0e Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Wed, 29 Jan 2025 14:25:51 +0100
Subject: [PATCH 05/10] browser: add BacktraceApi

---
 packages/browser/src/BacktraceApi.ts              | 15 +++++++++++++++
 .../browser/src/BacktraceBrowserRequestHandler.ts | 14 ++++++--------
 packages/browser/src/index.ts                     |  3 ++-
 3 files changed, 23 insertions(+), 9 deletions(-)
 create mode 100644 packages/browser/src/BacktraceApi.ts

diff --git a/packages/browser/src/BacktraceApi.ts b/packages/browser/src/BacktraceApi.ts
new file mode 100644
index 00000000..e94c047c
--- /dev/null
+++ b/packages/browser/src/BacktraceApi.ts
@@ -0,0 +1,15 @@
+import { BacktraceCoreApi, BacktraceCoreApiOptions } from '@backtrace/sdk-core';
+import {
+    BacktraceBrowserRequestHandler,
+    BacktraceBrowserRequestHandlerOptions,
+} from './BacktraceBrowserRequestHandler.js';
+
+export interface BacktraceApiOptions extends BacktraceCoreApiOptions {
+    readonly requestHandlerOptions?: BacktraceBrowserRequestHandlerOptions;
+}
+
+export class BacktraceApi extends BacktraceCoreApi {
+    constructor(options: BacktraceApiOptions) {
+        super(options, options.requestHandler ?? new BacktraceBrowserRequestHandler(options.requestHandlerOptions));
+    }
+}
diff --git a/packages/browser/src/BacktraceBrowserRequestHandler.ts b/packages/browser/src/BacktraceBrowserRequestHandler.ts
index 636eeb8d..75502c78 100644
--- a/packages/browser/src/BacktraceBrowserRequestHandler.ts
+++ b/packages/browser/src/BacktraceBrowserRequestHandler.ts
@@ -7,6 +7,10 @@ import {
     DEFAULT_TIMEOUT,
 } from '@backtrace/sdk-core';
 
+export interface BacktraceBrowserRequestHandlerOptions {
+    readonly timeout?: number;
+}
+
 export class BacktraceBrowserRequestHandler implements BacktraceRequestHandler {
     private readonly UPLOAD_FILE_NAME = 'upload_file';
     private readonly _timeout: number;
@@ -18,14 +22,8 @@ export class BacktraceBrowserRequestHandler implements BacktraceRequestHandler {
     private readonly MULTIPART_HEADERS = {
         'Transfer-Encoding': 'chunked',
     };
-    constructor(
-        private readonly _options: {
-            url: string;
-            token?: string;
-            timeout?: number;
-        },
-    ) {
-        this._timeout = this._options.timeout ?? DEFAULT_TIMEOUT;
+    constructor(private readonly _options?: BacktraceBrowserRequestHandlerOptions) {
+        this._timeout = this._options?.timeout ?? DEFAULT_TIMEOUT;
     }
     public async postError<T>(
         submissionUrl: string,
diff --git a/packages/browser/src/index.ts b/packages/browser/src/index.ts
index 1d21c796..d7c99298 100644
--- a/packages/browser/src/index.ts
+++ b/packages/browser/src/index.ts
@@ -10,15 +10,16 @@ export {
     BacktraceStringAttachment,
     BacktraceUint8ArrayAttachment,
     BreadcrumbLogLevel,
-    BreadcrumbType,
     BreadcrumbsEventSubscriber,
     BreadcrumbsManager,
+    BreadcrumbType,
     JavaScriptEngine,
     RawBreadcrumb,
     SingleSessionProvider,
     V8StackTraceConverter,
 } from '@backtrace/sdk-core';
 export * from './agentDefinition.js';
+export * from './BacktraceApi.js';
 export * from './BacktraceBrowserRequestHandler.js';
 export * from './BacktraceClient.js';
 export * from './BacktraceConfiguration.js';

From c7f902132b0e3b322a58d54b0f24046f6e237d8f Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Tue, 4 Feb 2025 14:30:01 +0100
Subject: [PATCH 06/10] browser: remove options class variable from
 BacktraceBrowserRequestHandler

---
 packages/browser/src/BacktraceBrowserRequestHandler.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/browser/src/BacktraceBrowserRequestHandler.ts b/packages/browser/src/BacktraceBrowserRequestHandler.ts
index 75502c78..ab5b71bf 100644
--- a/packages/browser/src/BacktraceBrowserRequestHandler.ts
+++ b/packages/browser/src/BacktraceBrowserRequestHandler.ts
@@ -22,8 +22,8 @@ export class BacktraceBrowserRequestHandler implements BacktraceRequestHandler {
     private readonly MULTIPART_HEADERS = {
         'Transfer-Encoding': 'chunked',
     };
-    constructor(private readonly _options?: BacktraceBrowserRequestHandlerOptions) {
-        this._timeout = this._options?.timeout ?? DEFAULT_TIMEOUT;
+    constructor(options?: BacktraceBrowserRequestHandlerOptions) {
+        this._timeout = options?.timeout ?? DEFAULT_TIMEOUT;
     }
     public async postError<T>(
         submissionUrl: string,

From 44aa9e936cfc39d3b8603417a7f3b1114d4f7983 Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Tue, 4 Feb 2025 14:30:23 +0100
Subject: [PATCH 07/10] node: remove options class variable from
 BacktraceNodeRequestHandler

---
 packages/node/src/BacktraceNodeRequestHandler.ts | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/packages/node/src/BacktraceNodeRequestHandler.ts b/packages/node/src/BacktraceNodeRequestHandler.ts
index 5fef8a51..49d0af33 100644
--- a/packages/node/src/BacktraceNodeRequestHandler.ts
+++ b/packages/node/src/BacktraceNodeRequestHandler.ts
@@ -20,6 +20,7 @@ export interface BacktraceNodeRequestHandlerOptions {
 export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
     private readonly UPLOAD_FILE_NAME = 'upload_file';
     private readonly _timeout: number;
+    private readonly _ignoreSslCertificate?: boolean;
 
     private readonly JSON_HEADERS = {
         'Content-type': 'application/json',
@@ -30,8 +31,9 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
         'Transfer-Encoding': 'chunked',
     };
 
-    constructor(private readonly _options?: BacktraceNodeRequestHandlerOptions) {
-        this._timeout = this._options?.timeout ?? DEFAULT_TIMEOUT;
+    constructor(options?: BacktraceNodeRequestHandlerOptions) {
+        this._timeout = options?.timeout ?? DEFAULT_TIMEOUT;
+        this._ignoreSslCertificate = options?.ignoreSslCertificate;
     }
 
     public async postError(
@@ -70,7 +72,7 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
                 const request = httpClient.request(
                     url,
                     {
-                        rejectUnauthorized: this._options?.ignoreSslCertificate === true,
+                        rejectUnauthorized: this._ignoreSslCertificate === true,
                         timeout: this._timeout,
                         method: 'POST',
                     },
@@ -128,7 +130,7 @@ export class BacktraceNodeRequestHandler implements BacktraceRequestHandler {
                 const request = httpClient.request(
                     url,
                     {
-                        rejectUnauthorized: this._options?.ignoreSslCertificate === true,
+                        rejectUnauthorized: this._ignoreSslCertificate === true,
                         timeout: this._timeout,
                         method: 'POST',
                         headers:

From 67de531ac1193a7f933adea5d4b132ea263fdd8c Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Fri, 7 Feb 2025 12:00:24 +0100
Subject: [PATCH 08/10] sdk-core, node, browser: MR updates

---
 packages/browser/src/BacktraceApi.ts                     | 3 ++-
 packages/node/src/BacktraceApi.ts                        | 3 ++-
 packages/sdk-core/src/BacktraceCoreApi.ts                | 9 ++++-----
 .../http/model/submit/request/BacktraceSubmitMemory.ts   | 6 +++---
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/packages/browser/src/BacktraceApi.ts b/packages/browser/src/BacktraceApi.ts
index e94c047c..6a63ea48 100644
--- a/packages/browser/src/BacktraceApi.ts
+++ b/packages/browser/src/BacktraceApi.ts
@@ -1,4 +1,4 @@
-import { BacktraceCoreApi, BacktraceCoreApiOptions } from '@backtrace/sdk-core';
+import { BacktraceCoreApi, BacktraceCoreApiOptions, BacktraceRequestHandler } from '@backtrace/sdk-core';
 import {
     BacktraceBrowserRequestHandler,
     BacktraceBrowserRequestHandlerOptions,
@@ -6,6 +6,7 @@ import {
 
 export interface BacktraceApiOptions extends BacktraceCoreApiOptions {
     readonly requestHandlerOptions?: BacktraceBrowserRequestHandlerOptions;
+    readonly requestHandler?: BacktraceRequestHandler;
 }
 
 export class BacktraceApi extends BacktraceCoreApi {
diff --git a/packages/node/src/BacktraceApi.ts b/packages/node/src/BacktraceApi.ts
index 6d2becd4..8eef3196 100644
--- a/packages/node/src/BacktraceApi.ts
+++ b/packages/node/src/BacktraceApi.ts
@@ -1,8 +1,9 @@
-import { BacktraceCoreApi, BacktraceCoreApiOptions } from '@backtrace/sdk-core';
+import { BacktraceCoreApi, BacktraceCoreApiOptions, BacktraceRequestHandler } from '@backtrace/sdk-core';
 import { BacktraceNodeRequestHandler, BacktraceNodeRequestHandlerOptions } from './BacktraceNodeRequestHandler.js';
 
 export interface BacktraceApiOptions extends BacktraceCoreApiOptions {
     readonly requestHandlerOptions?: BacktraceNodeRequestHandlerOptions;
+    readonly requestHandler?: BacktraceRequestHandler;
 }
 
 export class BacktraceApi extends BacktraceCoreApi {
diff --git a/packages/sdk-core/src/BacktraceCoreApi.ts b/packages/sdk-core/src/BacktraceCoreApi.ts
index 9e323cf4..92985e53 100644
--- a/packages/sdk-core/src/BacktraceCoreApi.ts
+++ b/packages/sdk-core/src/BacktraceCoreApi.ts
@@ -21,7 +21,6 @@ export interface BacktraceCoreApiOptions {
         readonly url?: string;
     };
 
-    readonly requestHandler?: BacktraceRequestHandler;
     readonly requestBacktraceReportSubmission?: RequestBacktraceReportSubmission;
 }
 
@@ -29,10 +28,12 @@ export class BacktraceCoreApi {
     private readonly _summedMetricsSubmissionUrl?: string;
     private readonly _uniqueMetricsSubmissionUrl?: string;
 
-    private readonly _requestHandler: BacktraceRequestHandler;
     private readonly _requestBacktraceReportSubmission: RequestBacktraceReportSubmission;
 
-    constructor(options: BacktraceCoreApiOptions, requestHandler: BacktraceRequestHandler) {
+    constructor(
+        options: BacktraceCoreApiOptions,
+        private readonly _requestHandler: BacktraceRequestHandler,
+    ) {
         this._summedMetricsSubmissionUrl = MetricsUrlInformation.generateSummedEventsUrl(
             options.metrics?.url ?? 'https://events.backtrace.io',
             options.url,
@@ -45,8 +46,6 @@ export class BacktraceCoreApi {
             options.token,
         );
 
-        this._requestHandler = options.requestHandler ?? requestHandler;
-
         this._requestBacktraceReportSubmission =
             options.requestBacktraceReportSubmission ??
             new RequestBacktraceReportSubmission(
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
index 518649e7..5c570ddf 100644
--- a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
@@ -1,4 +1,4 @@
-export interface DataBacktraceSubmitMemory {
+export interface BacktraceDataSubmitMemory {
     /**
      * An integer offset that this slice of memory starts at. The 64 bit integers are represented as strings.
      */
@@ -24,7 +24,7 @@ export interface DataBacktraceSubmitMemory {
     };
 }
 
-export interface SizedBacktraceSubmitMemory {
+export interface BacktraceSizedSubmitMemory {
     /**
      * An integer offset that this slice of memory starts at. The 64 bit integers are represented as strings.
      */
@@ -45,4 +45,4 @@ export interface SizedBacktraceSubmitMemory {
     };
 }
 
-export type BacktraceSubmitMemory = DataBacktraceSubmitMemory | SizedBacktraceSubmitMemory;
+export type BacktraceSubmitMemory = BacktraceDataSubmitMemory | BacktraceSizedSubmitMemory;

From 456e78bb4b600d1f33535af24fa5799c94773baa Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Fri, 7 Feb 2025 13:02:15 +0100
Subject: [PATCH 09/10] sdk-core: rename http models

---
 .../http/model/submit/request/BacktraceSubmitMemory.ts      | 6 +++---
 .../http/model/submit/request/BacktraceSubmitSourceCode.ts  | 6 +++---
 .../http/model/submit/request/BacktraceSubmitStackFrame.ts  | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
index 5c570ddf..71313315 100644
--- a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitMemory.ts
@@ -1,4 +1,4 @@
-export interface BacktraceDataSubmitMemory {
+export interface BacktraceSubmitDataMemory {
     /**
      * An integer offset that this slice of memory starts at. The 64 bit integers are represented as strings.
      */
@@ -24,7 +24,7 @@ export interface BacktraceDataSubmitMemory {
     };
 }
 
-export interface BacktraceSizedSubmitMemory {
+export interface BacktraceSubmitSizedMemory {
     /**
      * An integer offset that this slice of memory starts at. The 64 bit integers are represented as strings.
      */
@@ -45,4 +45,4 @@ export interface BacktraceSizedSubmitMemory {
     };
 }
 
-export type BacktraceSubmitMemory = BacktraceDataSubmitMemory | BacktraceSizedSubmitMemory;
+export type BacktraceSubmitMemory = BacktraceSubmitDataMemory | BacktraceSubmitSizedMemory;
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts
index d959a372..b6dc4f4f 100644
--- a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitSourceCode.ts
@@ -1,4 +1,4 @@
-export interface TextBacktraceSubmitSourceCode {
+export interface BacktraceSubmitTextSourceCode {
     /**
      * A string that provides the full source file or a subset of it.
      * If provided, then also `startLine` should be provided. If not provided, then `path` must be provided.
@@ -28,7 +28,7 @@ export interface TextBacktraceSubmitSourceCode {
     tabWidth?: number;
 }
 
-export interface PathBacktraceSubmitSourceCode {
+export interface BacktraceSubmitPathSourceCode {
     /**
      * A string value that provides the file system path to the original source code file.
      * If not provided, then `text` must be provided.
@@ -58,4 +58,4 @@ export interface PathBacktraceSubmitSourceCode {
     tabWidth?: number;
 }
 
-export type BacktraceSubmitSourceCode = TextBacktraceSubmitSourceCode | PathBacktraceSubmitSourceCode;
+export type BacktraceSubmitSourceCode = BacktraceSubmitTextSourceCode | BacktraceSubmitPathSourceCode;
diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
index 1642797d..4c7b3511 100644
--- a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
@@ -55,12 +55,12 @@ interface BaseBacktraceSubmitStackFrame {
     registers?: Record<string, number | string>;
 }
 
-export interface FuncBacktraceSubmitStackFrame extends BaseBacktraceSubmitStackFrame {
+export interface BacktraceSubmitFuncStackFrame extends BaseBacktraceSubmitStackFrame {
     funcName: string;
 }
 
-export interface AddressBacktraceSubmitStackFrame extends BaseBacktraceSubmitStackFrame {
+export interface BacktraceSubmitAddressStackFrame extends BaseBacktraceSubmitStackFrame {
     address: string;
 }
 
-export type BacktraceSubmitStackFrame = FuncBacktraceSubmitStackFrame | AddressBacktraceSubmitStackFrame;
+export type BacktraceSubmitStackFrame = BacktraceSubmitFuncStackFrame | BacktraceSubmitAddressStackFrame;

From 95cf2bd4c8b44c4b19f3a0e86fc890854eadd42f Mon Sep 17 00:00:00 2001
From: Sebastian Alex <sebastian.alex@saucelabs.com>
Date: Fri, 7 Feb 2025 13:03:50 +0100
Subject: [PATCH 10/10] sdk-core: rename http models

---
 .../http/model/submit/request/BacktraceSubmitStackFrame.ts  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
index 4c7b3511..3d25dce8 100644
--- a/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
+++ b/packages/sdk-core/src/model/http/model/submit/request/BacktraceSubmitStackFrame.ts
@@ -1,4 +1,4 @@
-interface BaseBacktraceSubmitStackFrame {
+interface BacktraceSubmitBaseStackFrame {
     /**
      * A boolean value that is true if the stack frame is created by hueristic method due to missing CFI,
      * and false otherwise.
@@ -55,11 +55,11 @@ interface BaseBacktraceSubmitStackFrame {
     registers?: Record<string, number | string>;
 }
 
-export interface BacktraceSubmitFuncStackFrame extends BaseBacktraceSubmitStackFrame {
+export interface BacktraceSubmitFuncStackFrame extends BacktraceSubmitBaseStackFrame {
     funcName: string;
 }
 
-export interface BacktraceSubmitAddressStackFrame extends BaseBacktraceSubmitStackFrame {
+export interface BacktraceSubmitAddressStackFrame extends BacktraceSubmitBaseStackFrame {
     address: string;
 }