@discover-cloud/shared 1.3.0 → 1.4.0

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 (81) hide show
  1. package/dist/authorization/index.d.ts +2 -2
  2. package/dist/authorization/permission-cache.service.js +27 -11
  3. package/dist/context/index.d.ts +1 -0
  4. package/dist/context/index.js +17 -0
  5. package/dist/context/request-context.storage.d.ts +21 -0
  6. package/dist/context/request-context.storage.js +37 -0
  7. package/dist/contracts/auth-service/account.dto.d.ts +1 -1
  8. package/dist/contracts/index.d.ts +1 -0
  9. package/dist/contracts/index.js +17 -0
  10. package/dist/contracts/visibility.d.ts +63 -0
  11. package/dist/contracts/visibility.js +10 -0
  12. package/dist/dtos/audit-service.types.d.ts +42 -0
  13. package/dist/dtos/audit-service.types.js +31 -0
  14. package/dist/dtos/auth-service.dto.d.ts +16 -1
  15. package/dist/dtos/cloud-service.dto.d.ts +9 -3
  16. package/dist/dtos/index.d.ts +6 -5
  17. package/dist/dtos/index.js +1 -0
  18. package/dist/dtos/insights-service.dto.d.ts +174 -13
  19. package/dist/dtos/response.dto.d.ts +6 -0
  20. package/dist/dtos/user-service.dto.d.ts +52 -7
  21. package/dist/enums/domain.enums.d.ts +52 -26
  22. package/dist/enums/domain.enums.js +64 -40
  23. package/dist/enums/index.d.ts +2 -2
  24. package/dist/errors/app-error.js +1 -1
  25. package/dist/errors/http-errors.d.ts +1 -1
  26. package/dist/errors/http-errors.js +26 -26
  27. package/dist/errors/index.d.ts +2 -2
  28. package/dist/http/index.d.ts +2 -2
  29. package/dist/http/request-context.d.ts +2 -2
  30. package/dist/http/request-context.js +5 -5
  31. package/dist/http/service-client.d.ts +2 -2
  32. package/dist/http/service-client.js +2 -2
  33. package/dist/index.d.ts +11 -10
  34. package/dist/index.js +1 -0
  35. package/dist/jwt/index.d.ts +3 -3
  36. package/dist/jwt/machine-jwt-verifier.d.ts +1 -1
  37. package/dist/jwt/machine-jwt-verifier.js +13 -14
  38. package/dist/jwt/machine-token-client.d.ts +1 -1
  39. package/dist/jwt/machine-token-client.js +8 -8
  40. package/dist/jwt/user-jwt-verifier.d.ts +1 -1
  41. package/dist/jwt/user-jwt-verifier.js +17 -16
  42. package/dist/messaging/audit.publisher.d.ts +14 -0
  43. package/dist/messaging/audit.publisher.js +49 -0
  44. package/dist/messaging/index.d.ts +1 -0
  45. package/dist/messaging/index.js +1 -0
  46. package/dist/messaging/rabbitmq.client.d.ts +5 -3
  47. package/dist/messaging/rabbitmq.client.js +17 -11
  48. package/dist/middleware/error-handler.middleware.d.ts +2 -2
  49. package/dist/middleware/error-handler.middleware.js +10 -10
  50. package/dist/middleware/index.d.ts +10 -10
  51. package/dist/middleware/request-context.middleware.d.ts +1 -12
  52. package/dist/middleware/request-context.middleware.js +17 -42
  53. package/dist/middleware/require-auth.middleware.d.ts +3 -19
  54. package/dist/middleware/require-auth.middleware.js +17 -26
  55. package/dist/middleware/require-machine.middleware.d.ts +2 -27
  56. package/dist/middleware/require-machine.middleware.js +30 -25
  57. package/dist/middleware/require-org-permission-from-body.middleware.js +1 -2
  58. package/dist/middleware/require-org-permission.middleware.d.ts +3 -3
  59. package/dist/middleware/require-org-permission.middleware.js +28 -28
  60. package/dist/middleware/require-platform-permission.middleware.d.ts +3 -3
  61. package/dist/middleware/require-platform-permission.middleware.js +10 -10
  62. package/dist/middleware/require-user.middleware.d.ts +1 -1
  63. package/dist/middleware/require-user.middleware.js +2 -2
  64. package/dist/middleware/require-workspace-permission.middleware.d.ts +3 -3
  65. package/dist/middleware/require-workspace-permission.middleware.js +25 -25
  66. package/dist/middleware/validate.middleware.d.ts +3 -3
  67. package/dist/middleware/validate.middleware.js +1 -1
  68. package/dist/types/audit.types.d.ts +39 -0
  69. package/dist/types/audit.types.js +30 -0
  70. package/dist/types/express.types.d.ts +14 -7
  71. package/dist/types/express.types.js +10 -10
  72. package/dist/types/index.d.ts +1 -1
  73. package/dist/utils/env.util.js +1 -1
  74. package/dist/utils/index.d.ts +5 -5
  75. package/dist/utils/logger.util.d.ts +5 -0
  76. package/dist/utils/logger.util.js +46 -8
  77. package/dist/utils/request-context.als.d.ts +10 -0
  78. package/dist/utils/request-context.als.js +5 -0
  79. package/dist/utils/response.util.d.ts +1 -1
  80. package/dist/utils/url-safety.util.js +4 -1
  81. package/package.json +1 -1
