@runtimescope/server-sdk 0.7.2 → 0.9.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/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -73,6 +73,7 @@ interface ServerSdkConfig {
|
|
|
73
73
|
endpoint?: string;
|
|
74
74
|
appName?: string;
|
|
75
75
|
sessionId?: string;
|
|
76
|
+
projectId?: string;
|
|
76
77
|
/** API key for authenticated connections to the collector */
|
|
77
78
|
authToken?: string;
|
|
78
79
|
captureStackTraces?: boolean;
|
|
@@ -174,6 +175,7 @@ interface HttpTransportOptions {
|
|
|
174
175
|
appName: string;
|
|
175
176
|
sdkVersion: string;
|
|
176
177
|
authToken?: string;
|
|
178
|
+
projectId?: string;
|
|
177
179
|
maxQueueSize?: number;
|
|
178
180
|
flushIntervalMs?: number;
|
|
179
181
|
maxRetries?: number;
|
|
@@ -186,6 +188,7 @@ declare class HttpTransport {
|
|
|
186
188
|
private appName;
|
|
187
189
|
private sdkVersion;
|
|
188
190
|
private authToken;
|
|
191
|
+
private projectId?;
|
|
189
192
|
private maxQueueSize;
|
|
190
193
|
private maxRetries;
|
|
191
194
|
private retryDelayMs;
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ interface ServerSdkConfig {
|
|
|
73
73
|
endpoint?: string;
|
|
74
74
|
appName?: string;
|
|
75
75
|
sessionId?: string;
|
|
76
|
+
projectId?: string;
|
|
76
77
|
/** API key for authenticated connections to the collector */
|
|
77
78
|
authToken?: string;
|
|
78
79
|
captureStackTraces?: boolean;
|
|
@@ -174,6 +175,7 @@ interface HttpTransportOptions {
|
|
|
174
175
|
appName: string;
|
|
175
176
|
sdkVersion: string;
|
|
176
177
|
authToken?: string;
|
|
178
|
+
projectId?: string;
|
|
177
179
|
maxQueueSize?: number;
|
|
178
180
|
flushIntervalMs?: number;
|
|
179
181
|
maxRetries?: number;
|
|
@@ -186,6 +188,7 @@ declare class HttpTransport {
|
|
|
186
188
|
private appName;
|
|
187
189
|
private sdkVersion;
|
|
188
190
|
private authToken;
|
|
191
|
+
private projectId?;
|
|
189
192
|
private maxQueueSize;
|
|
190
193
|
private maxRetries;
|
|
191
194
|
private retryDelayMs;
|
package/dist/index.js
CHANGED
|
@@ -14,12 +14,14 @@ var ServerTransport = class {
|
|
|
14
14
|
flushTimer = null;
|
|
15
15
|
authToken;
|
|
16
16
|
authFailed = false;
|
|
17
|
+
projectId;
|
|
17
18
|
constructor(options) {
|
|
18
19
|
this.url = options.url;
|
|
19
20
|
this.sessionId = options.sessionId;
|
|
20
21
|
this.appName = options.appName;
|
|
21
22
|
this.sdkVersion = options.sdkVersion;
|
|
22
23
|
this.authToken = options.authToken;
|
|
24
|
+
this.projectId = options.projectId;
|
|
23
25
|
this.maxQueueSize = options.maxQueueSize ?? 1e4;
|
|
24
26
|
}
|
|
25
27
|
get droppedCount() {
|
|
@@ -79,7 +81,8 @@ var ServerTransport = class {
|
|
|
79
81
|
appName: this.appName,
|
|
80
82
|
sdkVersion: this.sdkVersion,
|
|
81
83
|
sessionId: this.sessionId,
|
|
82
|
-
...this.authToken ? { authToken: this.authToken } : {}
|
|
84
|
+
...this.authToken ? { authToken: this.authToken } : {},
|
|
85
|
+
...this.projectId ? { projectId: this.projectId } : {}
|
|
83
86
|
},
|
|
84
87
|
timestamp: Date.now(),
|
|
85
88
|
sessionId: this.sessionId
|
|
@@ -136,6 +139,7 @@ var HttpTransport = class {
|
|
|
136
139
|
appName;
|
|
137
140
|
sdkVersion;
|
|
138
141
|
authToken;
|
|
142
|
+
projectId;
|
|
139
143
|
maxQueueSize;
|
|
140
144
|
maxRetries;
|
|
141
145
|
retryDelayMs;
|
|
@@ -148,6 +152,7 @@ var HttpTransport = class {
|
|
|
148
152
|
this.appName = options.appName;
|
|
149
153
|
this.sdkVersion = options.sdkVersion;
|
|
150
154
|
this.authToken = options.authToken;
|
|
155
|
+
this.projectId = options.projectId;
|
|
151
156
|
this.maxQueueSize = options.maxQueueSize ?? 1e4;
|
|
152
157
|
this.maxRetries = options.maxRetries ?? 2;
|
|
153
158
|
this.retryDelayMs = options.retryDelayMs ?? 500;
|
|
@@ -177,6 +182,7 @@ var HttpTransport = class {
|
|
|
177
182
|
if (!this.sessionRegistered) {
|
|
178
183
|
payload.appName = this.appName;
|
|
179
184
|
payload.sdkVersion = this.sdkVersion;
|
|
185
|
+
payload.projectId = this.projectId;
|
|
180
186
|
}
|
|
181
187
|
const body = JSON.stringify(payload);
|
|
182
188
|
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
@@ -1439,7 +1445,7 @@ function runtimeScopeMiddleware(emit, sessionId, options) {
|
|
|
1439
1445
|
}
|
|
1440
1446
|
|
|
1441
1447
|
// src/index.ts
|
|
1442
|
-
var SDK_VERSION = "0.
|
|
1448
|
+
var SDK_VERSION = "0.9.0";
|
|
1443
1449
|
var RuntimeScopeServer = class {
|
|
1444
1450
|
transport = null;
|
|
1445
1451
|
httpTransport = null;
|
|
@@ -1470,6 +1476,7 @@ var RuntimeScopeServer = class {
|
|
|
1470
1476
|
appName: config.appName ?? "server-app",
|
|
1471
1477
|
sdkVersion: SDK_VERSION,
|
|
1472
1478
|
authToken: config.authToken,
|
|
1479
|
+
projectId: config.projectId,
|
|
1473
1480
|
maxQueueSize: config.maxQueueSize,
|
|
1474
1481
|
flushIntervalMs: config.httpFlushIntervalMs
|
|
1475
1482
|
});
|
|
@@ -1480,6 +1487,7 @@ var RuntimeScopeServer = class {
|
|
|
1480
1487
|
appName: config.appName ?? "server-app",
|
|
1481
1488
|
sdkVersion: SDK_VERSION,
|
|
1482
1489
|
authToken: config.authToken,
|
|
1490
|
+
projectId: config.projectId,
|
|
1483
1491
|
maxQueueSize: config.maxQueueSize
|
|
1484
1492
|
});
|
|
1485
1493
|
this.transport.connect();
|