attlaz-client 1.9.62 → 1.9.64

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.
Files changed (268) hide show
  1. package/dist/Client.d.ts +79 -77
  2. package/dist/Client.js +230 -225
  3. package/dist/Core/MetaDataAware.d.ts +4 -4
  4. package/dist/Core/MetaDataAware.js +6 -6
  5. package/dist/Http/Data/Header.d.ts +3 -3
  6. package/dist/Http/Data/Header.js +2 -2
  7. package/dist/Http/Data/Parameters.d.ts +3 -3
  8. package/dist/Http/Data/Parameters.js +2 -2
  9. package/dist/Http/Data/QueryString.d.ts +9 -9
  10. package/dist/Http/Data/QueryString.js +29 -29
  11. package/dist/Http/HttpClient.d.ts +17 -17
  12. package/dist/Http/HttpClient.js +91 -91
  13. package/dist/Http/HttpClientRequest.d.ts +16 -16
  14. package/dist/Http/HttpClientRequest.js +41 -41
  15. package/dist/Http/HttpClientResponse.d.ts +6 -6
  16. package/dist/Http/HttpClientResponse.js +11 -11
  17. package/dist/Http/OAuthClient.d.ts +33 -33
  18. package/dist/Http/OAuthClient.js +231 -231
  19. package/dist/Http/OAuthClientOptions.d.ts +13 -13
  20. package/dist/Http/OAuthClientOptions.js +17 -17
  21. package/dist/Http/OAuthClientToken.d.ts +11 -11
  22. package/dist/Http/OAuthClientToken.js +36 -36
  23. package/dist/Model/Adapter/Adapter.d.ts +13 -13
  24. package/dist/Model/Adapter/Adapter.js +20 -20
  25. package/dist/Model/Adapter/AdapterConfiguration.d.ts +9 -9
  26. package/dist/Model/Adapter/AdapterConfiguration.js +16 -16
  27. package/dist/Model/Adapter/AdapterConnection.d.ts +10 -10
  28. package/dist/Model/Adapter/AdapterConnection.js +26 -26
  29. package/dist/Model/Config.d.ts +14 -14
  30. package/dist/Model/Config.js +27 -27
  31. package/dist/Model/DataValue.d.ts +6 -6
  32. package/dist/Model/DataValue.js +10 -10
  33. package/dist/Model/DataValueCollection.d.ts +16 -16
  34. package/dist/Model/DataValueCollection.js +61 -61
  35. package/dist/Model/Deployment/CodeSource.d.ts +13 -13
  36. package/dist/Model/Deployment/CodeSource.js +22 -22
  37. package/dist/Model/Deployment/CodeSourceAccount.d.ts +8 -8
  38. package/dist/Model/Deployment/CodeSourceAccount.js +22 -22
  39. package/dist/Model/Deployment/CodeSourceBuildStrategy.d.ts +9 -9
  40. package/dist/Model/Deployment/CodeSourceBuildStrategy.js +18 -18
  41. package/dist/Model/Deployment/SourcesAccountRepository.d.ts +5 -5
  42. package/dist/Model/Deployment/SourcesAccountRepository.js +12 -12
  43. package/dist/Model/Deployment/SourcesAccountRepositoryBranch.d.ts +4 -4
  44. package/dist/Model/Deployment/SourcesAccountRepositoryBranch.js +11 -11
  45. package/dist/Model/Error/ClientError.d.ts +10 -10
  46. package/dist/Model/Error/ClientError.js +93 -93
  47. package/dist/Model/Event/EventType.d.ts +17 -17
  48. package/dist/Model/Event/EventType.js +21 -21
  49. package/dist/Model/Flow/Flow.d.ts +15 -15
  50. package/dist/Model/Flow/Flow.js +30 -30
  51. package/dist/Model/Flow/FlowRun.d.ts +16 -16
  52. package/dist/Model/Flow/FlowRun.js +30 -30
  53. package/dist/Model/Flow/FlowRunHistory.d.ts +7 -7
  54. package/dist/Model/Flow/FlowRunHistory.js +15 -15
  55. package/dist/Model/Flow/FlowRunPriority.d.ts +9 -9
  56. package/dist/Model/Flow/FlowRunPriority.js +21 -21
  57. package/dist/Model/Flow/FlowRunResponse.d.ts +5 -5
  58. package/dist/Model/Flow/FlowRunResponse.js +6 -6
  59. package/dist/Model/Flow/FlowRunStats.d.ts +13 -13
  60. package/dist/Model/Flow/FlowRunStats.js +31 -31
  61. package/dist/Model/Flow/FlowRunStatus.d.ts +12 -12
  62. package/dist/Model/Flow/FlowRunStatus.js +24 -24
  63. package/dist/Model/Flow/FlowRunSummary.d.ts +9 -9
  64. package/dist/Model/Flow/FlowRunSummary.js +21 -21
  65. package/dist/Model/Flow/FlowSummary.d.ts +10 -10
  66. package/dist/Model/Flow/FlowSummary.js +26 -26
  67. package/dist/Model/HealthAlert/HealthAlert.d.ts +13 -13
  68. package/dist/Model/HealthAlert/HealthAlert.js +31 -31
  69. package/dist/Model/HealthAlert/HealthAlertStatus.d.ts +8 -8
  70. package/dist/Model/HealthAlert/HealthAlertStatus.js +20 -20
  71. package/dist/Model/HealthAlert/HealthTestType.d.ts +11 -11
  72. package/dist/Model/HealthAlert/HealthTestType.js +23 -23
  73. package/dist/Model/JsonSerializable.d.ts +4 -4
  74. package/dist/Model/JsonSerializable.js +16 -16
  75. package/dist/Model/Log/Log.d.ts +17 -17
  76. package/dist/Model/Log/Log.js +34 -34
  77. package/dist/Model/Log/LogItemFilter.d.ts +9 -9
  78. package/dist/Model/Log/LogItemFilter.js +10 -10
  79. package/dist/Model/Log/LogLevel.d.ts +15 -15
  80. package/dist/Model/Log/LogLevel.js +60 -60
  81. package/dist/Model/Log/LogQuery.d.ts +20 -20
  82. package/dist/Model/Log/LogQuery.js +15 -15
  83. package/dist/Model/Log/LogStatus.d.ts +8 -8
  84. package/dist/Model/Log/LogStatus.js +20 -20
  85. package/dist/Model/Log/LogStream.d.ts +6 -6
  86. package/dist/Model/Log/LogStream.js +10 -10
  87. package/dist/Model/Log/LogStreamId.d.ts +5 -5
  88. package/dist/Model/Log/LogStreamId.js +12 -12
  89. package/dist/Model/Log/LogStreamInformation.d.ts +18 -18
  90. package/dist/Model/Log/LogStreamInformation.js +59 -59
  91. package/dist/Model/Messaging/Channel/Channel.d.ts +15 -15
  92. package/dist/Model/Messaging/Channel/Channel.js +29 -29
  93. package/dist/Model/Messaging/Channel/ChannelData.d.ts +6 -6
  94. package/dist/Model/Messaging/Channel/ChannelData.js +12 -12
  95. package/dist/Model/Messaging/Channel/ChannelType.d.ts +10 -10
  96. package/dist/Model/Messaging/Channel/ChannelType.js +22 -22
  97. package/dist/Model/Messaging/Channel/EmailChannelData.d.ts +5 -5
  98. package/dist/Model/Messaging/Channel/EmailChannelData.js +12 -12
  99. package/dist/Model/Messaging/Channel/PushChannelData.d.ts +9 -9
  100. package/dist/Model/Messaging/Channel/PushChannelData.js +13 -13
  101. package/dist/Model/Messaging/Channel/SlackChannelData.d.ts +10 -10
  102. package/dist/Model/Messaging/Channel/SlackChannelData.js +17 -17
  103. package/dist/Model/Messaging/Channel/SmsChannelData.d.ts +5 -5
  104. package/dist/Model/Messaging/Channel/SmsChannelData.js +12 -12
  105. package/dist/Model/Messaging/Channel/WebhookChannelData.d.ts +6 -6
  106. package/dist/Model/Messaging/Channel/WebhookChannelData.js +13 -13
  107. package/dist/Model/Messaging/ChannelHistory.d.ts +10 -10
  108. package/dist/Model/Messaging/ChannelHistory.js +28 -28
  109. package/dist/Model/Messaging/Subscriber.d.ts +19 -19
  110. package/dist/Model/Messaging/Subscriber.js +33 -33
  111. package/dist/Model/Notification.d.ts +10 -10
  112. package/dist/Model/Notification.js +21 -21
  113. package/dist/Model/Pagination/CursorPagination.d.ts +5 -5
  114. package/dist/Model/Pagination/CursorPagination.js +11 -11
  115. package/dist/Model/Project/PlatformLanguage.d.ts +10 -10
  116. package/dist/Model/Project/PlatformLanguage.js +19 -19
  117. package/dist/Model/Project/Project.d.ts +12 -12
  118. package/dist/Model/Project/Project.js +23 -23
  119. package/dist/Model/Project/ProjectDeploy.d.ts +20 -20
  120. package/dist/Model/Project/ProjectDeploy.js +45 -45
  121. package/dist/Model/Project/ProjectDeployCommit.d.ts +7 -7
  122. package/dist/Model/Project/ProjectDeployCommit.js +6 -6
  123. package/dist/Model/Project/ProjectDeployStatus.d.ts +12 -12
  124. package/dist/Model/Project/ProjectDeployStatus.js +24 -24
  125. package/dist/Model/Project/ProjectEnvironment.d.ts +13 -13
  126. package/dist/Model/Project/ProjectEnvironment.js +26 -26
  127. package/dist/Model/Queue/QueueStatus.d.ts +10 -10
  128. package/dist/Model/Queue/QueueStatus.js +23 -23
  129. package/dist/Model/Result/CollectionResult.d.ts +7 -7
  130. package/dist/Model/Result/CollectionResult.js +30 -30
  131. package/dist/Model/Result/DataResult.d.ts +18 -18
  132. package/dist/Model/Result/DataResult.js +69 -69
  133. package/dist/Model/Result/ObjectResult.d.ts +6 -6
  134. package/dist/Model/Result/ObjectResult.js +26 -26
  135. package/dist/Model/Result/ObjectWrapper.d.ts +3 -3
  136. package/dist/Model/Result/ObjectWrapper.js +24 -24
  137. package/dist/Model/Result/ResultError.d.ts +4 -4
  138. package/dist/Model/Result/ResultError.js +9 -9
  139. package/dist/Model/Search/SearchResult.d.ts +14 -0
  140. package/dist/Model/Search/SearchResult.js +47 -0
  141. package/dist/Model/State.d.ts +8 -8
  142. package/dist/Model/State.js +20 -20
  143. package/dist/Model/StateAware.d.ts +4 -4
  144. package/dist/Model/StateAware.js +2 -2
  145. package/dist/Model/Storage/StorageInformation.d.ts +10 -10
  146. package/dist/Model/Storage/StorageInformation.js +6 -6
  147. package/dist/Model/Storage/StorageItem.d.ts +7 -7
  148. package/dist/Model/Storage/StorageItem.js +15 -15
  149. package/dist/Model/Storage/StorageItemInformation.d.ts +6 -6
  150. package/dist/Model/Storage/StorageItemInformation.js +14 -14
  151. package/dist/Model/Storage/StorageType.d.ts +9 -9
  152. package/dist/Model/Storage/StorageType.js +21 -21
  153. package/dist/Model/Trigger/ApiTrigger.d.ts +6 -6
  154. package/dist/Model/Trigger/ApiTrigger.js +14 -14
  155. package/dist/Model/Trigger/ApiTriggerData.d.ts +4 -4
  156. package/dist/Model/Trigger/ApiTriggerData.js +10 -10
  157. package/dist/Model/Trigger/ScheduleTrigger.d.ts +6 -6
  158. package/dist/Model/Trigger/ScheduleTrigger.js +14 -14
  159. package/dist/Model/Trigger/ScheduleTriggerData.d.ts +5 -5
  160. package/dist/Model/Trigger/ScheduleTriggerData.js +11 -11
  161. package/dist/Model/Trigger/Trigger.d.ts +17 -17
  162. package/dist/Model/Trigger/Trigger.js +50 -50
  163. package/dist/Model/Trigger/TriggerData.d.ts +3 -3
  164. package/dist/Model/Trigger/TriggerData.js +9 -9
  165. package/dist/Model/Trigger/TriggerType.d.ts +8 -8
  166. package/dist/Model/Trigger/TriggerType.js +20 -20
  167. package/dist/Model/Trigger/WebhookTrigger.d.ts +6 -6
  168. package/dist/Model/Trigger/WebhookTrigger.js +14 -14
  169. package/dist/Model/Trigger/WebhookTriggerData.d.ts +5 -5
  170. package/dist/Model/Trigger/WebhookTriggerData.js +11 -11
  171. package/dist/Model/User/UserAction.d.ts +14 -14
  172. package/dist/Model/User/UserAction.js +6 -6
  173. package/dist/Model/User/UserAuthProvider.d.ts +12 -12
  174. package/dist/Model/User/UserAuthProvider.js +23 -23
  175. package/dist/Model/User.d.ts +16 -16
  176. package/dist/Model/User.js +25 -25
  177. package/dist/Model/Worker/Platform.d.ts +12 -12
  178. package/dist/Model/Worker/Platform.js +22 -22
  179. package/dist/Model/Worker/PlatformImage.d.ts +12 -12
  180. package/dist/Model/Worker/PlatformImage.js +22 -22
  181. package/dist/Model/Worker/Worker.d.ts +11 -11
  182. package/dist/Model/Worker/Worker.js +25 -25
  183. package/dist/Model/Worker/WorkerConfig.d.ts +17 -17
  184. package/dist/Model/Worker/WorkerConfig.js +23 -23
  185. package/dist/Model/Worker/WorkerInstance.d.ts +6 -6
  186. package/dist/Model/Worker/WorkerInstance.js +11 -11
  187. package/dist/Model/Worker/WorkerInstanceState.d.ts +8 -8
  188. package/dist/Model/Worker/WorkerInstanceState.js +20 -20
  189. package/dist/Model/Worker/WorkerState.d.ts +10 -10
  190. package/dist/Model/Worker/WorkerState.js +22 -22
  191. package/dist/Model/Workspace/Workspace.d.ts +8 -8
  192. package/dist/Model/Workspace/Workspace.js +14 -14
  193. package/dist/Model/Workspace/WorkspaceMember.d.ts +12 -12
  194. package/dist/Model/Workspace/WorkspaceMember.js +9 -9
  195. package/dist/Model/Workspace/WorkspaceMemberInvite.d.ts +14 -14
  196. package/dist/Model/Workspace/WorkspaceMemberInvite.js +10 -10
  197. package/dist/Model/Workspace/WorkspaceMemberInvite2.d.ts +10 -10
  198. package/dist/Model/Workspace/WorkspaceMemberInvite2.js +17 -17
  199. package/dist/Model/Workspace/WorkspaceMemberInviteState.d.ts +11 -11
  200. package/dist/Model/Workspace/WorkspaceMemberInviteState.js +23 -23
  201. package/dist/Model/Workspace/WorkspaceMemberRole.d.ts +11 -11
  202. package/dist/Model/Workspace/WorkspaceMemberRole.js +23 -23
  203. package/dist/Service/AdapterEndpoint.d.ts +13 -13
  204. package/dist/Service/AdapterEndpoint.js +92 -92
  205. package/dist/Service/ChannelEndpoint.d.ts +12 -12
  206. package/dist/Service/ChannelEndpoint.js +119 -119
  207. package/dist/Service/CodeSourceBuildStrategyEndpoint.d.ts +6 -6
  208. package/dist/Service/CodeSourceBuildStrategyEndpoint.js +14 -14
  209. package/dist/Service/ConfigEndpoint.d.ts +8 -8
  210. package/dist/Service/ConfigEndpoint.js +50 -50
  211. package/dist/Service/Endpoint.d.ts +17 -17
  212. package/dist/Service/Endpoint.js +159 -159
  213. package/dist/Service/FirewallEndpoint.d.ts +10 -10
  214. package/dist/Service/FirewallEndpoint.js +70 -70
  215. package/dist/Service/FlowEndpoint.d.ts +11 -11
  216. package/dist/Service/FlowEndpoint.js +92 -92
  217. package/dist/Service/FlowRunEndpoint.d.ts +14 -14
  218. package/dist/Service/FlowRunEndpoint.js +91 -91
  219. package/dist/Service/FlowRunRequestEndpoint.d.ts +6 -6
  220. package/dist/Service/FlowRunRequestEndpoint.js +36 -36
  221. package/dist/Service/FlowRunStatsEndpoint.d.ts +5 -5
  222. package/dist/Service/FlowRunStatsEndpoint.js +25 -25
  223. package/dist/Service/HealthAlertEndpoint.d.ts +6 -6
  224. package/dist/Service/HealthAlertEndpoint.js +21 -21
  225. package/dist/Service/LogEndpoint.d.ts +18 -18
  226. package/dist/Service/LogEndpoint.js +147 -147
  227. package/dist/Service/NotificationsEndpoint.d.ts +7 -7
  228. package/dist/Service/NotificationsEndpoint.js +20 -20
  229. package/dist/Service/PlatformEndpoint.d.ts +8 -8
  230. package/dist/Service/PlatformEndpoint.js +19 -19
  231. package/dist/Service/PlatformLanguageEndpoint.d.ts +6 -6
  232. package/dist/Service/PlatformLanguageEndpoint.js +12 -12
  233. package/dist/Service/ProjectDeployEndpoint.d.ts +9 -9
  234. package/dist/Service/ProjectDeployEndpoint.js +60 -60
  235. package/dist/Service/ProjectEndpoint.d.ts +10 -9
  236. package/dist/Service/ProjectEndpoint.js +66 -61
  237. package/dist/Service/ProjectEnvironmentEndpoint.d.ts +8 -8
  238. package/dist/Service/ProjectEnvironmentEndpoint.js +52 -52
  239. package/dist/Service/QueueEndpoint.d.ts +5 -5
  240. package/dist/Service/QueueEndpoint.js +21 -21
  241. package/dist/Service/SearchEndpoint.d.ts +6 -0
  242. package/dist/Service/SearchEndpoint.js +16 -0
  243. package/dist/Service/SourcesAccountEndpoint.d.ts +15 -15
  244. package/dist/Service/SourcesAccountEndpoint.js +82 -82
  245. package/dist/Service/StorageEndpoint.d.ts +14 -14
  246. package/dist/Service/StorageEndpoint.js +117 -117
  247. package/dist/Service/SubscriberEndpoint.d.ts +8 -8
  248. package/dist/Service/SubscriberEndpoint.js +30 -30
  249. package/dist/Service/TriggerEndpoint.d.ts +8 -8
  250. package/dist/Service/TriggerEndpoint.js +54 -54
  251. package/dist/Service/UserEndpoint.d.ts +26 -26
  252. package/dist/Service/UserEndpoint.js +170 -170
  253. package/dist/Service/WorkerConfigEndpoint.d.ts +7 -7
  254. package/dist/Service/WorkerConfigEndpoint.js +38 -38
  255. package/dist/Service/WorkerEndpoint.d.ts +6 -6
  256. package/dist/Service/WorkerEndpoint.js +41 -41
  257. package/dist/Service/WorkspaceEndpoint.d.ts +6 -6
  258. package/dist/Service/WorkspaceEndpoint.js +20 -20
  259. package/dist/Service/WorkspaceMemberEndpoint.d.ts +13 -13
  260. package/dist/Service/WorkspaceMemberEndpoint.js +103 -103
  261. package/dist/Utils.d.ts +11 -11
  262. package/dist/Utils.js +67 -67
  263. package/dist/index.d.ts +133 -129
  264. package/dist/index.js +255 -248
  265. package/dist/main.js +1 -1
  266. package/dist/version.d.ts +1 -1
  267. package/dist/version.js +4 -4
  268. package/package.json +3 -3
