@runtimescope/server-sdk 0.8.0 → 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 CHANGED
@@ -63,12 +63,14 @@ var ServerTransport = class {
63
63
  flushTimer = null;
64
64
  authToken;
65
65
  authFailed = false;
66
+ projectId;
66
67
  constructor(options) {
67
68
  this.url = options.url;
68
69
  this.sessionId = options.sessionId;
69
70
  this.appName = options.appName;
70
71
  this.sdkVersion = options.sdkVersion;
71
72
  this.authToken = options.authToken;
73
+ this.projectId = options.projectId;
72
74
  this.maxQueueSize = options.maxQueueSize ?? 1e4;
73
75
  }
74
76
  get droppedCount() {
@@ -128,7 +130,8 @@ var ServerTransport = class {
128
130
  appName: this.appName,
129
131
  sdkVersion: this.sdkVersion,
130
132
  sessionId: this.sessionId,
131
- ...this.authToken ? { authToken: this.authToken } : {}
133
+ ...this.authToken ? { authToken: this.authToken } : {},
134
+ ...this.projectId ? { projectId: this.projectId } : {}
132
135
  },
133
136
  timestamp: Date.now(),
134
137
  sessionId: this.sessionId
@@ -185,6 +188,7 @@ var HttpTransport = class {
185
188
  appName;
186
189
  sdkVersion;
187
190
  authToken;
191
+ projectId;
188
192
  maxQueueSize;
189
193
  maxRetries;
190
194
  retryDelayMs;
@@ -197,6 +201,7 @@ var HttpTransport = class {
197
201
  this.appName = options.appName;
198
202
  this.sdkVersion = options.sdkVersion;
199
203
  this.authToken = options.authToken;
204
+ this.projectId = options.projectId;
200
205
  this.maxQueueSize = options.maxQueueSize ?? 1e4;
201
206
  this.maxRetries = options.maxRetries ?? 2;
202
207
  this.retryDelayMs = options.retryDelayMs ?? 500;
@@ -226,6 +231,7 @@ var HttpTransport = class {
226
231
  if (!this.sessionRegistered) {
227
232
  payload.appName = this.appName;
228
233
  payload.sdkVersion = this.sdkVersion;
234
+ payload.projectId = this.projectId;
229
235
  }
230
236
  const body = JSON.stringify(payload);
231
237
  for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
@@ -1488,7 +1494,7 @@ function runtimeScopeMiddleware(emit, sessionId, options) {
1488
1494
  }
1489
1495
 
1490
1496
  // src/index.ts
1491
- var SDK_VERSION = "0.8.0";
1497
+ var SDK_VERSION = "0.9.0";
1492
1498
  var RuntimeScopeServer = class {
1493
1499
  transport = null;
1494
1500
  httpTransport = null;
@@ -1519,6 +1525,7 @@ var RuntimeScopeServer = class {
1519
1525
  appName: config.appName ?? "server-app",
1520
1526
  sdkVersion: SDK_VERSION,
1521
1527
  authToken: config.authToken,
1528
+ projectId: config.projectId,
1522
1529
  maxQueueSize: config.maxQueueSize,
1523
1530
  flushIntervalMs: config.httpFlushIntervalMs
1524
1531
  });
@@ -1529,6 +1536,7 @@ var RuntimeScopeServer = class {
1529
1536
  appName: config.appName ?? "server-app",
1530
1537
  sdkVersion: SDK_VERSION,
1531
1538
  authToken: config.authToken,
1539
+ projectId: config.projectId,
1532
1540
  maxQueueSize: config.maxQueueSize
1533
1541
  });
1534
1542
  this.transport.connect();