Skip to content

Commit 99401ce

Browse files
authored
Merge branch 'main' into v1.6137.0
2 parents 710078f + 44184c2 commit 99401ce

File tree

12 files changed

+124
-149
lines changed

12 files changed

+124
-149
lines changed

packages/clients/src/api/audit_trail/v1alpha1/types.gen.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ export type ResourceType =
1313
| 'kube_node'
1414
| 'kube_acl'
1515
| 'keym_key'
16+
| 'iamx_user'
17+
| 'iamx_application'
18+
| 'iamx_group'
19+
| 'iamx_policy'
20+
| 'iamx_api_key'
21+
| 'iamx_ssh_key'
1622

1723
export interface KeyManagerKeyInfo {}
1824

packages/clients/src/api/cockpit/v1/api.gen.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
unmarshalListDataSourcesResponse,
3636
unmarshalListGrafanaProductDashboardsResponse,
3737
unmarshalListGrafanaUsersResponse,
38-
unmarshalListManagedAlertsResponse,
3938
unmarshalListPlansResponse,
4039
unmarshalListTokensResponse,
4140
unmarshalPlan,
@@ -66,7 +65,6 @@ import type {
6665
ListDataSourcesResponse,
6766
ListGrafanaProductDashboardsResponse,
6867
ListGrafanaUsersResponse,
69-
ListManagedAlertsResponse,
7068
ListPlansResponse,
7169
ListTokensResponse,
7270
Plan,
@@ -88,7 +86,6 @@ import type {
8886
RegionalApiListAlertsRequest,
8987
RegionalApiListContactPointsRequest,
9088
RegionalApiListDataSourcesRequest,
91-
RegionalApiListManagedAlertsRequest,
9289
RegionalApiListTokensRequest,
9390
RegionalApiTriggerTestAlertRequest,
9491
RegionalApiUpdateContactPointRequest,
@@ -838,39 +835,6 @@ export class RegionalAPI extends ParentAPI {
838835
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`,
839836
})
840837

841-
protected pageOfListManagedAlerts = (
842-
request: Readonly<RegionalApiListManagedAlertsRequest> = {},
843-
) =>
844-
this.client.fetch<ListManagedAlertsResponse>(
845-
{
846-
method: 'GET',
847-
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/managed-alerts`,
848-
urlParams: urlParams(
849-
['order_by', request.orderBy],
850-
['page', request.page],
851-
[
852-
'page_size',
853-
request.pageSize ?? this.client.settings.defaultPageSize,
854-
],
855-
[
856-
'project_id',
857-
request.projectId ?? this.client.settings.defaultProjectId,
858-
],
859-
),
860-
},
861-
unmarshalListManagedAlertsResponse,
862-
)
863-
864-
/**
865-
* List managed alerts. List all managed alerts for the specified Project.
866-
*
867-
* @param request - The request {@link RegionalApiListManagedAlertsRequest}
868-
* @returns A Promise of ListManagedAlertsResponse
869-
*/
870-
listManagedAlerts = (
871-
request: Readonly<RegionalApiListManagedAlertsRequest> = {},
872-
) => enrichForPagination('alerts', this.pageOfListManagedAlerts, request)
873-
874838
/**
875839
* List alerts. List preconfigured and/or custom alerts for the specified
876840
* Project.

packages/clients/src/api/cockpit/v1/marshalling.gen.ts

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import type { DefaultValues } from '../../../bridge'
1010
import type {
1111
Alert,
1212
AlertManager,
13-
AnyAlert,
1413
ContactPoint,
1514
ContactPointEmail,
1615
DataSource,
@@ -28,7 +27,6 @@ import type {
2827
ListDataSourcesResponse,
2928
ListGrafanaProductDashboardsResponse,
3029
ListGrafanaUsersResponse,
31-
ListManagedAlertsResponse,
3230
ListPlansResponse,
3331
ListTokensResponse,
3432
Plan,
@@ -238,22 +236,23 @@ export const unmarshalGrafana = (data: unknown): Grafana => {
238236
} as Grafana
239237
}
240238

241-
const unmarshalAnyAlert = (data: unknown): AnyAlert => {
239+
const unmarshalAlert = (data: unknown): Alert => {
242240
if (!isJSONObject(data)) {
243241
throw new TypeError(
244-
`Unmarshalling the type 'AnyAlert' failed as data isn't a dictionary.`,
242+
`Unmarshalling the type 'Alert' failed as data isn't a dictionary.`,
245243
)
246244
}
247245

248246
return {
249247
annotations: data.annotations,
250248
duration: data.duration,
249+
enabled: data.enabled,
251250
name: data.name,
252251
preconfigured: data.preconfigured,
253252
region: data.region,
254253
rule: data.rule,
255-
state: data.state,
256-
} as AnyAlert
254+
state: data.state ? data.state : undefined,
255+
} as Alert
257256
}
258257

259258
export const unmarshalListAlertsResponse = (
@@ -266,7 +265,7 @@ export const unmarshalListAlertsResponse = (
266265
}
267266

268267
return {
269-
alerts: unmarshalArrayOfObject(data.alerts, unmarshalAnyAlert),
268+
alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
270269
totalCount: data.total_count,
271270
} as ListAlertsResponse
272271
}
@@ -342,37 +341,6 @@ export const unmarshalListGrafanaUsersResponse = (
342341
} as ListGrafanaUsersResponse
343342
}
344343

345-
const unmarshalAlert = (data: unknown): Alert => {
346-
if (!isJSONObject(data)) {
347-
throw new TypeError(
348-
`Unmarshalling the type 'Alert' failed as data isn't a dictionary.`,
349-
)
350-
}
351-
352-
return {
353-
description: data.description,
354-
name: data.name,
355-
product: data.product,
356-
productFamily: data.product_family,
357-
rule: data.rule,
358-
} as Alert
359-
}
360-
361-
export const unmarshalListManagedAlertsResponse = (
362-
data: unknown,
363-
): ListManagedAlertsResponse => {
364-
if (!isJSONObject(data)) {
365-
throw new TypeError(
366-
`Unmarshalling the type 'ListManagedAlertsResponse' failed as data isn't a dictionary.`,
367-
)
368-
}
369-
370-
return {
371-
alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
372-
totalCount: data.total_count,
373-
} as ListManagedAlertsResponse
374-
}
375-
376344
export const unmarshalListPlansResponse = (
377345
data: unknown,
378346
): ListPlansResponse => {

packages/clients/src/api/cockpit/v1/types.gen.ts

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
// If you have any remark or suggestion do not hesitate to open an issue.
33
import type { Region as ScwRegion } from '../../../bridge'
44

5-
export type AnyAlertState =
6-
| 'unknown_state'
7-
| 'disabled'
8-
| 'enabled'
9-
| 'pending'
10-
| 'firing'
5+
export type AlertState = 'unknown_state' | 'inactive' | 'pending' | 'firing'
116

127
export type DataSourceOrigin =
138
| 'unknown_origin'
@@ -29,14 +24,6 @@ export type ListDataSourcesRequestOrderBy =
2924

3025
export type ListGrafanaUsersRequestOrderBy = 'login_asc' | 'login_desc'
3126

32-
export type ListManagedAlertsRequestOrderBy =
33-
| 'created_at_asc'
34-
| 'created_at_desc'
35-
| 'name_asc'
36-
| 'name_desc'
37-
| 'type_asc'
38-
| 'type_desc'
39-
4027
export type ListPlansRequestOrderBy = 'name_asc' | 'name_desc'
4128

4229
export type ListTokensRequestOrderBy =
@@ -71,7 +58,7 @@ export interface GetConfigResponseRetention {
7158
defaultDays: number
7259
}
7360

74-
export interface AnyAlert {
61+
export interface Alert {
7562
/**
7663
* Region to target. If none is passed will use default region from the
7764
* config.
@@ -81,7 +68,8 @@ export interface AnyAlert {
8168
name: string
8269
rule: string
8370
duration: string
84-
state: AnyAlertState
71+
enabled: boolean
72+
state?: AlertState
8573
annotations: Record<string, string>
8674
}
8775

@@ -151,14 +139,6 @@ export interface GrafanaUser {
151139
password?: string
152140
}
153141

154-
export interface Alert {
155-
productFamily: string
156-
product: string
157-
name: string
158-
rule: string
159-
description: string
160-
}
161-
162142
/** Type of pricing plan. */
163143
export interface Plan {
164144
/** Name of a given pricing plan. */
@@ -355,7 +335,7 @@ export interface ListAlertsResponse {
355335
/** Total count of alerts matching the request. */
356336
totalCount: number
357337
/** List of alerts matching the applied filters. */
358-
alerts: AnyAlert[]
338+
alerts: Alert[]
359339
}
360340

361341
/** Response returned when listing contact points. */
@@ -400,14 +380,6 @@ export interface ListGrafanaUsersResponse {
400380
grafanaUsers: GrafanaUser[]
401381
}
402382

403-
/** Response returned when listing data sources. */
404-
export interface ListManagedAlertsResponse {
405-
/** Total count of data sources matching the request. */
406-
totalCount: number
407-
/** Alerts matching the request within the pagination. */
408-
alerts: Alert[]
409-
}
410-
411383
/** Output returned when listing pricing plans. */
412384
export interface ListPlansResponse {
413385
/** Total count of available pricing plans. */
@@ -635,7 +607,7 @@ export type RegionalApiListAlertsRequest = {
635607
* `firing`. If omitted, no filtering is applied on alert states. Other
636608
* filters may still apply.
637609
*/
638-
state?: AnyAlertState
610+
state?: AlertState
639611
}
640612

641613
/** List contact points. */
@@ -683,26 +655,6 @@ export type RegionalApiListDataSourcesRequest = {
683655
types?: DataSourceType[]
684656
}
685657

686-
/** Enable the sending of managed alerts. */
687-
export type RegionalApiListManagedAlertsRequest = {
688-
/**
689-
* Region to target. If none is passed will use default region from the
690-
* config.
691-
*/
692-
region?: ScwRegion
693-
/** Page number to return, from the paginated results. */
694-
page?: number
695-
/** Number of data sources to return per page. */
696-
pageSize?: number
697-
/** Sort order for data sources in the response. */
698-
orderBy?: ListManagedAlertsRequestOrderBy
699-
/**
700-
* Project ID to filter for, only data sources from this Project will be
701-
* returned.
702-
*/
703-
projectId?: string
704-
}
705-
706658
/** List tokens. */
707659
export type RegionalApiListTokensRequest = {
708660
/**

packages/clients/src/api/cockpit/v1/validation-rules.gen.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ export const RegionalApiListDataSourcesRequest = {
4242
},
4343
}
4444

45-
export const RegionalApiListManagedAlertsRequest = {
46-
page: {
47-
greaterThanOrEqual: 1,
48-
},
49-
pageSize: {
50-
greaterThanOrEqual: 1,
51-
lessThanOrEqual: 1000,
52-
},
53-
}
54-
5545
export const RegionalApiListTokensRequest = {
5646
page: {
5747
greaterThanOrEqual: 1,

packages/clients/src/api/secret/v1beta1/api.gen.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ import type {
4646
ListTagsRequest,
4747
ListTagsResponse,
4848
ProtectSecretRequest,
49+
RestoreSecretRequest,
50+
RestoreSecretVersionRequest,
4951
Secret,
5052
SecretVersion,
5153
UnprotectSecretRequest,
@@ -158,6 +160,7 @@ export class API extends ParentAPI {
158160
],
159161
['path', request.path],
160162
['project_id', request.projectId],
163+
['scheduled_for_deletion', request.scheduledForDeletion],
161164
['tags', request.tags],
162165
['type', request.type],
163166
),
@@ -496,4 +499,40 @@ export class API extends ParentAPI {
496499
*/
497500
listSecretTypes = (request: Readonly<ListSecretTypesRequest> = {}) =>
498501
enrichForPagination('types', this.pageOfListSecretTypes, request)
502+
503+
/**
504+
* Restore a version.. Restore a secret's version specified by the `region`,
505+
* `secret_id` and `revision` parameters.
506+
*
507+
* @param request - The request {@link RestoreSecretVersionRequest}
508+
* @returns A Promise of SecretVersion
509+
*/
510+
restoreSecretVersion = (request: Readonly<RestoreSecretVersionRequest>) =>
511+
this.client.fetch<SecretVersion>(
512+
{
513+
body: '{}',
514+
headers: jsonContentHeaders,
515+
method: 'POST',
516+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/restore`,
517+
},
518+
unmarshalSecretVersion,
519+
)
520+
521+
/**
522+
* Restore a secret.. Restore a secret and all its versions scheduled for
523+
* deletion specified by the `region` and `secret_id` parameters.
524+
*
525+
* @param request - The request {@link RestoreSecretRequest}
526+
* @returns A Promise of Secret
527+
*/
528+
restoreSecret = (request: Readonly<RestoreSecretRequest>) =>
529+
this.client.fetch<Secret>(
530+
{
531+
body: '{}',
532+
headers: jsonContentHeaders,
533+
method: 'POST',
534+
path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/restore`,
535+
},
536+
unmarshalSecret,
537+
)
499538
}

packages/clients/src/api/secret/v1beta1/marshalling.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const unmarshalSecretVersion = (data: unknown): SecretVersion => {
5151
return {
5252
createdAt: unmarshalDate(data.created_at),
5353
deletedAt: unmarshalDate(data.deleted_at),
54+
deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
5455
description: data.description,
5556
ephemeralProperties: data.ephemeral_properties
5657
? unmarshalEphemeralProperties(data.ephemeral_properties)
@@ -86,6 +87,7 @@ export const unmarshalSecret = (data: unknown): Secret => {
8687

8788
return {
8889
createdAt: unmarshalDate(data.created_at),
90+
deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
8991
description: data.description,
9092
ephemeralPolicy: data.ephemeral_policy
9193
? unmarshalEphemeralPolicy(data.ephemeral_policy)

0 commit comments

Comments
 (0)