package/dist/Client.d.ts CHANGED
@@ -1,77 +1,79 @@
1
- import { OAuthClientToken } from './Http/OAuthClientToken';
2
- import { WorkerEndpoint } from './Service/WorkerEndpoint';
3
- import { AdapterEndpoint } from './Service/AdapterEndpoint';
4
- import { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint';
5
- import { ProjectEndpoint } from './Service/ProjectEndpoint';
6
- import { FlowRunRequestEndpoint } from './Service/FlowRunRequestEndpoint';
7
- import { OAuthClient } from './Http/OAuthClient';
8
- import { WorkerConfigEndpoint } from './Service/WorkerConfigEndpoint';
9
- import { WorkspaceEndpoint } from './Service/WorkspaceEndpoint';
10
- import { UserEndpoint } from './Service/UserEndpoint';
11
- import { ConfigEndpoint } from './Service/ConfigEndpoint';
12
- import { SubscriberEndpoint } from './Service/SubscriberEndpoint';
13
- import { FlowEndpoint } from './Service/FlowEndpoint';
14
- import { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint';
15
- import { StorageEndpoint } from './Service/StorageEndpoint';
16
- import { QueueEndpoint } from './Service/QueueEndpoint';
17
- import { NotificationsEndpoint } from './Service/NotificationsEndpoint';
18
- import { ProjectDeployEndpoint } from './Service/ProjectDeployEndpoint';
19
- import { SourcesAccountEndpoint } from './Service/SourcesAccountEndpoint';
20
- import { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint';
21
- import { ChannelEndpoint } from './Service/ChannelEndpoint';
22
- import { HealthAlertEndpoint } from './Service/HealthAlertEndpoint';
23
- import { FlowRunEndpoint } from './Service/FlowRunEndpoint';
24
- import { LogEndpoint } from './Service/LogEndpoint';
25
- import { TriggerEndpoint } from './Service/TriggerEndpoint';
26
- import { PlatformEndpoint } from './Service/PlatformEndpoint';
27
- import { FlowRunStatsEndpoint } from './Service/FlowRunStatsEndpoint';
28
- import { FirewallEndpoint } from './Service/FirewallEndpoint';
29
- import { CodeSourceBuildStrategyEndpoint } from './Service/CodeSourceBuildStrategyEndpoint';
30
- export declare class Client {
31
- private readonly apiEndpoint;
32
- private readonly clientId;
33
- private readonly clientSecret;
34
- private endpoints;
35
- private readonly httpClient;
36
- private Store;
37
- constructor(apiEndpoint: string, clientId: string, clientSecret: string);
38
- private getHeaders;
39
- getHttpClient(): OAuthClient;
40
- authenticate(): Promise<boolean>;
41
- authenticate(username: string, password: string): Promise<boolean>;
42
- isAuthenticated(): boolean;
43
- getToken(): OAuthClientToken | null;
44
- setToken(token: OAuthClientToken): void;
45
- unsetAccessToken(): void;
46
- getApiInformation(): Promise<{
47
- version: string;
48
- }>;
49
- getAdapterEndpoint(): AdapterEndpoint;
50
- getProjectEndpoint(): ProjectEndpoint;
51
- getProjectEnvironmentEndpoint(): ProjectEnvironmentEndpoint;
52
- getProjectDeployEndpoint(): ProjectDeployEndpoint;
53
- getChannelEndpoint(): ChannelEndpoint;
54
- getConfigEndpoint(): ConfigEndpoint;
55
- getNotificationsEndpoint(): NotificationsEndpoint;
56
- getPlatformEndpoint(): PlatformEndpoint;
57
- getSubscriberEndpoint(): SubscriberEndpoint;
58
- getLogEndPoint(): LogEndpoint;
59
- getFlowEndpoint(): FlowEndpoint;
60
- getFlowRunEndpoint(): FlowRunEndpoint;
61
- getFlowRunRequestEndpoint(): FlowRunRequestEndpoint;
62
- getFlowRunStatsEndpoint(): FlowRunStatsEndpoint;
63
- getWorkspaceEndpoint(): WorkspaceEndpoint;
64
- getTriggerEndpoint(): TriggerEndpoint;
65
- getUserEndpoint(): UserEndpoint;
66
- getWorkspaceMemberEndpoint(): WorkspaceMemberEndpoint;
67
- getWorkerEndpoint(): WorkerEndpoint;
68
- getSourcesAccountEndpoint(): SourcesAccountEndpoint;
69
- getLanguageEndpoint(): PlatformLanguageEndpoint;
70
- getStorageEndpoint(): StorageEndpoint;
71
- getWorkerConfigEndpoint(): WorkerConfigEndpoint;
72
- getQueueEndpoint(): QueueEndpoint;
73
- getHealthAlertEndpoint(): HealthAlertEndpoint;
74
- getCodeSourceBuildStrategyEndpoint(): CodeSourceBuildStrategyEndpoint;
75
- getFirewallEndpoint(): FirewallEndpoint;
76
- private getEndpoint;
77
- }
1
+ import { OAuthClientToken } from './Http/OAuthClientToken';
2
+ import { WorkerEndpoint } from './Service/WorkerEndpoint';
3
+ import { AdapterEndpoint } from './Service/AdapterEndpoint';
4
+ import { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint';
5
+ import { ProjectEndpoint } from './Service/ProjectEndpoint';
6
+ import { FlowRunRequestEndpoint } from './Service/FlowRunRequestEndpoint';
7
+ import { OAuthClient } from './Http/OAuthClient';
8
+ import { WorkerConfigEndpoint } from './Service/WorkerConfigEndpoint';
9
+ import { WorkspaceEndpoint } from './Service/WorkspaceEndpoint';
10
+ import { UserEndpoint } from './Service/UserEndpoint';
11
+ import { ConfigEndpoint } from './Service/ConfigEndpoint';
12
+ import { SubscriberEndpoint } from './Service/SubscriberEndpoint';
13
+ import { FlowEndpoint } from './Service/FlowEndpoint';
14
+ import { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint';
15
+ import { StorageEndpoint } from './Service/StorageEndpoint';
16
+ import { QueueEndpoint } from './Service/QueueEndpoint';
17
+ import { NotificationsEndpoint } from './Service/NotificationsEndpoint';
18
+ import { ProjectDeployEndpoint } from './Service/ProjectDeployEndpoint';
19
+ import { SourcesAccountEndpoint } from './Service/SourcesAccountEndpoint';
20
+ import { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint';
21
+ import { ChannelEndpoint } from './Service/ChannelEndpoint';
22
+ import { HealthAlertEndpoint } from './Service/HealthAlertEndpoint';
23
+ import { FlowRunEndpoint } from './Service/FlowRunEndpoint';
24
+ import { LogEndpoint } from './Service/LogEndpoint';
25
+ import { TriggerEndpoint } from './Service/TriggerEndpoint';
26
+ import { PlatformEndpoint } from './Service/PlatformEndpoint';
27
+ import { FlowRunStatsEndpoint } from './Service/FlowRunStatsEndpoint';
28
+ import { FirewallEndpoint } from './Service/FirewallEndpoint';
29
+ import { CodeSourceBuildStrategyEndpoint } from './Service/CodeSourceBuildStrategyEndpoint';
30
+ import { SearchEndpoint } from './Service/SearchEndpoint';
31
+ export declare class Client {
32
+ private readonly apiEndpoint;
33
+ private readonly clientId;
34
+ private readonly clientSecret;
35
+ private endpoints;
36
+ private readonly httpClient;
37
+ private Store;
38
+ constructor(apiEndpoint: string, clientId: string, clientSecret: string);
39
+ private getHeaders;
40
+ getHttpClient(): OAuthClient;
41
+ authenticate(): Promise<boolean>;
42
+ authenticate(username: string, password: string): Promise<boolean>;
43
+ isAuthenticated(): boolean;
44
+ getToken(): OAuthClientToken | null;
45
+ setToken(token: OAuthClientToken): void;
46
+ unsetAccessToken(): void;
47
+ getApiInformation(): Promise<{
48
+ version: string;
49
+ }>;
50
+ getAdapterEndpoint(): AdapterEndpoint;
51
+ getProjectEndpoint(): ProjectEndpoint;
52
+ getProjectEnvironmentEndpoint(): ProjectEnvironmentEndpoint;
53
+ getProjectDeployEndpoint(): ProjectDeployEndpoint;
54
+ getChannelEndpoint(): ChannelEndpoint;
55
+ getConfigEndpoint(): ConfigEndpoint;
56
+ getNotificationsEndpoint(): NotificationsEndpoint;
57
+ getPlatformEndpoint(): PlatformEndpoint;
58
+ getSubscriberEndpoint(): SubscriberEndpoint;
59
+ getLogEndPoint(): LogEndpoint;
60
+ getFlowEndpoint(): FlowEndpoint;
61
+ getFlowRunEndpoint(): FlowRunEndpoint;
62
+ getFlowRunRequestEndpoint(): FlowRunRequestEndpoint;
63
+ getFlowRunStatsEndpoint(): FlowRunStatsEndpoint;
64
+ getWorkspaceEndpoint(): WorkspaceEndpoint;
65
+ getTriggerEndpoint(): TriggerEndpoint;
66
+ getUserEndpoint(): UserEndpoint;
67
+ getWorkspaceMemberEndpoint(): WorkspaceMemberEndpoint;
68
+ getWorkerEndpoint(): WorkerEndpoint;
69
+ getSourcesAccountEndpoint(): SourcesAccountEndpoint;
70
+ getLanguageEndpoint(): PlatformLanguageEndpoint;
71
+ getStorageEndpoint(): StorageEndpoint;
72
+ getWorkerConfigEndpoint(): WorkerConfigEndpoint;
73
+ getQueueEndpoint(): QueueEndpoint;
74
+ getHealthAlertEndpoint(): HealthAlertEndpoint;
75
+ getCodeSourceBuildStrategyEndpoint(): CodeSourceBuildStrategyEndpoint;
76
+ getSearchEndpoint(): SearchEndpoint;
77
+ getFirewallEndpoint(): FirewallEndpoint;
78
+ private getEndpoint;
79
+ }
package/dist/Client.js CHANGED
@@ -1,225 +1,230 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = void 0;
4
- const WorkerEndpoint_1 = require("./Service/WorkerEndpoint");
5
- const AdapterEndpoint_1 = require("./Service/AdapterEndpoint");
6
- const ProjectEnvironmentEndpoint_1 = require("./Service/ProjectEnvironmentEndpoint");
7
- const ProjectEndpoint_1 = require("./Service/ProjectEndpoint");
8
- const FlowRunRequestEndpoint_1 = require("./Service/FlowRunRequestEndpoint");
9
- const OAuthClient_1 = require("./Http/OAuthClient");
10
- const WorkerConfigEndpoint_1 = require("./Service/WorkerConfigEndpoint");
11
- const WorkspaceEndpoint_1 = require("./Service/WorkspaceEndpoint");
12
- const UserEndpoint_1 = require("./Service/UserEndpoint");
13
- const ConfigEndpoint_1 = require("./Service/ConfigEndpoint");
14
- const SubscriberEndpoint_1 = require("./Service/SubscriberEndpoint");
15
- const FlowEndpoint_1 = require("./Service/FlowEndpoint");
16
- const WorkspaceMemberEndpoint_1 = require("./Service/WorkspaceMemberEndpoint");
17
- const StorageEndpoint_1 = require("./Service/StorageEndpoint");
18
- const QueueEndpoint_1 = require("./Service/QueueEndpoint");
19
- const NotificationsEndpoint_1 = require("./Service/NotificationsEndpoint");
20
- const ProjectDeployEndpoint_1 = require("./Service/ProjectDeployEndpoint");
21
- const SourcesAccountEndpoint_1 = require("./Service/SourcesAccountEndpoint");
22
- const OAuthClientOptions_1 = require("./Http/OAuthClientOptions");
23
- const PlatformLanguageEndpoint_1 = require("./Service/PlatformLanguageEndpoint");
24
- const ChannelEndpoint_1 = require("./Service/ChannelEndpoint");
25
- const HealthAlertEndpoint_1 = require("./Service/HealthAlertEndpoint");
26
- const FlowRunEndpoint_1 = require("./Service/FlowRunEndpoint");
27
- const LogEndpoint_1 = require("./Service/LogEndpoint");
28
- const TriggerEndpoint_1 = require("./Service/TriggerEndpoint");
29
- const PlatformEndpoint_1 = require("./Service/PlatformEndpoint");
30
- const FlowRunStatsEndpoint_1 = require("./Service/FlowRunStatsEndpoint");
31
- const FirewallEndpoint_1 = require("./Service/FirewallEndpoint");
32
- const version_1 = require("./version");
33
- const CodeSourceBuildStrategyEndpoint_1 = require("./Service/CodeSourceBuildStrategyEndpoint");
34
- class Client {
35
- constructor(apiEndpoint, clientId, clientSecret) {
36
- this.apiEndpoint = apiEndpoint;
37
- this.clientId = clientId;
38
- this.clientSecret = clientSecret;
39
- this.Store = {
40
- WorkerEndpoint: WorkerEndpoint_1.WorkerEndpoint,
41
- AdapterEndpoint: AdapterEndpoint_1.AdapterEndpoint,
42
- ProjectEndpoint: ProjectEndpoint_1.ProjectEndpoint,
43
- ProjectEnvironmentEndpoint: ProjectEnvironmentEndpoint_1.ProjectEnvironmentEndpoint,
44
- ProjectDeployEndpoint: ProjectDeployEndpoint_1.ProjectDeployEndpoint,
45
- QueueEndpoint: QueueEndpoint_1.QueueEndpoint,
46
- ChannelEndpoint: ChannelEndpoint_1.ChannelEndpoint,
47
- ConfigEndpoint: ConfigEndpoint_1.ConfigEndpoint,
48
- NotificationsEndpoint: NotificationsEndpoint_1.NotificationsEndpoint,
49
- SubscriberEndpoint: SubscriberEndpoint_1.SubscriberEndpoint,
50
- LogEndpoint: LogEndpoint_1.LogEndpoint,
51
- FlowEndpoint: FlowEndpoint_1.FlowEndpoint,
52
- FlowRunEndpoint: FlowRunEndpoint_1.FlowRunEndpoint,
53
- FlowRunRequestEndpoint: FlowRunRequestEndpoint_1.FlowRunRequestEndpoint,
54
- WorkspaceEndpoint: WorkspaceEndpoint_1.WorkspaceEndpoint,
55
- TriggerEndpoint: TriggerEndpoint_1.TriggerEndpoint,
56
- UserEndpoint: UserEndpoint_1.UserEndpoint,
57
- WorkspaceMemberEndpoint: WorkspaceMemberEndpoint_1.WorkspaceMemberEndpoint,
58
- SourcesAccountEndpoint: SourcesAccountEndpoint_1.SourcesAccountEndpoint,
59
- PlatformLanguageEndpoint: PlatformLanguageEndpoint_1.PlatformLanguageEndpoint,
60
- StorageEndpoint: StorageEndpoint_1.StorageEndpoint,
61
- WorkerConfigEndpoint: WorkerConfigEndpoint_1.WorkerConfigEndpoint,
62
- HealthAlertEndpoint: HealthAlertEndpoint_1.HealthAlertEndpoint,
63
- PlatformEndpoint: PlatformEndpoint_1.PlatformEndpoint,
64
- FlowRunStatsEndpoint: FlowRunStatsEndpoint_1.FlowRunStatsEndpoint,
65
- CodeSourceBuildStrategyEndpoint: CodeSourceBuildStrategyEndpoint_1.CodeSourceBuildStrategyEndpoint,
66
- FirewallEndpoint: FirewallEndpoint_1.FirewallEndpoint
67
- };
68
- const options = new OAuthClientOptions_1.OAuthClientOptions(apiEndpoint, clientId, clientSecret, this.getHeaders());
69
- this.httpClient = new OAuthClient_1.OAuthClient(options);
70
- this.endpoints = new Map();
71
- // this.test = new Map<string, any>();
72
- //
73
- // this.test.set('WorkerEndpoint', WorkerEndpoint);
74
- // this.socketService = socketIo(this.apiEndpoint);
75
- //
76
- // this.socketService.on('message', (data: any) => {
77
- // console.log('Incoming:', data);
78
- // });
79
- }
80
- getHeaders() {
81
- const userAgentInfo = {
82
- version: version_1.VERSION,
83
- language: 'Javascript',
84
- language_version: '',
85
- publisher: 'Attlaz'
86
- };
87
- return {
88
- 'User-Agent': 'Attlaz Javascript Client/' + version_1.VERSION,
89
- 'X-Attlaz-Client-User-Agent': JSON.stringify(userAgentInfo)
90
- };
91
- }
92
- getHttpClient() {
93
- return this.httpClient;
94
- }
95
- async authenticate(username = null, password = null) {
96
- if (username === null || password === null) {
97
- return this.httpClient.authenticate();
98
- }
99
- return this.httpClient.authenticate(username, password);
100
- }
101
- isAuthenticated() {
102
- return this.httpClient.isAuthenticated();
103
- }
104
- getToken() {
105
- return this.httpClient.getToken();
106
- }
107
- // public getAccessToken(): string {
108
- // return this.httpClient.getAccessToken();
109
- // }
110
- //
111
- setToken(token) {
112
- this.httpClient.setToken(token);
113
- }
114
- //
115
- // public x(accessToken: string, refreshToken: string): Promise<Token> {
116
- // return this.httpClient.refreshToken(accessToken, refreshToken);
117
- // }
118
- unsetAccessToken() {
119
- this.httpClient.unsetToken();
120
- }
121
- async getApiInformation() {
122
- const result = await this.httpClient.request('/system/health', null, 'GET', false);
123
- return { version: result.version };
124
- }
125
- /* Endpoints */
126
- getAdapterEndpoint() {
127
- return this.getEndpoint('adapter', this.Store.AdapterEndpoint);
128
- }
129
- getProjectEndpoint() {
130
- return this.getEndpoint('project', this.Store.ProjectEndpoint);
131
- }
132
- getProjectEnvironmentEndpoint() {
133
- return this.getEndpoint('project-environment', this.Store.ProjectEnvironmentEndpoint);
134
- }
135
- getProjectDeployEndpoint() {
136
- return this.getEndpoint('project-deploy', this.Store.ProjectDeployEndpoint);
137
- }
138
- getChannelEndpoint() {
139
- return this.getEndpoint('channel', this.Store.ChannelEndpoint);
140
- }
141
- getConfigEndpoint() {
142
- return this.getEndpoint('config', this.Store.ConfigEndpoint);
143
- }
144
- getNotificationsEndpoint() {
145
- return this.getEndpoint('notification', this.Store.NotificationsEndpoint);
146
- }
147
- getPlatformEndpoint() {
148
- return this.getEndpoint('platform', this.Store.PlatformEndpoint);
149
- }
150
- getSubscriberEndpoint() {
151
- return this.getEndpoint('subscriber', this.Store.SubscriberEndpoint);
152
- }
153
- getLogEndPoint() {
154
- return this.getEndpoint('log', this.Store.LogEndpoint);
155
- }
156
- getFlowEndpoint() {
157
- return this.getEndpoint('flow', this.Store.FlowEndpoint);
158
- }
159
- getFlowRunEndpoint() {
160
- return this.getEndpoint('flow-run', this.Store.FlowRunEndpoint);
161
- }
162
- getFlowRunRequestEndpoint() {
163
- return this.getEndpoint('flow-run-request', this.Store.FlowRunRequestEndpoint);
164
- }
165
- getFlowRunStatsEndpoint() {
166
- return this.getEndpoint('flow-run-stats', this.Store.FlowRunStatsEndpoint);
167
- }
168
- getWorkspaceEndpoint() {
169
- return this.getEndpoint('workspaces', this.Store.WorkspaceEndpoint);
170
- }
171
- getTriggerEndpoint() {
172
- return this.getEndpoint('trigger', this.Store.TriggerEndpoint);
173
- }
174
- getUserEndpoint() {
175
- return this.getEndpoint('user', this.Store.UserEndpoint);
176
- }
177
- getWorkspaceMemberEndpoint() {
178
- return this.getEndpoint('member', this.Store.WorkspaceMemberEndpoint);
179
- }
180
- getWorkerEndpoint() {
181
- return this.getEndpoint('worker', this.Store.WorkerEndpoint);
182
- }
183
- getSourcesAccountEndpoint() {
184
- return this.getEndpoint('sources-account', this.Store.SourcesAccountEndpoint);
185
- }
186
- getLanguageEndpoint() {
187
- return this.getEndpoint('language', this.Store.PlatformLanguageEndpoint);
188
- }
189
- getStorageEndpoint() {
190
- return this.getEndpoint('storage', this.Store.StorageEndpoint);
191
- }
192
- getWorkerConfigEndpoint() {
193
- return this.getEndpoint('worker-config', this.Store.WorkerConfigEndpoint);
194
- }
195
- getQueueEndpoint() {
196
- return this.getEndpoint('queue', this.Store.QueueEndpoint);
197
- }
198
- getHealthAlertEndpoint() {
199
- return this.getEndpoint('healt-alert', this.Store.HealthAlertEndpoint);
200
- }
201
- getCodeSourceBuildStrategyEndpoint() {
202
- return this.getEndpoint('code-source-deploy-strategy', this.Store.CodeSourceBuildStrategyEndpoint);
203
- }
204
- // TODO: this should be in a separate API?
205
- getFirewallEndpoint() {
206
- return this.getEndpoint('firewall', this.Store.FirewallEndpoint);
207
- }
208
- getEndpoint(key, className) {
209
- //const classNameString: string = className.name;
210
- if (!this.endpoints.has(key)) {
211
- // if (this.Store[classNameString] === undefined || this.Store[classNameString] === null) {
212
- // throw new Error(`Class type of \'${classNameString}\' is not in the store`);
213
- // }
214
- try {
215
- const endpoint = new className(this.httpClient);
216
- this.endpoints.set(key, endpoint);
217
- }
218
- catch (e) {
219
- throw new Error('Unable to initialize ' + key + ' endpoint (' + e.message + ')');
220
- }
221
- }
222
- return this.endpoints.get(key);
223
- }
224
- }
225
- exports.Client = Client;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Client = void 0;
4
+ const WorkerEndpoint_1 = require("./Service/WorkerEndpoint");
5
+ const AdapterEndpoint_1 = require("./Service/AdapterEndpoint");
6
+ const ProjectEnvironmentEndpoint_1 = require("./Service/ProjectEnvironmentEndpoint");
7
+ const ProjectEndpoint_1 = require("./Service/ProjectEndpoint");
8
+ const FlowRunRequestEndpoint_1 = require("./Service/FlowRunRequestEndpoint");
9
+ const OAuthClient_1 = require("./Http/OAuthClient");
10
+ const WorkerConfigEndpoint_1 = require("./Service/WorkerConfigEndpoint");
11
+ const WorkspaceEndpoint_1 = require("./Service/WorkspaceEndpoint");
12
+ const UserEndpoint_1 = require("./Service/UserEndpoint");
13
+ const ConfigEndpoint_1 = require("./Service/ConfigEndpoint");
14
+ const SubscriberEndpoint_1 = require("./Service/SubscriberEndpoint");
15
+ const FlowEndpoint_1 = require("./Service/FlowEndpoint");
16
+ const WorkspaceMemberEndpoint_1 = require("./Service/WorkspaceMemberEndpoint");
17
+ const StorageEndpoint_1 = require("./Service/StorageEndpoint");
18
+ const QueueEndpoint_1 = require("./Service/QueueEndpoint");
19
+ const NotificationsEndpoint_1 = require("./Service/NotificationsEndpoint");
20
+ const ProjectDeployEndpoint_1 = require("./Service/ProjectDeployEndpoint");
21
+ const SourcesAccountEndpoint_1 = require("./Service/SourcesAccountEndpoint");
22
+ const OAuthClientOptions_1 = require("./Http/OAuthClientOptions");
23
+ const PlatformLanguageEndpoint_1 = require("./Service/PlatformLanguageEndpoint");
24
+ const ChannelEndpoint_1 = require("./Service/ChannelEndpoint");
25
+ const HealthAlertEndpoint_1 = require("./Service/HealthAlertEndpoint");
26
+ const FlowRunEndpoint_1 = require("./Service/FlowRunEndpoint");
27
+ const LogEndpoint_1 = require("./Service/LogEndpoint");
28
+ const TriggerEndpoint_1 = require("./Service/TriggerEndpoint");
29
+ const PlatformEndpoint_1 = require("./Service/PlatformEndpoint");
30
+ const FlowRunStatsEndpoint_1 = require("./Service/FlowRunStatsEndpoint");
31
+ const FirewallEndpoint_1 = require("./Service/FirewallEndpoint");
32
+ const version_1 = require("./version");
33
+ const CodeSourceBuildStrategyEndpoint_1 = require("./Service/CodeSourceBuildStrategyEndpoint");
34
+ const SearchEndpoint_1 = require("./Service/SearchEndpoint");
35
+ class Client {
36
+ constructor(apiEndpoint, clientId, clientSecret) {
37
+ this.apiEndpoint = apiEndpoint;
38
+ this.clientId = clientId;
39
+ this.clientSecret = clientSecret;
40
+ this.Store = {
41
+ WorkerEndpoint: WorkerEndpoint_1.WorkerEndpoint,
42
+ AdapterEndpoint: AdapterEndpoint_1.AdapterEndpoint,
43
+ ProjectEndpoint: ProjectEndpoint_1.ProjectEndpoint,
44
+ ProjectEnvironmentEndpoint: ProjectEnvironmentEndpoint_1.ProjectEnvironmentEndpoint,
45
+ ProjectDeployEndpoint: ProjectDeployEndpoint_1.ProjectDeployEndpoint,
46
+ QueueEndpoint: QueueEndpoint_1.QueueEndpoint,
47
+ ChannelEndpoint: ChannelEndpoint_1.ChannelEndpoint,
48
+ ConfigEndpoint: ConfigEndpoint_1.ConfigEndpoint,
49
+ NotificationsEndpoint: NotificationsEndpoint_1.NotificationsEndpoint,
50
+ SubscriberEndpoint: SubscriberEndpoint_1.SubscriberEndpoint,
51
+ LogEndpoint: LogEndpoint_1.LogEndpoint,
52
+ FlowEndpoint: FlowEndpoint_1.FlowEndpoint,
53
+ FlowRunEndpoint: FlowRunEndpoint_1.FlowRunEndpoint,
54
+ FlowRunRequestEndpoint: FlowRunRequestEndpoint_1.FlowRunRequestEndpoint,
55
+ WorkspaceEndpoint: WorkspaceEndpoint_1.WorkspaceEndpoint,
56
+ TriggerEndpoint: TriggerEndpoint_1.TriggerEndpoint,
57
+ UserEndpoint: UserEndpoint_1.UserEndpoint,
58
+ WorkspaceMemberEndpoint: WorkspaceMemberEndpoint_1.WorkspaceMemberEndpoint,
59
+ SourcesAccountEndpoint: SourcesAccountEndpoint_1.SourcesAccountEndpoint,
60
+ PlatformLanguageEndpoint: PlatformLanguageEndpoint_1.PlatformLanguageEndpoint,
61
+ StorageEndpoint: StorageEndpoint_1.StorageEndpoint,
62
+ WorkerConfigEndpoint: WorkerConfigEndpoint_1.WorkerConfigEndpoint,
63
+ HealthAlertEndpoint: HealthAlertEndpoint_1.HealthAlertEndpoint,
64
+ PlatformEndpoint: PlatformEndpoint_1.PlatformEndpoint,
65
+ FlowRunStatsEndpoint: FlowRunStatsEndpoint_1.FlowRunStatsEndpoint,
66
+ CodeSourceBuildStrategyEndpoint: CodeSourceBuildStrategyEndpoint_1.CodeSourceBuildStrategyEndpoint,
67
+ FirewallEndpoint: FirewallEndpoint_1.FirewallEndpoint,
68
+ SearchEndpoint: SearchEndpoint_1.SearchEndpoint
69
+ };
70
+ const options = new OAuthClientOptions_1.OAuthClientOptions(apiEndpoint, clientId, clientSecret, this.getHeaders());
71
+ this.httpClient = new OAuthClient_1.OAuthClient(options);
72
+ this.endpoints = new Map();
73
+ // this.test = new Map<string, any>();
74
+ //
75
+ // this.test.set('WorkerEndpoint', WorkerEndpoint);
76
+ // this.socketService = socketIo(this.apiEndpoint);
77
+ //
78
+ // this.socketService.on('message', (data: any) => {
79
+ // console.log('Incoming:', data);
80
+ // });
81
+ }
82
+ getHeaders() {
83
+ const userAgentInfo = {
84
+ version: version_1.VERSION,
85
+ language: 'Javascript',
86
+ language_version: '',
87
+ publisher: 'Attlaz'
88
+ };
89
+ return {
90
+ 'User-Agent': 'Attlaz Javascript Client/' + version_1.VERSION,
91
+ 'X-Attlaz-Client-User-Agent': JSON.stringify(userAgentInfo)
92
+ };
93
+ }
94
+ getHttpClient() {
95
+ return this.httpClient;
96
+ }
97
+ async authenticate(username = null, password = null) {
98
+ if (username === null || password === null) {
99
+ return this.httpClient.authenticate();
100
+ }
101
+ return this.httpClient.authenticate(username, password);
102
+ }
103
+ isAuthenticated() {
104
+ return this.httpClient.isAuthenticated();
105
+ }
106
+ getToken() {
107
+ return this.httpClient.getToken();
108
+ }
109
+ // public getAccessToken(): string {
110
+ // return this.httpClient.getAccessToken();
111
+ // }
112
+ //
113
+ setToken(token) {
114
+ this.httpClient.setToken(token);
115
+ }
116
+ //
117
+ // public x(accessToken: string, refreshToken: string): Promise<Token> {
118
+ // return this.httpClient.refreshToken(accessToken, refreshToken);
119
+ // }
120
+ unsetAccessToken() {
121
+ this.httpClient.unsetToken();
122
+ }
123
+ async getApiInformation() {
124
+ const result = await this.httpClient.request('/system/health', null, 'GET', false);
125
+ return { version: result.version };
126
+ }
127
+ /* Endpoints */
128
+ getAdapterEndpoint() {
129
+ return this.getEndpoint('adapter', this.Store.AdapterEndpoint);
130
+ }
131
+ getProjectEndpoint() {
132
+ return this.getEndpoint('project', this.Store.ProjectEndpoint);
133
+ }
134
+ getProjectEnvironmentEndpoint() {
135
+ return this.getEndpoint('project-environment', this.Store.ProjectEnvironmentEndpoint);
136
+ }
137
+ getProjectDeployEndpoint() {
138
+ return this.getEndpoint('project-deploy', this.Store.ProjectDeployEndpoint);
139
+ }
140
+ getChannelEndpoint() {
141
+ return this.getEndpoint('channel', this.Store.ChannelEndpoint);
142
+ }
143
+ getConfigEndpoint() {
144
+ return this.getEndpoint('config', this.Store.ConfigEndpoint);
145
+ }
146
+ getNotificationsEndpoint() {
147
+ return this.getEndpoint('notification', this.Store.NotificationsEndpoint);
148
+ }
149
+ getPlatformEndpoint() {
150
+ return this.getEndpoint('platform', this.Store.PlatformEndpoint);
151
+ }
152
+ getSubscriberEndpoint() {
153
+ return this.getEndpoint('subscriber', this.Store.SubscriberEndpoint);
154
+ }
155
+ getLogEndPoint() {
156
+ return this.getEndpoint('log', this.Store.LogEndpoint);
157
+ }
158
+ getFlowEndpoint() {
159
+ return this.getEndpoint('flow', this.Store.FlowEndpoint);
160
+ }
161
+ getFlowRunEndpoint() {
162
+ return this.getEndpoint('flow-run', this.Store.FlowRunEndpoint);
163
+ }
164
+ getFlowRunRequestEndpoint() {
165
+ return this.getEndpoint('flow-run-request', this.Store.FlowRunRequestEndpoint);
166
+ }
167
+ getFlowRunStatsEndpoint() {
168
+ return this.getEndpoint('flow-run-stats', this.Store.FlowRunStatsEndpoint);
169
+ }
170
+ getWorkspaceEndpoint() {
171
+ return this.getEndpoint('workspaces', this.Store.WorkspaceEndpoint);
172
+ }
173
+ getTriggerEndpoint() {
174
+ return this.getEndpoint('trigger', this.Store.TriggerEndpoint);
175
+ }
176
+ getUserEndpoint() {
177
+ return this.getEndpoint('user', this.Store.UserEndpoint);
178
+ }
179
+ getWorkspaceMemberEndpoint() {
180
+ return this.getEndpoint('member', this.Store.WorkspaceMemberEndpoint);
181
+ }
182
+ getWorkerEndpoint() {
183
+ return this.getEndpoint('worker', this.Store.WorkerEndpoint);
184
+ }
185
+ getSourcesAccountEndpoint() {
186
+ return this.getEndpoint('sources-account', this.Store.SourcesAccountEndpoint);
187
+ }
188
+ getLanguageEndpoint() {
189
+ return this.getEndpoint('language', this.Store.PlatformLanguageEndpoint);
190
+ }
191
+ getStorageEndpoint() {
192
+ return this.getEndpoint('storage', this.Store.StorageEndpoint);
193
+ }
194
+ getWorkerConfigEndpoint() {
195
+ return this.getEndpoint('worker-config', this.Store.WorkerConfigEndpoint);
196
+ }
197
+ getQueueEndpoint() {
198
+ return this.getEndpoint('queue', this.Store.QueueEndpoint);
199
+ }
200
+ getHealthAlertEndpoint() {
201
+ return this.getEndpoint('healt-alert', this.Store.HealthAlertEndpoint);
202
+ }
203
+ getCodeSourceBuildStrategyEndpoint() {
204
+ return this.getEndpoint('code-source-deploy-strategy', this.Store.CodeSourceBuildStrategyEndpoint);
205
+ }
206
+ getSearchEndpoint() {
207
+ return this.getEndpoint('search', this.Store.SearchEndpoint);
208
+ }
209
+ // TODO: this should be in a separate API?
210
+ getFirewallEndpoint() {
211
+ return this.getEndpoint('firewall', this.Store.FirewallEndpoint);
212
+ }
213
+ getEndpoint(key, className) {
214
+ //const classNameString: string = className.name;
215
+ if (!this.endpoints.has(key)) {
216
+ // if (this.Store[classNameString] === undefined || this.Store[classNameString] === null) {
217
+ // throw new Error(`Class type of \'${classNameString}\' is not in the store`);
218
+ // }
219
+ try {
220
+ const endpoint = new className(this.httpClient);
221
+ this.endpoints.set(key, endpoint);
222
+ }
223
+ catch (e) {
224
+ throw new Error('Unable to initialize ' + key + ' endpoint (' + e.message + ')');
225
+ }
226
+ }
227
+ return this.endpoints.get(key);
228
+ }
229
+ }
230
+ exports.Client = Client;
@@ -1,4 +1,4 @@
1
- import { DataValueCollection } from '../Model/DataValueCollection';
2
- export declare abstract class MetaDataAware {
3
- metadata: DataValueCollection;
4
- }
1
+ import { DataValueCollection } from '../Model/DataValueCollection';
2
+ export declare abstract class MetaDataAware {
3
+ metadata: DataValueCollection;
4
+ }