@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,185 @@
|
|
|
1
|
+
import { ClientError } from '../Http/ClientError.js';
|
|
2
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
3
|
+
import { HttpStatus } from '../Http/HttpStatus.js';
|
|
4
|
+
import { DataValueCollection } from '../Model/DataValueCollection.js';
|
|
5
|
+
import { ApiError } from '../Model/Error/ApiError.js';
|
|
6
|
+
import { LogStreamId } from '../Model/Log/LogStreamId.js';
|
|
7
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
8
|
+
import { ObjectResult } from '../Model/Result/ObjectResult.js';
|
|
9
|
+
import { ObjectWrapper } from '../Model/Result/ObjectWrapper.js';
|
|
10
|
+
import { Utils } from '../Utils.js';
|
|
11
|
+
export class Endpoint {
|
|
12
|
+
httpClient;
|
|
13
|
+
constructor(httpClient) {
|
|
14
|
+
this.httpClient = httpClient;
|
|
15
|
+
}
|
|
16
|
+
formatParameters(data = null) {
|
|
17
|
+
if (data === null || data === undefined) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
if (Array.isArray(data)) {
|
|
21
|
+
const result = [];
|
|
22
|
+
for (const value of data) {
|
|
23
|
+
result.push(this.formatParameters(value));
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
if (Utils.isDate(data)) {
|
|
28
|
+
return data.toISOString();
|
|
29
|
+
}
|
|
30
|
+
if (typeof data === 'object') {
|
|
31
|
+
// These types need recursive formatting applied to their serialized output.
|
|
32
|
+
if (data instanceof DataValueCollection || data instanceof LogStreamId) {
|
|
33
|
+
return this.formatParameters(data.jsonSerialize());
|
|
34
|
+
}
|
|
35
|
+
if (data instanceof QueryString) {
|
|
36
|
+
return data.getParameters();
|
|
37
|
+
}
|
|
38
|
+
// Duck-type check for JsonSerializable: avoids fragile instanceof checks across
|
|
39
|
+
// ESM module boundaries where class identity can differ between realms.
|
|
40
|
+
if (typeof data.jsonSerialize === 'function') {
|
|
41
|
+
return data.jsonSerialize();
|
|
42
|
+
}
|
|
43
|
+
const result = {};
|
|
44
|
+
for (const [key, value] of Object.entries(data)) {
|
|
45
|
+
const formattedKey = this.formatKey(key);
|
|
46
|
+
result[formattedKey] = this.formatParameters(value);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
formatKey(key) {
|
|
53
|
+
let formattedKey = key.replace(/([A-Z])/g, ' $1');
|
|
54
|
+
formattedKey = formattedKey.split(' ').join('_').toLowerCase();
|
|
55
|
+
// Intentional: the API expects bare resource names, not ID-suffixed ones.
|
|
56
|
+
// e.g. TypeScript `environmentId` → snake_case `environment_id` → API param `environment`
|
|
57
|
+
if (formattedKey.endsWith('_id')) {
|
|
58
|
+
formattedKey = formattedKey.substring(0, formattedKey.length - '_id'.length);
|
|
59
|
+
}
|
|
60
|
+
// Intentional: same convention for plural IDs.
|
|
61
|
+
// e.g. `categoryIds` → `category_ids` → `categorys` (TODO: handle irregular plurals properly)
|
|
62
|
+
if (formattedKey.endsWith('_ids')) {
|
|
63
|
+
formattedKey = formattedKey.substring(0, formattedKey.length - '_ids'.length) + 's';
|
|
64
|
+
}
|
|
65
|
+
return formattedKey;
|
|
66
|
+
}
|
|
67
|
+
async requestCollection(action, parser, parameters = null, method = 'GET', signWithOauthToken = true) {
|
|
68
|
+
parameters = this.formatParameters(parameters);
|
|
69
|
+
if (action instanceof QueryString) {
|
|
70
|
+
action = action.build();
|
|
71
|
+
}
|
|
72
|
+
let requestResponse;
|
|
73
|
+
try {
|
|
74
|
+
requestResponse = await this.httpClient.request(action, parameters, method, signWithOauthToken);
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
throw this.toApiError(error);
|
|
78
|
+
}
|
|
79
|
+
const result = new CollectionResult();
|
|
80
|
+
/**
|
|
81
|
+
* Parse data
|
|
82
|
+
*/
|
|
83
|
+
if (requestResponse === null || requestResponse === undefined) {
|
|
84
|
+
throw new Error('Unable to parse collection: response is empty for action `[' + method + '] ' + action + '`');
|
|
85
|
+
}
|
|
86
|
+
if (!Object.prototype.hasOwnProperty.call(requestResponse, 'data') || requestResponse.data === undefined) {
|
|
87
|
+
throw new Error('Unable to parse collection: data is not defined in response from action `[' + method + '] ' + action + '`');
|
|
88
|
+
}
|
|
89
|
+
if (!Object.prototype.hasOwnProperty.call(requestResponse, 'has_more') || requestResponse.has_more === undefined) {
|
|
90
|
+
throw new Error('Unable to parse collection: hasMore is not defined in response from action `[' + method + '] ' + action + '`');
|
|
91
|
+
}
|
|
92
|
+
const hasMore = Utils.isTrue(requestResponse.has_more);
|
|
93
|
+
result.setData(this.parseCollection(requestResponse.data, parser), hasMore);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
async requestObject(action, parameters = null, parser, method = 'GET', signWithOauthToken = true) {
|
|
97
|
+
parameters = this.formatParameters(parameters);
|
|
98
|
+
if (action instanceof QueryString) {
|
|
99
|
+
action = action.build();
|
|
100
|
+
}
|
|
101
|
+
const result = new ObjectResult();
|
|
102
|
+
let requestResponse;
|
|
103
|
+
try {
|
|
104
|
+
requestResponse = await this.httpClient.request(action, parameters, method, signWithOauthToken);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
if (error.httpStatus === HttpStatus.HTTP_NOTFOUND) {
|
|
108
|
+
result.setData(null);
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
throw this.toApiError(error);
|
|
112
|
+
}
|
|
113
|
+
// TODO: add errors
|
|
114
|
+
/**
|
|
115
|
+
* Parse errors
|
|
116
|
+
*/
|
|
117
|
+
if (requestResponse === null || requestResponse === undefined) {
|
|
118
|
+
throw new ApiError('Unable to parse object: response is empty for action `[' + method + '] ' + action + '`', HttpStatus.HTTP_INTERNAL_SERVER_ERROR);
|
|
119
|
+
}
|
|
120
|
+
result.setData(this.parseObject(requestResponse, parser));
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
toApiError(error) {
|
|
124
|
+
if (error instanceof ClientError) {
|
|
125
|
+
const apiError = new ApiError(error.message, error.httpStatus);
|
|
126
|
+
if (error.response !== null && error.response !== undefined) {
|
|
127
|
+
const response = error.response;
|
|
128
|
+
if (response.data !== null && response.data !== undefined && response.data.error !== undefined) {
|
|
129
|
+
if (response.data.error.type !== undefined) {
|
|
130
|
+
apiError.type = response.data.error.type;
|
|
131
|
+
}
|
|
132
|
+
if (response.data.error.code !== undefined) {
|
|
133
|
+
apiError.code = response.data.error.code;
|
|
134
|
+
}
|
|
135
|
+
if (response.data.error.message !== undefined) {
|
|
136
|
+
apiError.message = response.data.error.message;
|
|
137
|
+
}
|
|
138
|
+
if (response.data.error.param !== undefined) {
|
|
139
|
+
apiError.param = response.data.error.param;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return apiError;
|
|
144
|
+
}
|
|
145
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
146
|
+
console.error('Unrecognised error type (not a ClientError)', { error });
|
|
147
|
+
}
|
|
148
|
+
return new ApiError('Unknown Error', HttpStatus.HTTP_INTERNAL_SERVER_ERROR);
|
|
149
|
+
}
|
|
150
|
+
parseCollection(rawData, parser) {
|
|
151
|
+
const data = [];
|
|
152
|
+
if (!Array.isArray(rawData)) {
|
|
153
|
+
throw new Error('Invalid data');
|
|
154
|
+
}
|
|
155
|
+
for (const rawDataEntry of rawData) {
|
|
156
|
+
const parsedObject = this.parseObject(rawDataEntry, parser);
|
|
157
|
+
if (parsedObject !== null) {
|
|
158
|
+
data.push(parsedObject);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return data;
|
|
162
|
+
}
|
|
163
|
+
parseObject(rawObject, parser) {
|
|
164
|
+
// Parse the raw object directly by default. With debug enabled the object is wrapped so
|
|
165
|
+
// that reads of properties the response doesn't contain get reported — useful for spotting
|
|
166
|
+
// schema drift, but too noisy (and a per-object Proxy cost) to run normally.
|
|
167
|
+
// Enable via client.getHttpClient().enableDebug().
|
|
168
|
+
const data = this.httpClient.isDebugEnabled() ? ObjectWrapper.wrap(rawObject) : rawObject;
|
|
169
|
+
try {
|
|
170
|
+
return parser(data);
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
// Report through the transport's parse-error handler (defaults to console.error;
|
|
174
|
+
// consumers can route it to a logger / error tracker via Client.setParseErrorHandler).
|
|
175
|
+
this.httpClient.reportParseError('Unable to parse object', { object: rawObject, error });
|
|
176
|
+
// In debug, surface schema drift loudly (dev/tests) by rethrowing. In production,
|
|
177
|
+
// degrade gracefully — return null so the caller skips the row / shows a not-found
|
|
178
|
+
// state, and a single unparseable object never breaks an entire view.
|
|
179
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
2
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export type BlockedIp = {
|
|
5
|
+
id: string;
|
|
6
|
+
ip: string;
|
|
7
|
+
from: Date;
|
|
8
|
+
to: Date;
|
|
9
|
+
reason: string;
|
|
10
|
+
};
|
|
11
|
+
export type FlaggedIp = {
|
|
12
|
+
id: string;
|
|
13
|
+
ip: string;
|
|
14
|
+
date: Date;
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
export type IpRule = {
|
|
18
|
+
id: string;
|
|
19
|
+
ip: string;
|
|
20
|
+
action: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
export declare class FirewallEndpoint extends Endpoint {
|
|
24
|
+
getBlockedIps(pagination: CursorPagination): Promise<CollectionResult<BlockedIp>>;
|
|
25
|
+
getFlaggedIps(pagination: CursorPagination): Promise<CollectionResult<FlaggedIp>>;
|
|
26
|
+
getIpRules(pagination: CursorPagination): Promise<CollectionResult<IpRule>>;
|
|
27
|
+
createIpRule(ip: string, action: string, description?: string): Promise<boolean>;
|
|
28
|
+
unblockIP(ip: string): Promise<boolean>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Utils } from '../Utils.js';
|
|
2
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export class FirewallEndpoint extends Endpoint {
|
|
5
|
+
async getBlockedIps(pagination) {
|
|
6
|
+
const parser = (raw) => {
|
|
7
|
+
return {
|
|
8
|
+
id: raw.id,
|
|
9
|
+
ip: raw.ip,
|
|
10
|
+
from: Utils.parseRawDate(raw.from),
|
|
11
|
+
to: Utils.parseRawDate(raw.to),
|
|
12
|
+
reason: raw.reason,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const queryString = new QueryString('/system/firewall/blocked');
|
|
16
|
+
queryString.addPagination(pagination);
|
|
17
|
+
const result = await this.requestCollection(queryString, parser);
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
async getFlaggedIps(pagination) {
|
|
21
|
+
const parser = (raw) => {
|
|
22
|
+
return {
|
|
23
|
+
id: raw.id,
|
|
24
|
+
ip: raw.ip,
|
|
25
|
+
date: Utils.parseRawDate(raw.date),
|
|
26
|
+
reason: raw.reason,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const queryString = new QueryString('/system/firewall/flagged');
|
|
30
|
+
queryString.addPagination(pagination);
|
|
31
|
+
const result = await this.requestCollection(queryString, parser);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
async getIpRules(pagination) {
|
|
35
|
+
const parser = (raw) => {
|
|
36
|
+
return {
|
|
37
|
+
id: raw.id,
|
|
38
|
+
ip: raw.ip,
|
|
39
|
+
action: raw.action,
|
|
40
|
+
description: raw.description,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const queryString = new QueryString('/system/firewall/rules');
|
|
44
|
+
queryString.addPagination(pagination);
|
|
45
|
+
const result = await this.requestCollection(queryString, parser);
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
async createIpRule(ip, action, description = '') {
|
|
49
|
+
const cmd = '/system/firewall/ip_rules';
|
|
50
|
+
try {
|
|
51
|
+
const parser = (raw) => raw.success;
|
|
52
|
+
const result = await this.requestObject(cmd, {
|
|
53
|
+
ip, action, description,
|
|
54
|
+
}, parser, 'PUT');
|
|
55
|
+
const re = result.getData();
|
|
56
|
+
if (re === null) {
|
|
57
|
+
console.log('createIPRule wrong result', { result, parsed: re });
|
|
58
|
+
throw new Error('Unable to create IP rule: wrong response from API');
|
|
59
|
+
}
|
|
60
|
+
return re.success;
|
|
61
|
+
}
|
|
62
|
+
catch (ex) {
|
|
63
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
64
|
+
console.error('Failed to create IP rule', ex);
|
|
65
|
+
}
|
|
66
|
+
throw ex;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async unblockIP(ip) {
|
|
70
|
+
const cmd = '/system/firewall/blocked_ips';
|
|
71
|
+
try {
|
|
72
|
+
const parser = (raw) => ({ success: raw.success });
|
|
73
|
+
const result = await this.requestObject(cmd, { ip }, parser, 'DELETE');
|
|
74
|
+
const x = result.getData();
|
|
75
|
+
if (x === null) {
|
|
76
|
+
console.log('Unblock ip wrong response', { result, parsed: x });
|
|
77
|
+
throw new Error('Unable to unblock ip: wrong response from API');
|
|
78
|
+
}
|
|
79
|
+
return x.success;
|
|
80
|
+
}
|
|
81
|
+
catch (ex) {
|
|
82
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
83
|
+
console.error('Unable to unblock ip', ex);
|
|
84
|
+
}
|
|
85
|
+
throw ex;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Flow } from '../Model/Flow/Flow.js';
|
|
2
|
+
import { FlowSummary } from '../Model/Flow/FlowSummary.js';
|
|
3
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
4
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
5
|
+
import { Endpoint } from './Endpoint.js';
|
|
6
|
+
export declare class FlowEndpoint extends Endpoint {
|
|
7
|
+
getByProject(projectId: string, pagination: CursorPagination): Promise<CollectionResult<Flow>>;
|
|
8
|
+
getById(flowId: string): Promise<Flow | null>;
|
|
9
|
+
getFlowSummaries(projectId: string, projectEnvironmentId?: string | null, pagination?: CursorPagination | null): Promise<CollectionResult<FlowSummary>>;
|
|
10
|
+
getFlowSummary(flowId: string, projectEnvironmentId?: string | null): Promise<FlowSummary | null>;
|
|
11
|
+
save(flow: Flow): Promise<Flow>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
|
+
import { HttpStatus } from '../Http/HttpStatus.js';
|
|
3
|
+
import { Flow } from '../Model/Flow/Flow.js';
|
|
4
|
+
import { FlowSummary } from '../Model/Flow/FlowSummary.js';
|
|
5
|
+
import { Utils } from '../Utils.js';
|
|
6
|
+
import { Endpoint } from './Endpoint.js';
|
|
7
|
+
export class FlowEndpoint extends Endpoint {
|
|
8
|
+
async getByProject(projectId, pagination) {
|
|
9
|
+
try {
|
|
10
|
+
const queryString = new QueryString('/projects/' + projectId + '/flows');
|
|
11
|
+
queryString.addPagination(pagination);
|
|
12
|
+
const result = await this.requestCollection(queryString, Flow.parse);
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
17
|
+
console.error('Failed to get projects: ', error);
|
|
18
|
+
}
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async getById(flowId) {
|
|
23
|
+
try {
|
|
24
|
+
const result = await this.requestObject('/flows/' + flowId, null, Flow.parse);
|
|
25
|
+
return result.getData();
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error.httpStatus === HttpStatus.HTTP_NOTFOUND) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
32
|
+
console.error('Failed to load flows: ' + error);
|
|
33
|
+
}
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async getFlowSummaries(projectId, projectEnvironmentId = null, pagination = null) {
|
|
38
|
+
let parameters = null;
|
|
39
|
+
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
40
|
+
parameters = { environment: projectEnvironmentId };
|
|
41
|
+
}
|
|
42
|
+
const queryString = new QueryString('projects/' + projectId + '/flowsummaries');
|
|
43
|
+
if (pagination !== null) {
|
|
44
|
+
queryString.addPagination(pagination);
|
|
45
|
+
}
|
|
46
|
+
return await this.requestCollection(queryString, FlowSummary.parse, parameters);
|
|
47
|
+
}
|
|
48
|
+
async getFlowSummary(flowId, projectEnvironmentId = null) {
|
|
49
|
+
let parameters = null;
|
|
50
|
+
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
51
|
+
parameters = { environment: projectEnvironmentId };
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const rawFlowSummaries = await this.requestObject('flows/' + flowId + '/summaries', parameters, FlowSummary.parse);
|
|
55
|
+
if (rawFlowSummaries.getData() === null) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return rawFlowSummaries.getData();
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
62
|
+
console.error('Failed to load flow by id ' + flowId + ': ' + e);
|
|
63
|
+
}
|
|
64
|
+
throw e;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async save(flow) {
|
|
68
|
+
try {
|
|
69
|
+
const url = '/projects/' + flow.projectId + '/flows';
|
|
70
|
+
const result = await this.requestObject(url, flow, Flow.parse, 'POST');
|
|
71
|
+
const updatedFlow = result.getData();
|
|
72
|
+
if (updatedFlow === null) {
|
|
73
|
+
throw new Error('Flow not updated');
|
|
74
|
+
}
|
|
75
|
+
return updatedFlow;
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
79
|
+
console.error('Failed to save flow: ', e);
|
|
80
|
+
}
|
|
81
|
+
throw e;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FlowRun } from '../Model/Flow/FlowRun.js';
|
|
2
|
+
import { FlowRunStatus } from '../Model/Flow/FlowRunStatus.js';
|
|
3
|
+
import { FlowRunSummary } from '../Model/Flow/FlowRunSummary.js';
|
|
4
|
+
import { FlowRunHistory } from '../Model/Flow/FlowRunHistory.js';
|
|
5
|
+
import { FlowRunLifecycle } from '../Model/Flow/FlowRunLifecycle.js';
|
|
6
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
7
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
8
|
+
import { Endpoint } from './Endpoint.js';
|
|
9
|
+
export declare class FlowRunEndpoint extends Endpoint {
|
|
10
|
+
getFlowRuns(flowId: string): Promise<CollectionResult<FlowRun>>;
|
|
11
|
+
getFlowRunSummaries(flowId: string, flowRunStatuses?: FlowRunStatus[] | null, pagination?: CursorPagination | null, projectEnvironmentId?: string | null): Promise<CollectionResult<FlowRunSummary>>;
|
|
12
|
+
getFlowRunSummary(flowRunId: string): Promise<FlowRunSummary | null>;
|
|
13
|
+
getFlowRunHistory(flowRunId: string): Promise<CollectionResult<FlowRunHistory>>;
|
|
14
|
+
/**
|
|
15
|
+
* Authoritative lifecycle (status derived from history, first-terminal-wins). Prefer this over
|
|
16
|
+
* getFlowRunSummary for control-flow decisions (e.g. the worker tombstone), since the summary
|
|
17
|
+
* reflects the eventually-consistent index projection which can lag the history.
|
|
18
|
+
*/
|
|
19
|
+
getFlowRunLifecycle(flowRunId: string): Promise<FlowRunLifecycle | null>;
|
|
20
|
+
updateFlowRun(flowRunId: string, status: FlowRunStatus, time?: Date | null): Promise<FlowRun>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { FlowRun } from '../Model/Flow/FlowRun.js';
|
|
2
|
+
import { FlowRunSummary } from '../Model/Flow/FlowRunSummary.js';
|
|
3
|
+
import { FlowRunHistory } from '../Model/Flow/FlowRunHistory.js';
|
|
4
|
+
import { FlowRunLifecycle } from '../Model/Flow/FlowRunLifecycle.js';
|
|
5
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
6
|
+
import { Endpoint } from './Endpoint.js';
|
|
7
|
+
export class FlowRunEndpoint extends Endpoint {
|
|
8
|
+
async getFlowRuns(flowId) {
|
|
9
|
+
const result = await this.requestCollection('/flows/' + flowId + '/runs', FlowRun.parse);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
async getFlowRunSummaries(flowId, flowRunStatuses = null, pagination = null, projectEnvironmentId = null) {
|
|
13
|
+
try {
|
|
14
|
+
const queryString = new QueryString('/flows/' + flowId + '/runsummaries');
|
|
15
|
+
queryString.addPagination(pagination);
|
|
16
|
+
// if (from !== null && from !== undefined) {
|
|
17
|
+
//
|
|
18
|
+
// params = {};
|
|
19
|
+
//
|
|
20
|
+
// params.from = from.toISOString();
|
|
21
|
+
// }
|
|
22
|
+
// if (to !== null && to !== undefined) {
|
|
23
|
+
// if (params === null || params === undefined) {
|
|
24
|
+
// params = {};
|
|
25
|
+
// }
|
|
26
|
+
// params.to = to.toISOString();
|
|
27
|
+
// }
|
|
28
|
+
if (projectEnvironmentId !== null && projectEnvironmentId !== undefined && projectEnvironmentId !== '') {
|
|
29
|
+
queryString.set('environment', projectEnvironmentId);
|
|
30
|
+
}
|
|
31
|
+
if (flowRunStatuses !== null && flowRunStatuses !== undefined && flowRunStatuses.length > 0) {
|
|
32
|
+
queryString.set('statuses', flowRunStatuses.map((status) => status.toString()));
|
|
33
|
+
}
|
|
34
|
+
// if (flowRunStatuses !== null && flowRunStatuses.length > 0) {
|
|
35
|
+
// if (params === null || params === undefined) {
|
|
36
|
+
// params = {};
|
|
37
|
+
// }
|
|
38
|
+
// params.statuses = flowRunStatuses;
|
|
39
|
+
// }
|
|
40
|
+
const result = await this.requestCollection(queryString.build(), FlowRunSummary.parse);
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
45
|
+
console.error('Failed to load flow runs: ' + error);
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async getFlowRunSummary(flowRunId) {
|
|
51
|
+
try {
|
|
52
|
+
const result = await this.requestObject('/flowruns/' + flowRunId + '/summaries', null, FlowRunSummary.parse);
|
|
53
|
+
return result.getData();
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
57
|
+
console.error('Failed to load flow runs: ' + error);
|
|
58
|
+
}
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async getFlowRunHistory(flowRunId) {
|
|
63
|
+
const result = await this.requestCollection('/flowruns/' + flowRunId + '/history', FlowRunHistory.parse);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Authoritative lifecycle (status derived from history, first-terminal-wins). Prefer this over
|
|
68
|
+
* getFlowRunSummary for control-flow decisions (e.g. the worker tombstone), since the summary
|
|
69
|
+
* reflects the eventually-consistent index projection which can lag the history.
|
|
70
|
+
*/
|
|
71
|
+
async getFlowRunLifecycle(flowRunId) {
|
|
72
|
+
const result = await this.requestObject('/flowruns/' + flowRunId + '/lifecycle', null, FlowRunLifecycle.parse);
|
|
73
|
+
return result.getData();
|
|
74
|
+
}
|
|
75
|
+
async updateFlowRun(flowRunId, status, time = null) {
|
|
76
|
+
if (flowRunId.length === 0) {
|
|
77
|
+
throw new Error('Flow run id cannot be empty');
|
|
78
|
+
}
|
|
79
|
+
const params = {};
|
|
80
|
+
if (status !== null && status !== undefined) {
|
|
81
|
+
params.status = status;
|
|
82
|
+
}
|
|
83
|
+
if (time !== null && time !== undefined) {
|
|
84
|
+
params.time = time;
|
|
85
|
+
}
|
|
86
|
+
const result = await this.requestObject('/flowruns/' + flowRunId + '', params, FlowRun.parse, 'POST');
|
|
87
|
+
const updatedFlowRun = result.getData();
|
|
88
|
+
if (updatedFlowRun === null) {
|
|
89
|
+
throw new Error('FlowRun not updated');
|
|
90
|
+
}
|
|
91
|
+
return updatedFlowRun;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FlowRunResponse } from '../Model/Flow/FlowRunResponse.js';
|
|
2
|
+
import { Parameters } from '../Http/Data/Parameters.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export declare class FlowRunRequestEndpoint extends Endpoint {
|
|
5
|
+
requestFlowRun(flowId: string, params: Parameters, wait?: boolean): Promise<FlowRunResponse>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FlowRunResponse } from '../Model/Flow/FlowRunResponse.js';
|
|
2
|
+
import { Endpoint } from './Endpoint.js';
|
|
3
|
+
export class FlowRunRequestEndpoint extends Endpoint {
|
|
4
|
+
async requestFlowRun(flowId, params, wait = false) {
|
|
5
|
+
let url = '/flows/' + flowId + '/flowrunrequests';
|
|
6
|
+
if (wait) {
|
|
7
|
+
url += '?wait=true';
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const parser = (raw) => {
|
|
11
|
+
const flowRunResponse = new FlowRunResponse();
|
|
12
|
+
flowRunResponse.flowRunRequestId = raw.flow_run_request;
|
|
13
|
+
flowRunResponse.result = raw.result;
|
|
14
|
+
flowRunResponse.success = raw.success;
|
|
15
|
+
return flowRunResponse;
|
|
16
|
+
};
|
|
17
|
+
const result = await this.requestObject(url, params, parser, 'POST');
|
|
18
|
+
// console.log('TODO: parse postTaskExecutionRequest result', result);
|
|
19
|
+
const postedFlowRunResponse = result.getData();
|
|
20
|
+
if (postedFlowRunResponse === null) {
|
|
21
|
+
throw new Error('FlowRunResponse not updated');
|
|
22
|
+
}
|
|
23
|
+
return postedFlowRunResponse;
|
|
24
|
+
}
|
|
25
|
+
catch (ex) {
|
|
26
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
27
|
+
console.error('Failed to request flow run: ', ex);
|
|
28
|
+
}
|
|
29
|
+
throw ex;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FlowRunStats } from '../Model/Flow/FlowRunStats.js';
|
|
2
|
+
import { Endpoint } from './Endpoint.js';
|
|
3
|
+
export class FlowRunStatsEndpoint extends Endpoint {
|
|
4
|
+
async create(flowRunStats) {
|
|
5
|
+
const url = '/flowruns/' + flowRunStats.flowRunId + '/stats';
|
|
6
|
+
try {
|
|
7
|
+
const result = await this.requestObject(url, flowRunStats, FlowRunStats.parse, 'POST');
|
|
8
|
+
const createdFlowRunStat = result.getData();
|
|
9
|
+
if (createdFlowRunStat === null) {
|
|
10
|
+
throw new Error('Unable to create stats: wrong response from API');
|
|
11
|
+
}
|
|
12
|
+
return createdFlowRunStat;
|
|
13
|
+
}
|
|
14
|
+
catch (ex) {
|
|
15
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
16
|
+
console.error('Failed to create flow run stats: ', ex);
|
|
17
|
+
}
|
|
18
|
+
throw ex;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EntityType } from '../Model/EntityType.js';
|
|
2
|
+
import { HealthAlert } from '../Model/HealthAlert/HealthAlert.js';
|
|
3
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
|
+
import { Endpoint } from './Endpoint.js';
|
|
5
|
+
export declare class HealthAlertEndpoint extends Endpoint {
|
|
6
|
+
getCurrentAlertsByScope(scopeType: EntityType, scopeId: string): Promise<CollectionResult<HealthAlert>>;
|
|
7
|
+
/**
|
|
8
|
+
* Fetch all current alerts under a parent scope (today: only ProjectEnvironment).
|
|
9
|
+
* One query returns env-direct, pool-direct, and flow-direct alerts in a single round-trip
|
|
10
|
+
* — replaces the old N-call multi-scope loop on env-overview pages.
|
|
11
|
+
*/
|
|
12
|
+
getCurrentAlertsByParentScope(parentScopeType: EntityType, parentScopeId: string): Promise<CollectionResult<HealthAlert>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
|
+
import { HealthAlert } from '../Model/HealthAlert/HealthAlert.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
|
+
export class HealthAlertEndpoint extends Endpoint {
|
|
5
|
+
async getCurrentAlertsByScope(scopeType, scopeId) {
|
|
6
|
+
try {
|
|
7
|
+
const q = new QueryString('/health/' + scopeType + '/' + scopeId);
|
|
8
|
+
const result = await this.requestCollection(q, HealthAlert.parse);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
13
|
+
console.error('Failed to load health alerts: ', error);
|
|
14
|
+
}
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Fetch all current alerts under a parent scope (today: only ProjectEnvironment).
|
|
20
|
+
* One query returns env-direct, pool-direct, and flow-direct alerts in a single round-trip
|
|
21
|
+
* — replaces the old N-call multi-scope loop on env-overview pages.
|
|
22
|
+
*/
|
|
23
|
+
async getCurrentAlertsByParentScope(parentScopeType, parentScopeId) {
|
|
24
|
+
try {
|
|
25
|
+
const q = new QueryString('/health/by-parent/' + parentScopeType + '/' + parentScopeId);
|
|
26
|
+
const result = await this.requestCollection(q, HealthAlert.parse);
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
31
|
+
console.error('Failed to load health alerts by parent scope: ', error);
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Endpoint } from './Endpoint.js';
|
|
2
|
+
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
|
+
import { InboxMessage } from '../Model/Inbox/InboxMessage.js';
|
|
4
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
5
|
+
export declare class InboxEndpoint extends Endpoint {
|
|
6
|
+
getAll(pagination?: CursorPagination | null, unacknowledgedOnly?: boolean): Promise<CollectionResult<InboxMessage>>;
|
|
7
|
+
save(message: InboxMessage): Promise<InboxMessage>;
|
|
8
|
+
}
|