@airtop/sdk 0.1.14 → 0.1.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/api/resources/profiles/client/Client.js +2 -2
- package/api/resources/sessions/client/Client.js +12 -12
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
- package/api/resources/sessions/types/index.d.ts +1 -1
- package/api/resources/sessions/types/index.js +1 -1
- package/api/resources/windows/client/Client.js +26 -26
- package/dist/api/resources/profiles/client/Client.js +2 -2
- package/dist/api/resources/sessions/client/Client.js +12 -12
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +4 -4
- package/dist/api/resources/sessions/types/index.d.ts +1 -1
- package/dist/api/resources/sessions/types/index.js +1 -1
- package/dist/api/resources/windows/client/Client.js +26 -26
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
- package/dist/serialization/resources/sessions/types/index.d.ts +1 -1
- package/dist/serialization/resources/sessions/types/index.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/process-screenshots.d.ts +10 -0
- package/dist/utils/process-screenshots.js +59 -0
- package/package.json +1 -1
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +5 -5
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +2 -2
- package/serialization/resources/sessions/types/index.d.ts +1 -1
- package/serialization/resources/sessions/types/index.js +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/process-screenshots.d.ts +10 -0
- package/utils/process-screenshots.js +59 -0
@@ -84,8 +84,8 @@ class Profiles {
|
|
84
84
|
Authorization: yield this._getAuthorizationHeader(),
|
85
85
|
"X-Fern-Language": "JavaScript",
|
86
86
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
87
|
-
"X-Fern-SDK-Version": "0.1.
|
88
|
-
"User-Agent": "@airtop/sdk/0.1.
|
87
|
+
"X-Fern-SDK-Version": "0.1.15",
|
88
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
89
89
|
"X-Fern-Runtime": core.RUNTIME.type,
|
90
90
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
91
91
|
},
|
@@ -94,8 +94,8 @@ class Sessions {
|
|
94
94
|
Authorization: yield this._getAuthorizationHeader(),
|
95
95
|
"X-Fern-Language": "JavaScript",
|
96
96
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
97
|
-
"X-Fern-SDK-Version": "0.1.
|
98
|
-
"User-Agent": "@airtop/sdk/0.1.
|
97
|
+
"X-Fern-SDK-Version": "0.1.15",
|
98
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
99
99
|
"X-Fern-Runtime": core.RUNTIME.type,
|
100
100
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
101
101
|
},
|
@@ -180,8 +180,8 @@ class Sessions {
|
|
180
180
|
Authorization: yield this._getAuthorizationHeader(),
|
181
181
|
"X-Fern-Language": "JavaScript",
|
182
182
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
183
|
-
"X-Fern-SDK-Version": "0.1.
|
184
|
-
"User-Agent": "@airtop/sdk/0.1.
|
183
|
+
"X-Fern-SDK-Version": "0.1.15",
|
184
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
185
185
|
"X-Fern-Runtime": core.RUNTIME.type,
|
186
186
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
187
187
|
},
|
@@ -245,8 +245,8 @@ class Sessions {
|
|
245
245
|
Authorization: yield this._getAuthorizationHeader(),
|
246
246
|
"X-Fern-Language": "JavaScript",
|
247
247
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
248
|
-
"X-Fern-SDK-Version": "0.1.
|
249
|
-
"User-Agent": "@airtop/sdk/0.1.
|
248
|
+
"X-Fern-SDK-Version": "0.1.15",
|
249
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
250
250
|
"X-Fern-Runtime": core.RUNTIME.type,
|
251
251
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
252
252
|
},
|
@@ -332,8 +332,8 @@ class Sessions {
|
|
332
332
|
Authorization: yield this._getAuthorizationHeader(),
|
333
333
|
"X-Fern-Language": "JavaScript",
|
334
334
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
335
|
-
"X-Fern-SDK-Version": "0.1.
|
336
|
-
"User-Agent": "@airtop/sdk/0.1.
|
335
|
+
"X-Fern-SDK-Version": "0.1.15",
|
336
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
337
337
|
"X-Fern-Runtime": core.RUNTIME.type,
|
338
338
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
339
339
|
},
|
@@ -388,8 +388,8 @@ class Sessions {
|
|
388
388
|
Authorization: yield this._getAuthorizationHeader(),
|
389
389
|
"X-Fern-Language": "JavaScript",
|
390
390
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
391
|
-
"X-Fern-SDK-Version": "0.1.
|
392
|
-
"User-Agent": "@airtop/sdk/0.1.
|
391
|
+
"X-Fern-SDK-Version": "0.1.15",
|
392
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
393
393
|
"X-Fern-Runtime": core.RUNTIME.type,
|
394
394
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
395
395
|
},
|
@@ -486,8 +486,8 @@ class Sessions {
|
|
486
486
|
Authorization: yield this._getAuthorizationHeader(),
|
487
487
|
"X-Fern-Language": "JavaScript",
|
488
488
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
489
|
-
"X-Fern-SDK-Version": "0.1.
|
490
|
-
"User-Agent": "@airtop/sdk/0.1.
|
489
|
+
"X-Fern-SDK-Version": "0.1.15",
|
490
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
491
491
|
"X-Fern-Runtime": core.RUNTIME.type,
|
492
492
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
493
493
|
},
|
@@ -5,11 +5,8 @@ import * as Airtop from "../../../index";
|
|
5
5
|
/**
|
6
6
|
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
|
7
7
|
*/
|
8
|
-
export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.
|
8
|
+
export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.Status | Airtop.SessionsEventsResponse.Error_ | Airtop.SessionsEventsResponse.WindowEvent | Airtop.SessionsEventsResponse.SessionEvent;
|
9
9
|
export declare namespace SessionsEventsResponse {
|
10
|
-
interface SessionEvent extends Airtop.SessionsEventsResponseSessionEvent {
|
11
|
-
event: "sessionEvent";
|
12
|
-
}
|
13
10
|
interface Status extends Airtop.SessionsEventsResponseStatus {
|
14
11
|
event: "status";
|
15
12
|
}
|
@@ -19,4 +16,7 @@ export declare namespace SessionsEventsResponse {
|
|
19
16
|
interface WindowEvent extends Airtop.SessionsEventsResponseWindowEvent {
|
20
17
|
event: "windowEvent";
|
21
18
|
}
|
19
|
+
interface SessionEvent extends Airtop.SessionsEventsResponseSessionEvent {
|
20
|
+
event: "sessionEvent";
|
21
|
+
}
|
22
22
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from "./SessionsListRequestStatus";
|
2
|
-
export * from "./SessionsEventsResponseSessionEvent";
|
3
2
|
export * from "./SessionsEventsResponseStatus";
|
4
3
|
export * from "./SessionsEventsResponseError";
|
5
4
|
export * from "./SessionsEventsResponseWindowEvent";
|
5
|
+
export * from "./SessionsEventsResponseSessionEvent";
|
6
6
|
export * from "./SessionsEventsResponse";
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./SessionsListRequestStatus"), exports);
|
18
|
-
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
19
18
|
__exportStar(require("./SessionsEventsResponseStatus"), exports);
|
20
19
|
__exportStar(require("./SessionsEventsResponseError"), exports);
|
21
20
|
__exportStar(require("./SessionsEventsResponseWindowEvent"), exports);
|
21
|
+
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
22
22
|
__exportStar(require("./SessionsEventsResponse"), exports);
|
@@ -68,8 +68,8 @@ class Windows {
|
|
68
68
|
Authorization: yield this._getAuthorizationHeader(),
|
69
69
|
"X-Fern-Language": "JavaScript",
|
70
70
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
71
|
-
"X-Fern-SDK-Version": "0.1.
|
72
|
-
"User-Agent": "@airtop/sdk/0.1.
|
71
|
+
"X-Fern-SDK-Version": "0.1.15",
|
72
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
73
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
74
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
75
75
|
},
|
@@ -144,8 +144,8 @@ class Windows {
|
|
144
144
|
Authorization: yield this._getAuthorizationHeader(),
|
145
145
|
"X-Fern-Language": "JavaScript",
|
146
146
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
147
|
-
"X-Fern-SDK-Version": "0.1.
|
148
|
-
"User-Agent": "@airtop/sdk/0.1.
|
147
|
+
"X-Fern-SDK-Version": "0.1.15",
|
148
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
149
149
|
"X-Fern-Runtime": core.RUNTIME.type,
|
150
150
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
151
151
|
},
|
@@ -209,8 +209,8 @@ class Windows {
|
|
209
209
|
Authorization: yield this._getAuthorizationHeader(),
|
210
210
|
"X-Fern-Language": "JavaScript",
|
211
211
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
212
|
-
"X-Fern-SDK-Version": "0.1.
|
213
|
-
"User-Agent": "@airtop/sdk/0.1.
|
212
|
+
"X-Fern-SDK-Version": "0.1.15",
|
213
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
214
214
|
"X-Fern-Runtime": core.RUNTIME.type,
|
215
215
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
216
216
|
},
|
@@ -271,8 +271,8 @@ class Windows {
|
|
271
271
|
Authorization: yield this._getAuthorizationHeader(),
|
272
272
|
"X-Fern-Language": "JavaScript",
|
273
273
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
274
|
-
"X-Fern-SDK-Version": "0.1.
|
275
|
-
"User-Agent": "@airtop/sdk/0.1.
|
274
|
+
"X-Fern-SDK-Version": "0.1.15",
|
275
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
276
276
|
"X-Fern-Runtime": core.RUNTIME.type,
|
277
277
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
278
278
|
},
|
@@ -335,8 +335,8 @@ class Windows {
|
|
335
335
|
Authorization: yield this._getAuthorizationHeader(),
|
336
336
|
"X-Fern-Language": "JavaScript",
|
337
337
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
338
|
-
"X-Fern-SDK-Version": "0.1.
|
339
|
-
"User-Agent": "@airtop/sdk/0.1.
|
338
|
+
"X-Fern-SDK-Version": "0.1.15",
|
339
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
340
340
|
"X-Fern-Runtime": core.RUNTIME.type,
|
341
341
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
342
342
|
},
|
@@ -398,8 +398,8 @@ class Windows {
|
|
398
398
|
Authorization: yield this._getAuthorizationHeader(),
|
399
399
|
"X-Fern-Language": "JavaScript",
|
400
400
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
401
|
-
"X-Fern-SDK-Version": "0.1.
|
402
|
-
"User-Agent": "@airtop/sdk/0.1.
|
401
|
+
"X-Fern-SDK-Version": "0.1.15",
|
402
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
403
403
|
"X-Fern-Runtime": core.RUNTIME.type,
|
404
404
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
405
405
|
},
|
@@ -463,8 +463,8 @@ class Windows {
|
|
463
463
|
Authorization: yield this._getAuthorizationHeader(),
|
464
464
|
"X-Fern-Language": "JavaScript",
|
465
465
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
466
|
-
"X-Fern-SDK-Version": "0.1.
|
467
|
-
"User-Agent": "@airtop/sdk/0.1.
|
466
|
+
"X-Fern-SDK-Version": "0.1.15",
|
467
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
468
468
|
"X-Fern-Runtime": core.RUNTIME.type,
|
469
469
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
470
470
|
},
|
@@ -528,8 +528,8 @@ class Windows {
|
|
528
528
|
Authorization: yield this._getAuthorizationHeader(),
|
529
529
|
"X-Fern-Language": "JavaScript",
|
530
530
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
531
|
-
"X-Fern-SDK-Version": "0.1.
|
532
|
-
"User-Agent": "@airtop/sdk/0.1.
|
531
|
+
"X-Fern-SDK-Version": "0.1.15",
|
532
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
533
533
|
"X-Fern-Runtime": core.RUNTIME.type,
|
534
534
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
535
535
|
},
|
@@ -595,8 +595,8 @@ class Windows {
|
|
595
595
|
Authorization: yield this._getAuthorizationHeader(),
|
596
596
|
"X-Fern-Language": "JavaScript",
|
597
597
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
598
|
-
"X-Fern-SDK-Version": "0.1.
|
599
|
-
"User-Agent": "@airtop/sdk/0.1.
|
598
|
+
"X-Fern-SDK-Version": "0.1.15",
|
599
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
600
600
|
"X-Fern-Runtime": core.RUNTIME.type,
|
601
601
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
602
602
|
},
|
@@ -660,8 +660,8 @@ class Windows {
|
|
660
660
|
Authorization: yield this._getAuthorizationHeader(),
|
661
661
|
"X-Fern-Language": "JavaScript",
|
662
662
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
663
|
-
"X-Fern-SDK-Version": "0.1.
|
664
|
-
"User-Agent": "@airtop/sdk/0.1.
|
663
|
+
"X-Fern-SDK-Version": "0.1.15",
|
664
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
665
665
|
"X-Fern-Runtime": core.RUNTIME.type,
|
666
666
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
667
667
|
},
|
@@ -723,8 +723,8 @@ class Windows {
|
|
723
723
|
Authorization: yield this._getAuthorizationHeader(),
|
724
724
|
"X-Fern-Language": "JavaScript",
|
725
725
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
726
|
-
"X-Fern-SDK-Version": "0.1.
|
727
|
-
"User-Agent": "@airtop/sdk/0.1.
|
726
|
+
"X-Fern-SDK-Version": "0.1.15",
|
727
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
728
728
|
"X-Fern-Runtime": core.RUNTIME.type,
|
729
729
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
730
730
|
},
|
@@ -788,8 +788,8 @@ class Windows {
|
|
788
788
|
Authorization: yield this._getAuthorizationHeader(),
|
789
789
|
"X-Fern-Language": "JavaScript",
|
790
790
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
791
|
-
"X-Fern-SDK-Version": "0.1.
|
792
|
-
"User-Agent": "@airtop/sdk/0.1.
|
791
|
+
"X-Fern-SDK-Version": "0.1.15",
|
792
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
793
793
|
"X-Fern-Runtime": core.RUNTIME.type,
|
794
794
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
795
795
|
},
|
@@ -855,8 +855,8 @@ class Windows {
|
|
855
855
|
Authorization: yield this._getAuthorizationHeader(),
|
856
856
|
"X-Fern-Language": "JavaScript",
|
857
857
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
858
|
-
"X-Fern-SDK-Version": "0.1.
|
859
|
-
"User-Agent": "@airtop/sdk/0.1.
|
858
|
+
"X-Fern-SDK-Version": "0.1.15",
|
859
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
860
860
|
"X-Fern-Runtime": core.RUNTIME.type,
|
861
861
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
862
862
|
},
|
@@ -84,8 +84,8 @@ class Profiles {
|
|
84
84
|
Authorization: yield this._getAuthorizationHeader(),
|
85
85
|
"X-Fern-Language": "JavaScript",
|
86
86
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
87
|
-
"X-Fern-SDK-Version": "0.1.
|
88
|
-
"User-Agent": "@airtop/sdk/0.1.
|
87
|
+
"X-Fern-SDK-Version": "0.1.15",
|
88
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
89
89
|
"X-Fern-Runtime": core.RUNTIME.type,
|
90
90
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
91
91
|
},
|
@@ -94,8 +94,8 @@ class Sessions {
|
|
94
94
|
Authorization: yield this._getAuthorizationHeader(),
|
95
95
|
"X-Fern-Language": "JavaScript",
|
96
96
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
97
|
-
"X-Fern-SDK-Version": "0.1.
|
98
|
-
"User-Agent": "@airtop/sdk/0.1.
|
97
|
+
"X-Fern-SDK-Version": "0.1.15",
|
98
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
99
99
|
"X-Fern-Runtime": core.RUNTIME.type,
|
100
100
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
101
101
|
},
|
@@ -180,8 +180,8 @@ class Sessions {
|
|
180
180
|
Authorization: yield this._getAuthorizationHeader(),
|
181
181
|
"X-Fern-Language": "JavaScript",
|
182
182
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
183
|
-
"X-Fern-SDK-Version": "0.1.
|
184
|
-
"User-Agent": "@airtop/sdk/0.1.
|
183
|
+
"X-Fern-SDK-Version": "0.1.15",
|
184
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
185
185
|
"X-Fern-Runtime": core.RUNTIME.type,
|
186
186
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
187
187
|
},
|
@@ -245,8 +245,8 @@ class Sessions {
|
|
245
245
|
Authorization: yield this._getAuthorizationHeader(),
|
246
246
|
"X-Fern-Language": "JavaScript",
|
247
247
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
248
|
-
"X-Fern-SDK-Version": "0.1.
|
249
|
-
"User-Agent": "@airtop/sdk/0.1.
|
248
|
+
"X-Fern-SDK-Version": "0.1.15",
|
249
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
250
250
|
"X-Fern-Runtime": core.RUNTIME.type,
|
251
251
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
252
252
|
},
|
@@ -332,8 +332,8 @@ class Sessions {
|
|
332
332
|
Authorization: yield this._getAuthorizationHeader(),
|
333
333
|
"X-Fern-Language": "JavaScript",
|
334
334
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
335
|
-
"X-Fern-SDK-Version": "0.1.
|
336
|
-
"User-Agent": "@airtop/sdk/0.1.
|
335
|
+
"X-Fern-SDK-Version": "0.1.15",
|
336
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
337
337
|
"X-Fern-Runtime": core.RUNTIME.type,
|
338
338
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
339
339
|
},
|
@@ -388,8 +388,8 @@ class Sessions {
|
|
388
388
|
Authorization: yield this._getAuthorizationHeader(),
|
389
389
|
"X-Fern-Language": "JavaScript",
|
390
390
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
391
|
-
"X-Fern-SDK-Version": "0.1.
|
392
|
-
"User-Agent": "@airtop/sdk/0.1.
|
391
|
+
"X-Fern-SDK-Version": "0.1.15",
|
392
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
393
393
|
"X-Fern-Runtime": core.RUNTIME.type,
|
394
394
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
395
395
|
},
|
@@ -486,8 +486,8 @@ class Sessions {
|
|
486
486
|
Authorization: yield this._getAuthorizationHeader(),
|
487
487
|
"X-Fern-Language": "JavaScript",
|
488
488
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
489
|
-
"X-Fern-SDK-Version": "0.1.
|
490
|
-
"User-Agent": "@airtop/sdk/0.1.
|
489
|
+
"X-Fern-SDK-Version": "0.1.15",
|
490
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
491
491
|
"X-Fern-Runtime": core.RUNTIME.type,
|
492
492
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
493
493
|
},
|
@@ -5,11 +5,8 @@ import * as Airtop from "../../../index";
|
|
5
5
|
/**
|
6
6
|
* Each oneOf object in the array represents one possible Server Sent Events (SSE) message, serialized as UTF-8 text according to the SSE specification.
|
7
7
|
*/
|
8
|
-
export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.
|
8
|
+
export declare type SessionsEventsResponse = Airtop.SessionsEventsResponse.Status | Airtop.SessionsEventsResponse.Error_ | Airtop.SessionsEventsResponse.WindowEvent | Airtop.SessionsEventsResponse.SessionEvent;
|
9
9
|
export declare namespace SessionsEventsResponse {
|
10
|
-
interface SessionEvent extends Airtop.SessionsEventsResponseSessionEvent {
|
11
|
-
event: "sessionEvent";
|
12
|
-
}
|
13
10
|
interface Status extends Airtop.SessionsEventsResponseStatus {
|
14
11
|
event: "status";
|
15
12
|
}
|
@@ -19,4 +16,7 @@ export declare namespace SessionsEventsResponse {
|
|
19
16
|
interface WindowEvent extends Airtop.SessionsEventsResponseWindowEvent {
|
20
17
|
event: "windowEvent";
|
21
18
|
}
|
19
|
+
interface SessionEvent extends Airtop.SessionsEventsResponseSessionEvent {
|
20
|
+
event: "sessionEvent";
|
21
|
+
}
|
22
22
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from "./SessionsListRequestStatus";
|
2
|
-
export * from "./SessionsEventsResponseSessionEvent";
|
3
2
|
export * from "./SessionsEventsResponseStatus";
|
4
3
|
export * from "./SessionsEventsResponseError";
|
5
4
|
export * from "./SessionsEventsResponseWindowEvent";
|
5
|
+
export * from "./SessionsEventsResponseSessionEvent";
|
6
6
|
export * from "./SessionsEventsResponse";
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./SessionsListRequestStatus"), exports);
|
18
|
-
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
19
18
|
__exportStar(require("./SessionsEventsResponseStatus"), exports);
|
20
19
|
__exportStar(require("./SessionsEventsResponseError"), exports);
|
21
20
|
__exportStar(require("./SessionsEventsResponseWindowEvent"), exports);
|
21
|
+
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
22
22
|
__exportStar(require("./SessionsEventsResponse"), exports);
|
@@ -68,8 +68,8 @@ class Windows {
|
|
68
68
|
Authorization: yield this._getAuthorizationHeader(),
|
69
69
|
"X-Fern-Language": "JavaScript",
|
70
70
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
71
|
-
"X-Fern-SDK-Version": "0.1.
|
72
|
-
"User-Agent": "@airtop/sdk/0.1.
|
71
|
+
"X-Fern-SDK-Version": "0.1.15",
|
72
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
73
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
74
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
75
75
|
},
|
@@ -144,8 +144,8 @@ class Windows {
|
|
144
144
|
Authorization: yield this._getAuthorizationHeader(),
|
145
145
|
"X-Fern-Language": "JavaScript",
|
146
146
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
147
|
-
"X-Fern-SDK-Version": "0.1.
|
148
|
-
"User-Agent": "@airtop/sdk/0.1.
|
147
|
+
"X-Fern-SDK-Version": "0.1.15",
|
148
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
149
149
|
"X-Fern-Runtime": core.RUNTIME.type,
|
150
150
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
151
151
|
},
|
@@ -209,8 +209,8 @@ class Windows {
|
|
209
209
|
Authorization: yield this._getAuthorizationHeader(),
|
210
210
|
"X-Fern-Language": "JavaScript",
|
211
211
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
212
|
-
"X-Fern-SDK-Version": "0.1.
|
213
|
-
"User-Agent": "@airtop/sdk/0.1.
|
212
|
+
"X-Fern-SDK-Version": "0.1.15",
|
213
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
214
214
|
"X-Fern-Runtime": core.RUNTIME.type,
|
215
215
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
216
216
|
},
|
@@ -271,8 +271,8 @@ class Windows {
|
|
271
271
|
Authorization: yield this._getAuthorizationHeader(),
|
272
272
|
"X-Fern-Language": "JavaScript",
|
273
273
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
274
|
-
"X-Fern-SDK-Version": "0.1.
|
275
|
-
"User-Agent": "@airtop/sdk/0.1.
|
274
|
+
"X-Fern-SDK-Version": "0.1.15",
|
275
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
276
276
|
"X-Fern-Runtime": core.RUNTIME.type,
|
277
277
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
278
278
|
},
|
@@ -335,8 +335,8 @@ class Windows {
|
|
335
335
|
Authorization: yield this._getAuthorizationHeader(),
|
336
336
|
"X-Fern-Language": "JavaScript",
|
337
337
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
338
|
-
"X-Fern-SDK-Version": "0.1.
|
339
|
-
"User-Agent": "@airtop/sdk/0.1.
|
338
|
+
"X-Fern-SDK-Version": "0.1.15",
|
339
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
340
340
|
"X-Fern-Runtime": core.RUNTIME.type,
|
341
341
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
342
342
|
},
|
@@ -398,8 +398,8 @@ class Windows {
|
|
398
398
|
Authorization: yield this._getAuthorizationHeader(),
|
399
399
|
"X-Fern-Language": "JavaScript",
|
400
400
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
401
|
-
"X-Fern-SDK-Version": "0.1.
|
402
|
-
"User-Agent": "@airtop/sdk/0.1.
|
401
|
+
"X-Fern-SDK-Version": "0.1.15",
|
402
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
403
403
|
"X-Fern-Runtime": core.RUNTIME.type,
|
404
404
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
405
405
|
},
|
@@ -463,8 +463,8 @@ class Windows {
|
|
463
463
|
Authorization: yield this._getAuthorizationHeader(),
|
464
464
|
"X-Fern-Language": "JavaScript",
|
465
465
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
466
|
-
"X-Fern-SDK-Version": "0.1.
|
467
|
-
"User-Agent": "@airtop/sdk/0.1.
|
466
|
+
"X-Fern-SDK-Version": "0.1.15",
|
467
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
468
468
|
"X-Fern-Runtime": core.RUNTIME.type,
|
469
469
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
470
470
|
},
|
@@ -528,8 +528,8 @@ class Windows {
|
|
528
528
|
Authorization: yield this._getAuthorizationHeader(),
|
529
529
|
"X-Fern-Language": "JavaScript",
|
530
530
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
531
|
-
"X-Fern-SDK-Version": "0.1.
|
532
|
-
"User-Agent": "@airtop/sdk/0.1.
|
531
|
+
"X-Fern-SDK-Version": "0.1.15",
|
532
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
533
533
|
"X-Fern-Runtime": core.RUNTIME.type,
|
534
534
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
535
535
|
},
|
@@ -595,8 +595,8 @@ class Windows {
|
|
595
595
|
Authorization: yield this._getAuthorizationHeader(),
|
596
596
|
"X-Fern-Language": "JavaScript",
|
597
597
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
598
|
-
"X-Fern-SDK-Version": "0.1.
|
599
|
-
"User-Agent": "@airtop/sdk/0.1.
|
598
|
+
"X-Fern-SDK-Version": "0.1.15",
|
599
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
600
600
|
"X-Fern-Runtime": core.RUNTIME.type,
|
601
601
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
602
602
|
},
|
@@ -660,8 +660,8 @@ class Windows {
|
|
660
660
|
Authorization: yield this._getAuthorizationHeader(),
|
661
661
|
"X-Fern-Language": "JavaScript",
|
662
662
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
663
|
-
"X-Fern-SDK-Version": "0.1.
|
664
|
-
"User-Agent": "@airtop/sdk/0.1.
|
663
|
+
"X-Fern-SDK-Version": "0.1.15",
|
664
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
665
665
|
"X-Fern-Runtime": core.RUNTIME.type,
|
666
666
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
667
667
|
},
|
@@ -723,8 +723,8 @@ class Windows {
|
|
723
723
|
Authorization: yield this._getAuthorizationHeader(),
|
724
724
|
"X-Fern-Language": "JavaScript",
|
725
725
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
726
|
-
"X-Fern-SDK-Version": "0.1.
|
727
|
-
"User-Agent": "@airtop/sdk/0.1.
|
726
|
+
"X-Fern-SDK-Version": "0.1.15",
|
727
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
728
728
|
"X-Fern-Runtime": core.RUNTIME.type,
|
729
729
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
730
730
|
},
|
@@ -788,8 +788,8 @@ class Windows {
|
|
788
788
|
Authorization: yield this._getAuthorizationHeader(),
|
789
789
|
"X-Fern-Language": "JavaScript",
|
790
790
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
791
|
-
"X-Fern-SDK-Version": "0.1.
|
792
|
-
"User-Agent": "@airtop/sdk/0.1.
|
791
|
+
"X-Fern-SDK-Version": "0.1.15",
|
792
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
793
793
|
"X-Fern-Runtime": core.RUNTIME.type,
|
794
794
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
795
795
|
},
|
@@ -855,8 +855,8 @@ class Windows {
|
|
855
855
|
Authorization: yield this._getAuthorizationHeader(),
|
856
856
|
"X-Fern-Language": "JavaScript",
|
857
857
|
"X-Fern-SDK-Name": "@airtop/sdk",
|
858
|
-
"X-Fern-SDK-Version": "0.1.
|
859
|
-
"User-Agent": "@airtop/sdk/0.1.
|
858
|
+
"X-Fern-SDK-Version": "0.1.15",
|
859
|
+
"User-Agent": "@airtop/sdk/0.1.15",
|
860
860
|
"X-Fern-Runtime": core.RUNTIME.type,
|
861
861
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
862
862
|
},
|
@@ -4,16 +4,13 @@
|
|
4
4
|
import * as serializers from "../../../index";
|
5
5
|
import * as Airtop from "../../../../api/index";
|
6
6
|
import * as core from "../../../../core";
|
7
|
-
import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
|
8
7
|
import { SessionsEventsResponseStatus } from "./SessionsEventsResponseStatus";
|
9
8
|
import { SessionsEventsResponseError } from "./SessionsEventsResponseError";
|
10
9
|
import { SessionsEventsResponseWindowEvent } from "./SessionsEventsResponseWindowEvent";
|
10
|
+
import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
|
11
11
|
export declare const SessionsEventsResponse: core.serialization.Schema<serializers.SessionsEventsResponse.Raw, Airtop.SessionsEventsResponse>;
|
12
12
|
export declare namespace SessionsEventsResponse {
|
13
|
-
type Raw = SessionsEventsResponse.
|
14
|
-
interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
|
15
|
-
event: "sessionEvent";
|
16
|
-
}
|
13
|
+
type Raw = SessionsEventsResponse.Status | SessionsEventsResponse.Error | SessionsEventsResponse.WindowEvent | SessionsEventsResponse.SessionEvent;
|
17
14
|
interface Status extends SessionsEventsResponseStatus.Raw {
|
18
15
|
event: "status";
|
19
16
|
}
|
@@ -23,4 +20,7 @@ export declare namespace SessionsEventsResponse {
|
|
23
20
|
interface WindowEvent extends SessionsEventsResponseWindowEvent.Raw {
|
24
21
|
event: "windowEvent";
|
25
22
|
}
|
23
|
+
interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
|
24
|
+
event: "sessionEvent";
|
25
|
+
}
|
26
26
|
}
|
@@ -28,16 +28,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.SessionsEventsResponse = void 0;
|
30
30
|
const core = __importStar(require("../../../../core"));
|
31
|
-
const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
|
32
31
|
const SessionsEventsResponseStatus_1 = require("./SessionsEventsResponseStatus");
|
33
32
|
const SessionsEventsResponseError_1 = require("./SessionsEventsResponseError");
|
34
33
|
const SessionsEventsResponseWindowEvent_1 = require("./SessionsEventsResponseWindowEvent");
|
34
|
+
const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
|
35
35
|
exports.SessionsEventsResponse = core.serialization
|
36
36
|
.union("event", {
|
37
|
-
sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
|
38
37
|
status: SessionsEventsResponseStatus_1.SessionsEventsResponseStatus,
|
39
38
|
error: SessionsEventsResponseError_1.SessionsEventsResponseError,
|
40
39
|
windowEvent: SessionsEventsResponseWindowEvent_1.SessionsEventsResponseWindowEvent,
|
40
|
+
sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
|
41
41
|
})
|
42
42
|
.transform({
|
43
43
|
transform: (value) => value,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from "./SessionsListRequestStatus";
|
2
|
-
export * from "./SessionsEventsResponseSessionEvent";
|
3
2
|
export * from "./SessionsEventsResponseStatus";
|
4
3
|
export * from "./SessionsEventsResponseError";
|
5
4
|
export * from "./SessionsEventsResponseWindowEvent";
|
5
|
+
export * from "./SessionsEventsResponseSessionEvent";
|
6
6
|
export * from "./SessionsEventsResponse";
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./SessionsListRequestStatus"), exports);
|
18
|
-
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
19
18
|
__exportStar(require("./SessionsEventsResponseStatus"), exports);
|
20
19
|
__exportStar(require("./SessionsEventsResponseError"), exports);
|
21
20
|
__exportStar(require("./SessionsEventsResponseWindowEvent"), exports);
|
21
|
+
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
22
22
|
__exportStar(require("./SessionsEventsResponse"), exports);
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./batch-operate/batch-util"), exports);
|
18
18
|
__exportStar(require("./batch-operate/types"), exports);
|
19
|
+
__exportStar(require("./process-screenshots"), exports);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import type { AiPromptResponse } from "api";
|
3
|
+
export declare type ProcessScreenshotsResponse = {
|
4
|
+
index: number;
|
5
|
+
success: boolean;
|
6
|
+
binaryData?: Buffer;
|
7
|
+
mimeType?: string;
|
8
|
+
error?: Error;
|
9
|
+
};
|
10
|
+
export declare function processScreenshots(response: AiPromptResponse): Promise<ProcessScreenshotsResponse[]>;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.processScreenshots = void 0;
|
13
|
+
function extractMimeAndBase64(dataUrl) {
|
14
|
+
const match = dataUrl.match(/^data:(image\/\w+);base64,(.+)$/);
|
15
|
+
if (match) {
|
16
|
+
return { mimeType: match[1], base64Data: match[2] };
|
17
|
+
}
|
18
|
+
return {
|
19
|
+
mimeType: "image/jpeg",
|
20
|
+
base64Data: dataUrl.replace(/^data:image\/jpeg;base64,/, ""),
|
21
|
+
};
|
22
|
+
}
|
23
|
+
function processScreenshots(response) {
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25
|
+
const screenshots = response.meta.screenshots;
|
26
|
+
if (!screenshots) {
|
27
|
+
return [];
|
28
|
+
}
|
29
|
+
const processedScreenshots = screenshots.map((screenshot, index) => {
|
30
|
+
if (!screenshot.dataUrl) {
|
31
|
+
return {
|
32
|
+
index,
|
33
|
+
error: new Error("Screenshot data URL not found"),
|
34
|
+
success: false,
|
35
|
+
};
|
36
|
+
}
|
37
|
+
try {
|
38
|
+
const { mimeType, base64Data } = extractMimeAndBase64(screenshot.dataUrl);
|
39
|
+
const binaryData = Buffer.from(base64Data, "base64");
|
40
|
+
return {
|
41
|
+
index,
|
42
|
+
binaryData,
|
43
|
+
mimeType,
|
44
|
+
success: true,
|
45
|
+
};
|
46
|
+
}
|
47
|
+
catch (err) {
|
48
|
+
console.error(`Error processing screenshot ${index}:`, err);
|
49
|
+
return {
|
50
|
+
index,
|
51
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
52
|
+
success: false,
|
53
|
+
};
|
54
|
+
}
|
55
|
+
});
|
56
|
+
return processedScreenshots;
|
57
|
+
});
|
58
|
+
}
|
59
|
+
exports.processScreenshots = processScreenshots;
|
package/package.json
CHANGED
@@ -4,16 +4,13 @@
|
|
4
4
|
import * as serializers from "../../../index";
|
5
5
|
import * as Airtop from "../../../../api/index";
|
6
6
|
import * as core from "../../../../core";
|
7
|
-
import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
|
8
7
|
import { SessionsEventsResponseStatus } from "./SessionsEventsResponseStatus";
|
9
8
|
import { SessionsEventsResponseError } from "./SessionsEventsResponseError";
|
10
9
|
import { SessionsEventsResponseWindowEvent } from "./SessionsEventsResponseWindowEvent";
|
10
|
+
import { SessionsEventsResponseSessionEvent } from "./SessionsEventsResponseSessionEvent";
|
11
11
|
export declare const SessionsEventsResponse: core.serialization.Schema<serializers.SessionsEventsResponse.Raw, Airtop.SessionsEventsResponse>;
|
12
12
|
export declare namespace SessionsEventsResponse {
|
13
|
-
type Raw = SessionsEventsResponse.
|
14
|
-
interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
|
15
|
-
event: "sessionEvent";
|
16
|
-
}
|
13
|
+
type Raw = SessionsEventsResponse.Status | SessionsEventsResponse.Error | SessionsEventsResponse.WindowEvent | SessionsEventsResponse.SessionEvent;
|
17
14
|
interface Status extends SessionsEventsResponseStatus.Raw {
|
18
15
|
event: "status";
|
19
16
|
}
|
@@ -23,4 +20,7 @@ export declare namespace SessionsEventsResponse {
|
|
23
20
|
interface WindowEvent extends SessionsEventsResponseWindowEvent.Raw {
|
24
21
|
event: "windowEvent";
|
25
22
|
}
|
23
|
+
interface SessionEvent extends SessionsEventsResponseSessionEvent.Raw {
|
24
|
+
event: "sessionEvent";
|
25
|
+
}
|
26
26
|
}
|
@@ -28,16 +28,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
exports.SessionsEventsResponse = void 0;
|
30
30
|
const core = __importStar(require("../../../../core"));
|
31
|
-
const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
|
32
31
|
const SessionsEventsResponseStatus_1 = require("./SessionsEventsResponseStatus");
|
33
32
|
const SessionsEventsResponseError_1 = require("./SessionsEventsResponseError");
|
34
33
|
const SessionsEventsResponseWindowEvent_1 = require("./SessionsEventsResponseWindowEvent");
|
34
|
+
const SessionsEventsResponseSessionEvent_1 = require("./SessionsEventsResponseSessionEvent");
|
35
35
|
exports.SessionsEventsResponse = core.serialization
|
36
36
|
.union("event", {
|
37
|
-
sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
|
38
37
|
status: SessionsEventsResponseStatus_1.SessionsEventsResponseStatus,
|
39
38
|
error: SessionsEventsResponseError_1.SessionsEventsResponseError,
|
40
39
|
windowEvent: SessionsEventsResponseWindowEvent_1.SessionsEventsResponseWindowEvent,
|
40
|
+
sessionEvent: SessionsEventsResponseSessionEvent_1.SessionsEventsResponseSessionEvent,
|
41
41
|
})
|
42
42
|
.transform({
|
43
43
|
transform: (value) => value,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from "./SessionsListRequestStatus";
|
2
|
-
export * from "./SessionsEventsResponseSessionEvent";
|
3
2
|
export * from "./SessionsEventsResponseStatus";
|
4
3
|
export * from "./SessionsEventsResponseError";
|
5
4
|
export * from "./SessionsEventsResponseWindowEvent";
|
5
|
+
export * from "./SessionsEventsResponseSessionEvent";
|
6
6
|
export * from "./SessionsEventsResponse";
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./SessionsListRequestStatus"), exports);
|
18
|
-
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
19
18
|
__exportStar(require("./SessionsEventsResponseStatus"), exports);
|
20
19
|
__exportStar(require("./SessionsEventsResponseError"), exports);
|
21
20
|
__exportStar(require("./SessionsEventsResponseWindowEvent"), exports);
|
21
|
+
__exportStar(require("./SessionsEventsResponseSessionEvent"), exports);
|
22
22
|
__exportStar(require("./SessionsEventsResponse"), exports);
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./batch-operate/batch-util"), exports);
|
18
18
|
__exportStar(require("./batch-operate/types"), exports);
|
19
|
+
__exportStar(require("./process-screenshots"), exports);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import type { AiPromptResponse } from "api";
|
3
|
+
export declare type ProcessScreenshotsResponse = {
|
4
|
+
index: number;
|
5
|
+
success: boolean;
|
6
|
+
binaryData?: Buffer;
|
7
|
+
mimeType?: string;
|
8
|
+
error?: Error;
|
9
|
+
};
|
10
|
+
export declare function processScreenshots(response: AiPromptResponse): Promise<ProcessScreenshotsResponse[]>;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.processScreenshots = void 0;
|
13
|
+
function extractMimeAndBase64(dataUrl) {
|
14
|
+
const match = dataUrl.match(/^data:(image\/\w+);base64,(.+)$/);
|
15
|
+
if (match) {
|
16
|
+
return { mimeType: match[1], base64Data: match[2] };
|
17
|
+
}
|
18
|
+
return {
|
19
|
+
mimeType: "image/jpeg",
|
20
|
+
base64Data: dataUrl.replace(/^data:image\/jpeg;base64,/, ""),
|
21
|
+
};
|
22
|
+
}
|
23
|
+
function processScreenshots(response) {
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
25
|
+
const screenshots = response.meta.screenshots;
|
26
|
+
if (!screenshots) {
|
27
|
+
return [];
|
28
|
+
}
|
29
|
+
const processedScreenshots = screenshots.map((screenshot, index) => {
|
30
|
+
if (!screenshot.dataUrl) {
|
31
|
+
return {
|
32
|
+
index,
|
33
|
+
error: new Error("Screenshot data URL not found"),
|
34
|
+
success: false,
|
35
|
+
};
|
36
|
+
}
|
37
|
+
try {
|
38
|
+
const { mimeType, base64Data } = extractMimeAndBase64(screenshot.dataUrl);
|
39
|
+
const binaryData = Buffer.from(base64Data, "base64");
|
40
|
+
return {
|
41
|
+
index,
|
42
|
+
binaryData,
|
43
|
+
mimeType,
|
44
|
+
success: true,
|
45
|
+
};
|
46
|
+
}
|
47
|
+
catch (err) {
|
48
|
+
console.error(`Error processing screenshot ${index}:`, err);
|
49
|
+
return {
|
50
|
+
index,
|
51
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
52
|
+
success: false,
|
53
|
+
};
|
54
|
+
}
|
55
|
+
});
|
56
|
+
return processedScreenshots;
|
57
|
+
});
|
58
|
+
}
|
59
|
+
exports.processScreenshots = processScreenshots;
|