@spottoai/types-package 1.0.2-beta.19 → 1.0.2-beta.191
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/LICENSE +18 -40
- package/README.md +4 -11
- package/dist/accounts/accounts.d.ts +45 -3
- package/dist/accounts/accounts.d.ts.map +1 -1
- package/dist/accounts/index.d.ts +3 -0
- package/dist/accounts/index.d.ts.map +1 -1
- package/dist/accounts/index.js +3 -0
- package/dist/accounts/index.js.map +1 -1
- package/dist/accounts/readPermissions.d.ts +45 -0
- package/dist/accounts/readPermissions.d.ts.map +1 -0
- package/dist/accounts/readPermissions.js +70 -0
- package/dist/accounts/readPermissions.js.map +1 -0
- package/dist/accounts/validation.d.ts +24 -0
- package/dist/accounts/validation.d.ts.map +1 -0
- package/dist/accounts/validation.js +3 -0
- package/dist/accounts/validation.js.map +1 -0
- package/dist/accounts/writePermissions.d.ts +34 -0
- package/dist/accounts/writePermissions.d.ts.map +1 -0
- package/dist/accounts/writePermissions.js +37 -0
- package/dist/accounts/writePermissions.js.map +1 -0
- package/dist/ai/index.d.ts +975 -9
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/azure/benefits.d.ts +137 -0
- package/dist/azure/benefits.d.ts.map +1 -0
- package/dist/azure/benefits.js +3 -0
- package/dist/azure/benefits.js.map +1 -0
- package/dist/azure/billingPlots.d.ts +108 -0
- package/dist/azure/billingPlots.d.ts.map +1 -0
- package/dist/azure/billingPlots.js +6 -0
- package/dist/azure/billingPlots.js.map +1 -0
- package/dist/azure/budgets.d.ts +4 -0
- package/dist/azure/budgets.d.ts.map +1 -1
- package/dist/azure/commitmentsPlanning.d.ts +159 -0
- package/dist/azure/commitmentsPlanning.d.ts.map +1 -0
- package/dist/azure/commitmentsPlanning.js +3 -0
- package/dist/azure/commitmentsPlanning.js.map +1 -0
- package/dist/azure/common.d.ts +34 -0
- package/dist/azure/common.d.ts.map +1 -1
- package/dist/azure/configs.d.ts +73 -0
- package/dist/azure/configs.d.ts.map +1 -1
- package/dist/azure/costEstimation.d.ts +78 -0
- package/dist/azure/costEstimation.d.ts.map +1 -0
- package/dist/azure/costEstimation.js +3 -0
- package/dist/azure/costEstimation.js.map +1 -0
- package/dist/azure/metrics.d.ts +40 -0
- package/dist/azure/metrics.d.ts.map +1 -1
- package/dist/azure/payloads.d.ts +20 -1
- package/dist/azure/payloads.d.ts.map +1 -1
- package/dist/azure/prices.d.ts +179 -0
- package/dist/azure/prices.d.ts.map +1 -1
- package/dist/azure/recommendationAudit.d.ts +113 -0
- package/dist/azure/recommendationAudit.d.ts.map +1 -0
- package/dist/azure/recommendationAudit.js +10 -0
- package/dist/azure/recommendationAudit.js.map +1 -0
- package/dist/azure/recommendationState.d.ts +91 -2
- package/dist/azure/recommendationState.d.ts.map +1 -1
- package/dist/azure/recommendations.d.ts +362 -5
- package/dist/azure/recommendations.d.ts.map +1 -1
- package/dist/azure/recommendations.js.map +1 -1
- package/dist/azure/relationships.d.ts +77 -0
- package/dist/azure/relationships.d.ts.map +1 -0
- package/dist/azure/relationships.js +3 -0
- package/dist/azure/relationships.js.map +1 -0
- package/dist/azure/reports.d.ts +248 -0
- package/dist/azure/reports.d.ts.map +1 -1
- package/dist/azure/reports.js +13 -0
- package/dist/azure/reports.js.map +1 -1
- package/dist/azure/resources.d.ts +39 -0
- package/dist/azure/resources.d.ts.map +1 -1
- package/dist/azure/reviewChecklist.d.ts +139 -0
- package/dist/azure/reviewChecklist.d.ts.map +1 -0
- package/dist/azure/reviewChecklist.js +3 -0
- package/dist/azure/reviewChecklist.js.map +1 -0
- package/dist/azure/security.d.ts +15 -1
- package/dist/azure/security.d.ts.map +1 -1
- package/dist/azure/serviceRetirement.d.ts +28 -0
- package/dist/azure/serviceRetirement.d.ts.map +1 -0
- package/dist/azure/serviceRetirement.js +3 -0
- package/dist/azure/serviceRetirement.js.map +1 -0
- package/dist/azure/serviceRetirementState.d.ts +22 -0
- package/dist/azure/serviceRetirementState.d.ts.map +1 -0
- package/dist/azure/serviceRetirementState.js +3 -0
- package/dist/azure/serviceRetirementState.js.map +1 -0
- package/dist/azure/storage-inventory.d.ts +241 -0
- package/dist/azure/storage-inventory.d.ts.map +1 -0
- package/dist/azure/storage-inventory.js +3 -0
- package/dist/azure/storage-inventory.js.map +1 -0
- package/dist/azure/subscriptions.d.ts +34 -13
- package/dist/azure/subscriptions.d.ts.map +1 -1
- package/dist/azure/views.d.ts +147 -2
- package/dist/azure/views.d.ts.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/pagination.d.ts +3 -0
- package/dist/common/pagination.d.ts.map +1 -1
- package/dist/common/provider.d.ts +9 -0
- package/dist/common/provider.d.ts.map +1 -0
- package/dist/common/provider.js +9 -0
- package/dist/common/provider.js.map +1 -0
- package/dist/company/billingAccount.d.ts +30 -0
- package/dist/company/billingAccount.d.ts.map +1 -0
- package/dist/company/billingAccount.js +3 -0
- package/dist/company/billingAccount.js.map +1 -0
- package/dist/company/company.d.ts +26 -1
- package/dist/company/company.d.ts.map +1 -1
- package/dist/company/index.d.ts +1 -0
- package/dist/company/index.d.ts.map +1 -1
- package/dist/company/index.js +1 -0
- package/dist/company/index.js.map +1 -1
- package/dist/company/notification.d.ts +31 -1
- package/dist/company/notification.d.ts.map +1 -1
- package/dist/company/notification.js +24 -12
- package/dist/company/notification.js.map +1 -1
- package/dist/company/survey.d.ts +3 -0
- package/dist/company/survey.d.ts.map +1 -1
- package/dist/events/alertDefinitionRun.d.ts +23 -0
- package/dist/events/alertDefinitionRun.d.ts.map +1 -0
- package/dist/events/alertDefinitionRun.js +3 -0
- package/dist/events/alertDefinitionRun.js.map +1 -0
- package/dist/events/baseAlert.d.ts +130 -0
- package/dist/events/baseAlert.d.ts.map +1 -0
- package/dist/events/baseAlert.js +3 -0
- package/dist/events/baseAlert.js.map +1 -0
- package/dist/events/cost.d.ts +361 -0
- package/dist/events/cost.d.ts.map +1 -0
- package/dist/events/cost.js +3 -0
- package/dist/events/cost.js.map +1 -0
- package/dist/events/costAnomalies.d.ts +47 -0
- package/dist/events/costAnomalies.d.ts.map +1 -0
- package/dist/events/costAnomalies.js +3 -0
- package/dist/events/costAnomalies.js.map +1 -0
- package/dist/events/costViews.d.ts +23 -0
- package/dist/events/costViews.d.ts.map +1 -0
- package/dist/events/costViews.js +3 -0
- package/dist/events/costViews.js.map +1 -0
- package/dist/events/eventStatus.d.ts +67 -0
- package/dist/events/eventStatus.d.ts.map +1 -0
- package/dist/events/eventStatus.js +3 -0
- package/dist/events/eventStatus.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +23 -0
- package/dist/events/index.js.map +1 -0
- package/dist/feedbacks/feedback.d.ts +9 -0
- package/dist/feedbacks/feedback.d.ts.map +1 -1
- package/dist/identity/apikey.d.ts +67 -0
- package/dist/identity/apikey.d.ts.map +1 -0
- package/dist/identity/apikey.js +3 -0
- package/dist/identity/apikey.js.map +1 -0
- package/dist/identity/index.d.ts +2 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/halo.d.ts +76 -0
- package/dist/integrations/halo.d.ts.map +1 -0
- package/dist/integrations/halo.js +3 -0
- package/dist/integrations/halo.js.map +1 -0
- package/dist/integrations/index.d.ts +3 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +19 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/integrationTickets.d.ts +67 -0
- package/dist/integrations/integrationTickets.d.ts.map +1 -0
- package/dist/integrations/integrationTickets.js +3 -0
- package/dist/integrations/integrationTickets.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +18 -0
- package/dist/tags/index.js.map +1 -0
- package/dist/tags/tags.d.ts +26 -0
- package/dist/tags/tags.d.ts.map +1 -0
- package/dist/tags/tags.js +10 -0
- package/dist/tags/tags.js.map +1 -0
- package/dist/unknown/services.d.ts +12 -0
- package/dist/unknown/services.d.ts.map +1 -0
- package/dist/unknown/services.js +3 -0
- package/dist/unknown/services.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { AlertSeverity, AlertStatus, AlertLifecycleEvent, TagMatchMode, BaseAlertScope, BaseAlertDestinationSlackOrTeams, BaseAlertDestinationWebhook, BaseAlertDestinationJira, BaseAlertDestinationEmail, BaseAlertDestinations, BaseAlertComment, BaseAlertDefinition, BaseAlertInstance, ListAlertsParams, ListAlertDefinitionsParams } from './baseAlert.js';
|
|
2
|
+
export type CostAlertSeverity = AlertSeverity;
|
|
3
|
+
export type CostAlertCategory = 'cost';
|
|
4
|
+
export type CostAlertType = 'costAnomaly' | 'budget';
|
|
5
|
+
export type CostAlertStatus = AlertStatus;
|
|
6
|
+
export type { TagMatchMode };
|
|
7
|
+
export interface CostAlertTag {
|
|
8
|
+
key: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CostAlertScope extends BaseAlertScope {
|
|
12
|
+
tags?: CostAlertTag[];
|
|
13
|
+
}
|
|
14
|
+
export type CostAlertTriggerType = 'threshold' | 'baseline' | 'pricing_missing' | 'missing_metrics' | 'default';
|
|
15
|
+
export interface CostAlertContext {
|
|
16
|
+
triggerType?: CostAlertTriggerType;
|
|
17
|
+
trigger?: {
|
|
18
|
+
label?: string;
|
|
19
|
+
value?: number;
|
|
20
|
+
source?: string;
|
|
21
|
+
overPct?: number;
|
|
22
|
+
severity?: CostAlertSeverity;
|
|
23
|
+
};
|
|
24
|
+
estimate?: {
|
|
25
|
+
amount?: number;
|
|
26
|
+
currency?: string;
|
|
27
|
+
source?: string;
|
|
28
|
+
};
|
|
29
|
+
baseline?: {
|
|
30
|
+
lastDay?: number;
|
|
31
|
+
prevDay?: number;
|
|
32
|
+
avg7?: number;
|
|
33
|
+
avg14?: number;
|
|
34
|
+
tokenLastDay?: number;
|
|
35
|
+
tokenPrevDay?: number;
|
|
36
|
+
tokenAvg7?: number;
|
|
37
|
+
tokenAvg14?: number;
|
|
38
|
+
dodPct?: number;
|
|
39
|
+
tokenDodPct?: number;
|
|
40
|
+
};
|
|
41
|
+
reason?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface CostAlert {
|
|
44
|
+
id: string;
|
|
45
|
+
severity: CostAlertSeverity;
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
eventId: string;
|
|
49
|
+
eventTimestamp: string;
|
|
50
|
+
resourceId: string;
|
|
51
|
+
resourceType: string;
|
|
52
|
+
serviceCategory?: string;
|
|
53
|
+
subscriptionId?: string;
|
|
54
|
+
resourceGroup?: string;
|
|
55
|
+
estimatedCost?: number;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
context?: CostAlertContext;
|
|
58
|
+
}
|
|
59
|
+
export interface CostAlertFile {
|
|
60
|
+
generatedAt: string;
|
|
61
|
+
items: CostAlert[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* New Alert Definition (Table Storage row / API DTO).
|
|
65
|
+
*/
|
|
66
|
+
export interface CostAlertDefinition extends BaseAlertDefinition<CostAlertCriteria, CostAlertDestinations, CostAlertScope, CostAlertType> {
|
|
67
|
+
type: CostAlertType;
|
|
68
|
+
scope: CostAlertScope;
|
|
69
|
+
criteria?: CostAlertCriteria;
|
|
70
|
+
destinations?: CostAlertDestinations;
|
|
71
|
+
/** Whether the current user has permission to edit this alert definition. Added by API. */
|
|
72
|
+
canEdit?: boolean;
|
|
73
|
+
/** Whether the current user has permission to delete this alert definition. Added by API. */
|
|
74
|
+
canDelete?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export type ListCostAlertDefinitionsParams = ListAlertDefinitionsParams;
|
|
77
|
+
export type ListCostAlertsParams = ListAlertsParams<CostAlertType>;
|
|
78
|
+
export interface CostAlertCriteria {
|
|
79
|
+
confidence?: Array<'High' | 'Medium' | 'Low'>;
|
|
80
|
+
minDelta?: number;
|
|
81
|
+
minPercentChange?: number;
|
|
82
|
+
minCost?: number;
|
|
83
|
+
tagRelevance?: {
|
|
84
|
+
minScopeSharePercent?: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Data source selection:
|
|
88
|
+
* - auto: use actual billing if available, else estimated
|
|
89
|
+
* - actual: billing artifacts only
|
|
90
|
+
* - estimated: metrics/pricing estimation only
|
|
91
|
+
*/
|
|
92
|
+
dataSource?: 'auto' | 'actual' | 'estimated';
|
|
93
|
+
period?: 'monthly' | 'last_30_days';
|
|
94
|
+
budgetAmount?: number;
|
|
95
|
+
budgetCurrency?: string;
|
|
96
|
+
budgetThresholdPercents?: number[];
|
|
97
|
+
budgetThresholdAmounts?: number[];
|
|
98
|
+
forecastThresholdPercents?: number[];
|
|
99
|
+
forecastThresholdAmounts?: number[];
|
|
100
|
+
/**
|
|
101
|
+
* Optional day-over-day / month-over-month thresholds (cost anomaly extensions).
|
|
102
|
+
* These are additive to minDelta/minPercentChange when compare window is DoD/MoM.
|
|
103
|
+
*/
|
|
104
|
+
dodThresholdPercents?: number[];
|
|
105
|
+
dodThresholdAmounts?: number[];
|
|
106
|
+
momThresholdPercents?: number[];
|
|
107
|
+
momThresholdAmounts?: number[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Destination types for cost alerts are used for both:
|
|
111
|
+
* - API request payloads (create/update), where secrets are required by validation
|
|
112
|
+
* - API responses, where secrets may be redacted/omitted for non-admin readers
|
|
113
|
+
*
|
|
114
|
+
* For that reason, secret-bearing fields are optional at the type level.
|
|
115
|
+
*/
|
|
116
|
+
export interface CostAlertDestinationSlackOrTeams extends Omit<BaseAlertDestinationSlackOrTeams, 'webhookUrl'> {
|
|
117
|
+
webhookUrl?: string | null;
|
|
118
|
+
}
|
|
119
|
+
export interface CostAlertDestinationWebhook extends Omit<BaseAlertDestinationWebhook, 'url' | 'auth'> {
|
|
120
|
+
url?: string | null;
|
|
121
|
+
auth?: {
|
|
122
|
+
type: 'bearer';
|
|
123
|
+
tokenRef?: string | null;
|
|
124
|
+
};
|
|
125
|
+
events?: AlertLifecycleEvent[];
|
|
126
|
+
}
|
|
127
|
+
export interface CostAlertDestinationEmail extends Omit<BaseAlertDestinationEmail, 'email'> {
|
|
128
|
+
email?: string | null;
|
|
129
|
+
}
|
|
130
|
+
export type CostAlertDestinationJira = BaseAlertDestinationJira;
|
|
131
|
+
export interface CostAlertDestinations extends BaseAlertDestinations {
|
|
132
|
+
slack?: CostAlertDestinationSlackOrTeams[];
|
|
133
|
+
teams?: CostAlertDestinationSlackOrTeams[];
|
|
134
|
+
webhooks?: CostAlertDestinationWebhook[];
|
|
135
|
+
jira?: CostAlertDestinationJira;
|
|
136
|
+
emails?: CostAlertDestinationEmail[];
|
|
137
|
+
}
|
|
138
|
+
export interface CostAlertDiscriminator {
|
|
139
|
+
kind: 'anomalyDate' | 'periodStart' | string;
|
|
140
|
+
value: string;
|
|
141
|
+
}
|
|
142
|
+
export type CostAlertComment = BaseAlertComment;
|
|
143
|
+
export interface CostAlertSummary {
|
|
144
|
+
currencyCode?: string;
|
|
145
|
+
confidence?: 'High' | 'Medium' | 'Low';
|
|
146
|
+
delta?: number;
|
|
147
|
+
percentChange?: number;
|
|
148
|
+
amount?: number;
|
|
149
|
+
budgetAmount?: number;
|
|
150
|
+
forecastAmount?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Time window for the computed amount (ISO date).
|
|
153
|
+
* This represents the period for current cost (from periodStart to today).
|
|
154
|
+
*/
|
|
155
|
+
periodStart?: string;
|
|
156
|
+
periodEnd?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Optional window size for estimated spend (days).
|
|
159
|
+
* This represents the number of days in the forecast window.
|
|
160
|
+
*/
|
|
161
|
+
windowDays?: number;
|
|
162
|
+
/**
|
|
163
|
+
* Forecast period start date (ISO date).
|
|
164
|
+
* Forecast is projected from this date to forecastPeriodEnd.
|
|
165
|
+
*/
|
|
166
|
+
forecastPeriodStart?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Forecast period end date (ISO date).
|
|
169
|
+
* Forecast is projected until this date.
|
|
170
|
+
*/
|
|
171
|
+
forecastPeriodEnd?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Full period start date (ISO date).
|
|
174
|
+
* This represents the start of the entire period (e.g., month start for monthly budgets).
|
|
175
|
+
*/
|
|
176
|
+
fullPeriodStart?: string;
|
|
177
|
+
/**
|
|
178
|
+
* Full period end date (ISO date).
|
|
179
|
+
* This represents the end of the entire period (e.g., month end for monthly budgets).
|
|
180
|
+
*/
|
|
181
|
+
fullPeriodEnd?: string;
|
|
182
|
+
/**
|
|
183
|
+
* actual | estimated (resolved at evaluation time)
|
|
184
|
+
*/
|
|
185
|
+
dataSource?: 'actual' | 'estimated' | 'blended' | 'unknown' | 'metrics_pricing';
|
|
186
|
+
/**
|
|
187
|
+
* Estimated coverage (0-100) when using estimated spend.
|
|
188
|
+
*/
|
|
189
|
+
coveragePercent?: number;
|
|
190
|
+
reconciliationStatus?: 'pending' | 'matched' | 'mismatch';
|
|
191
|
+
actualShare?: number;
|
|
192
|
+
estimatedShare?: number;
|
|
193
|
+
estimationMethod?: string;
|
|
194
|
+
estimatedDays?: string[];
|
|
195
|
+
estimatedDaysSource?: 'metrics' | 'ma7' | 'ma14' | 'ma';
|
|
196
|
+
periodType?: 'calendar_month' | 'billing_period' | 'rolling_30_days';
|
|
197
|
+
dataShare?: {
|
|
198
|
+
actual?: number;
|
|
199
|
+
estimated?: number;
|
|
200
|
+
forecast?: number;
|
|
201
|
+
estimatedByMethod?: {
|
|
202
|
+
metrics_pricing?: number;
|
|
203
|
+
moving_average?: number;
|
|
204
|
+
other?: number;
|
|
205
|
+
};
|
|
206
|
+
qualityScore?: number;
|
|
207
|
+
qualityLevel?: 'high' | 'medium' | 'low';
|
|
208
|
+
};
|
|
209
|
+
tagFilterApplied?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Human-readable summary text for display in alerts list and notifications.
|
|
212
|
+
* Generated from structured summary data for easy consumption.
|
|
213
|
+
*/
|
|
214
|
+
summaryText?: string;
|
|
215
|
+
/**
|
|
216
|
+
* Forecast confidence level (High, Medium, Low) based on data availability and elapsed days.
|
|
217
|
+
* Used to indicate the reliability of forecast calculations.
|
|
218
|
+
*/
|
|
219
|
+
forecastConfidence?: 'high' | 'medium' | 'low';
|
|
220
|
+
/**
|
|
221
|
+
* Forecast method used to calculate the forecast amount.
|
|
222
|
+
* Values: 'conservative-blended', 'conservative-linear', 'trend-based', 'linear', 'rolling-current', 'fallback'
|
|
223
|
+
*/
|
|
224
|
+
forecastMethod?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Detailed information about the forecast calculation, including:
|
|
227
|
+
* - elapsedDays: Number of days elapsed in the period
|
|
228
|
+
* - totalDays: Total days in the period
|
|
229
|
+
* - remainingDays: Number of days remaining in the forecast period
|
|
230
|
+
* - dailyRate: Daily spending rate
|
|
231
|
+
* - For conservative-blended: historicalAverage, historicalDailyRate, blendedDailyRate, blendRatio
|
|
232
|
+
* - For conservative-linear: multiplier
|
|
233
|
+
* - For trend-based: trendAdjustment, growthRate, growthRateApplied
|
|
234
|
+
* - For recent-average-decreasing: recentAverageDailyRate, isDecreasingTrend
|
|
235
|
+
* - For weighted-average: recentAverageDailyRate
|
|
236
|
+
* - For rolling-current: method, note
|
|
237
|
+
*/
|
|
238
|
+
forecastDetails?: Record<string, unknown>;
|
|
239
|
+
/**
|
|
240
|
+
* Human-readable explanation combining data confidence, estimated mix, and forecast approach.
|
|
241
|
+
*/
|
|
242
|
+
dataStatusExplaination?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Daily forecast costs for the remaining days in the period.
|
|
245
|
+
* Each entry contains the date (YYYYMMDD format), predicted cost, and method used.
|
|
246
|
+
* This allows frontend to visualize how the forecast is distributed across days.
|
|
247
|
+
*/
|
|
248
|
+
forecastDailyCosts?: Array<{
|
|
249
|
+
date: number;
|
|
250
|
+
cost: number;
|
|
251
|
+
dataSource: 'forecast';
|
|
252
|
+
method: string;
|
|
253
|
+
}>;
|
|
254
|
+
/**
|
|
255
|
+
* Trigger reason indicating why the alert was triggered.
|
|
256
|
+
* For budget alerts: 'budget-threshold-percent' | 'budget-threshold-amount' | 'forecast-threshold-percent' | 'forecast-threshold-amount' | 'budget-threshold' | 'forecast-threshold' | 'both'
|
|
257
|
+
* For cost anomaly alerts: 'confidence' | 'minDelta' | 'minPercentChange' | 'minCost' | 'dodThreshold' | 'momThreshold' | string
|
|
258
|
+
*/
|
|
259
|
+
triggerReason?: string | string[];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Daily cost data point for breakdown visualization
|
|
263
|
+
*/
|
|
264
|
+
export interface DailyCostDataPoint {
|
|
265
|
+
/** Date in YYYYMMDD format (number) */
|
|
266
|
+
date: number;
|
|
267
|
+
/** Cost for this day */
|
|
268
|
+
cost: number;
|
|
269
|
+
/** Data source: actual (from billing/metrics), estimated (MA-based), or forecast (projected) */
|
|
270
|
+
dataSource: 'actual' | 'estimated' | 'forecast';
|
|
271
|
+
/** For estimated/forecast: method used (e.g., 'moving-average-7', 'moving-average-14', 'moving-average', 'metrics_pricing', 'linear', 'trend') */
|
|
272
|
+
method?: string;
|
|
273
|
+
/** For actual: whether this came from metrics (true) or billing (false) */
|
|
274
|
+
fromMetrics?: boolean;
|
|
275
|
+
}
|
|
276
|
+
export interface CostAlertBreakdownResource {
|
|
277
|
+
resourceId: string;
|
|
278
|
+
name?: string;
|
|
279
|
+
delta?: number;
|
|
280
|
+
cost?: number;
|
|
281
|
+
percentage?: number;
|
|
282
|
+
/**
|
|
283
|
+
* Combined tags (Azure + spottoTags) for client-side filtering (ANY/ALL).
|
|
284
|
+
*/
|
|
285
|
+
tags?: Record<string, string>;
|
|
286
|
+
/** Optional: metrics inputs for this resource (e.g., tokensIn/out). */
|
|
287
|
+
metricsInput?: Record<string, unknown>;
|
|
288
|
+
/** Optional: unit rates applied to compute cost. */
|
|
289
|
+
unitRates?: Record<string, number>;
|
|
290
|
+
/** Optional: estimated vs actual composition for UI. */
|
|
291
|
+
dataSource?: 'estimated' | 'actual' | 'blended' | 'metrics_pricing';
|
|
292
|
+
actualShare?: number;
|
|
293
|
+
estimatedShare?: number;
|
|
294
|
+
estimationMethod?: string;
|
|
295
|
+
/**
|
|
296
|
+
* Resource type (e.g., "microsoft.cognitiveservices/accounts")
|
|
297
|
+
* Helps frontend determine how to display this resource and its children
|
|
298
|
+
*/
|
|
299
|
+
resourceType?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Daily cost breakdown for this resource
|
|
302
|
+
* Includes actual, estimated, and forecast days
|
|
303
|
+
*/
|
|
304
|
+
dailyCosts?: DailyCostDataPoint[];
|
|
305
|
+
/**
|
|
306
|
+
* Deployment-level breakdown (only for resources that have sub-components)
|
|
307
|
+
* For cognitive services: contains deployment/model information
|
|
308
|
+
* Limited to top N deployments to keep breakdown size manageable
|
|
309
|
+
*/
|
|
310
|
+
deployments?: Array<{
|
|
311
|
+
deployment?: string;
|
|
312
|
+
model?: string;
|
|
313
|
+
cost: number;
|
|
314
|
+
percentage?: number;
|
|
315
|
+
metricsInput?: Record<string, unknown>;
|
|
316
|
+
unitRates?: Record<string, number>;
|
|
317
|
+
/** Daily cost breakdown for this deployment */
|
|
318
|
+
dailyCosts?: DailyCostDataPoint[];
|
|
319
|
+
}>;
|
|
320
|
+
}
|
|
321
|
+
export interface CostAlertBreakdownService {
|
|
322
|
+
serviceName: string;
|
|
323
|
+
delta?: number;
|
|
324
|
+
cost?: number;
|
|
325
|
+
percentage?: number;
|
|
326
|
+
dataSource?: 'estimated' | 'actual' | 'blended' | 'metrics_pricing';
|
|
327
|
+
/** Daily cost breakdown aggregated at service level */
|
|
328
|
+
dailyCosts?: DailyCostDataPoint[];
|
|
329
|
+
resources?: CostAlertBreakdownResource[];
|
|
330
|
+
unmappedResourceNames?: string[];
|
|
331
|
+
}
|
|
332
|
+
export interface CostAlertBreakdownTop {
|
|
333
|
+
subscriptionId: string;
|
|
334
|
+
subscriptionName?: string;
|
|
335
|
+
cost?: number;
|
|
336
|
+
percentage?: number;
|
|
337
|
+
/** Daily cost breakdown aggregated at subscription level */
|
|
338
|
+
dailyCosts?: DailyCostDataPoint[];
|
|
339
|
+
services?: CostAlertBreakdownService[];
|
|
340
|
+
}
|
|
341
|
+
export interface CostAlertBreakdownSummary {
|
|
342
|
+
top?: CostAlertBreakdownTop[];
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* New Alert Instance (Table Storage row / API DTO).
|
|
346
|
+
* Legacy CostAlert can map into this with status=open and category=cost.
|
|
347
|
+
*/
|
|
348
|
+
export interface CostAlertInstance extends BaseAlertInstance<CostAlertSummary, CostAlertScope, CostAlertType, CostAlertBreakdownSummary> {
|
|
349
|
+
category: CostAlertCategory;
|
|
350
|
+
discriminator: CostAlertDiscriminator;
|
|
351
|
+
/**
|
|
352
|
+
* Derived signature of scope (subs + tags) for idempotency/dedupe.
|
|
353
|
+
*/
|
|
354
|
+
scopeSignature?: string;
|
|
355
|
+
jiraIssueKey?: string;
|
|
356
|
+
comments?: CostAlertComment[];
|
|
357
|
+
summary?: CostAlertSummary;
|
|
358
|
+
breakdown?: CostAlertBreakdownSummary;
|
|
359
|
+
definitionSnapshot?: string;
|
|
360
|
+
}
|
|
361
|
+
//# sourceMappingURL=cost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost.d.ts","sourceRoot":"","sources":["../../src/events/cost.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,gCAAgC,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AC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClC,QAAQ,CAAC,EAAE,yBAAyB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,yBAAyB;IACxC,GAAG,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,CAAC,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,yBAAyB,CAAC;IACtI,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,aAAa,EAAE,sBAAsB,CAAC;IACtC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,SAAS,CAAC,EAAE,yBAAyB,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost.js","sourceRoot":"","sources":["../../src/events/cost.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { BillingAnomalyDriver } from '../azure/billingPlots.js';
|
|
2
|
+
/**
|
|
3
|
+
* A compact representation of anomaly drivers that are treated as subscription-level spend
|
|
4
|
+
* (i.e. no stable resourceId to deep link to), used in cost anomaly notifications.
|
|
5
|
+
*/
|
|
6
|
+
export interface CostAnomalySubscriptionPlan {
|
|
7
|
+
name: string;
|
|
8
|
+
summary?: string;
|
|
9
|
+
resourceId?: string;
|
|
10
|
+
serviceName?: string;
|
|
11
|
+
cost?: number;
|
|
12
|
+
delta?: number;
|
|
13
|
+
percentChange?: number | null;
|
|
14
|
+
}
|
|
15
|
+
export type CostAnomalyStatus = 'new' | 'notified';
|
|
16
|
+
/**
|
|
17
|
+
* Persisted cost anomaly record used for notification dedupe and anomaly history.
|
|
18
|
+
*/
|
|
19
|
+
export interface CostAnomalyRecord {
|
|
20
|
+
subscriptionId: string;
|
|
21
|
+
anomalyId: string;
|
|
22
|
+
/** Unix timestamp for the anomaly date */
|
|
23
|
+
date: number;
|
|
24
|
+
summary: string;
|
|
25
|
+
confidence?: string;
|
|
26
|
+
cost?: number;
|
|
27
|
+
delta?: number;
|
|
28
|
+
percentChange?: number | null;
|
|
29
|
+
currencyCode?: string;
|
|
30
|
+
detectedAt: string;
|
|
31
|
+
notifiedAt?: string;
|
|
32
|
+
status: CostAnomalyStatus;
|
|
33
|
+
drivers?: BillingAnomalyDriver[];
|
|
34
|
+
notes?: string[];
|
|
35
|
+
metadata?: Record<string, unknown>;
|
|
36
|
+
resourceIds?: string[];
|
|
37
|
+
resourceNames?: string[];
|
|
38
|
+
subscriptionPlans?: CostAnomalySubscriptionPlan[];
|
|
39
|
+
}
|
|
40
|
+
export interface CostAnomalyListResult {
|
|
41
|
+
results: CostAnomalyRecord[];
|
|
42
|
+
continuation?: {
|
|
43
|
+
NextPartitionKey?: string;
|
|
44
|
+
NextRowKey?: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=costAnomalies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costAnomalies.d.ts","sourceRoot":"","sources":["../../src/events/costAnomalies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,UAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,CAAC,EAAE,2BAA2B,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costAnomalies.js","sourceRoot":"","sources":["../../src/events/costAnomalies.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CostAlertCriteria, CostAlertDefinition, CostAlertInstance } from './cost';
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight definition reference included alongside instances in list views.
|
|
4
|
+
* This is not persisted as part of the alert instance row.
|
|
5
|
+
*/
|
|
6
|
+
export interface CostAlertDefinitionReference {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
criteria?: CostAlertCriteria;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* API/Portal view model for an alert instance.
|
|
13
|
+
* Extends the persisted `CostAlertInstance` with runtime-only convenience fields.
|
|
14
|
+
*/
|
|
15
|
+
export interface CostAlertInstanceView extends CostAlertInstance {
|
|
16
|
+
/**
|
|
17
|
+
* Hydrated definition data for UI rendering. This is not stored in Table Storage.
|
|
18
|
+
* - List endpoints often return a lightweight `CostAlertDefinitionReference`.
|
|
19
|
+
* - Detail endpoints may return the full `CostAlertDefinition` (or a superset).
|
|
20
|
+
*/
|
|
21
|
+
definition?: CostAlertDefinitionReference | CostAlertDefinition;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=costViews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costViews.d.ts","sourceRoot":"","sources":["../../src/events/costViews.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAExF;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D;;;;OAIG;IACH,UAAU,CAAC,EAAE,4BAA4B,GAAG,mBAAmB,CAAC;CACjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costViews.js","sourceRoot":"","sources":["../../src/events/costViews.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface EventStatus {
|
|
2
|
+
/** PartitionKey */
|
|
3
|
+
eventId: string;
|
|
4
|
+
/** RowKey( objectType + objectId) */
|
|
5
|
+
objectKey: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** dismiss / implement / restore / share / process … */
|
|
8
|
+
event: string;
|
|
9
|
+
/** recommendation / notification / subscription … */
|
|
10
|
+
eventDomain: string;
|
|
11
|
+
/** recommendation / resource / subscription / notification */
|
|
12
|
+
objectType: string;
|
|
13
|
+
objectId?: string;
|
|
14
|
+
subjectId?: string;
|
|
15
|
+
/** resource / subscription */
|
|
16
|
+
scope?: string;
|
|
17
|
+
/** Success / Failed / Processing / Requested */
|
|
18
|
+
status: string;
|
|
19
|
+
/** ISO timestamp */
|
|
20
|
+
statusAt: string;
|
|
21
|
+
statusHistory: Array<{
|
|
22
|
+
status: string;
|
|
23
|
+
occurredAt: string;
|
|
24
|
+
}>;
|
|
25
|
+
subscriptionId?: string;
|
|
26
|
+
tenantId?: string;
|
|
27
|
+
companyId?: string;
|
|
28
|
+
errorMessage?: string;
|
|
29
|
+
errorStack?: string[];
|
|
30
|
+
/** ticket/url */
|
|
31
|
+
sharedWith?: string[];
|
|
32
|
+
/** email / slack / jira … */
|
|
33
|
+
channel?: string;
|
|
34
|
+
shareTicketMetadata?: ShareTicketMetadata;
|
|
35
|
+
userId?: string;
|
|
36
|
+
context?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export interface UserEvent {
|
|
39
|
+
/** PartitionKey */
|
|
40
|
+
userId: string;
|
|
41
|
+
/** RowKey */
|
|
42
|
+
eventId: string;
|
|
43
|
+
objectKey?: string;
|
|
44
|
+
label: string;
|
|
45
|
+
event: string;
|
|
46
|
+
eventDomain: string;
|
|
47
|
+
objectType: string;
|
|
48
|
+
objectId?: string;
|
|
49
|
+
subjectId?: string;
|
|
50
|
+
status: string;
|
|
51
|
+
statusAt: string;
|
|
52
|
+
subscriptionId?: string;
|
|
53
|
+
tenantId?: string;
|
|
54
|
+
companyId?: string;
|
|
55
|
+
errorMessage?: string;
|
|
56
|
+
channel?: string;
|
|
57
|
+
sharedWith?: string[];
|
|
58
|
+
shareTicketMetadata?: ShareTicketMetadata;
|
|
59
|
+
lastStatusRead: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface ShareTicketMetadata {
|
|
62
|
+
provider: 'jira' | 'halo' | 'connectwise';
|
|
63
|
+
ticketId?: string | number;
|
|
64
|
+
ticketUrl?: string;
|
|
65
|
+
integrationCompanyId?: string;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=eventStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventStatus.d.ts","sourceRoot":"","sources":["../../src/events/eventStatus.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,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0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventStatus.js","sourceRoot":"","sources":["../../src/events/eventStatus.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./eventStatus"), exports);
|
|
18
|
+
__exportStar(require("./cost"), exports);
|
|
19
|
+
__exportStar(require("./costViews"), exports);
|
|
20
|
+
__exportStar(require("./costAnomalies"), exports);
|
|
21
|
+
__exportStar(require("./baseAlert"), exports);
|
|
22
|
+
__exportStar(require("./alertDefinitionRun"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,yCAAuB;AACvB,8CAA4B;AAC5B,kDAAgC;AAChC,8CAA4B;AAC5B,uDAAqC"}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Partition Key: url hash
|
|
3
|
+
* Row Key = userId_postedDate
|
|
4
|
+
*/
|
|
1
5
|
export interface FeedbackData {
|
|
6
|
+
/** url of the page the feedback was posted on */
|
|
2
7
|
url: string;
|
|
8
|
+
/** company id of the company the feedback was posted on */
|
|
3
9
|
companyId: string;
|
|
10
|
+
/** comment text */
|
|
4
11
|
comment: string;
|
|
12
|
+
/** true if the user wants to be contacted about the feedback */
|
|
5
13
|
contact: boolean;
|
|
14
|
+
/** true if the feedback is negative */
|
|
6
15
|
isNegative: boolean;
|
|
7
16
|
}
|
|
8
17
|
export interface FeedbackResponse {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/feedbacks/feedback.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/feedbacks/feedback.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IAMZ,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|