@attlaz/client 1.77.1
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/README.md +30 -0
- package/dist/AttlazResource.d.ts +3 -0
- package/dist/AttlazResource.js +4 -0
- package/dist/Client.d.ts +114 -0
- package/dist/Client.js +278 -0
- package/dist/Core/MetaDataAware.d.ts +11 -0
- package/dist/Core/MetaDataAware.js +27 -0
- package/dist/Core/MetaDataWithIconAware.d.ts +13 -0
- package/dist/Core/MetaDataWithIconAware.js +26 -0
- package/dist/Helper/LoadAllHelper.d.ts +8 -0
- package/dist/Helper/LoadAllHelper.js +25 -0
- package/dist/Helper/ResponseParser.d.ts +2 -0
- package/dist/Helper/ResponseParser.js +2 -0
- package/dist/Http/ClientError.d.ts +22 -0
- package/dist/Http/ClientError.js +79 -0
- package/dist/Http/ContentTypeHelper.d.ts +6 -0
- package/dist/Http/ContentTypeHelper.js +13 -0
- package/dist/Http/Data/Headers.d.ts +3 -0
- package/dist/Http/Data/Headers.js +1 -0
- package/dist/Http/Data/Parameters.d.ts +3 -0
- package/dist/Http/Data/Parameters.js +1 -0
- package/dist/Http/Data/QueryString.d.ts +18 -0
- package/dist/Http/Data/QueryString.js +67 -0
- package/dist/Http/HttpClient.d.ts +5 -0
- package/dist/Http/HttpClient.js +54 -0
- package/dist/Http/HttpClientRequest.d.ts +17 -0
- package/dist/Http/HttpClientRequest.js +39 -0
- package/dist/Http/HttpClientResponse.d.ts +8 -0
- package/dist/Http/HttpClientResponse.js +10 -0
- package/dist/Http/HttpStatus.d.ts +13 -0
- package/dist/Http/HttpStatus.js +13 -0
- package/dist/Http/OAuthClientOptions.d.ts +11 -0
- package/dist/Http/OAuthClientOptions.js +15 -0
- package/dist/Http/OAuthClientToken.d.ts +11 -0
- package/dist/Http/OAuthClientToken.js +32 -0
- package/dist/Http/Transport/DirectTransport.d.ts +41 -0
- package/dist/Http/Transport/DirectTransport.js +83 -0
- package/dist/Http/Transport/ITransport.d.ts +13 -0
- package/dist/Http/Transport/ITransport.js +1 -0
- package/dist/Http/Transport/OAuthClient.d.ts +45 -0
- package/dist/Http/Transport/OAuthClient.js +315 -0
- package/dist/Model/AccessToken/UserAccessToken.d.ts +15 -0
- package/dist/Model/AccessToken/UserAccessToken.js +28 -0
- package/dist/Model/AccessToken/UserAccessTokenStatus.d.ts +11 -0
- package/dist/Model/AccessToken/UserAccessTokenStatus.js +12 -0
- package/dist/Model/Adapter/Adapter.d.ts +14 -0
- package/dist/Model/Adapter/Adapter.js +28 -0
- package/dist/Model/Adapter/AdapterCategory.d.ts +6 -0
- package/dist/Model/Adapter/AdapterCategory.js +12 -0
- package/dist/Model/Adapter/AdapterConfiguration.d.ts +12 -0
- package/dist/Model/Adapter/AdapterConfiguration.js +22 -0
- package/dist/Model/Adapter/AdapterConnection.d.ts +15 -0
- package/dist/Model/Adapter/AdapterConnection.js +24 -0
- package/dist/Model/Adapter/AdapterConnectionConfigurationValue.d.ts +7 -0
- package/dist/Model/Adapter/AdapterConnectionConfigurationValue.js +6 -0
- package/dist/Model/Adapter/AdapterConnectionEvent.d.ts +9 -0
- package/dist/Model/Adapter/AdapterConnectionEvent.js +18 -0
- package/dist/Model/Adapter/AdapterConnectionStatus.d.ts +9 -0
- package/dist/Model/Adapter/AdapterConnectionStatus.js +20 -0
- package/dist/Model/Adapter/TestConnectionResult.d.ts +33 -0
- package/dist/Model/Adapter/TestConnectionResult.js +19 -0
- package/dist/Model/ApiRecord.d.ts +1 -0
- package/dist/Model/ApiRecord.js +1 -0
- package/dist/Model/Collections/Collection.d.ts +13 -0
- package/dist/Model/Collections/Collection.js +15 -0
- package/dist/Model/Collections/CollectionRecord.d.ts +6 -0
- package/dist/Model/Collections/CollectionRecord.js +12 -0
- package/dist/Model/Command/CommandExecutionFilter.d.ts +6 -0
- package/dist/Model/Command/CommandExecutionFilter.js +1 -0
- package/dist/Model/Command/CommandExecutionHistory.d.ts +15 -0
- package/dist/Model/Command/CommandExecutionHistory.js +15 -0
- package/dist/Model/Command/CommandExecutionStatus.d.ts +9 -0
- package/dist/Model/Command/CommandExecutionStatus.js +20 -0
- package/dist/Model/Config.d.ts +17 -0
- package/dist/Model/Config.js +31 -0
- package/dist/Model/Configuration/Configuration.d.ts +10 -0
- package/dist/Model/Configuration/Configuration.js +17 -0
- package/dist/Model/DataValue.d.ts +6 -0
- package/dist/Model/DataValue.js +8 -0
- package/dist/Model/DataValueCollection.d.ts +17 -0
- package/dist/Model/DataValueCollection.js +61 -0
- package/dist/Model/Deployment/CodeSource.d.ts +24 -0
- package/dist/Model/Deployment/CodeSource.js +32 -0
- package/dist/Model/Deployment/CodeSourceAccount.d.ts +13 -0
- package/dist/Model/Deployment/CodeSourceAccount.js +25 -0
- package/dist/Model/Deployment/CodeSourceBuildStrategy.d.ts +10 -0
- package/dist/Model/Deployment/CodeSourceBuildStrategy.js +17 -0
- package/dist/Model/Deployment/CodeSourceRunStrategy.d.ts +10 -0
- package/dist/Model/Deployment/CodeSourceRunStrategy.js +17 -0
- package/dist/Model/Deployment/SourcesAccountRepository.d.ts +7 -0
- package/dist/Model/Deployment/SourcesAccountRepository.js +14 -0
- package/dist/Model/Deployment/SourcesAccountRepositoryBranch.d.ts +4 -0
- package/dist/Model/Deployment/SourcesAccountRepositoryBranch.js +8 -0
- package/dist/Model/EntityId.d.ts +9 -0
- package/dist/Model/EntityId.js +27 -0
- package/dist/Model/EntityType.d.ts +25 -0
- package/dist/Model/EntityType.js +33 -0
- package/dist/Model/Error/ApiError.d.ts +14 -0
- package/dist/Model/Error/ApiError.js +16 -0
- package/dist/Model/Event/EventType.d.ts +17 -0
- package/dist/Model/Event/EventType.js +18 -0
- package/dist/Model/Filter/FilterNode.d.ts +18 -0
- package/dist/Model/Filter/FilterNode.js +1 -0
- package/dist/Model/Filter/FilterOperator.d.ts +1 -0
- package/dist/Model/Filter/FilterOperator.js +1 -0
- package/dist/Model/Flow/Flow.d.ts +17 -0
- package/dist/Model/Flow/Flow.js +27 -0
- package/dist/Model/Flow/FlowRun.d.ts +18 -0
- package/dist/Model/Flow/FlowRun.js +32 -0
- package/dist/Model/Flow/FlowRunHistory.d.ts +8 -0
- package/dist/Model/Flow/FlowRunHistory.js +14 -0
- package/dist/Model/Flow/FlowRunHistoryStatus.d.ts +16 -0
- package/dist/Model/Flow/FlowRunHistoryStatus.js +24 -0
- package/dist/Model/Flow/FlowRunLifecycle.d.ts +16 -0
- package/dist/Model/Flow/FlowRunLifecycle.js +24 -0
- package/dist/Model/Flow/FlowRunPriority.d.ts +9 -0
- package/dist/Model/Flow/FlowRunPriority.js +17 -0
- package/dist/Model/Flow/FlowRunResponse.d.ts +5 -0
- package/dist/Model/Flow/FlowRunResponse.js +6 -0
- package/dist/Model/Flow/FlowRunStats.d.ts +13 -0
- package/dist/Model/Flow/FlowRunStats.js +27 -0
- package/dist/Model/Flow/FlowRunStatus.d.ts +12 -0
- package/dist/Model/Flow/FlowRunStatus.js +20 -0
- package/dist/Model/Flow/FlowRunSummary.d.ts +17 -0
- package/dist/Model/Flow/FlowRunSummary.js +33 -0
- package/dist/Model/Flow/FlowSummary.d.ts +11 -0
- package/dist/Model/Flow/FlowSummary.js +21 -0
- package/dist/Model/Flow/FlowTemplate.d.ts +10 -0
- package/dist/Model/Flow/FlowTemplate.js +10 -0
- package/dist/Model/HealthAlert/HealthAlert.d.ts +17 -0
- package/dist/Model/HealthAlert/HealthAlert.js +34 -0
- package/dist/Model/HealthAlert/HealthAlertSeverity.d.ts +8 -0
- package/dist/Model/HealthAlert/HealthAlertSeverity.js +16 -0
- package/dist/Model/HealthAlert/HealthAlertStatus.d.ts +8 -0
- package/dist/Model/HealthAlert/HealthAlertStatus.js +16 -0
- package/dist/Model/HealthAlert/HealthTestType.d.ts +14 -0
- package/dist/Model/HealthAlert/HealthTestType.js +22 -0
- package/dist/Model/Inbox/InboxMessage.d.ts +10 -0
- package/dist/Model/Inbox/InboxMessage.js +21 -0
- package/dist/Model/Infrastructure/RunnerPool.d.ts +39 -0
- package/dist/Model/Infrastructure/RunnerPool.js +77 -0
- package/dist/Model/InfrastructureStatus/QueueStatus.d.ts +11 -0
- package/dist/Model/InfrastructureStatus/QueueStatus.js +11 -0
- package/dist/Model/InfrastructureStatus/RunnersStatus.d.ts +9 -0
- package/dist/Model/InfrastructureStatus/RunnersStatus.js +9 -0
- package/dist/Model/InfrastructureStatus/StorageStatus.d.ts +13 -0
- package/dist/Model/InfrastructureStatus/StorageStatus.js +7 -0
- package/dist/Model/JsonSerializable.d.ts +6 -0
- package/dist/Model/JsonSerializable.js +12 -0
- package/dist/Model/Log/Log.d.ts +17 -0
- package/dist/Model/Log/Log.js +37 -0
- package/dist/Model/Log/LogLevel.d.ts +15 -0
- package/dist/Model/Log/LogLevel.js +54 -0
- package/dist/Model/Log/LogQuery.d.ts +26 -0
- package/dist/Model/Log/LogQuery.js +15 -0
- package/dist/Model/Log/LogStatus.d.ts +8 -0
- package/dist/Model/Log/LogStatus.js +16 -0
- package/dist/Model/Log/LogStream.d.ts +6 -0
- package/dist/Model/Log/LogStream.js +8 -0
- package/dist/Model/Log/LogStreamId.d.ts +5 -0
- package/dist/Model/Log/LogStreamId.js +7 -0
- package/dist/Model/Log/LogStreamInformation.d.ts +18 -0
- package/dist/Model/Log/LogStreamInformation.js +58 -0
- package/dist/Model/Messaging/Channel/Channel.d.ts +16 -0
- package/dist/Model/Messaging/Channel/Channel.js +31 -0
- package/dist/Model/Messaging/Channel/ChannelData.d.ts +6 -0
- package/dist/Model/Messaging/Channel/ChannelData.js +9 -0
- package/dist/Model/Messaging/Channel/ChannelType.d.ts +10 -0
- package/dist/Model/Messaging/Channel/ChannelType.js +18 -0
- package/dist/Model/Messaging/Channel/EmailChannelData.d.ts +5 -0
- package/dist/Model/Messaging/Channel/EmailChannelData.js +9 -0
- package/dist/Model/Messaging/Channel/PushChannelData.d.ts +5 -0
- package/dist/Model/Messaging/Channel/PushChannelData.js +9 -0
- package/dist/Model/Messaging/Channel/SlackChannelData.d.ts +10 -0
- package/dist/Model/Messaging/Channel/SlackChannelData.js +19 -0
- package/dist/Model/Messaging/Channel/SmsChannelData.d.ts +5 -0
- package/dist/Model/Messaging/Channel/SmsChannelData.js +9 -0
- package/dist/Model/Messaging/Channel/WebhookChannelData.d.ts +6 -0
- package/dist/Model/Messaging/Channel/WebhookChannelData.js +11 -0
- package/dist/Model/Messaging/ChannelHistory.d.ts +10 -0
- package/dist/Model/Messaging/ChannelHistory.js +31 -0
- package/dist/Model/Messaging/Subscriber.d.ts +19 -0
- package/dist/Model/Messaging/Subscriber.js +35 -0
- package/dist/Model/Pagination/CursorPagination.d.ts +5 -0
- package/dist/Model/Pagination/CursorPagination.js +5 -0
- package/dist/Model/Pagination/Filters.d.ts +20 -0
- package/dist/Model/Pagination/Filters.js +33 -0
- package/dist/Model/Project/CodeDeploy.d.ts +28 -0
- package/dist/Model/Project/CodeDeploy.js +57 -0
- package/dist/Model/Project/CodeDeployStatus.d.ts +12 -0
- package/dist/Model/Project/CodeDeployStatus.js +20 -0
- package/dist/Model/Project/PlatformLanguage.d.ts +11 -0
- package/dist/Model/Project/PlatformLanguage.js +19 -0
- package/dist/Model/Project/Project.d.ts +13 -0
- package/dist/Model/Project/Project.js +26 -0
- package/dist/Model/Project/ProjectDeployCommit.d.ts +7 -0
- package/dist/Model/Project/ProjectDeployCommit.js +7 -0
- package/dist/Model/Project/ProjectEnvironment.d.ts +16 -0
- package/dist/Model/Project/ProjectEnvironment.js +25 -0
- package/dist/Model/Project/ProjectEnvironmentType.d.ts +8 -0
- package/dist/Model/Project/ProjectEnvironmentType.js +16 -0
- package/dist/Model/ProviderToken/ProviderToken.d.ts +11 -0
- package/dist/Model/ProviderToken/ProviderToken.js +12 -0
- package/dist/Model/ProviderToken/ProviderTokenAccessToken.d.ts +6 -0
- package/dist/Model/ProviderToken/ProviderTokenAccessToken.js +11 -0
- package/dist/Model/Result/CollectionResult.d.ts +7 -0
- package/dist/Model/Result/CollectionResult.js +27 -0
- package/dist/Model/Result/ObjectResult.d.ts +5 -0
- package/dist/Model/Result/ObjectResult.js +21 -0
- package/dist/Model/Result/ObjectWrapper.d.ts +3 -0
- package/dist/Model/Result/ObjectWrapper.js +20 -0
- package/dist/Model/Result/ResultError.d.ts +4 -0
- package/dist/Model/Result/ResultError.js +6 -0
- package/dist/Model/Runner/RunnerImage.d.ts +13 -0
- package/dist/Model/Runner/RunnerImage.js +12 -0
- package/dist/Model/Search/SearchResult.d.ts +23 -0
- package/dist/Model/Search/SearchResult.js +94 -0
- package/dist/Model/State.d.ts +8 -0
- package/dist/Model/State.js +16 -0
- package/dist/Model/StateAware.d.ts +4 -0
- package/dist/Model/StateAware.js +1 -0
- package/dist/Model/Storage/StorageInformation.d.ts +10 -0
- package/dist/Model/Storage/StorageInformation.js +7 -0
- package/dist/Model/Storage/StorageItem.d.ts +9 -0
- package/dist/Model/Storage/StorageItem.js +21 -0
- package/dist/Model/Storage/StorageItemInformation.d.ts +8 -0
- package/dist/Model/Storage/StorageItemInformation.js +19 -0
- package/dist/Model/Storage/StorageType.d.ts +9 -0
- package/dist/Model/Storage/StorageType.js +17 -0
- package/dist/Model/Trigger/Trigger.d.ts +18 -0
- package/dist/Model/Trigger/Trigger.js +34 -0
- package/dist/Model/User/User.d.ts +18 -0
- package/dist/Model/User/User.js +33 -0
- package/dist/Model/User/UserAction.d.ts +14 -0
- package/dist/Model/User/UserAction.js +13 -0
- package/dist/Model/User/UserActionFilter.d.ts +10 -0
- package/dist/Model/User/UserActionFilter.js +1 -0
- package/dist/Model/User/UserAuthProvider.d.ts +12 -0
- package/dist/Model/User/UserAuthProvider.js +22 -0
- package/dist/Model/User/UserNotificationSession.d.ts +13 -0
- package/dist/Model/User/UserNotificationSession.js +11 -0
- package/dist/Model/User/UserSummary.d.ts +13 -0
- package/dist/Model/User/UserSummary.js +11 -0
- package/dist/Model/Worker/InfrastructureConfiguration.d.ts +16 -0
- package/dist/Model/Worker/InfrastructureConfiguration.js +20 -0
- package/dist/Model/Worker/Platform.d.ts +13 -0
- package/dist/Model/Worker/Platform.js +24 -0
- package/dist/Model/Worker/PlatformImage.d.ts +13 -0
- package/dist/Model/Worker/PlatformImage.js +24 -0
- package/dist/Model/Workspace/Workspace.d.ts +10 -0
- package/dist/Model/Workspace/Workspace.js +14 -0
- package/dist/Model/Workspace/WorkspaceMember.d.ts +14 -0
- package/dist/Model/Workspace/WorkspaceMember.js +32 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite.d.ts +13 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite.js +13 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite2.d.ts +10 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite2.js +19 -0
- package/dist/Model/Workspace/WorkspaceMemberInviteState.d.ts +11 -0
- package/dist/Model/Workspace/WorkspaceMemberInviteState.js +19 -0
- package/dist/Model/Workspace/WorkspaceMemberRole.d.ts +4 -0
- package/dist/Model/Workspace/WorkspaceMemberRole.js +4 -0
- package/dist/ResourceNamespace.d.ts +2 -0
- package/dist/ResourceNamespace.js +2 -0
- package/dist/Service/AccessTokenEndpoint.d.ts +11 -0
- package/dist/Service/AccessTokenEndpoint.js +82 -0
- package/dist/Service/AdapterConnectionEndpoint.d.ts +28 -0
- package/dist/Service/AdapterConnectionEndpoint.js +124 -0
- package/dist/Service/AdapterEndpoint.d.ts +12 -0
- package/dist/Service/AdapterEndpoint.js +64 -0
- package/dist/Service/ChannelEndpoint.d.ts +13 -0
- package/dist/Service/ChannelEndpoint.js +96 -0
- package/dist/Service/CodeDeployEndpoint.d.ts +9 -0
- package/dist/Service/CodeDeployEndpoint.js +56 -0
- package/dist/Service/CodeSourceStrategiesEndpoint.d.ts +8 -0
- package/dist/Service/CodeSourceStrategiesEndpoint.js +13 -0
- package/dist/Service/CollectionsEndpoint.d.ts +11 -0
- package/dist/Service/CollectionsEndpoint.js +54 -0
- package/dist/Service/CommandExecutionEndpoint.d.ts +14 -0
- package/dist/Service/CommandExecutionEndpoint.js +60 -0
- package/dist/Service/ConfigEndpoint.d.ts +8 -0
- package/dist/Service/ConfigEndpoint.js +46 -0
- package/dist/Service/ConfigurationEndpoint.d.ts +20 -0
- package/dist/Service/ConfigurationEndpoint.js +53 -0
- package/dist/Service/Endpoint.d.ts +16 -0
- package/dist/Service/Endpoint.js +185 -0
- package/dist/Service/FirewallEndpoint.d.ts +29 -0
- package/dist/Service/FirewallEndpoint.js +88 -0
- package/dist/Service/FlowEndpoint.d.ts +12 -0
- package/dist/Service/FlowEndpoint.js +84 -0
- package/dist/Service/FlowRunEndpoint.d.ts +21 -0
- package/dist/Service/FlowRunEndpoint.js +93 -0
- package/dist/Service/FlowRunRequestEndpoint.d.ts +6 -0
- package/dist/Service/FlowRunRequestEndpoint.js +32 -0
- package/dist/Service/FlowRunStatsEndpoint.d.ts +5 -0
- package/dist/Service/FlowRunStatsEndpoint.js +21 -0
- package/dist/Service/HealthAlertEndpoint.d.ts +13 -0
- package/dist/Service/HealthAlertEndpoint.js +36 -0
- package/dist/Service/InboxEndpoint.d.ts +8 -0
- package/dist/Service/InboxEndpoint.js +20 -0
- package/dist/Service/LogEndpoint.d.ts +18 -0
- package/dist/Service/LogEndpoint.js +127 -0
- package/dist/Service/PlatformEndpoint.d.ts +9 -0
- package/dist/Service/PlatformEndpoint.js +18 -0
- package/dist/Service/PlatformLanguageEndpoint.d.ts +6 -0
- package/dist/Service/PlatformLanguageEndpoint.js +7 -0
- package/dist/Service/ProjectEndpoint.d.ts +11 -0
- package/dist/Service/ProjectEndpoint.js +63 -0
- package/dist/Service/ProjectEnvironmentEndpoint.d.ts +8 -0
- package/dist/Service/ProjectEnvironmentEndpoint.js +48 -0
- package/dist/Service/ProviderTokenEndpoint.d.ts +16 -0
- package/dist/Service/ProviderTokenEndpoint.js +43 -0
- package/dist/Service/RunnerEndpoint.d.ts +6 -0
- package/dist/Service/RunnerEndpoint.js +28 -0
- package/dist/Service/RunnerPoolEndpoint.d.ts +9 -0
- package/dist/Service/RunnerPoolEndpoint.js +20 -0
- package/dist/Service/SearchEndpoint.d.ts +6 -0
- package/dist/Service/SearchEndpoint.js +14 -0
- package/dist/Service/SourcesAccountEndpoint.d.ts +16 -0
- package/dist/Service/SourcesAccountEndpoint.js +85 -0
- package/dist/Service/StorageEndpoint.d.ts +20 -0
- package/dist/Service/StorageEndpoint.js +130 -0
- package/dist/Service/SubscriberEndpoint.d.ts +9 -0
- package/dist/Service/SubscriberEndpoint.js +29 -0
- package/dist/Service/TriggerEndpoint.d.ts +10 -0
- package/dist/Service/TriggerEndpoint.js +67 -0
- package/dist/Service/UserActionEndpoint.d.ts +16 -0
- package/dist/Service/UserActionEndpoint.js +96 -0
- package/dist/Service/UserEndpoint.d.ts +29 -0
- package/dist/Service/UserEndpoint.js +178 -0
- package/dist/Service/WorkspaceEndpoint.d.ts +9 -0
- package/dist/Service/WorkspaceEndpoint.js +49 -0
- package/dist/Service/WorkspaceMemberEndpoint.d.ts +14 -0
- package/dist/Service/WorkspaceMemberEndpoint.js +77 -0
- package/dist/Utils.d.ts +11 -0
- package/dist/Utils.js +68 -0
- package/dist/index.d.ts +169 -0
- package/dist/index.js +154 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Endpoint } from './Endpoint.js';
|
|
2
|
+
import { InboxMessage } from '../Model/Inbox/InboxMessage.js';
|
|
3
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
4
|
+
export class InboxEndpoint extends Endpoint {
|
|
5
|
+
async getAll(pagination = null, unacknowledgedOnly = false) {
|
|
6
|
+
const queryString = new QueryString('inbox_messages');
|
|
7
|
+
queryString.set('unacknowledgedOnly', unacknowledgedOnly);
|
|
8
|
+
queryString.addPagination(pagination);
|
|
9
|
+
const result = await this.requestCollection(queryString, InboxMessage.parse);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
async save(message) {
|
|
13
|
+
const result = await this.requestObject('/inbox_messages', message, InboxMessage.parse, 'POST');
|
|
14
|
+
const savedNotification = result.getData();
|
|
15
|
+
if (savedNotification === null) {
|
|
16
|
+
throw new Error('Unable to save inbox message: wrong response from API');
|
|
17
|
+
}
|
|
18
|
+
return savedNotification;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FilterNode } from '../Model/Filter/FilterNode.js';
|
|
2
|
+
import { Log } from '../Model/Log/Log.js';
|
|
3
|
+
import { LogQuery } from '../Model/Log/LogQuery.js';
|
|
4
|
+
import { LogStream } from '../Model/Log/LogStream.js';
|
|
5
|
+
import { LogStreamId } from '../Model/Log/LogStreamId.js';
|
|
6
|
+
import { LogStreamInformation } from '../Model/Log/LogStreamInformation.js';
|
|
7
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
8
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
9
|
+
import { Endpoint } from './Endpoint.js';
|
|
10
|
+
export declare class LogEndpoint extends Endpoint {
|
|
11
|
+
getLogs(logQuery: LogQuery): Promise<CollectionResult<Log>>;
|
|
12
|
+
getCursoredLogEntries(logStreamId: LogStreamId, pagination: CursorPagination | null, filter: FilterNode | null): Promise<CollectionResult<Log>>;
|
|
13
|
+
save(log: Log): Promise<Log>;
|
|
14
|
+
delete(logId: string): Promise<boolean>;
|
|
15
|
+
clear(logStreamId: LogStreamId): Promise<boolean>;
|
|
16
|
+
getInformation(logStreamId: LogStreamId): Promise<LogStreamInformation | null>;
|
|
17
|
+
getByProject(projectId: string, pagination?: CursorPagination | null): Promise<CollectionResult<LogStream>>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
|
+
import { Log } from '../Model/Log/Log.js';
|
|
3
|
+
import { LogStream } from '../Model/Log/LogStream.js';
|
|
4
|
+
import { LogStreamId } from '../Model/Log/LogStreamId.js';
|
|
5
|
+
import { LogStreamInformation } from '../Model/Log/LogStreamInformation.js';
|
|
6
|
+
import { Endpoint } from './Endpoint.js';
|
|
7
|
+
export class LogEndpoint extends Endpoint {
|
|
8
|
+
async getLogs(logQuery) {
|
|
9
|
+
const arrQuery = [];
|
|
10
|
+
if (logQuery.limit !== null) {
|
|
11
|
+
arrQuery.push('limit=' + logQuery.limit);
|
|
12
|
+
}
|
|
13
|
+
if (logQuery.startingAfterId !== null) {
|
|
14
|
+
arrQuery.push('starting_after=' + logQuery.startingAfterId);
|
|
15
|
+
}
|
|
16
|
+
// Resolved
|
|
17
|
+
if (logQuery.hidden !== null && logQuery.hidden !== undefined) {
|
|
18
|
+
if (logQuery.hidden) {
|
|
19
|
+
arrQuery.push('hidden=1');
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
arrQuery.push('hidden=0');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// LogLevels
|
|
26
|
+
if (logQuery.logLevels !== null && logQuery.logLevels !== undefined && logQuery.logLevels.length > 0) {
|
|
27
|
+
arrQuery.push('logLevels=' + logQuery.logLevels.join(','));
|
|
28
|
+
}
|
|
29
|
+
// Tags
|
|
30
|
+
if (logQuery.tags !== null && logQuery.tags !== undefined && logQuery.tags.length > 0) {
|
|
31
|
+
const arrTags = [];
|
|
32
|
+
// TODO: map this
|
|
33
|
+
for (const tag of logQuery.tags) {
|
|
34
|
+
arrTags.push(tag.key + ':' + tag.values);
|
|
35
|
+
}
|
|
36
|
+
const strTags = arrTags.join(',');
|
|
37
|
+
arrQuery.push('tags=' + strTags);
|
|
38
|
+
}
|
|
39
|
+
const cmd = '/logstreams/' + logQuery.logStreamId.toString() + '/logs/?' + arrQuery.join('&');
|
|
40
|
+
const result = await this.requestCollection(cmd, Log.parse);
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
async getCursoredLogEntries(logStreamId, pagination, filter) {
|
|
44
|
+
const queryString = new QueryString('/logstreams/' + logStreamId.toString() + '/logs');
|
|
45
|
+
queryString.addPagination(pagination);
|
|
46
|
+
if (filter !== null && filter !== undefined) {
|
|
47
|
+
queryString.set('filter', JSON.stringify(filter));
|
|
48
|
+
}
|
|
49
|
+
const result = await this.requestCollection(queryString, Log.parse);
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
async save(log) {
|
|
53
|
+
try {
|
|
54
|
+
const cmd = '/logstreams/' + log.logStream.toString() + '/logs';
|
|
55
|
+
const result = await this.requestObject(cmd, log, Log.parse, 'POST');
|
|
56
|
+
const updatedLogEntry = result.getData();
|
|
57
|
+
if (updatedLogEntry === null) {
|
|
58
|
+
throw new Error('Log not updated');
|
|
59
|
+
}
|
|
60
|
+
return updatedLogEntry;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
64
|
+
console.error('Failed to save log: ', error);
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async delete(logId) {
|
|
70
|
+
const cmd = '/logstreams/:streamId/logs/' + logId;
|
|
71
|
+
try {
|
|
72
|
+
const parser = (raw) => ({ deleted: raw.deleted });
|
|
73
|
+
const result = await this.requestObject(cmd, null, parser, 'DELETE');
|
|
74
|
+
const re = result.getData();
|
|
75
|
+
if (re === null) {
|
|
76
|
+
console.log('delete log entry wrong data', { result, parsed: re });
|
|
77
|
+
throw new Error('Unable to delete log entry: wrong response from API');
|
|
78
|
+
}
|
|
79
|
+
return re.deleted;
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
83
|
+
console.error('Failed to save log: ', e);
|
|
84
|
+
}
|
|
85
|
+
throw e;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async clear(logStreamId) {
|
|
89
|
+
const cmd = '/logstreams/' + logStreamId.toString() + '/clear';
|
|
90
|
+
try {
|
|
91
|
+
const parser = (raw) => ({ cleared: raw.cleared });
|
|
92
|
+
const result = await this.requestObject(cmd, null, parser, 'POST');
|
|
93
|
+
const re = result.getData();
|
|
94
|
+
if (re === null) {
|
|
95
|
+
console.log('Log stream cleared wrong data', { result, parsed: re });
|
|
96
|
+
throw new Error('Unable to clear log stream: wrong response from API');
|
|
97
|
+
}
|
|
98
|
+
return re.cleared;
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
102
|
+
console.error('Failed to save log: ', e);
|
|
103
|
+
}
|
|
104
|
+
throw e;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async getInformation(logStreamId) {
|
|
108
|
+
try {
|
|
109
|
+
const url = '/logstreams/' + logStreamId.toString() + '/info';
|
|
110
|
+
const result = await this.requestObject(url, null, LogStreamInformation.parse);
|
|
111
|
+
return result.getData();
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
115
|
+
console.error('Failed to load log stream information: ', error);
|
|
116
|
+
}
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async getByProject(projectId, pagination = null) {
|
|
121
|
+
const queryString = new QueryString('projects/' + projectId + '/logstreams');
|
|
122
|
+
queryString.addPagination(pagination);
|
|
123
|
+
const parser = (raw) => new LogStream(new LogStreamId(raw.id), raw.name);
|
|
124
|
+
const result = await this.requestCollection(queryString, parser);
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Platform } from '../Model/Worker/Platform.js';
|
|
2
|
+
import { PlatformImage } from '../Model/Worker/PlatformImage.js';
|
|
3
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
5
|
+
import { Endpoint } from './Endpoint.js';
|
|
6
|
+
export declare class PlatformEndpoint extends Endpoint {
|
|
7
|
+
getAll(workspaceId: string | null, pagination: CursorPagination): Promise<CollectionResult<Platform>>;
|
|
8
|
+
getPlatformImages(workspaceId: string | null, platformId: string, pagination: CursorPagination): Promise<CollectionResult<PlatformImage>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Platform } from '../Model/Worker/Platform.js';
|
|
2
|
+
import { PlatformImage } from '../Model/Worker/PlatformImage.js';
|
|
3
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
4
|
+
import { Endpoint } from './Endpoint.js';
|
|
5
|
+
export class PlatformEndpoint extends Endpoint {
|
|
6
|
+
async getAll(workspaceId, pagination) {
|
|
7
|
+
const qs = new QueryString('/workspaces/' + (workspaceId === null ? 'all' : workspaceId) + '/platforms');
|
|
8
|
+
qs.addPagination(pagination);
|
|
9
|
+
const result = await this.requestCollection(qs, Platform.parse);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
async getPlatformImages(workspaceId, platformId, pagination) {
|
|
13
|
+
const qs = new QueryString('/workspaces/' + (workspaceId === null ? 'all' : workspaceId) + '/platforms/' + platformId + '/images');
|
|
14
|
+
qs.addPagination(pagination);
|
|
15
|
+
const result = await this.requestCollection(qs, PlatformImage.parse);
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PlatformLanguage } from '../Model/Project/PlatformLanguage.js';
|
|
2
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export declare class PlatformLanguageEndpoint extends Endpoint {
|
|
5
|
+
getAll(workspaceId: string): Promise<CollectionResult<PlatformLanguage>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PlatformLanguage } from '../Model/Project/PlatformLanguage.js';
|
|
2
|
+
import { Endpoint } from './Endpoint.js';
|
|
3
|
+
export class PlatformLanguageEndpoint extends Endpoint {
|
|
4
|
+
async getAll(workspaceId) {
|
|
5
|
+
return await this.requestCollection('/workspaces/' + workspaceId + '/platforms/languages', PlatformLanguage.parse);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Project } from '../Model/Project/Project.js';
|
|
2
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
|
+
import { State } from '../Model/State.js';
|
|
4
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
5
|
+
import { Endpoint } from './Endpoint.js';
|
|
6
|
+
export declare class ProjectEndpoint extends Endpoint {
|
|
7
|
+
getAll(pagination?: CursorPagination | null): Promise<CollectionResult<Project>>;
|
|
8
|
+
getByWorkspace(workspaceId: string, pagination?: CursorPagination | null, states?: State[] | null): Promise<CollectionResult<Project>>;
|
|
9
|
+
getById(projectId: string): Promise<Project | null>;
|
|
10
|
+
save(project: Project): Promise<Project>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Project } from '../Model/Project/Project.js';
|
|
2
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export class ProjectEndpoint extends Endpoint {
|
|
5
|
+
async getAll(pagination = null) {
|
|
6
|
+
try {
|
|
7
|
+
const queryString = new QueryString('/projects');
|
|
8
|
+
queryString.addPagination(pagination);
|
|
9
|
+
const result = await this.requestCollection(queryString, Project.parse);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
14
|
+
console.error('Failed to load projects: ' + e);
|
|
15
|
+
}
|
|
16
|
+
throw e;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async getByWorkspace(workspaceId, pagination = null, states = null) {
|
|
20
|
+
try {
|
|
21
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/projects');
|
|
22
|
+
queryString.addPagination(pagination);
|
|
23
|
+
queryString.addStateFilter(states);
|
|
24
|
+
const result = await this.requestCollection(queryString, Project.parse);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
29
|
+
console.error('Failed to load projects: ' + e);
|
|
30
|
+
}
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async getById(projectId) {
|
|
35
|
+
try {
|
|
36
|
+
const result = await this.requestObject('projects/' + projectId + '', null, Project.parse);
|
|
37
|
+
return result.getData();
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
41
|
+
console.error('Failed to load project by id: ' + error);
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async save(project) {
|
|
47
|
+
try {
|
|
48
|
+
const url = '/projects';
|
|
49
|
+
const result = await this.requestObject(url, project, Project.parse, 'POST');
|
|
50
|
+
const updatedProject = result.getData();
|
|
51
|
+
if (updatedProject === null) {
|
|
52
|
+
throw new Error('Project not updated');
|
|
53
|
+
}
|
|
54
|
+
return updatedProject;
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
58
|
+
console.error('Failed to save project: ', error);
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ProjectEnvironment } from '../Model/Project/ProjectEnvironment.js';
|
|
2
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export declare class ProjectEnvironmentEndpoint extends Endpoint {
|
|
5
|
+
getByProject(id: string): Promise<CollectionResult<ProjectEnvironment>>;
|
|
6
|
+
getById(id: string): Promise<ProjectEnvironment | null>;
|
|
7
|
+
save(projectEnvironment: ProjectEnvironment): Promise<ProjectEnvironment>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ProjectEnvironment } from '../Model/Project/ProjectEnvironment.js';
|
|
2
|
+
import { HttpStatus } from '../Http/HttpStatus.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export class ProjectEnvironmentEndpoint extends Endpoint {
|
|
5
|
+
async getByProject(id) {
|
|
6
|
+
try {
|
|
7
|
+
const result = await this.requestCollection('/projects/' + id + '/environments', ProjectEnvironment.parse);
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
12
|
+
console.error('Failed to load project environments', error);
|
|
13
|
+
}
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async getById(id) {
|
|
18
|
+
try {
|
|
19
|
+
const rawProjectEnvironment = await this.requestObject('/projectenvironments/' + id + '', null, ProjectEnvironment.parse);
|
|
20
|
+
return rawProjectEnvironment.getData();
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (error.httpStatus === HttpStatus.HTTP_NOTFOUND) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
27
|
+
console.error('Failed to load project environment by id', error);
|
|
28
|
+
}
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async save(projectEnvironment) {
|
|
33
|
+
try {
|
|
34
|
+
const result = await this.requestObject('projectenvironments/', projectEnvironment, ProjectEnvironment.parse, 'POST');
|
|
35
|
+
const createdProjectEnvironment = result.getData();
|
|
36
|
+
if (createdProjectEnvironment === null) {
|
|
37
|
+
throw new Error('ProjectEnvironment not created');
|
|
38
|
+
}
|
|
39
|
+
return createdProjectEnvironment;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
43
|
+
console.error('Failed to save project environment', error, projectEnvironment);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ProviderToken } from '../Model/ProviderToken/ProviderToken.js';
|
|
2
|
+
import { ProviderTokenAccessToken } from '../Model/ProviderToken/ProviderTokenAccessToken.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export declare class ProviderTokenEndpoint extends Endpoint {
|
|
5
|
+
getProviderToken(providerTokenId: string): Promise<ProviderToken | null>;
|
|
6
|
+
getProviderTokenAccessToken(providerTokenId: string): Promise<ProviderTokenAccessToken | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Revoke (remove) a provider token. Optionally pass the adapter-connection configuration that holds
|
|
9
|
+
* this token — the API also unsets that exact (connection, configuration) row when it references this
|
|
10
|
+
* token, so disconnecting a connection's auth is a single request.
|
|
11
|
+
*/
|
|
12
|
+
revokeProviderToken(providerTokenId: string, connectionConfiguration?: {
|
|
13
|
+
connection: string;
|
|
14
|
+
configuration: string;
|
|
15
|
+
} | null): Promise<boolean>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
|
+
import { ProviderToken } from '../Model/ProviderToken/ProviderToken.js';
|
|
3
|
+
import { ProviderTokenAccessToken } from '../Model/ProviderToken/ProviderTokenAccessToken.js';
|
|
4
|
+
import { Endpoint } from './Endpoint.js';
|
|
5
|
+
export class ProviderTokenEndpoint extends Endpoint {
|
|
6
|
+
async getProviderToken(providerTokenId) {
|
|
7
|
+
const queryString = new QueryString('/provider-tokens/' + providerTokenId);
|
|
8
|
+
const result = await this.requestObject(queryString, null, ProviderToken.parse);
|
|
9
|
+
return result.getData();
|
|
10
|
+
}
|
|
11
|
+
async getProviderTokenAccessToken(providerTokenId) {
|
|
12
|
+
const queryString = new QueryString('/provider-tokens/' + providerTokenId + '/access-token');
|
|
13
|
+
const result = await this.requestObject(queryString, null, ProviderTokenAccessToken.parse);
|
|
14
|
+
return result.getData();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Revoke (remove) a provider token. Optionally pass the adapter-connection configuration that holds
|
|
18
|
+
* this token — the API also unsets that exact (connection, configuration) row when it references this
|
|
19
|
+
* token, so disconnecting a connection's auth is a single request.
|
|
20
|
+
*/
|
|
21
|
+
async revokeProviderToken(providerTokenId, connectionConfiguration = null) {
|
|
22
|
+
const queryString = new QueryString('/provider-tokens/' + providerTokenId);
|
|
23
|
+
if (connectionConfiguration !== null) {
|
|
24
|
+
queryString.set('connection', connectionConfiguration.connection);
|
|
25
|
+
queryString.set('configuration', connectionConfiguration.configuration);
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const parser = (raw) => ({ deleted: raw.deleted });
|
|
29
|
+
const result = await this.requestObject(queryString, null, parser, 'DELETE');
|
|
30
|
+
const re = result.getData();
|
|
31
|
+
if (re === null) {
|
|
32
|
+
throw new Error('Unable to revoke provider token: wrong response from API');
|
|
33
|
+
}
|
|
34
|
+
return re.deleted;
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
38
|
+
console.error('Failed to revoke provider token: ', e);
|
|
39
|
+
}
|
|
40
|
+
throw e;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Endpoint } from './Endpoint.js';
|
|
2
|
+
import { RunnerImage } from '../Model/Runner/RunnerImage.js';
|
|
3
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
|
+
export declare class RunnerEndpoint extends Endpoint {
|
|
5
|
+
getImages(): Promise<CollectionResult<RunnerImage>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Endpoint } from './Endpoint.js';
|
|
2
|
+
import { RunnerImage } from '../Model/Runner/RunnerImage.js';
|
|
3
|
+
import { Utils } from '../Utils.js';
|
|
4
|
+
import { State } from '../Model/State.js';
|
|
5
|
+
export class RunnerEndpoint extends Endpoint {
|
|
6
|
+
async getImages() {
|
|
7
|
+
const url = '/runners/images';
|
|
8
|
+
const parser = (rawImage) => {
|
|
9
|
+
const runnerImage = new RunnerImage();
|
|
10
|
+
runnerImage.id = rawImage.id;
|
|
11
|
+
runnerImage.name = rawImage.name;
|
|
12
|
+
runnerImage.image = rawImage.image;
|
|
13
|
+
runnerImage.version = rawImage.image;
|
|
14
|
+
runnerImage.buildDate = Utils.parseRawDate(rawImage.build_date);
|
|
15
|
+
runnerImage.deprecated = Utils.isTrue(rawImage.deprecated);
|
|
16
|
+
if (rawImage.end_of_support !== null && rawImage.end_of_support !== undefined) {
|
|
17
|
+
runnerImage.endOfSupport = Utils.parseRawDate(rawImage.end_of_support);
|
|
18
|
+
}
|
|
19
|
+
if (rawImage.end_of_life !== null && rawImage.end_of_life !== undefined) {
|
|
20
|
+
runnerImage.endOfLife = Utils.parseRawDate(rawImage.end_of_life);
|
|
21
|
+
}
|
|
22
|
+
runnerImage.state = State.fromString(rawImage.state);
|
|
23
|
+
return runnerImage;
|
|
24
|
+
};
|
|
25
|
+
const result = await this.requestCollection(url, parser);
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RunnerPool } from '../Model/Infrastructure/RunnerPool.js';
|
|
2
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
3
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
|
+
import { Endpoint } from './Endpoint.js';
|
|
5
|
+
export declare class RunnerPoolEndpoint extends Endpoint {
|
|
6
|
+
getByProjectEnvironment(projectEnvironmentId: string, pagination?: CursorPagination | null): Promise<CollectionResult<RunnerPool>>;
|
|
7
|
+
getById(queueSpecificationId: string): Promise<RunnerPool | null>;
|
|
8
|
+
redeploy(runnerPoolId: string): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
|
+
import { RunnerPool } from '../Model/Infrastructure/RunnerPool.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export class RunnerPoolEndpoint extends Endpoint {
|
|
5
|
+
async getByProjectEnvironment(projectEnvironmentId, pagination = null) {
|
|
6
|
+
const queryString = new QueryString('/runner-pools/project-environments/' + projectEnvironmentId + '');
|
|
7
|
+
queryString.addPagination(pagination);
|
|
8
|
+
const result = await this.requestCollection(queryString, RunnerPool.parse);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
async getById(queueSpecificationId) {
|
|
12
|
+
const queryString = new QueryString('/runner-pools/' + queueSpecificationId);
|
|
13
|
+
const result = await this.requestObject(queryString, null, RunnerPool.parse);
|
|
14
|
+
return result.getData();
|
|
15
|
+
}
|
|
16
|
+
async redeploy(runnerPoolId) {
|
|
17
|
+
const queryString = new QueryString('/runner-pools/' + runnerPoolId + '/redeploy');
|
|
18
|
+
await this.requestObject(queryString, null, (raw) => raw, 'POST');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
2
|
+
import { SearchResult } from '../Model/Search/SearchResult.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export declare class SearchEndpoint extends Endpoint {
|
|
5
|
+
search(query: string): Promise<CollectionResult<SearchResult>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SearchResult } from '../Model/Search/SearchResult.js';
|
|
2
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export class SearchEndpoint extends Endpoint {
|
|
5
|
+
async search(query) {
|
|
6
|
+
if (query.length > 512) {
|
|
7
|
+
query = query.substring(0, 512);
|
|
8
|
+
}
|
|
9
|
+
const qs = new QueryString('search');
|
|
10
|
+
qs.set('q', query);
|
|
11
|
+
const result = await this.requestCollection(qs, SearchResult.parse);
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CodeSourceAccount } from '../Model/Deployment/CodeSourceAccount.js';
|
|
2
|
+
import { CodeSource } from '../Model/Deployment/CodeSource.js';
|
|
3
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
|
+
import { SourcesAccountRepository } from '../Model/Deployment/SourcesAccountRepository.js';
|
|
5
|
+
import { SourcesAccountRepositoryBranch } from '../Model/Deployment/SourcesAccountRepositoryBranch.js';
|
|
6
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
7
|
+
import { Endpoint } from './Endpoint.js';
|
|
8
|
+
export declare class SourcesAccountEndpoint extends Endpoint {
|
|
9
|
+
getAllCodeSources(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CodeSource>>;
|
|
10
|
+
getAllCodeSourceAccounts(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CodeSourceAccount>>;
|
|
11
|
+
getCodeSourceAccountById(id: string): Promise<CodeSourceAccount | null>;
|
|
12
|
+
getCodeSourceById(codeSourceId: string): Promise<CodeSource | null>;
|
|
13
|
+
getRepositories(codeSourceAccountId: string, pagination?: CursorPagination | null): Promise<CollectionResult<SourcesAccountRepository>>;
|
|
14
|
+
getRepositoryBranches(codeSourceAccountId: string, repositoryKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<SourcesAccountRepositoryBranch>>;
|
|
15
|
+
saveCodeSource(codeSource: CodeSource): Promise<CodeSource>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { CodeSourceAccount } from '../Model/Deployment/CodeSourceAccount.js';
|
|
2
|
+
import { CodeSource } from '../Model/Deployment/CodeSource.js';
|
|
3
|
+
import { SourcesAccountRepository } from '../Model/Deployment/SourcesAccountRepository.js';
|
|
4
|
+
import { SourcesAccountRepositoryBranch } from '../Model/Deployment/SourcesAccountRepositoryBranch.js';
|
|
5
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
6
|
+
import { HttpStatus } from '../Http/HttpStatus.js';
|
|
7
|
+
import { Endpoint } from './Endpoint.js';
|
|
8
|
+
export class SourcesAccountEndpoint extends Endpoint {
|
|
9
|
+
async getAllCodeSources(workspaceId, pagination = null) {
|
|
10
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/codesources');
|
|
11
|
+
queryString.addPagination(pagination);
|
|
12
|
+
const result = await this.requestCollection(queryString, CodeSource.parse);
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
async getAllCodeSourceAccounts(workspaceId, pagination = null) {
|
|
16
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/codesourceaccounts');
|
|
17
|
+
queryString.addPagination(pagination);
|
|
18
|
+
const result = await this.requestCollection(queryString, CodeSourceAccount.parse);
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
async getCodeSourceAccountById(id) {
|
|
22
|
+
try {
|
|
23
|
+
const rawSourcesAccounts = await this.requestObject('codesourceaccounts/' + id, null, CodeSourceAccount.parse);
|
|
24
|
+
return rawSourcesAccounts.getData();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
if (error.httpStatus === HttpStatus.HTTP_NOTFOUND) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
31
|
+
console.error('Failed to load code source account by id', error);
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
// let sourcesAccounts: CodeSourceAccount[] = [];
|
|
36
|
+
// for (let rawSourcesAccount of rawSourcesAccounts) {
|
|
37
|
+
// sourcesAccounts.push(CodeSourceAccount.parse(rawSourcesAccount));
|
|
38
|
+
// }
|
|
39
|
+
// return sourcesAccounts;
|
|
40
|
+
}
|
|
41
|
+
async getCodeSourceById(codeSourceId) {
|
|
42
|
+
try {
|
|
43
|
+
const result = await this.requestObject('/codesources/' + codeSourceId, null, CodeSource.parse);
|
|
44
|
+
return result.getData();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
if (error.httpStatus === HttpStatus.HTTP_NOTFOUND) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
51
|
+
console.error('Failed to load code source by id', error);
|
|
52
|
+
}
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async getRepositories(codeSourceAccountId, pagination = null) {
|
|
57
|
+
const queryString = new QueryString('codesourceaccounts/' + codeSourceAccountId + '/repositories');
|
|
58
|
+
queryString.addPagination(pagination);
|
|
59
|
+
const rawSourcesAccountRepositories = await this.requestCollection(queryString, SourcesAccountRepository.parse);
|
|
60
|
+
return rawSourcesAccountRepositories;
|
|
61
|
+
}
|
|
62
|
+
async getRepositoryBranches(codeSourceAccountId, repositoryKey, pagination = null) {
|
|
63
|
+
const queryString = new QueryString('codesourceaccounts/' + codeSourceAccountId + '/repositories/' + repositoryKey + '/branches');
|
|
64
|
+
queryString.addPagination(pagination);
|
|
65
|
+
const rawBranches = await this.requestCollection(queryString, SourcesAccountRepositoryBranch.parse);
|
|
66
|
+
return rawBranches;
|
|
67
|
+
}
|
|
68
|
+
async saveCodeSource(codeSource) {
|
|
69
|
+
try {
|
|
70
|
+
const url = '/codesources/';
|
|
71
|
+
const result = await this.requestObject(url, codeSource, CodeSource.parse, 'POST');
|
|
72
|
+
const updatedCodeSource = result.getData();
|
|
73
|
+
if (updatedCodeSource === null) {
|
|
74
|
+
throw new Error('Unable to update code source: wrong response from API');
|
|
75
|
+
}
|
|
76
|
+
return updatedCodeSource;
|
|
77
|
+
}
|
|
78
|
+
catch (ex) {
|
|
79
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
80
|
+
console.error('Failed to save code source: ', ex);
|
|
81
|
+
}
|
|
82
|
+
throw ex;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StorageType } from '../Model/Storage/StorageType.js';
|
|
2
|
+
import { StorageInformation } from '../Model/Storage/StorageInformation.js';
|
|
3
|
+
import { StorageItem } from '../Model/Storage/StorageItem.js';
|
|
4
|
+
import { StorageItemInformation } from '../Model/Storage/StorageItemInformation.js';
|
|
5
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
6
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
7
|
+
import { Endpoint } from './Endpoint.js';
|
|
8
|
+
export declare class StorageEndpoint extends Endpoint {
|
|
9
|
+
getInformation(projectEnvironmentId: string, storageType: StorageType): Promise<StorageInformation | null>;
|
|
10
|
+
clearBucket(projectEnvironmentId: string, storageType: StorageType, bucketKey: string): Promise<boolean>;
|
|
11
|
+
getBucketItemsInformation(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<StorageItemInformation>>;
|
|
12
|
+
/** @deprecated Renamed to getBucketItemsInformation. Kept for backwards compatibility. */
|
|
13
|
+
getPoolItemsInformation(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<StorageItemInformation>>;
|
|
14
|
+
/** @deprecated Renamed to clearBucket. Kept for backwards compatibility. */
|
|
15
|
+
clearPool(projectEnvironmentId: string, storageType: StorageType, bucketKey: string): Promise<boolean>;
|
|
16
|
+
getItem(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, storageItemKey: string): Promise<StorageItem | null>;
|
|
17
|
+
getBucketItem(storageBucketId: string, storageItemKey: string): Promise<StorageItem | null>;
|
|
18
|
+
setItem(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, storageItem: StorageItem): Promise<StorageItem>;
|
|
19
|
+
deleteItem(projectEnvironmentId: string, storageType: StorageType, bucketKey: string, storageItemKey: string): Promise<boolean>;
|
|
20
|
+
}
|