@airtop/sdk 1.0.0-alpha2.14 → 1.0.0-alpha2.15

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
@@ -9,7 +9,7 @@ var require_package = __commonJS({
9
9
  module.exports = {
10
10
  name: "@airtop/sdk",
11
11
  description: "Airtop SDK for TypeScript",
12
- version: "1.0.0-alpha2.14",
12
+ version: "1.0.0-alpha2.15",
13
13
  type: "module",
14
14
  main: "./dist/index.cjs",
15
15
  module: "./dist/index.js",
@@ -121,6 +121,9 @@ var AirtopBase = class {
121
121
  this.client = config.client;
122
122
  this.outputJsonAdapter = config.outputSchemaAdapter;
123
123
  this.jobId = config.jobId;
124
+ if (config.agentEventPublisher) {
125
+ this.agentEventPublisher = config.agentEventPublisher;
126
+ }
124
127
  }
125
128
  /**
126
129
  * Sets the publisher for sending agent events. Internal use only.
@@ -193,7 +196,9 @@ var AirtopBase = class {
193
196
  return {
194
197
  client: this.client,
195
198
  log: this.log,
196
- jobId: this.jobId
199
+ jobId: this.jobId,
200
+ outputSchemaAdapter: this.outputJsonAdapter,
201
+ agentEventPublisher: this.agentEventPublisher
197
202
  };
198
203
  }
199
204
  /**
@@ -513,6 +518,20 @@ var AirtopWindowClient = class extends AirtopBase {
513
518
  });
514
519
  this.windowId = windowId;
515
520
  this.sessionId = sessionId;
521
+ this.client.windows.get(
522
+ this.windowId,
523
+ {
524
+ sessionId: this.sessionId,
525
+ ...config
526
+ },
527
+ this.resolveRequestOptions()
528
+ ).then((results) => {
529
+ this._sendAgentPayload("LiveViewUrl", {
530
+ liveViewUrl: results.data.liveViewUrl,
531
+ windowId: this.windowId,
532
+ sessionId: this.sessionId
533
+ });
534
+ });
516
535
  }
517
536
  /**
518
537
  * Gets the window ID.
@@ -541,11 +560,6 @@ var AirtopWindowClient = class extends AirtopBase {
541
560
  },
542
561
  this.resolveRequestOptions(requestOptions)
543
562
  );
544
- this._sendAgentPayload("LiveViewUrl", {
545
- liveViewUrl: results.data.liveViewUrl,
546
- windowId: this.windowId,
547
- sessionId: this.sessionId
548
- });
549
563
  return new AirtopWindow(this.getCommonConfig(), this.sessionId, results);
550
564
  }
551
565
  /**
@@ -1119,6 +1133,19 @@ var AirtopSessionClient = class extends AirtopBase {
1119
1133
  },
1120
1134
  this.resolveRequestOptions(requestOptions)
1121
1135
  );
1136
+ this.client.windows.get(
1137
+ results.data.windowId,
1138
+ {
1139
+ sessionId: this.sessionId
1140
+ },
1141
+ this.resolveRequestOptions()
1142
+ ).then((windowResults) => {
1143
+ this._sendAgentPayload("LiveViewUrl", {
1144
+ liveViewUrl: windowResults.data.liveViewUrl,
1145
+ windowId: results.data.windowId,
1146
+ sessionId: this.sessionId
1147
+ });
1148
+ });
1122
1149
  return new AirtopWindow(this.getCommonConfig(), this.sessionId, results);
1123
1150
  }
1124
1151
  /**
@@ -1228,7 +1255,8 @@ var AirtopClient = class extends AirtopBase {
1228
1255
  metadataFieldName: "metadata"
1229
1256
  }),
1230
1257
  outputSchemaAdapter: config.outputSchemaAdapter,
1231
- jobId: config.jobId
1258
+ jobId: config.jobId,
1259
+ agentEventPublisher: config.agentEventPublisher
1232
1260
  });
1233
1261
  this.log.withPrefix("[Airtop SDK]");
1234
1262
  this.client.logLevel = config.logLevel;