@@ -6,7 +6,7 @@
6
6
  * All push payloads and query DTOs are scoped to a workspaceId — the sole
7
7
  * multi-tenancy discriminator. userId / organizationId have been removed.
8
8
  */
9
- import { CloudProvider } from "../enums";
9
+ import { CloudProvider, RecommendationCategory, RecommendationStatus, Severity, AlertStatus, ReportType, ReportStatus, ReportFormat, ResourceEventType } from '../enums';
10
10
  export interface PushCostItem {
11
11
  service: string;
12
12
  region: string;
@@ -33,30 +33,66 @@ export interface PushBudgetItem {
33
33
  forecastSpend: number;
34
34
  period: string;
35
35
  }
36
+ export interface PushResourceEventItem {
37
+ resourceId: string;
38
+ resourceType: string;
39
+ eventType: ResourceEventType;
40
+ severity?: Severity;
41
+ title: string;
42
+ description?: string;
43
+ before?: Record<string, unknown>;
44
+ after?: Record<string, unknown>;
45
+ metadata?: Record<string, unknown>;
46
+ occurredAt: string;
47
+ }
48
+ export interface PushRecommendationItem {
49
+ resourceId?: string;
50
+ resourceType?: string;
51
+ category: RecommendationCategory;
52
+ severity?: Severity;
53
+ title: string;
54
+ description: string;
55
+ estimatedSaving?: number;
56
+ estimatedSavingCurrency?: string;
57
+ metadata?: Record<string, unknown>;
58
+ expiresAt?: string;
59
+ }
36
60
  export interface PushCostPayload {
37
61
  cloudAccountId: string;
38
62
  /** Workspace that owns this data — the sole tenancy scope. */
39
- workspaceId: string;
40
63
  provider: CloudProvider;
41
64
  costs: PushCostItem[];
42
65
  }
43
66
  export interface PushResourcePayload {
44
67
  cloudAccountId: string;
45
68
  /** Workspace that owns this data — the sole tenancy scope. */
46
- workspaceId: string;
47
69
  provider: CloudProvider;
48
70
  resources: PushResourceItem[];
49
71
  }
50
72
  export interface PushBudgetPayload {
51
73
  cloudAccountId: string;
52
74
  /** Workspace that owns this data — the sole tenancy scope. */
53
- workspaceId: string;
75
+ provider: CloudProvider;
54
76
  budgets: PushBudgetItem[];
55
77
  }
78
+ /**
79
+ * Bundled fetch-result payload — matches the shape cloud-service's
80
+ * SyncOrchestrator.publishSyncData() emits on "cloud.fetch.completed".
81
+ * Used by the event consumer rather than a direct HTTP push.
82
+ */
83
+ export interface PushResourceEventPayload {
84
+ cloudAccountId: string;
85
+ provider: CloudProvider;
86
+ events: PushResourceEventItem[];
87
+ }
88
+ export interface PushRecommendationPayload {
89
+ cloudAccountId: string;
90
+ provider: CloudProvider;
91
+ recommendations: PushRecommendationItem[];
92
+ }
56
93
  export interface CostRecordDto {
57
94
  id: string;
58
95
  cloudAccountId: string;
59
- workspaceId: string;
60
96
  provider: CloudProvider;
61
97
  service: string;
62
98
  region: string;
@@ -70,7 +106,6 @@ export interface CostRecordDto {
70
106
  export interface ResourceRecordDto {
71
107
  id: string;
72
108
  cloudAccountId: string;
73
- workspaceId: string;
74
109
  provider: CloudProvider;
75
110
  resourceType: string;
76
111
  resourceId: string;
@@ -81,10 +116,23 @@ export interface ResourceRecordDto {
81
116
  metadata: Record<string, unknown>;
82
117
  recordedAt: string;
83
118
  }
119
+ export interface LatestResourceSnapshotDto {
120
+ resourceId: string;
121
+ resourceType: string;
122
+ cloudAccountId: string;
123
+ provider: CloudProvider;
124
+ region: string;
125
+ name: string | null;
126
+ status: string;
127
+ tags: Record<string, string>;
128
+ metadata: Record<string, unknown>;
129
+ firstSeenAt: string;
130
+ lastSeenAt: string;
131
+ deletedAt: string | null;
132
+ }
84
133
  export interface BudgetRecordDto {
85
134
  id: string;
86
135
  cloudAccountId: string;
87
- workspaceId: string;
88
136
  name: string;
89
137
  limitAmount: number;
90
138
  currency: string;
@@ -96,17 +144,129 @@ export interface BudgetRecordDto {
96
144
  isForecastOver: boolean;
97
145
  recordedAt: string;
98
146
  }
147
+ export interface ResourceEventDto {
148
+ id: string;
149
+ cloudAccountId: string;
150
+ provider: CloudProvider;
151
+ resourceId: string;
152
+ resourceType: string;
153
+ eventType: ResourceEventType;
154
+ severity: Severity;
155
+ title: string;
156
+ description: string | null;
157
+ before: Record<string, unknown> | null;
158
+ after: Record<string, unknown> | null;
159
+ metadata: Record<string, unknown>;
160
+ occurredAt: string;
161
+ detectedAt: string;
162
+ }
163
+ export interface RecommendationDto {
164
+ id: string;
165
+ cloudAccountId: string;
166
+ provider: CloudProvider;
167
+ resourceId: string | null;
168
+ resourceType: string | null;
169
+ category: RecommendationCategory;
170
+ severity: Severity;
171
+ title: string;
172
+ description: string;
173
+ estimatedSaving: number | null;
174
+ estimatedSavingCurrency: string;
175
+ status: RecommendationStatus;
176
+ metadata: Record<string, unknown>;
177
+ appliedAt: string | null;
178
+ appliedBy: string | null;
179
+ dismissedAt: string | null;
180
+ dismissedBy: string | null;
181
+ expiresAt: string | null;
182
+ staleAt: string | null;
183
+ createdAt: string;
184
+ updatedAt: string;
185
+ }
186
+ export interface AlertDto {
187
+ id: string;
188
+ cloudAccountId: string | null;
189
+ provider: CloudProvider | null;
190
+ alertRuleId: string | null;
191
+ resourceId: string | null;
192
+ resourceType: string | null;
193
+ severity: Severity;
194
+ status: AlertStatus;
195
+ title: string;
196
+ message: string;
197
+ metadata: Record<string, unknown>;
198
+ acknowledgedAt: string | null;
199
+ acknowledgedBy: string | null;
200
+ resolvedAt: string | null;
201
+ resolvedBy: string | null;
202
+ createdAt: string;
203
+ updatedAt: string;
204
+ }
205
+ export interface ReportDto {
206
+ id: string;
207
+ cloudAccountId: string | null;
208
+ name: string;
209
+ type: ReportType;
210
+ format: ReportFormat;
211
+ status: ReportStatus;
212
+ filters: Record<string, unknown>;
213
+ storageUrl: string | null;
214
+ fileSizeBytes: string | null;
215
+ mimeType: string | null;
216
+ errorMessage: string | null;
217
+ generatedBy: string;
218
+ generatedAt: string | null;
219
+ expiresAt: string | null;
220
+ cleanedAt: string | null;
221
+ createdAt: string;
222
+ updatedAt: string;
223
+ }
224
+ export interface ExchangeRateDto {
225
+ id: string;
226
+ fromCurrency: string;
227
+ toCurrency: string;
228
+ rate: number;
229
+ source: string;
230
+ effectiveDate: string;
231
+ createdAt: string;
232
+ }
233
+ export interface IngestionSnapshotDto {
234
+ id: string;
235
+ cloudAccountId: string;
236
+ syncJobId: string;
237
+ resourcesFound: number;
238
+ resourcesAdded: number;
239
+ resourcesUpdated: number;
240
+ resourcesRemoved: number;
241
+ costRecordsImported: number;
242
+ budgetsImported: number;
243
+ durationMs: number | null;
244
+ createdAt: string;
245
+ }
246
+ export interface BulkWriteResultDto {
247
+ count: number;
248
+ }
249
+ export interface CloudAccountPurgeResultDto {
250
+ cloudAccountId: string;
251
+ costRecords: number;
252
+ resourceRecords: number;
253
+ resourceEvents: number;
254
+ budgetSnapshots: number;
255
+ recommendations: number;
256
+ alerts: number;
257
+ reports: number;
258
+ ingestionSnapshots: number;
259
+ }
99
260
  /**
100
261
  * Parameter model for cost queries.
101
262
  * Scoped to a workspaceId — callers must always provide this.
102
263
  */
103
264
  export interface CostQueryDto {
104
- workspaceId: string;
105
265
  cloudAccountId?: string;
106
266
  provider?: CloudProvider;
107
267
  from?: Date;
108
268
  to?: Date;
109
- groupBy?: "service" | "region" | "provider" | "day" | "month";
269
+ groupBy?: 'service' | 'region' | 'provider' | 'day' | 'month';
110
270
  }
111
271
  export interface DashboardSummaryDto {
112
272
  totalSpend: number;
@@ -118,8 +278,9 @@ export interface DashboardSummaryDto {
118
278
  label: string;
119
279
  amount: number;
120
280
  }[];
121
- costTrend: {
122
- date: string;
123
- amount: number;
124
- }[];
281
+ costTrend: CostTrendDto[];
282
+ }
283
+ export interface CostTrendDto {
284
+ date: string;
285
+ amount: number;
125
286
  }
@@ -46,3 +46,9 @@ export interface MachineTokenDto {
46
46
  accessToken: string;
47
47
  expiresIn: number;
48
48
  }
49
+ export interface CountResponseDto {
50
+ count: number;
51
+ }
52
+ export interface SecretResponseDto {
53
+ secret: string;
54
+ }
@@ -1,4 +1,5 @@
1
- import { Currency, Theme, OrganizationStatus, MembershipStatus, WorkspaceType, RoleType, RoleCategory, RoleAssignmentStatus, InviteScopeType, InviteStatus, AlertRuleOperator, AlertRuleMetric, NotificationChannelType } from '../enums';
1
+ import { Currency, Theme, OrganizationStatus, MembershipStatus, WorkspaceType, RoleType, RoleCategory, RoleAssignmentStatus, InviteScopeType, InviteStatus, AlertRuleMetric, AlertRuleOperator, NotificationChannelType, ScopeType } from '../enums';
2
+ import { PaginatedResponseDto } from './response.dto';
2
3
  export interface UserDto {
3
4
  id: string;
4
5
  email: string;
@@ -58,12 +59,21 @@ export interface WorkspaceDto {
58
59
  name: string;
59
60
  slug: string;
60
61
  type: WorkspaceType;
61
- ownerUserId: string | null;
62
62
  organizationId: string | null;
63
+ ownerId: string;
64
+ /** JSON resource filter defining which cloud resources belong to this workspace. */
65
+ resourceFilter: Record<string, unknown> | null;
66
+ linkedToOrgAt: string | null;
63
67
  createdAt: string;
64
68
  updatedAt: string;
65
69
  deletedAt: string | null;
66
70
  }
71
+ /** Maps a Workspace to the Cloud Accounts it can access. */
72
+ export interface WorkspaceCloudAccountDto {
73
+ workspaceId: string;
74
+ cloudAccountId: string;
75
+ createdAt: string;
76
+ }
67
77
  export interface WorkspaceMemberDto {
68
78
  id: string;
69
79
  workspaceId: string;
@@ -131,15 +141,18 @@ export interface InviteDto {
131
141
  createdAt: string;
132
142
  updatedAt: string;
133
143
  }
144
+ export interface ProvisionUserResponseDto {
145
+ user: UserWithProfileDto;
146
+ personalWorkspace: WorkspaceDto;
147
+ }
134
148
  export interface AlertRuleDto {
135
149
  id: string;
136
150
  workspaceId: string;
137
- createdById: string;
151
+ createdBy: string;
138
152
  name: string;
139
153
  metric: AlertRuleMetric;
140
154
  operator: AlertRuleOperator;
141
155
  threshold: number;
142
- thresholdCurrency: Currency | null;
143
156
  isActive: boolean;
144
157
  createdAt: string;
145
158
  updatedAt: string;
@@ -155,7 +168,39 @@ export interface AlertRuleChannelDto {
155
168
  export interface AlertRuleWithChannelsDto extends AlertRuleDto {
156
169
  channels: AlertRuleChannelDto[];
157
170
  }
158
- export interface ProvisionUserResponseDto {
159
- user: UserWithProfileDto;
160
- personalWorkspace: WorkspaceDto;
171
+ export interface PermissionCheckDto {
172
+ userId: string;
173
+ permissionKey: string;
174
+ scopeType: ScopeType;
175
+ organizationId?: string;
176
+ workspaceId?: string;
177
+ }
178
+ export interface PermissionCheckResultDto extends PermissionCheckDto {
179
+ allowed: boolean;
180
+ }
181
+ export interface UserContextDto {
182
+ user: UserDto;
183
+ organizations: OrganizationDto[];
184
+ workspaces: WorkspaceDto[];
185
+ permissions: PermissionDto[];
186
+ }
187
+ export interface SecurityContextDto {
188
+ user: UserDto;
189
+ roles: RoleAssignmentDto[];
190
+ }
191
+ export interface MyInvitesListDto {
192
+ organizations: PaginatedResponseDto<InviteDto>;
193
+ workspaces: PaginatedResponseDto<InviteDto>;
194
+ }
195
+ export interface ResentInviteDto {
196
+ invite: InviteDto;
197
+ token: string;
198
+ }
199
+ export interface PermissionPreviewDto {
200
+ count: number;
201
+ permissions: PermissionDto[];
202
+ }
203
+ export interface PurgeStatsDto {
204
+ workspaces: number;
205
+ organizations: number;
161
206
  }
@@ -39,6 +39,11 @@ export declare enum SyncType {
39
39
  RESOURCES = "RESOURCES",
40
40
  BUDGETS = "BUDGETS"
41
41
  }
42
+ export declare enum SyncTrigger {
43
+ MANUAL = "MANUAL",
44
+ SCHEDULED = "SCHEDULED",
45
+ WEBHOOK = "WEBHOOK"
46
+ }
42
47
  /**
43
48
  * Type of change detected in a cloud resource lifecycle.
44
49
  */
@@ -48,7 +53,6 @@ export declare enum ResourceEventType {
48
53
  DELETED = "DELETED",
49
54
  STATUS_CHANGED = "STATUS_CHANGED",
50
55
  CONFIG_CHANGED = "CONFIG_CHANGED",
51
- TAG_CHANGED = "TAG_CHANGED",
52
56
  SECURITY_CHANGED = "SECURITY_CHANGED",
53
57
  COST_CHANGED = "COST_CHANGED"
54
58
  }
@@ -88,6 +92,35 @@ export declare enum AlertStatus {
88
92
  ACKNOWLEDGED = "ACKNOWLEDGED",
89
93
  RESOLVED = "RESOLVED"
90
94
  }
95
+ export declare enum AlertRuleOperator {
96
+ GT = "GT",
97
+ LT = "LT",
98
+ GTE = "GTE",
99
+ LTE = "LTE"
100
+ }
101
+ export declare enum AlertRuleMetric {
102
+ COST_DAILY = "COST_DAILY",
103
+ COST_MONTHLY = "COST_MONTHLY",
104
+ RESOURCE_COUNT = "RESOURCE_COUNT",
105
+ BUDGET_UTILIZATION = "BUDGET_UTILIZATION"
106
+ }
107
+ export declare enum NotificationChannelType {
108
+ EMAIL = "EMAIL",
109
+ SLACK = "SLACK",
110
+ WEBHOOK = "WEBHOOK"
111
+ }
112
+ export declare enum BudgetPeriod {
113
+ DAILY = "DAILY",
114
+ WEEKLY = "WEEKLY",
115
+ MONTHLY = "MONTHLY",
116
+ QUARTERLY = "QUARTERLY",
117
+ ANNUAL = "ANNUAL"
118
+ }
119
+ export declare enum BudgetStatus {
120
+ OK = "OK",
121
+ WARNING = "WARNING",
122
+ EXCEEDED = "EXCEEDED"
123
+ }
91
124
  export declare enum ReportType {
92
125
  COST = "COST",
93
126
  RESOURCE = "RESOURCE",
@@ -152,11 +185,15 @@ export declare enum PlatformRoleAssignmentStatus {
152
185
  ACTIVE = "ACTIVE",
153
186
  REVOKED = "REVOKED"
154
187
  }
188
+ export declare enum ServiceClientStatus {
189
+ ACTIVE = "ACTIVE",
190
+ DISABLED = "DISABLED",
191
+ REVOKED = "REVOKED"
192
+ }
155
193
  export declare enum UserStatus {
156
194
  ACTIVE = "ACTIVE",
157
195
  SUSPENDED = "SUSPENDED",
158
- PENDING_DELETION = "PENDING_DELETION",
159
- DELETED = "DELETED"
196
+ PENDING_DELETION = "PENDING_DELETION"
160
197
  }
161
198
  export declare enum Theme {
162
199
  LIGHT = "LIGHT",
@@ -176,24 +213,25 @@ export declare enum Currency {
176
213
  export declare enum OrganizationStatus {
177
214
  ACTIVE = "ACTIVE",
178
215
  SUSPENDED = "SUSPENDED",
179
- PENDING_DELETION = "PENDING_DELETION",
180
- DELETED = "DELETED"
216
+ PENDING_DELETION = "PENDING_DELETION"
181
217
  }
182
218
  export declare enum WorkspaceStatus {
183
219
  ACTIVE = "ACTIVE",
184
220
  SUSPENDED = "SUSPENDED",
185
- PENDING_DELETION = "PENDING_DELETION",
186
- DELETED = "DELETED"
221
+ PENDING_DELETION = "PENDING_DELETION"
187
222
  }
188
223
  export declare enum MembershipStatus {
189
224
  ACTIVE = "ACTIVE",
190
225
  INACTIVE = "INACTIVE"
191
226
  }
192
227
  export declare enum WorkspaceType {
193
- PERSONAL = "PERSONAL",// Private, owner only, no members
194
- TEAM = "TEAM",// User-created, invite-based membership
228
+ PERSONAL = "PERSONAL",// Private, owner only, auto-provisioned on signup
195
229
  ORGANIZATION = "ORGANIZATION"
196
230
  }
231
+ export declare enum CloudAccountOwnerType {
232
+ ORGANIZATION = "ORGANIZATION",
233
+ PERSONAL_WORKSPACE = "PERSONAL_WORKSPACE"
234
+ }
197
235
  export declare enum RoleType {
198
236
  SYSTEM = "SYSTEM",
199
237
  CUSTOM = "CUSTOM"
@@ -250,23 +288,6 @@ export declare enum RoleAssignmentStatus {
250
288
  ACTIVE = "ACTIVE",
251
289
  REVOKED = "REVOKED"
252
290
  }
253
- export declare enum AlertRuleOperator {
254
- GT = "GT",
255
- LT = "LT",
256
- GTE = "GTE",
257
- LTE = "LTE"
258
- }
259
- export declare enum AlertRuleMetric {
260
- COST_DAILY = "COST_DAILY",
261
- COST_MONTHLY = "COST_MONTHLY",
262
- RESOURCE_COUNT = "RESOURCE_COUNT",
263
- BUDGET_UTILIZATION = "BUDGET_UTILIZATION"
264
- }
265
- export declare enum NotificationChannelType {
266
- EMAIL = "EMAIL",
267
- SLACK = "SLACK",
268
- WEBHOOK = "WEBHOOK"
269
- }
270
291
  export declare enum InviteScopeType {
271
292
  ORGANIZATION = "ORGANIZATION",
272
293
  WORKSPACE = "WORKSPACE"
@@ -278,3 +299,8 @@ export declare enum InviteStatus {
278
299
  REVOKED = "REVOKED",
279
300
  EXPIRED = "EXPIRED"
280
301
  }
302
+ export declare enum TimeGrouping {
303
+ DAY = "day",
304
+ WEEK = "week",
305
+ MONTH = "month"
306
+ }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  /* ---------------------------------------------------------------------------
3
- Cloud Providers
3
+ Cloud Service
4
4
  --------------------------------------------------------------------------- */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.InviteStatus = exports.InviteScopeType = exports.NotificationChannelType = exports.AlertRuleMetric = exports.AlertRuleOperator = exports.RoleAssignmentStatus = exports.ScopeType = exports.PermissionCategory = exports.RoleCategory = exports.RoleType = exports.WorkspaceType = exports.MembershipStatus = exports.WorkspaceStatus = exports.OrganizationStatus = exports.Currency = exports.Theme = exports.UserStatus = exports.PlatformRoleAssignmentStatus = exports.PlatformPermissionCategory = exports.PlatformRoleCategory = exports.PlatformRoleType = exports.OAuthProvider = exports.AccountTokenType = exports.AccountStatus = exports.ReportFormat = exports.ReportStatus = exports.ReportType = exports.AlertStatus = exports.RecommendationStatus = exports.RecommendationCategory = exports.Severity = exports.ResourceEventType = exports.SyncType = exports.SyncStatus = exports.CloudAccountStatus = exports.AzureAuthMethod = exports.GcpAuthMethod = exports.AwsAuthMethod = exports.CloudProvider = void 0;
6
+ exports.TimeGrouping = exports.InviteStatus = exports.InviteScopeType = exports.RoleAssignmentStatus = exports.ScopeType = exports.PermissionCategory = exports.RoleCategory = exports.RoleType = exports.CloudAccountOwnerType = exports.WorkspaceType = exports.MembershipStatus = exports.WorkspaceStatus = exports.OrganizationStatus = exports.Currency = exports.Theme = exports.UserStatus = exports.ServiceClientStatus = exports.PlatformRoleAssignmentStatus = exports.PlatformPermissionCategory = exports.PlatformRoleCategory = exports.PlatformRoleType = exports.OAuthProvider = exports.AccountTokenType = exports.AccountStatus = exports.ReportFormat = exports.ReportStatus = exports.ReportType = exports.BudgetStatus = exports.BudgetPeriod = exports.NotificationChannelType = exports.AlertRuleMetric = exports.AlertRuleOperator = exports.AlertStatus = exports.RecommendationStatus = exports.RecommendationCategory = exports.Severity = exports.ResourceEventType = exports.SyncTrigger = exports.SyncType = exports.SyncStatus = exports.CloudAccountStatus = exports.AzureAuthMethod = exports.GcpAuthMethod = exports.AwsAuthMethod = exports.CloudProvider = void 0;
7
7
  var CloudProvider;
8
8
  (function (CloudProvider) {
9
9
  CloudProvider["AWS"] = "AWS";
@@ -61,8 +61,14 @@ var SyncType;
61
61
  SyncType["RESOURCES"] = "RESOURCES";
62
62
  SyncType["BUDGETS"] = "BUDGETS";
63
63
  })(SyncType || (exports.SyncType = SyncType = {}));
64
+ var SyncTrigger;
65
+ (function (SyncTrigger) {
66
+ SyncTrigger["MANUAL"] = "MANUAL";
67
+ SyncTrigger["SCHEDULED"] = "SCHEDULED";
68
+ SyncTrigger["WEBHOOK"] = "WEBHOOK";
69
+ })(SyncTrigger || (exports.SyncTrigger = SyncTrigger = {}));
64
70
  /* ---------------------------------------------------------------------------
65
- Resource Events
71
+ Insights Service
66
72
  --------------------------------------------------------------------------- */
67
73
  /**
68
74
  * Type of change detected in a cloud resource lifecycle.
@@ -74,13 +80,9 @@ var ResourceEventType;
74
80
  ResourceEventType["DELETED"] = "DELETED";
75
81
  ResourceEventType["STATUS_CHANGED"] = "STATUS_CHANGED";
76
82
  ResourceEventType["CONFIG_CHANGED"] = "CONFIG_CHANGED";
77
- ResourceEventType["TAG_CHANGED"] = "TAG_CHANGED";
78
83
  ResourceEventType["SECURITY_CHANGED"] = "SECURITY_CHANGED";
79
84
  ResourceEventType["COST_CHANGED"] = "COST_CHANGED";
80
85
  })(ResourceEventType || (exports.ResourceEventType = ResourceEventType = {}));
81
- /* ---------------------------------------------------------------------------
82
- Severity
83
- --------------------------------------------------------------------------- */
84
86
  /**
85
87
  * Generic severity scale used by alerts, recommendations,
86
88
  * resource events, and future security findings.
@@ -93,9 +95,6 @@ var Severity;
93
95
  Severity["HIGH"] = "HIGH";
94
96
  Severity["CRITICAL"] = "CRITICAL";
95
97
  })(Severity || (exports.Severity = Severity = {}));
96
- /* ---------------------------------------------------------------------------
97
- Recommendations
98
- --------------------------------------------------------------------------- */
99
98
  /**
100
99
  * Optimization recommendation category.
101
100
  */
@@ -115,9 +114,6 @@ var RecommendationStatus;
115
114
  RecommendationStatus["APPLIED"] = "APPLIED";
116
115
  RecommendationStatus["DISMISSED"] = "DISMISSED";
117
116
  })(RecommendationStatus || (exports.RecommendationStatus = RecommendationStatus = {}));
118
- /* ---------------------------------------------------------------------------
119
- Alerts
120
- --------------------------------------------------------------------------- */
121
117
  /**
122
118
  * User-facing alert lifecycle state.
123
119
  */
@@ -127,9 +123,40 @@ var AlertStatus;
127
123
  AlertStatus["ACKNOWLEDGED"] = "ACKNOWLEDGED";
128
124
  AlertStatus["RESOLVED"] = "RESOLVED";
129
125
  })(AlertStatus || (exports.AlertStatus = AlertStatus = {}));
130
- /* ---------------------------------------------------------------------------
131
- Reports
132
- --------------------------------------------------------------------------- */
126
+ var AlertRuleOperator;
127
+ (function (AlertRuleOperator) {
128
+ AlertRuleOperator["GT"] = "GT";
129
+ AlertRuleOperator["LT"] = "LT";
130
+ AlertRuleOperator["GTE"] = "GTE";
131
+ AlertRuleOperator["LTE"] = "LTE";
132
+ })(AlertRuleOperator || (exports.AlertRuleOperator = AlertRuleOperator = {}));
133
+ var AlertRuleMetric;
134
+ (function (AlertRuleMetric) {
135
+ AlertRuleMetric["COST_DAILY"] = "COST_DAILY";
136
+ AlertRuleMetric["COST_MONTHLY"] = "COST_MONTHLY";
137
+ AlertRuleMetric["RESOURCE_COUNT"] = "RESOURCE_COUNT";
138
+ AlertRuleMetric["BUDGET_UTILIZATION"] = "BUDGET_UTILIZATION";
139
+ })(AlertRuleMetric || (exports.AlertRuleMetric = AlertRuleMetric = {}));
140
+ var NotificationChannelType;
141
+ (function (NotificationChannelType) {
142
+ NotificationChannelType["EMAIL"] = "EMAIL";
143
+ NotificationChannelType["SLACK"] = "SLACK";
144
+ NotificationChannelType["WEBHOOK"] = "WEBHOOK";
145
+ })(NotificationChannelType || (exports.NotificationChannelType = NotificationChannelType = {}));
146
+ var BudgetPeriod;
147
+ (function (BudgetPeriod) {
148
+ BudgetPeriod["DAILY"] = "DAILY";
149
+ BudgetPeriod["WEEKLY"] = "WEEKLY";
150
+ BudgetPeriod["MONTHLY"] = "MONTHLY";
151
+ BudgetPeriod["QUARTERLY"] = "QUARTERLY";
152
+ BudgetPeriod["ANNUAL"] = "ANNUAL";
153
+ })(BudgetPeriod || (exports.BudgetPeriod = BudgetPeriod = {}));
154
+ var BudgetStatus;
155
+ (function (BudgetStatus) {
156
+ BudgetStatus["OK"] = "OK";
157
+ BudgetStatus["WARNING"] = "WARNING";
158
+ BudgetStatus["EXCEEDED"] = "EXCEEDED";
159
+ })(BudgetStatus || (exports.BudgetStatus = BudgetStatus = {}));
133
160
  var ReportType;
134
161
  (function (ReportType) {
135
162
  ReportType["COST"] = "COST";
@@ -207,6 +234,12 @@ var PlatformRoleAssignmentStatus;
207
234
  PlatformRoleAssignmentStatus["ACTIVE"] = "ACTIVE";
208
235
  PlatformRoleAssignmentStatus["REVOKED"] = "REVOKED";
209
236
  })(PlatformRoleAssignmentStatus || (exports.PlatformRoleAssignmentStatus = PlatformRoleAssignmentStatus = {}));
237
+ var ServiceClientStatus;
238
+ (function (ServiceClientStatus) {
239
+ ServiceClientStatus["ACTIVE"] = "ACTIVE";
240
+ ServiceClientStatus["DISABLED"] = "DISABLED";
241
+ ServiceClientStatus["REVOKED"] = "REVOKED";
242
+ })(ServiceClientStatus || (exports.ServiceClientStatus = ServiceClientStatus = {}));
210
243
  /* ---------------------------------------------------------------------------
211
244
  User Service
212
245
  --------------------------------------------------------------------------- */
@@ -215,7 +248,6 @@ var UserStatus;
215
248
  UserStatus["ACTIVE"] = "ACTIVE";
216
249
  UserStatus["SUSPENDED"] = "SUSPENDED";
217
250
  UserStatus["PENDING_DELETION"] = "PENDING_DELETION";
218
- UserStatus["DELETED"] = "DELETED";
219
251
  })(UserStatus || (exports.UserStatus = UserStatus = {}));
220
252
  var Theme;
221
253
  (function (Theme) {
@@ -239,14 +271,12 @@ var OrganizationStatus;
239
271
  OrganizationStatus["ACTIVE"] = "ACTIVE";
240
272
  OrganizationStatus["SUSPENDED"] = "SUSPENDED";
241
273
  OrganizationStatus["PENDING_DELETION"] = "PENDING_DELETION";
242
- OrganizationStatus["DELETED"] = "DELETED";
243
274
  })(OrganizationStatus || (exports.OrganizationStatus = OrganizationStatus = {}));
244
275
  var WorkspaceStatus;
245
276
  (function (WorkspaceStatus) {
246
277
  WorkspaceStatus["ACTIVE"] = "ACTIVE";
247
278
  WorkspaceStatus["SUSPENDED"] = "SUSPENDED";
248
279
  WorkspaceStatus["PENDING_DELETION"] = "PENDING_DELETION";
249
- WorkspaceStatus["DELETED"] = "DELETED";
250
280
  })(WorkspaceStatus || (exports.WorkspaceStatus = WorkspaceStatus = {}));
251
281
  var MembershipStatus;
252
282
  (function (MembershipStatus) {
@@ -256,9 +286,14 @@ var MembershipStatus;
256
286
  var WorkspaceType;
257
287
  (function (WorkspaceType) {
258
288
  WorkspaceType["PERSONAL"] = "PERSONAL";
259
- WorkspaceType["TEAM"] = "TEAM";
260
289
  WorkspaceType["ORGANIZATION"] = "ORGANIZATION";
261
290
  })(WorkspaceType || (exports.WorkspaceType = WorkspaceType = {}));
291
+ // Defines who owns a CloudAccount — an Organization or a Personal Workspace.
292
+ var CloudAccountOwnerType;
293
+ (function (CloudAccountOwnerType) {
294
+ CloudAccountOwnerType["ORGANIZATION"] = "ORGANIZATION";
295
+ CloudAccountOwnerType["PERSONAL_WORKSPACE"] = "PERSONAL_WORKSPACE";
296
+ })(CloudAccountOwnerType || (exports.CloudAccountOwnerType = CloudAccountOwnerType = {}));
262
297
  var RoleType;
263
298
  (function (RoleType) {
264
299
  RoleType["SYSTEM"] = "SYSTEM";
@@ -320,26 +355,6 @@ var RoleAssignmentStatus;
320
355
  RoleAssignmentStatus["ACTIVE"] = "ACTIVE";
321
356
  RoleAssignmentStatus["REVOKED"] = "REVOKED";
322
357
  })(RoleAssignmentStatus || (exports.RoleAssignmentStatus = RoleAssignmentStatus = {}));
323
- var AlertRuleOperator;
324
- (function (AlertRuleOperator) {
325
- AlertRuleOperator["GT"] = "GT";
326
- AlertRuleOperator["LT"] = "LT";
327
- AlertRuleOperator["GTE"] = "GTE";
328
- AlertRuleOperator["LTE"] = "LTE";
329
- })(AlertRuleOperator || (exports.AlertRuleOperator = AlertRuleOperator = {}));
330
- var AlertRuleMetric;
331
- (function (AlertRuleMetric) {
332
- AlertRuleMetric["COST_DAILY"] = "COST_DAILY";
333
- AlertRuleMetric["COST_MONTHLY"] = "COST_MONTHLY";
334
- AlertRuleMetric["RESOURCE_COUNT"] = "RESOURCE_COUNT";
335
- AlertRuleMetric["BUDGET_UTILIZATION"] = "BUDGET_UTILIZATION";
336
- })(AlertRuleMetric || (exports.AlertRuleMetric = AlertRuleMetric = {}));
337
- var NotificationChannelType;
338
- (function (NotificationChannelType) {
339
- NotificationChannelType["EMAIL"] = "EMAIL";
340
- NotificationChannelType["SLACK"] = "SLACK";
341
- NotificationChannelType["WEBHOOK"] = "WEBHOOK";
342
- })(NotificationChannelType || (exports.NotificationChannelType = NotificationChannelType = {}));
343
358
  var InviteScopeType;
344
359
  (function (InviteScopeType) {
345
360
  InviteScopeType["ORGANIZATION"] = "ORGANIZATION";
@@ -353,3 +368,12 @@ var InviteStatus;
353
368
  InviteStatus["REVOKED"] = "REVOKED";
354
369
  InviteStatus["EXPIRED"] = "EXPIRED";
355
370
  })(InviteStatus || (exports.InviteStatus = InviteStatus = {}));
371
+ /* ---------------------------------------------------------------------------
372
+ Insights Service (Shared Aggregations)
373
+ --------------------------------------------------------------------------- */
374
+ var TimeGrouping;
375
+ (function (TimeGrouping) {
376
+ TimeGrouping["DAY"] = "day";
377
+ TimeGrouping["WEEK"] = "week";
378
+ TimeGrouping["MONTH"] = "month";
379
+ })(TimeGrouping || (exports.TimeGrouping = TimeGrouping = {}));