@airtop/sdk 0.1.36 → 0.1.37-beta1
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/Client.d.ts +3 -0
- package/Client.js +11 -6
- package/README.md +9 -10
- package/api/resources/automations/client/Client.js +4 -4
- package/api/resources/files/client/Client.d.ts +69 -0
- package/api/resources/files/client/Client.js +286 -0
- package/api/resources/files/client/index.d.ts +1 -0
- package/api/resources/files/client/index.js +17 -0
- package/api/resources/files/client/requests/CreateFileRestInputV1.d.ts +20 -0
- package/api/resources/files/client/requests/CreateFileRestInputV1.js +5 -0
- package/api/resources/files/client/requests/FilesListRequest.d.ts +24 -0
- package/api/resources/files/client/requests/FilesListRequest.js +5 -0
- package/api/resources/files/client/requests/index.d.ts +2 -0
- package/api/resources/files/client/requests/index.js +2 -0
- package/api/resources/files/index.d.ts +2 -0
- package/api/resources/files/index.js +18 -0
- package/api/resources/files/types/CreateFileRestInputV1FileType.d.ts +13 -0
- package/api/resources/files/types/CreateFileRestInputV1FileType.js +12 -0
- package/api/resources/files/types/index.d.ts +1 -0
- package/api/resources/files/types/index.js +17 -0
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/profiles/client/Client.js +1 -1
- package/api/resources/requests/client/Client.js +1 -1
- package/api/resources/sessions/client/Client.js +6 -6
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +7 -4
- package/api/resources/sessions/types/SessionsEventsResponseFileEvent.d.ts +11 -0
- package/api/resources/sessions/types/SessionsEventsResponseFileEvent.js +5 -0
- package/api/resources/sessions/types/index.d.ts +2 -1
- package/api/resources/sessions/types/index.js +2 -1
- package/api/resources/windows/client/Client.d.ts +126 -0
- package/api/resources/windows/client/Client.js +577 -21
- package/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
- package/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
- package/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +25 -0
- package/api/resources/windows/client/requests/OperatorPromptV1Body.js +5 -0
- package/api/resources/windows/client/requests/index.d.ts +10 -0
- package/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +9 -0
- package/api/types/AsyncOperatorPromptResponseEnvelope.js +5 -0
- package/api/types/CreateFileV1.d.ts +24 -0
- package/api/types/CreateFileV1.js +5 -0
- package/api/types/CreateFileV1FileType.d.ts +13 -0
- package/api/types/CreateFileV1FileType.js +12 -0
- package/api/types/CreateFileV1Status.d.ts +13 -0
- package/api/types/CreateFileV1Status.js +12 -0
- package/api/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.d.ts +10 -0
- package/api/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.js +5 -0
- package/api/types/EnvelopeGetFileV1EnvelopeDefaultMeta.d.ts +10 -0
- package/api/types/EnvelopeGetFileV1EnvelopeDefaultMeta.js +5 -0
- package/api/types/ExternalFile.d.ts +35 -0
- package/api/types/ExternalFile.js +5 -0
- package/api/types/FileEventMessage.d.ts +16 -0
- package/api/types/FileEventMessage.js +5 -0
- package/api/types/FileEventMessageStatus.d.ts +13 -0
- package/api/types/FileEventMessageStatus.js +12 -0
- package/api/types/FilesResponse.d.ts +10 -0
- package/api/types/FilesResponse.js +5 -0
- package/api/types/FilesWithPagination.d.ts +10 -0
- package/api/types/FilesWithPagination.js +5 -0
- package/api/types/GetFileV1.d.ts +26 -0
- package/api/types/GetFileV1.js +5 -0
- package/api/types/GetFileV1FileType.d.ts +13 -0
- package/api/types/GetFileV1FileType.js +12 -0
- package/api/types/GetFileV1Status.d.ts +13 -0
- package/api/types/GetFileV1Status.js +12 -0
- package/api/types/index.d.ts +14 -0
- package/api/types/index.js +14 -0
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +11 -6
- package/dist/api/resources/automations/client/Client.js +4 -4
- package/dist/api/resources/files/client/Client.d.ts +69 -0
- package/dist/api/resources/files/client/Client.js +286 -0
- package/dist/api/resources/files/client/index.d.ts +1 -0
- package/dist/api/resources/files/client/index.js +17 -0
- package/dist/api/resources/files/client/requests/CreateFileRestInputV1.d.ts +20 -0
- package/dist/api/resources/files/client/requests/CreateFileRestInputV1.js +5 -0
- package/dist/api/resources/files/client/requests/FilesListRequest.d.ts +24 -0
- package/dist/api/resources/files/client/requests/FilesListRequest.js +5 -0
- package/dist/api/resources/files/client/requests/index.d.ts +2 -0
- package/dist/api/resources/files/client/requests/index.js +2 -0
- package/dist/api/resources/files/index.d.ts +2 -0
- package/dist/api/resources/files/index.js +18 -0
- package/dist/api/resources/files/types/CreateFileRestInputV1FileType.d.ts +13 -0
- package/dist/api/resources/files/types/CreateFileRestInputV1FileType.js +12 -0
- package/dist/api/resources/files/types/index.d.ts +1 -0
- package/dist/api/resources/files/types/index.js +17 -0
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/profiles/client/Client.js +1 -1
- package/dist/api/resources/requests/client/Client.js +1 -1
- package/dist/api/resources/sessions/client/Client.js +6 -6
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +7 -4
- package/dist/api/resources/sessions/types/SessionsEventsResponseFileEvent.d.ts +11 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseFileEvent.js +5 -0
- package/dist/api/resources/sessions/types/index.d.ts +2 -1
- package/dist/api/resources/sessions/types/index.js +2 -1
- package/dist/api/resources/windows/client/Client.d.ts +126 -0
- package/dist/api/resources/windows/client/Client.js +577 -21
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.js +5 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +10 -0
- package/dist/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +9 -0
- package/dist/api/types/AsyncOperatorPromptResponseEnvelope.js +5 -0
- package/dist/api/types/CreateFileV1.d.ts +24 -0
- package/dist/api/types/CreateFileV1.js +5 -0
- package/dist/api/types/CreateFileV1FileType.d.ts +13 -0
- package/dist/api/types/CreateFileV1FileType.js +12 -0
- package/dist/api/types/CreateFileV1Status.d.ts +13 -0
- package/dist/api/types/CreateFileV1Status.js +12 -0
- package/dist/api/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.d.ts +10 -0
- package/dist/api/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.js +5 -0
- package/dist/api/types/EnvelopeGetFileV1EnvelopeDefaultMeta.d.ts +10 -0
- package/dist/api/types/EnvelopeGetFileV1EnvelopeDefaultMeta.js +5 -0
- package/dist/api/types/ExternalFile.d.ts +35 -0
- package/dist/api/types/ExternalFile.js +5 -0
- package/dist/api/types/FileEventMessage.d.ts +16 -0
- package/dist/api/types/FileEventMessage.js +5 -0
- package/dist/api/types/FileEventMessageStatus.d.ts +13 -0
- package/dist/api/types/FileEventMessageStatus.js +12 -0
- package/dist/api/types/FilesResponse.d.ts +10 -0
- package/dist/api/types/FilesResponse.js +5 -0
- package/dist/api/types/FilesWithPagination.d.ts +10 -0
- package/dist/api/types/FilesWithPagination.js +5 -0
- package/dist/api/types/GetFileV1.d.ts +26 -0
- package/dist/api/types/GetFileV1.js +5 -0
- package/dist/api/types/GetFileV1FileType.d.ts +13 -0
- package/dist/api/types/GetFileV1FileType.js +12 -0
- package/dist/api/types/GetFileV1Status.d.ts +13 -0
- package/dist/api/types/GetFileV1Status.js +12 -0
- package/dist/api/types/index.d.ts +14 -0
- package/dist/api/types/index.js +14 -0
- package/dist/serialization/resources/files/client/index.d.ts +1 -0
- package/dist/serialization/resources/files/client/index.js +17 -0
- package/dist/serialization/resources/files/client/requests/CreateFileRestInputV1.d.ts +16 -0
- package/dist/serialization/resources/files/client/requests/CreateFileRestInputV1.js +47 -0
- package/dist/serialization/resources/files/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/files/client/requests/index.js +5 -0
- package/dist/serialization/resources/files/index.d.ts +2 -0
- package/dist/serialization/resources/files/index.js +18 -0
- package/dist/serialization/resources/files/types/CreateFileRestInputV1FileType.d.ts +10 -0
- package/dist/serialization/resources/files/types/CreateFileRestInputV1FileType.js +41 -0
- package/dist/serialization/resources/files/types/index.d.ts +1 -0
- package/dist/serialization/resources/files/types/index.js +17 -0
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +4 -1
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +9 -5
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +4 -2
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseFileEvent.d.ts +15 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseFileEvent.js +46 -0
- package/dist/serialization/resources/sessions/types/index.d.ts +2 -1
- package/dist/serialization/resources/sessions/types/index.js +2 -1
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.js +51 -0
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +51 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +51 -0
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +49 -0
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.js +55 -0
- package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +17 -0
- package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +48 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +10 -0
- package/dist/serialization/resources/windows/client/requests/index.js +21 -1
- package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +15 -0
- package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.js +46 -0
- package/dist/serialization/types/CreateFileV1.d.ts +22 -0
- package/dist/serialization/types/CreateFileV1.js +53 -0
- package/dist/serialization/types/CreateFileV1FileType.d.ts +10 -0
- package/dist/serialization/types/CreateFileV1FileType.js +41 -0
- package/dist/serialization/types/CreateFileV1Status.d.ts +10 -0
- package/dist/serialization/types/CreateFileV1Status.js +41 -0
- package/dist/serialization/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.d.ts +18 -0
- package/dist/serialization/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.js +49 -0
- package/dist/serialization/types/EnvelopeGetFileV1EnvelopeDefaultMeta.d.ts +18 -0
- package/dist/serialization/types/EnvelopeGetFileV1EnvelopeDefaultMeta.js +49 -0
- package/dist/serialization/types/ExternalFile.d.ts +26 -0
- package/dist/serialization/types/ExternalFile.js +57 -0
- package/dist/serialization/types/FileEventMessage.d.ts +17 -0
- package/dist/serialization/types/FileEventMessage.js +48 -0
- package/dist/serialization/types/FileEventMessageStatus.d.ts +10 -0
- package/dist/serialization/types/FileEventMessageStatus.js +41 -0
- package/dist/serialization/types/FilesResponse.d.ts +18 -0
- package/dist/serialization/types/FilesResponse.js +49 -0
- package/dist/serialization/types/FilesWithPagination.d.ts +15 -0
- package/dist/serialization/types/FilesWithPagination.js +46 -0
- package/dist/serialization/types/GetFileV1.d.ts +23 -0
- package/dist/serialization/types/GetFileV1.js +54 -0
- package/dist/serialization/types/GetFileV1FileType.d.ts +10 -0
- package/dist/serialization/types/GetFileV1FileType.js +41 -0
- package/dist/serialization/types/GetFileV1Status.d.ts +10 -0
- package/dist/serialization/types/GetFileV1Status.js +41 -0
- package/dist/serialization/types/index.d.ts +14 -0
- package/dist/serialization/types/index.js +14 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/AirtopClient.d.ts +3 -0
- package/dist/wrapper/AirtopClient.js +5 -0
- package/dist/wrapper/AirtopFiles.d.ts +50 -0
- package/dist/wrapper/AirtopFiles.js +180 -0
- package/dist/wrapper/AirtopSessions.d.ts +59 -0
- package/dist/wrapper/AirtopSessions.js +236 -17
- package/package.json +1 -1
- package/reference.md +1122 -166
- package/serialization/resources/files/client/index.d.ts +1 -0
- package/serialization/resources/files/client/index.js +17 -0
- package/serialization/resources/files/client/requests/CreateFileRestInputV1.d.ts +16 -0
- package/serialization/resources/files/client/requests/CreateFileRestInputV1.js +47 -0
- package/serialization/resources/files/client/requests/index.d.ts +1 -0
- package/serialization/resources/files/client/requests/index.js +5 -0
- package/serialization/resources/files/index.d.ts +2 -0
- package/serialization/resources/files/index.js +18 -0
- package/serialization/resources/files/types/CreateFileRestInputV1FileType.d.ts +10 -0
- package/serialization/resources/files/types/CreateFileRestInputV1FileType.js +41 -0
- package/serialization/resources/files/types/index.d.ts +1 -0
- package/serialization/resources/files/types/index.js +17 -0
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +4 -1
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +9 -5
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +4 -2
- package/serialization/resources/sessions/types/SessionsEventsResponseFileEvent.d.ts +15 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseFileEvent.js +46 -0
- package/serialization/resources/sessions/types/index.d.ts +2 -1
- package/serialization/resources/sessions/types/index.js +2 -1
- package/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncClickRequest.js +51 -0
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +51 -0
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +51 -0
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +49 -0
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.js +55 -0
- package/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +17 -0
- package/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +48 -0
- package/serialization/resources/windows/client/requests/index.d.ts +10 -0
- package/serialization/resources/windows/client/requests/index.js +21 -1
- package/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +15 -0
- package/serialization/types/AsyncOperatorPromptResponseEnvelope.js +46 -0
- package/serialization/types/CreateFileV1.d.ts +22 -0
- package/serialization/types/CreateFileV1.js +53 -0
- package/serialization/types/CreateFileV1FileType.d.ts +10 -0
- package/serialization/types/CreateFileV1FileType.js +41 -0
- package/serialization/types/CreateFileV1Status.d.ts +10 -0
- package/serialization/types/CreateFileV1Status.js +41 -0
- package/serialization/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.d.ts +18 -0
- package/serialization/types/EnvelopeCreateFileV1EnvelopeDefaultMeta.js +49 -0
- package/serialization/types/EnvelopeGetFileV1EnvelopeDefaultMeta.d.ts +18 -0
- package/serialization/types/EnvelopeGetFileV1EnvelopeDefaultMeta.js +49 -0
- package/serialization/types/ExternalFile.d.ts +26 -0
- package/serialization/types/ExternalFile.js +57 -0
- package/serialization/types/FileEventMessage.d.ts +17 -0
- package/serialization/types/FileEventMessage.js +48 -0
- package/serialization/types/FileEventMessageStatus.d.ts +10 -0
- package/serialization/types/FileEventMessageStatus.js +41 -0
- package/serialization/types/FilesResponse.d.ts +18 -0
- package/serialization/types/FilesResponse.js +49 -0
- package/serialization/types/FilesWithPagination.d.ts +15 -0
- package/serialization/types/FilesWithPagination.js +46 -0
- package/serialization/types/GetFileV1.d.ts +23 -0
- package/serialization/types/GetFileV1.js +54 -0
- package/serialization/types/GetFileV1FileType.d.ts +10 -0
- package/serialization/types/GetFileV1FileType.js +41 -0
- package/serialization/types/GetFileV1Status.d.ts +10 -0
- package/serialization/types/GetFileV1Status.js +41 -0
- package/serialization/types/index.d.ts +14 -0
- package/serialization/types/index.js +14 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/AirtopClient.d.ts +3 -0
- package/wrapper/AirtopClient.js +5 -0
- package/wrapper/AirtopFiles.d.ts +50 -0
- package/wrapper/AirtopFiles.js +180 -0
- package/wrapper/AirtopSessions.d.ts +59 -0
- package/wrapper/AirtopSessions.js +236 -17
@@ -1,4 +1,37 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
2
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
@@ -15,9 +48,16 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
15
48
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
16
49
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
17
50
|
};
|
51
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
52
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
53
|
+
};
|
18
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
19
55
|
exports.AirtopSessions = void 0;
|
56
|
+
const readable_stream_1 = require("readable-stream");
|
57
|
+
const fs = __importStar(require("fs"));
|
58
|
+
const path = __importStar(require("path"));
|
20
59
|
const Client_1 = require("../api/resources/sessions/client/Client");
|
60
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
21
61
|
class AirtopSessions extends Client_1.Sessions {
|
22
62
|
constructor(_options, debug = false) {
|
23
63
|
super(_options);
|
@@ -66,30 +106,209 @@ class AirtopSessions extends Client_1.Sessions {
|
|
66
106
|
}
|
67
107
|
});
|
68
108
|
}
|
109
|
+
/**
|
110
|
+
* Waits for a session to enter the 'running' status
|
111
|
+
*
|
112
|
+
* @param id - The ID of the session to wait for
|
113
|
+
* @param requestOptions - Optional request configuration including timeout
|
114
|
+
* @returns The session event indicating the session is ready, or null if timed out
|
115
|
+
*/
|
69
116
|
waitForSessionReady(id, requestOptions) {
|
70
117
|
return __awaiter(this, void 0, void 0, function* () {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
118
|
+
const timeoutSeconds = (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) || 300;
|
119
|
+
// Create a promise that resolves to null after the timeout
|
120
|
+
const timeoutPromise = new Promise((resolve) => {
|
121
|
+
setTimeout(() => resolve(null), timeoutSeconds * 1000);
|
122
|
+
});
|
123
|
+
// Create a promise for the event processing
|
124
|
+
const processEventsPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
125
|
+
var _a, e_1, _b, _c;
|
126
|
+
const sessionEvents = yield this.events(id, {}, Object.assign({ timeoutInSeconds: timeoutSeconds }, (requestOptions || {})));
|
127
|
+
try {
|
128
|
+
for (var _d = true, sessionEvents_1 = __asyncValues(sessionEvents), sessionEvents_1_1; sessionEvents_1_1 = yield sessionEvents_1.next(), _a = sessionEvents_1_1.done, !_a; _d = true) {
|
129
|
+
_c = sessionEvents_1_1.value;
|
130
|
+
_d = false;
|
131
|
+
const event = _c;
|
132
|
+
const e = event;
|
133
|
+
if (e.event === 'status') {
|
134
|
+
this.log(`status message received:\n${JSON.stringify(event, null, 2)}`);
|
135
|
+
if (e.status === 'running') {
|
136
|
+
return event;
|
137
|
+
}
|
138
|
+
}
|
82
139
|
}
|
83
140
|
}
|
84
|
-
|
85
|
-
|
86
|
-
|
141
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
142
|
+
finally {
|
143
|
+
try {
|
144
|
+
if (!_d && !_a && (_b = sessionEvents_1.return)) yield _b.call(sessionEvents_1);
|
145
|
+
}
|
146
|
+
finally { if (e_1) throw e_1.error; }
|
147
|
+
}
|
148
|
+
return null;
|
149
|
+
}))();
|
150
|
+
// Race the timeout against the event processing
|
151
|
+
return Promise.race([timeoutPromise, processEventsPromise]);
|
152
|
+
});
|
153
|
+
}
|
154
|
+
/**
|
155
|
+
* Waits for a file to be downloaded in a session and reach 'available' status.
|
156
|
+
* Defaults to looking back 5 seconds in the event stream for the file to be available.
|
157
|
+
* Use `includePriorEvents` and `lookbackSeconds` to control this behavior.
|
158
|
+
*
|
159
|
+
* @param {Object} params - The parameters for the function
|
160
|
+
* @param {string} params.sessionId - The ID of the session to monitor
|
161
|
+
* @param {boolean} [params.includePriorEvents=true] - Whether to include prior events in the wait. Default `true`.
|
162
|
+
* @param {number} [params.lookbackSeconds=5] - The number of seconds to look back for prior events. Default `5`.
|
163
|
+
* @param {Sessions.RequestOptions} [requestOptions] - Optional request configuration including timeout
|
164
|
+
* @returns {Promise<{ id: string, downloadUrl: string } | null>} Object containing file's id and downloadUrl, or null if timed out
|
165
|
+
*/
|
166
|
+
waitForDownload(sessionId, configuration, requestOptions) {
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
168
|
+
const { includePriorEvents = true, lookbackSeconds = 5 } = configuration || {};
|
169
|
+
const startTime = new Date();
|
170
|
+
const timeoutSeconds = (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) || 120;
|
171
|
+
// Create a promise that resolves to null after the timeout
|
172
|
+
const timeoutPromise = new Promise((resolve) => {
|
173
|
+
setTimeout(() => resolve(null), timeoutSeconds * 1000);
|
174
|
+
});
|
175
|
+
// Create a promise for the event processing
|
176
|
+
const processEventsPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
177
|
+
var _a, e_2, _b, _c;
|
178
|
+
const sessionEvents = yield this.events(sessionId, { all: includePriorEvents }, Object.assign({ timeoutInSeconds: timeoutSeconds }, (requestOptions || {})));
|
87
179
|
try {
|
88
|
-
|
180
|
+
for (var _d = true, sessionEvents_2 = __asyncValues(sessionEvents), sessionEvents_2_1; sessionEvents_2_1 = yield sessionEvents_2.next(), _a = sessionEvents_2_1.done, !_a; _d = true) {
|
181
|
+
_c = sessionEvents_2_1.value;
|
182
|
+
_d = false;
|
183
|
+
const event = _c;
|
184
|
+
const e = event;
|
185
|
+
if (e.event === 'file_status') {
|
186
|
+
if (e.status === 'available') {
|
187
|
+
const eventTime = Date.parse(e.eventTime);
|
188
|
+
this.log(`file_status message received:\n${JSON.stringify(event, null, 2)}`);
|
189
|
+
const thresholdTime = startTime.getTime() - lookbackSeconds * 1000;
|
190
|
+
if (eventTime < thresholdTime) {
|
191
|
+
this.log(`skipping file available event for ${e.fileId} because its timestamp is earlier than lookbackSeconds`);
|
192
|
+
continue;
|
193
|
+
}
|
194
|
+
return {
|
195
|
+
id: e.fileId,
|
196
|
+
downloadUrl: e.downloadUrl,
|
197
|
+
};
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
203
|
+
finally {
|
204
|
+
try {
|
205
|
+
if (!_d && !_a && (_b = sessionEvents_2.return)) yield _b.call(sessionEvents_2);
|
206
|
+
}
|
207
|
+
finally { if (e_2) throw e_2.error; }
|
89
208
|
}
|
90
|
-
|
209
|
+
return null;
|
210
|
+
}))();
|
211
|
+
// Race the timeout against the event processing
|
212
|
+
return Promise.race([timeoutPromise, processEventsPromise]);
|
213
|
+
});
|
214
|
+
}
|
215
|
+
/**
|
216
|
+
* Waits for a file download to start in a session
|
217
|
+
*
|
218
|
+
* @param {Object} params - The parameters for the function
|
219
|
+
* @param {string} params.sessionId - The ID of the session to monitor
|
220
|
+
* @param {boolean} [params.includePriorEvents=false] - Whether to include prior events in the wait
|
221
|
+
* @param {Sessions.RequestOptions} [requestOptions] - Optional request configuration including timeout
|
222
|
+
* @returns {Promise<{ id: string, downloadUrl: string } | null>} Object containing file's id and downloadUrl, or null if timed out
|
223
|
+
*/
|
224
|
+
waitForDownloadStart(_a, requestOptions_1) {
|
225
|
+
return __awaiter(this, arguments, void 0, function* ({ sessionId, includePriorEvents = false }, requestOptions) {
|
226
|
+
const timeoutSeconds = (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) || 60;
|
227
|
+
// Create a promise that resolves to null after the timeout
|
228
|
+
const timeoutPromise = new Promise((resolve) => {
|
229
|
+
setTimeout(() => resolve(null), timeoutSeconds * 1000);
|
230
|
+
});
|
231
|
+
// Create a promise for the event processing
|
232
|
+
const processEventsPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
233
|
+
var _a, e_3, _b, _c;
|
234
|
+
const sessionEvents = yield this.events(sessionId, { all: includePriorEvents }, Object.assign({ timeoutInSeconds: timeoutSeconds }, (requestOptions || {})));
|
235
|
+
try {
|
236
|
+
for (var _d = true, sessionEvents_3 = __asyncValues(sessionEvents), sessionEvents_3_1; sessionEvents_3_1 = yield sessionEvents_3.next(), _a = sessionEvents_3_1.done, !_a; _d = true) {
|
237
|
+
_c = sessionEvents_3_1.value;
|
238
|
+
_d = false;
|
239
|
+
const event = _c;
|
240
|
+
const e = event;
|
241
|
+
if (e.event === 'file_status') {
|
242
|
+
this.log(`file_status message received:\n${JSON.stringify(event, null, 2)}`);
|
243
|
+
if (e.status === 'uploading') {
|
244
|
+
return {
|
245
|
+
id: e.fileId,
|
246
|
+
downloadUrl: e.downloadUrl,
|
247
|
+
};
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
}
|
252
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
253
|
+
finally {
|
254
|
+
try {
|
255
|
+
if (!_d && !_a && (_b = sessionEvents_3.return)) yield _b.call(sessionEvents_3);
|
256
|
+
}
|
257
|
+
finally { if (e_3) throw e_3.error; }
|
258
|
+
}
|
259
|
+
return null;
|
260
|
+
}))();
|
261
|
+
// Race the timeout against the event processing
|
262
|
+
return Promise.race([timeoutPromise, processEventsPromise]);
|
263
|
+
});
|
264
|
+
}
|
265
|
+
/**
|
266
|
+
* Downloads the next file from a session as soon as it starts to become available
|
267
|
+
*
|
268
|
+
* @param {Object} params - The parameters for the function
|
269
|
+
* @param {string} params.sessionId - The ID of the session to download from
|
270
|
+
* @param {string} params.destinationPath - The local path where the file should be saved
|
271
|
+
* @param {function} [params.onProgress] - Optional callback to track download progress
|
272
|
+
* @param {boolean} [params.includePriorEvents=false] - Whether to include prior events in the wait
|
273
|
+
* @param {Sessions.RequestOptions} [requestOptions] - Optional request configuration including timeout
|
274
|
+
* @throws Error if no file is available to download within the timeout period
|
275
|
+
*/
|
276
|
+
downloadNextFile(_a, requestOptions_1) {
|
277
|
+
return __awaiter(this, arguments, void 0, function* ({ sessionId, destinationPath, onProgress, includePriorEvents = false, }, requestOptions) {
|
278
|
+
var _b;
|
279
|
+
const nextFile = yield this.waitForDownload(sessionId, { includePriorEvents }, requestOptions);
|
280
|
+
if (!nextFile) {
|
281
|
+
throw new Error('No file to download within timeout');
|
282
|
+
}
|
283
|
+
const downloadResponse = yield (0, node_fetch_1.default)(nextFile.downloadUrl);
|
284
|
+
if (!downloadResponse.ok) {
|
285
|
+
throw new Error(`Failed to download file: ${downloadResponse.statusText}`);
|
91
286
|
}
|
92
|
-
|
287
|
+
const totalBytes = Number.parseInt((_b = downloadResponse.headers.get('content-length')) !== null && _b !== void 0 ? _b : '0', 10);
|
288
|
+
let downloadedBytes = 0;
|
289
|
+
fs.mkdirSync(path.dirname(destinationPath), { recursive: true });
|
290
|
+
const fileStream = fs.createWriteStream(destinationPath);
|
291
|
+
yield new Promise((resolve, reject) => {
|
292
|
+
var _a, _b;
|
293
|
+
if (onProgress && downloadResponse.body) {
|
294
|
+
// Create a transform stream to track progress
|
295
|
+
const progressStream = new readable_stream_1.Transform({
|
296
|
+
transform(chunk, encoding, callback) {
|
297
|
+
downloadedBytes += chunk.length;
|
298
|
+
onProgress(downloadedBytes, totalBytes);
|
299
|
+
callback(null, chunk);
|
300
|
+
},
|
301
|
+
});
|
302
|
+
downloadResponse.body.pipe(progressStream).pipe(fileStream);
|
303
|
+
progressStream.on('error', reject);
|
304
|
+
}
|
305
|
+
else {
|
306
|
+
// If no progress callback, pipe directly
|
307
|
+
(_a = downloadResponse.body) === null || _a === void 0 ? void 0 : _a.pipe(fileStream);
|
308
|
+
}
|
309
|
+
(_b = downloadResponse.body) === null || _b === void 0 ? void 0 : _b.on('error', reject);
|
310
|
+
fileStream.on('finish', resolve);
|
311
|
+
});
|
93
312
|
});
|
94
313
|
}
|
95
314
|
}
|