@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,21 @@
|
|
|
1
|
+
import { Utils } from '../../Utils.js';
|
|
2
|
+
export class InboxMessage {
|
|
3
|
+
id;
|
|
4
|
+
userId;
|
|
5
|
+
type;
|
|
6
|
+
subject;
|
|
7
|
+
body;
|
|
8
|
+
time;
|
|
9
|
+
acknowledged = false;
|
|
10
|
+
static parse(rawNotification) {
|
|
11
|
+
const inboxMessage = new InboxMessage();
|
|
12
|
+
inboxMessage.id = rawNotification.id;
|
|
13
|
+
inboxMessage.userId = rawNotification.user;
|
|
14
|
+
inboxMessage.type = rawNotification.type;
|
|
15
|
+
inboxMessage.subject = rawNotification.subject;
|
|
16
|
+
inboxMessage.body = rawNotification.body;
|
|
17
|
+
inboxMessage.time = Utils.parseRawDate(rawNotification.time);
|
|
18
|
+
inboxMessage.acknowledged = Utils.isTrue(rawNotification.acknowledged);
|
|
19
|
+
return inboxMessage;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { State } from '../State.js';
|
|
2
|
+
export declare class RunnerPool {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
environment: string;
|
|
6
|
+
queueIdentifier: string;
|
|
7
|
+
deploymentIdentifier: string;
|
|
8
|
+
type: QueueSpecificationType;
|
|
9
|
+
configuration: RunnerPoolConfiguration;
|
|
10
|
+
state: State;
|
|
11
|
+
static parse(raw: any): RunnerPool;
|
|
12
|
+
/**
|
|
13
|
+
* Coerce a raw wire value into a ResolvedValue<T> envelope. Accepts `{value, source}`
|
|
14
|
+
* as-is; falls back to `{value: defaultValue, source: null}` when the input is null,
|
|
15
|
+
* undefined, or missing the envelope shape, and appends the field name to `missing`
|
|
16
|
+
* so the caller can log a single batched warning. The `value` itself isn't type-
|
|
17
|
+
* validated — if T is `string | null` and the server sends a number, that's a
|
|
18
|
+
* server-side bug, not something this layer can fix.
|
|
19
|
+
*/
|
|
20
|
+
private static parseResolved;
|
|
21
|
+
}
|
|
22
|
+
export type QueueSpecificationType = 'flow_run';
|
|
23
|
+
export type ConfigurationSource = 'RunnerPool' | 'ProjectEnvironment' | 'Workspace' | 'Zone';
|
|
24
|
+
export interface ResolvedValue<T> {
|
|
25
|
+
value: T;
|
|
26
|
+
source: ConfigurationSource | null;
|
|
27
|
+
}
|
|
28
|
+
export interface RunnerPoolConfiguration {
|
|
29
|
+
enabled: ResolvedValue<boolean>;
|
|
30
|
+
minRunners: ResolvedValue<number>;
|
|
31
|
+
maxRunners: ResolvedValue<number>;
|
|
32
|
+
cpuLimit: ResolvedValue<number | null>;
|
|
33
|
+
memoryLimit: ResolvedValue<number | null>;
|
|
34
|
+
imageId: ResolvedValue<string | null>;
|
|
35
|
+
runnerEndpoint: ResolvedValue<string | null>;
|
|
36
|
+
runnerTokenId: ResolvedValue<string | null>;
|
|
37
|
+
codeEndpoint: ResolvedValue<string | null>;
|
|
38
|
+
codeTokenId: ResolvedValue<string | null>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { State } from '../State.js';
|
|
2
|
+
export class RunnerPool {
|
|
3
|
+
id;
|
|
4
|
+
name;
|
|
5
|
+
environment;
|
|
6
|
+
queueIdentifier;
|
|
7
|
+
deploymentIdentifier;
|
|
8
|
+
type = 'flow_run';
|
|
9
|
+
// Resolved server-side via the configuration chain (pool → env → workspace → zone fallback).
|
|
10
|
+
// Each field reports the resolved value plus the scope it came from. source === null means
|
|
11
|
+
// the value is a baked-in default (nothing was found anywhere in the chain).
|
|
12
|
+
configuration = {
|
|
13
|
+
enabled: { value: false, source: null },
|
|
14
|
+
minRunners: { value: 0, source: null },
|
|
15
|
+
maxRunners: { value: 0, source: null },
|
|
16
|
+
cpuLimit: { value: null, source: null },
|
|
17
|
+
memoryLimit: { value: null, source: null },
|
|
18
|
+
imageId: { value: null, source: null },
|
|
19
|
+
runnerEndpoint: { value: null, source: null },
|
|
20
|
+
codeEndpoint: { value: null, source: null },
|
|
21
|
+
runnerTokenId: { value: null, source: null },
|
|
22
|
+
codeTokenId: { value: null, source: null },
|
|
23
|
+
};
|
|
24
|
+
state = State.Active;
|
|
25
|
+
static parse(raw) {
|
|
26
|
+
const queueSpecification = new RunnerPool();
|
|
27
|
+
queueSpecification.id = raw.id;
|
|
28
|
+
queueSpecification.name = raw.name;
|
|
29
|
+
queueSpecification.environment = raw.environment;
|
|
30
|
+
queueSpecification.queueIdentifier = raw.queue_identifier;
|
|
31
|
+
queueSpecification.deploymentIdentifier = raw.deployment_identifier;
|
|
32
|
+
queueSpecification.type = raw.type;
|
|
33
|
+
// Per-field defensive parsing. Each entry falls back to a default ResolvedValue
|
|
34
|
+
// if the server didn't send it or sent a malformed shape — keeps the UI alive
|
|
35
|
+
// when wire contracts drift (e.g. the API auto-strips `_id` so `image_id` arrives
|
|
36
|
+
// as `image`; we hit that 2026-05-17). Missing/malformed fields are collected and
|
|
37
|
+
// logged together as a single console.warn so server-side regressions stay visible.
|
|
38
|
+
const config = raw.configuration ?? {};
|
|
39
|
+
const missing = [];
|
|
40
|
+
if (raw.configuration === undefined || raw.configuration === null) {
|
|
41
|
+
missing.push('(entire configuration object)');
|
|
42
|
+
}
|
|
43
|
+
queueSpecification.configuration = {
|
|
44
|
+
enabled: RunnerPool.parseResolved(config.enabled, false, 'enabled', missing),
|
|
45
|
+
minRunners: RunnerPool.parseResolved(config.min_runners, 0, 'min_runners', missing),
|
|
46
|
+
maxRunners: RunnerPool.parseResolved(config.max_runners, 0, 'max_runners', missing),
|
|
47
|
+
cpuLimit: RunnerPool.parseResolved(config.cpu_limit, null, 'cpu_limit', missing),
|
|
48
|
+
memoryLimit: RunnerPool.parseResolved(config.memory_limit, null, 'memory_limit', missing),
|
|
49
|
+
// API strips `_id` suffix from snake_case keys, so `image_id` → `image` on the wire.
|
|
50
|
+
imageId: RunnerPool.parseResolved(config.image, null, 'image', missing),
|
|
51
|
+
runnerEndpoint: RunnerPool.parseResolved(config.runner_endpoint, null, 'runner_endpoint', missing),
|
|
52
|
+
runnerTokenId: RunnerPool.parseResolved(config.runner_token, null, 'runner_token', missing),
|
|
53
|
+
codeEndpoint: RunnerPool.parseResolved(config.code_endpoint, null, 'code_endpoint', missing),
|
|
54
|
+
codeTokenId: RunnerPool.parseResolved(config.code_token, null, 'code_token', missing),
|
|
55
|
+
};
|
|
56
|
+
if (missing.length > 0) {
|
|
57
|
+
console.warn('RunnerPool.parse: pool "' + queueSpecification.id + '" has missing or malformed configuration fields', { fields: missing });
|
|
58
|
+
}
|
|
59
|
+
queueSpecification.state = State.fromString(raw.state);
|
|
60
|
+
return queueSpecification;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Coerce a raw wire value into a ResolvedValue<T> envelope. Accepts `{value, source}`
|
|
64
|
+
* as-is; falls back to `{value: defaultValue, source: null}` when the input is null,
|
|
65
|
+
* undefined, or missing the envelope shape, and appends the field name to `missing`
|
|
66
|
+
* so the caller can log a single batched warning. The `value` itself isn't type-
|
|
67
|
+
* validated — if T is `string | null` and the server sends a number, that's a
|
|
68
|
+
* server-side bug, not something this layer can fix.
|
|
69
|
+
*/
|
|
70
|
+
static parseResolved(raw, defaultValue, fieldName, missing) {
|
|
71
|
+
if (raw !== null && typeof raw === 'object' && 'value' in raw && 'source' in raw) {
|
|
72
|
+
return raw;
|
|
73
|
+
}
|
|
74
|
+
missing.push(fieldName);
|
|
75
|
+
return { value: defaultValue, source: null };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class QueueStatus {
|
|
2
|
+
name: string;
|
|
3
|
+
state: 'nonexisting' | 'running';
|
|
4
|
+
vhost: string;
|
|
5
|
+
messages_ready: number;
|
|
6
|
+
messages_handling: number;
|
|
7
|
+
message_publish_rate: number;
|
|
8
|
+
message_handling_rate: number;
|
|
9
|
+
consumers: number;
|
|
10
|
+
date: Date;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type StorageTypeStatus = {
|
|
2
|
+
exists: boolean;
|
|
3
|
+
used: number;
|
|
4
|
+
limit: number | null;
|
|
5
|
+
};
|
|
6
|
+
export declare class StorageStatus {
|
|
7
|
+
persistent: StorageTypeStatus;
|
|
8
|
+
cache: StorageTypeStatus;
|
|
9
|
+
vault: StorageTypeStatus;
|
|
10
|
+
infrastructure: StorageTypeStatus;
|
|
11
|
+
updated: Date;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class JsonSerializable {
|
|
2
|
+
static stringify(object) {
|
|
3
|
+
const replacer = (key, value) => {
|
|
4
|
+
// Filtering out properties
|
|
5
|
+
if (value instanceof JsonSerializable && 'jsonSerialize' in value) {
|
|
6
|
+
return value.jsonSerialize();
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
return JSON.stringify(object, replacer);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataValueCollection } from '../DataValueCollection.js';
|
|
2
|
+
import { LogLevel } from './LogLevel.js';
|
|
3
|
+
import { LogStatus } from './LogStatus.js';
|
|
4
|
+
import { LogStreamId } from './LogStreamId.js';
|
|
5
|
+
export declare class Log {
|
|
6
|
+
id: string;
|
|
7
|
+
readonly logStream: LogStreamId;
|
|
8
|
+
readonly date: Date;
|
|
9
|
+
readonly level: LogLevel;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
context: object;
|
|
12
|
+
status: LogStatus;
|
|
13
|
+
tags: DataValueCollection;
|
|
14
|
+
_version: string;
|
|
15
|
+
constructor(logStream: LogStreamId, message: string, level: LogLevel, date: Date);
|
|
16
|
+
static parse(rawLog: any): Log;
|
|
17
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Utils } from '../../Utils.js';
|
|
2
|
+
import { DataValueCollection } from '../DataValueCollection.js';
|
|
3
|
+
import { LogLevel } from './LogLevel.js';
|
|
4
|
+
import { LogStatus } from './LogStatus.js';
|
|
5
|
+
import { LogStreamId } from './LogStreamId.js';
|
|
6
|
+
export class Log {
|
|
7
|
+
id;
|
|
8
|
+
logStream;
|
|
9
|
+
date;
|
|
10
|
+
level;
|
|
11
|
+
message;
|
|
12
|
+
context;
|
|
13
|
+
status = LogStatus.Normal;
|
|
14
|
+
tags;
|
|
15
|
+
_version;
|
|
16
|
+
constructor(logStream, message, level, date) {
|
|
17
|
+
this.logStream = logStream;
|
|
18
|
+
this.message = message;
|
|
19
|
+
this.level = level;
|
|
20
|
+
this.date = date;
|
|
21
|
+
this.tags = new DataValueCollection();
|
|
22
|
+
}
|
|
23
|
+
static parse(rawLog) {
|
|
24
|
+
const date = Utils.parseRawDate(rawLog.date);
|
|
25
|
+
const level = LogLevel.fromString(rawLog.level);
|
|
26
|
+
const logStream = new LogStreamId(rawLog.log_stream);
|
|
27
|
+
const log = new Log(logStream, rawLog.message, level, date);
|
|
28
|
+
log.id = rawLog.id;
|
|
29
|
+
log.context = rawLog.context;
|
|
30
|
+
if (rawLog.status !== null && rawLog.status !== undefined && rawLog.status !== '') {
|
|
31
|
+
log.status = LogStatus.fromString(rawLog.status);
|
|
32
|
+
}
|
|
33
|
+
log.tags = DataValueCollection.fromObject(rawLog.tags);
|
|
34
|
+
log._version = rawLog._version;
|
|
35
|
+
return log;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
Debug = "debug",
|
|
3
|
+
Info = "info",
|
|
4
|
+
Notice = "notice",
|
|
5
|
+
Warning = "warning",
|
|
6
|
+
Error = "error",
|
|
7
|
+
Critical = "critical",
|
|
8
|
+
Alert = "alert",
|
|
9
|
+
Emergency = "emergency"
|
|
10
|
+
}
|
|
11
|
+
export declare namespace LogLevel {
|
|
12
|
+
const compare: (logLevelA: LogLevel, logLevelB: LogLevel) => number;
|
|
13
|
+
const toNumeric: (logLevel: LogLevel) => number;
|
|
14
|
+
const fromString: (input: string) => LogLevel;
|
|
15
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Utils } from '../../Utils.js';
|
|
2
|
+
export var LogLevel;
|
|
3
|
+
(function (LogLevel) {
|
|
4
|
+
LogLevel["Debug"] = "debug";
|
|
5
|
+
LogLevel["Info"] = "info";
|
|
6
|
+
LogLevel["Notice"] = "notice";
|
|
7
|
+
LogLevel["Warning"] = "warning";
|
|
8
|
+
LogLevel["Error"] = "error";
|
|
9
|
+
LogLevel["Critical"] = "critical";
|
|
10
|
+
LogLevel["Alert"] = "alert";
|
|
11
|
+
LogLevel["Emergency"] = "emergency";
|
|
12
|
+
})(LogLevel || (LogLevel = {}));
|
|
13
|
+
(function (LogLevel) {
|
|
14
|
+
LogLevel.compare = (logLevelA, logLevelB) => {
|
|
15
|
+
const logLevelANumeric = LogLevel.toNumeric(logLevelA);
|
|
16
|
+
const logLevelBNumeric = LogLevel.toNumeric(logLevelB);
|
|
17
|
+
if (logLevelANumeric > logLevelBNumeric) {
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
if (logLevelANumeric < logLevelBNumeric) {
|
|
21
|
+
return -1;
|
|
22
|
+
}
|
|
23
|
+
return 0;
|
|
24
|
+
};
|
|
25
|
+
LogLevel.toNumeric = (logLevel) => {
|
|
26
|
+
switch (logLevel) {
|
|
27
|
+
case LogLevel.Debug:
|
|
28
|
+
return 100;
|
|
29
|
+
case LogLevel.Info:
|
|
30
|
+
return 200;
|
|
31
|
+
case LogLevel.Notice:
|
|
32
|
+
return 250;
|
|
33
|
+
case LogLevel.Warning:
|
|
34
|
+
return 300;
|
|
35
|
+
case LogLevel.Error:
|
|
36
|
+
return 400;
|
|
37
|
+
case LogLevel.Critical:
|
|
38
|
+
return 500;
|
|
39
|
+
case LogLevel.Alert:
|
|
40
|
+
return 550;
|
|
41
|
+
case LogLevel.Emergency:
|
|
42
|
+
return 600;
|
|
43
|
+
default:
|
|
44
|
+
throw new Error('Unknown log level "' + logLevel + '"');
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
LogLevel.fromString = (input) => {
|
|
48
|
+
const result = Utils.parseEnum(input, LogLevel);
|
|
49
|
+
if (result === null) {
|
|
50
|
+
throw new Error('Unable to parse LogLevel from string: Unknown LogLevel "' + input + '"');
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
})(LogLevel || (LogLevel = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LogLevel } from './LogLevel.js';
|
|
2
|
+
import { LogStreamId } from './LogStreamId.js';
|
|
3
|
+
import { DataValueValue } from '../DataValue.js';
|
|
4
|
+
export declare class LogQuery {
|
|
5
|
+
readonly logStreamId: LogStreamId;
|
|
6
|
+
/** @deprecated use filters property instead **/
|
|
7
|
+
message: string | null;
|
|
8
|
+
hidden: boolean | null;
|
|
9
|
+
logLevels: LogLevel[] | null;
|
|
10
|
+
tags: Array<{
|
|
11
|
+
key: string;
|
|
12
|
+
values: DataValueValue[];
|
|
13
|
+
}> | null;
|
|
14
|
+
filters: {
|
|
15
|
+
field: 'message' | 'context';
|
|
16
|
+
value: string;
|
|
17
|
+
method: 'contains';
|
|
18
|
+
}[];
|
|
19
|
+
limit: number | null;
|
|
20
|
+
startingAfterId: string | null;
|
|
21
|
+
sort: Array<{
|
|
22
|
+
field: string;
|
|
23
|
+
direction: number;
|
|
24
|
+
}>;
|
|
25
|
+
constructor(logStreamId: LogStreamId);
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export class LogQuery {
|
|
2
|
+
logStreamId;
|
|
3
|
+
/** @deprecated use filters property instead **/
|
|
4
|
+
message = null;
|
|
5
|
+
hidden = null;
|
|
6
|
+
logLevels = null;
|
|
7
|
+
tags = null;
|
|
8
|
+
filters = [];
|
|
9
|
+
limit = null;
|
|
10
|
+
startingAfterId = null;
|
|
11
|
+
sort;
|
|
12
|
+
constructor(logStreamId) {
|
|
13
|
+
this.logStreamId = logStreamId;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Utils } from '../../Utils.js';
|
|
2
|
+
export var LogStatus;
|
|
3
|
+
(function (LogStatus) {
|
|
4
|
+
LogStatus["Normal"] = "normal";
|
|
5
|
+
LogStatus["Ignored"] = "ignored";
|
|
6
|
+
LogStatus["Resolved"] = "resolved";
|
|
7
|
+
})(LogStatus || (LogStatus = {}));
|
|
8
|
+
(function (LogStatus) {
|
|
9
|
+
LogStatus.fromString = (input) => {
|
|
10
|
+
const result = Utils.parseEnum(input, LogStatus);
|
|
11
|
+
if (result === null) {
|
|
12
|
+
throw new Error('Unable to parse LogStatus from string: Unknown LogStatus "' + input + '"');
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
})(LogStatus || (LogStatus = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LogLevel } from './LogLevel.js';
|
|
2
|
+
import { DataValueValue } from '../DataValue.js';
|
|
3
|
+
import { LogStreamId } from './LogStreamId.js';
|
|
4
|
+
export declare class LogStreamInformation {
|
|
5
|
+
logStreamId: LogStreamId;
|
|
6
|
+
logLevels: {
|
|
7
|
+
logLevel: LogLevel;
|
|
8
|
+
count: number;
|
|
9
|
+
}[];
|
|
10
|
+
tags: {
|
|
11
|
+
tag: string;
|
|
12
|
+
values: {
|
|
13
|
+
value: DataValueValue;
|
|
14
|
+
count: number;
|
|
15
|
+
}[];
|
|
16
|
+
}[];
|
|
17
|
+
static parse(raw: any): LogStreamInformation;
|
|
18
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { LogLevel } from './LogLevel.js';
|
|
2
|
+
import { LogStreamId } from './LogStreamId.js';
|
|
3
|
+
export class LogStreamInformation {
|
|
4
|
+
logStreamId;
|
|
5
|
+
logLevels;
|
|
6
|
+
tags;
|
|
7
|
+
static parse(raw) {
|
|
8
|
+
const rawData = raw;
|
|
9
|
+
if (rawData === null || rawData === undefined) {
|
|
10
|
+
throw new Error('Invalid response');
|
|
11
|
+
}
|
|
12
|
+
const result = new LogStreamInformation();
|
|
13
|
+
result.logStreamId = new LogStreamId(rawData.log_stream);
|
|
14
|
+
/**
|
|
15
|
+
* LogLevel
|
|
16
|
+
*/
|
|
17
|
+
result.logLevels = [];
|
|
18
|
+
for (const logLevel of rawData.log_levels) {
|
|
19
|
+
result.logLevels.push({ logLevel: LogLevel.fromString(logLevel.log_level), count: logLevel.count });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Tags
|
|
23
|
+
*/
|
|
24
|
+
result.tags = [];
|
|
25
|
+
for (const tag of rawData.tags) {
|
|
26
|
+
const values = [];
|
|
27
|
+
for (const tagValue of tag.values) {
|
|
28
|
+
values.push({ value: tagValue.value, count: tagValue.count });
|
|
29
|
+
}
|
|
30
|
+
result.tags.push({ tag: tag.tag, values: values });
|
|
31
|
+
}
|
|
32
|
+
// Object.keys(rawData.level_count).forEach((logLevelKey: string, index) => {
|
|
33
|
+
//
|
|
34
|
+
// const logLevel: LogLevel = LogLevel.fromString(logLevelKey);
|
|
35
|
+
//
|
|
36
|
+
// const parsedCount: number | null = parseInt(rawData.level_count[logLevelKey], undefined);
|
|
37
|
+
// if (parsedCount !== null) {
|
|
38
|
+
// logLevels.set(logLevel, parsedCount);
|
|
39
|
+
// } else {
|
|
40
|
+
// console.error('Unserialize log level count: Unable to parse log level count', rawData.level_count[logLevelKey]);
|
|
41
|
+
// }
|
|
42
|
+
//
|
|
43
|
+
// });
|
|
44
|
+
// const tags: Map<string, DataValueValue[]> = new Map<string, DataValueValue[]>();
|
|
45
|
+
// if (rawData.tags !== null && rawData.tags !== undefined) {
|
|
46
|
+
//
|
|
47
|
+
// Object.keys(rawData.tags).forEach((tagKey: string, index) => {
|
|
48
|
+
//
|
|
49
|
+
// const values: DataValueValue[] = rawData.tags[tagKey];
|
|
50
|
+
//
|
|
51
|
+
// tags.set(tagKey, values);
|
|
52
|
+
//
|
|
53
|
+
// });
|
|
54
|
+
// }
|
|
55
|
+
// throw new Error('Need update!');
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { State } from '../../State.js';
|
|
2
|
+
import { StateAware } from '../../StateAware.js';
|
|
3
|
+
import { MetaDataAware } from '../../../Core/MetaDataAware.js';
|
|
4
|
+
import { ChannelType } from './ChannelType.js';
|
|
5
|
+
export declare class Channel extends MetaDataAware implements StateAware {
|
|
6
|
+
id: string;
|
|
7
|
+
ownerId: string;
|
|
8
|
+
type: ChannelType;
|
|
9
|
+
data: any;
|
|
10
|
+
state: State;
|
|
11
|
+
workspaces: string[];
|
|
12
|
+
isPrivate: boolean;
|
|
13
|
+
singleUse: boolean;
|
|
14
|
+
constructor(id: string, ownerId: string, name: string, type: ChannelType, data: any);
|
|
15
|
+
static parse(rawChannel: Record<string, unknown>): Channel;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { State } from '../../State.js';
|
|
2
|
+
import { Utils } from '../../../Utils.js';
|
|
3
|
+
import { MetaDataAware } from '../../../Core/MetaDataAware.js';
|
|
4
|
+
import { ChannelType } from './ChannelType.js';
|
|
5
|
+
export class Channel extends MetaDataAware {
|
|
6
|
+
id;
|
|
7
|
+
ownerId;
|
|
8
|
+
type;
|
|
9
|
+
data;
|
|
10
|
+
state = State.Active;
|
|
11
|
+
workspaces = [];
|
|
12
|
+
isPrivate = false;
|
|
13
|
+
singleUse = false;
|
|
14
|
+
constructor(id, ownerId, name, type, data) {
|
|
15
|
+
super();
|
|
16
|
+
this.id = id;
|
|
17
|
+
this.ownerId = ownerId;
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.type = type;
|
|
20
|
+
this.data = data;
|
|
21
|
+
}
|
|
22
|
+
static parse(rawChannel) {
|
|
23
|
+
const type = ChannelType.fromString(rawChannel.type);
|
|
24
|
+
const channel = new Channel(rawChannel.id, rawChannel.owner, rawChannel.name, type, rawChannel.data);
|
|
25
|
+
channel.state = State.fromString(rawChannel.state);
|
|
26
|
+
channel.isPrivate = Utils.isTrue(rawChannel.is_private);
|
|
27
|
+
channel.singleUse = Utils.isTrue(rawChannel.single_use);
|
|
28
|
+
channel.workspaces = rawChannel.workspaces;
|
|
29
|
+
return channel;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Utils } from '../../../Utils.js';
|
|
2
|
+
export var ChannelType;
|
|
3
|
+
(function (ChannelType) {
|
|
4
|
+
ChannelType["Email"] = "email";
|
|
5
|
+
ChannelType["Push"] = "push";
|
|
6
|
+
ChannelType["Slack"] = "slack";
|
|
7
|
+
ChannelType["SMS"] = "sms";
|
|
8
|
+
ChannelType["Webhook"] = "webhook";
|
|
9
|
+
})(ChannelType || (ChannelType = {}));
|
|
10
|
+
(function (ChannelType) {
|
|
11
|
+
ChannelType.fromString = (input) => {
|
|
12
|
+
const result = Utils.parseEnum(input, ChannelType);
|
|
13
|
+
if (result === null) {
|
|
14
|
+
throw new Error('Unable to parse ChannelType from string: Unknown ChannelType "' + input + '"');
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
})(ChannelType || (ChannelType = {}));
|