Skip to content

Commit ba934b4

Browse files
authored
Merge branch 'main' into v1.7051.0
2 parents eff501c + de42af9 commit ba934b4

File tree

13 files changed

+288
-40
lines changed

13 files changed

+288
-40
lines changed

packages/sdk/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts"
3232
},
3333
"dependencies": {
34+
"@scaleway/sdk-client": "workspace:^",
3435
"@scaleway/sdk-account": "workspace:*",
3536
"@scaleway/sdk-applesilicon": "workspace:*",
3637
"@scaleway/sdk-audit-trail": "workspace:*",

packages/sdk/src/index.gen.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ import { Testv1 } from '@scaleway/sdk-test'
4444
import { Vpcv2 } from '@scaleway/sdk-vpc'
4545
import { Vpcgwv1, Vpcgwv2 } from '@scaleway/sdk-vpcgw'
4646
import { Webhostingv1 } from '@scaleway/sdk-webhosting'
47+
48+
export { createAdvancedClient, createClient } from '@scaleway/sdk-client'
49+
4750
/**
4851
* @deprecated Direct version exports are deprecated. Use the 'Account' namespace instead (e.g., Account.v1).
4952
*/

packages_generated/audit_trail/src/v1alpha1/api.gen.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ import {
1010
} from '@scaleway/sdk-client'
1111
import {
1212
unmarshalListAuthenticationEventsResponse,
13+
unmarshalListCombinedEventsResponse,
1314
unmarshalListEventsResponse,
1415
unmarshalListProductsResponse,
1516
} from './marshalling.gen'
1617
import type {
1718
ListAuthenticationEventsRequest,
1819
ListAuthenticationEventsResponse,
20+
ListCombinedEventsRequest,
21+
ListCombinedEventsResponse,
1922
ListEventsRequest,
2023
ListEventsResponse,
2124
ListProductsRequest,
@@ -107,6 +110,32 @@ export class API extends ParentAPI {
107110
unmarshalListAuthenticationEventsResponse,
108111
)
109112

113+
listCombinedEvents = (request: Readonly<ListCombinedEventsRequest> = {}) =>
114+
this.client.fetch<ListCombinedEventsResponse>(
115+
{
116+
method: 'GET',
117+
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/combined-events`,
118+
urlParams: urlParams(
119+
['order_by', request.orderBy],
120+
[
121+
'organization_id',
122+
request.organizationId ??
123+
this.client.settings.defaultOrganizationId,
124+
],
125+
[
126+
'page_size',
127+
request.pageSize ?? this.client.settings.defaultPageSize,
128+
],
129+
['page_token', request.pageToken],
130+
['project_id', request.projectId],
131+
['recorded_after', request.recordedAfter],
132+
['recorded_before', request.recordedBefore],
133+
['resource_type', request.resourceType],
134+
),
135+
},
136+
unmarshalListCombinedEventsResponse,
137+
)
138+
110139
/**
111140
* Retrieve the list of Scaleway resources for which you have Audit Trail events.
112141
*

packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
BaremetalSettingInfo,
1616
Event,
1717
EventPrincipal,
18-
EventSystem,
1918
InstanceServerInfo,
2019
IpamIpInfo,
2120
KeyManagerKeyInfo,
@@ -24,6 +23,8 @@ import type {
2423
KubernetesNodeInfo,
2524
KubernetesPoolInfo,
2625
ListAuthenticationEventsResponse,
26+
ListCombinedEventsResponse,
27+
ListCombinedEventsResponseCombinedEvent,
2728
ListEventsResponse,
2829
ListProductsResponse,
2930
LoadBalancerAclInfo,
@@ -38,6 +39,7 @@ import type {
3839
Resource,
3940
SecretManagerSecretInfo,
4041
SecretManagerSecretVersionInfo,
42+
SystemEvent,
4143
} from './types.gen'
4244

4345
const unmarshalAccountOrganizationInfo = (
@@ -471,18 +473,6 @@ const unmarshalEventPrincipal = (data: unknown): EventPrincipal => {
471473
} as EventPrincipal
472474
}
473475

474-
const unmarshalEventSystem = (data: unknown): EventSystem => {
475-
if (!isJSONObject(data)) {
476-
throw new TypeError(
477-
`Unmarshalling the type 'EventSystem' failed as data isn't a dictionary.`,
478-
)
479-
}
480-
481-
return {
482-
name: data.name,
483-
} as EventSystem
484-
}
485-
486476
export const unmarshalEvent = (data: unknown): Event => {
487477
if (!isJSONObject(data)) {
488478
throw new TypeError(
@@ -507,11 +497,65 @@ export const unmarshalEvent = (data: unknown): Event => {
507497
serviceName: data.service_name,
508498
sourceIp: data.source_ip,
509499
statusCode: data.status_code,
510-
system: data.system ? unmarshalEventSystem(data.system) : undefined,
511500
userAgent: data.user_agent,
512501
} as Event
513502
}
514503

504+
const unmarshalSystemEvent = (data: unknown): SystemEvent => {
505+
if (!isJSONObject(data)) {
506+
throw new TypeError(
507+
`Unmarshalling the type 'SystemEvent' failed as data isn't a dictionary.`,
508+
)
509+
}
510+
511+
return {
512+
id: data.id,
513+
kind: data.kind,
514+
locality: data.locality,
515+
organizationId: data.organization_id,
516+
productName: data.product_name,
517+
projectId: data.project_id,
518+
recordedAt: unmarshalDate(data.recorded_at),
519+
resources: unmarshalArrayOfObject(data.resources, unmarshalResource),
520+
source: data.source,
521+
systemName: data.system_name,
522+
} as SystemEvent
523+
}
524+
525+
const unmarshalListCombinedEventsResponseCombinedEvent = (
526+
data: unknown,
527+
): ListCombinedEventsResponseCombinedEvent => {
528+
if (!isJSONObject(data)) {
529+
throw new TypeError(
530+
`Unmarshalling the type 'ListCombinedEventsResponseCombinedEvent' failed as data isn't a dictionary.`,
531+
)
532+
}
533+
534+
return {
535+
api: data.api ? unmarshalEvent(data.api) : undefined,
536+
auth: data.auth ? unmarshalAuthenticationEvent(data.auth) : undefined,
537+
system: data.system ? unmarshalSystemEvent(data.system) : undefined,
538+
} as ListCombinedEventsResponseCombinedEvent
539+
}
540+
541+
export const unmarshalListCombinedEventsResponse = (
542+
data: unknown,
543+
): ListCombinedEventsResponse => {
544+
if (!isJSONObject(data)) {
545+
throw new TypeError(
546+
`Unmarshalling the type 'ListCombinedEventsResponse' failed as data isn't a dictionary.`,
547+
)
548+
}
549+
550+
return {
551+
events: unmarshalArrayOfObject(
552+
data.events,
553+
unmarshalListCombinedEventsResponseCombinedEvent,
554+
),
555+
nextPageToken: data.next_page_token,
556+
} as ListCombinedEventsResponse
557+
}
558+
515559
export const unmarshalListEventsResponse = (
516560
data: unknown,
517561
): ListEventsResponse => {

packages_generated/audit_trail/src/v1alpha1/types.gen.ts

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export type ListAuthenticationEventsRequestOrderBy =
2828
| 'recorded_at_desc'
2929
| 'recorded_at_asc'
3030

31+
export type ListCombinedEventsRequestOrderBy =
32+
| 'recorded_at_desc'
33+
| 'recorded_at_asc'
34+
3135
export type ListEventsRequestOrderBy = 'recorded_at_desc' | 'recorded_at_asc'
3236

3337
export type ResourceType =
@@ -76,6 +80,8 @@ export type ResourceType =
7680
| 'sfs_filesystem'
7781
| 'vpc_private_network'
7882

83+
export type SystemEventKind = 'unknown_kind' | 'cron' | 'notification'
84+
7985
export interface AccountOrganizationInfo {}
8086

8187
export interface AccountProjectInfo {
@@ -309,15 +315,6 @@ export interface EventPrincipal {
309315
id: string
310316
}
311317

312-
export interface EventSystem {
313-
name: string
314-
}
315-
316-
export interface ProductService {
317-
name: string
318-
methods: string[]
319-
}
320-
321318
export interface AuthenticationEvent {
322319
/**
323320
* ID of the event.
@@ -385,15 +382,9 @@ export interface Event {
385382
/**
386383
* User or IAM application at the origin of the event.
387384
*
388-
* One-of ('source'): at most one of 'principal', 'system' could be set.
385+
* One-of ('source'): at most one of 'principal' could be set.
389386
*/
390387
principal?: EventPrincipal
391-
/**
392-
* The Scaleway system that performed an action on behalf of the client.
393-
*
394-
* One-of ('source'): at most one of 'principal', 'system' could be set.
395-
*/
396-
system?: EventSystem
397388
/**
398389
* Organization ID containing the event.
399390
*/
@@ -440,6 +431,42 @@ export interface Event {
440431
statusCode: number
441432
}
442433

434+
export interface SystemEvent {
435+
id: string
436+
recordedAt?: Date
437+
locality: string
438+
organizationId: string
439+
projectId?: string
440+
source: string
441+
systemName: string
442+
resources: Resource[]
443+
kind: SystemEventKind
444+
productName: string
445+
}
446+
447+
export interface ProductService {
448+
name: string
449+
methods: string[]
450+
}
451+
452+
export interface ListCombinedEventsResponseCombinedEvent {
453+
/**
454+
*
455+
* One-of ('event'): at most one of 'api', 'auth', 'system' could be set.
456+
*/
457+
api?: Event
458+
/**
459+
*
460+
* One-of ('event'): at most one of 'api', 'auth', 'system' could be set.
461+
*/
462+
auth?: AuthenticationEvent
463+
/**
464+
*
465+
* One-of ('event'): at most one of 'api', 'auth', 'system' could be set.
466+
*/
467+
system?: SystemEvent
468+
}
469+
443470
export interface Product {
444471
/**
445472
* Product title.
@@ -473,6 +500,26 @@ export interface ListAuthenticationEventsResponse {
473500
nextPageToken?: string
474501
}
475502

503+
export type ListCombinedEventsRequest = {
504+
/**
505+
* Region to target. If none is passed will use default region from the config.
506+
*/
507+
region?: ScwRegion
508+
organizationId?: string
509+
projectId?: string
510+
resourceType?: ResourceType
511+
recordedAfter?: Date
512+
recordedBefore?: Date
513+
orderBy?: ListCombinedEventsRequestOrderBy
514+
pageSize?: number
515+
pageToken?: string
516+
}
517+
518+
export interface ListCombinedEventsResponse {
519+
events: ListCombinedEventsResponseCombinedEvent[]
520+
nextPageToken?: string
521+
}
522+
476523
export type ListEventsRequest = {
477524
/**
478525
* Region to target. If none is passed will use default region from the config.

packages_generated/audit_trail/src/v1alpha1/validation-rules.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export const ListAuthenticationEventsRequest = {
88
},
99
}
1010

11+
export const ListCombinedEventsRequest = {
12+
pageSize: {
13+
greaterThanOrEqual: 1,
14+
lessThanOrEqual: 1000,
15+
},
16+
}
17+
1118
export const ListEventsRequest = {
1219
methodName: {
1320
pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/,

packages_generated/s2s_vpn/src/v1alpha1/api.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ export class API extends ParentAPI {
252252
path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/connections`,
253253
urlParams: urlParams(
254254
['customer_gateway_ids', request.customerGatewayIds],
255+
['is_ipv6', request.isIpv6],
255256
['name', request.name],
256257
['order_by', request.orderBy],
257258
['page', request.page],

packages_generated/s2s_vpn/src/v1alpha1/marshalling.gen.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,21 @@ export const unmarshalConnection = (data: unknown): Connection => {
9494
unmarshalConnectionCipher,
9595
),
9696
initiationPolicy: data.initiation_policy,
97+
isIpv6: data.is_ipv6,
9798
name: data.name,
9899
organizationId: data.organization_id,
99100
projectId: data.project_id,
100101
region: data.region,
101102
routePropagationEnabled: data.route_propagation_enabled,
102103
status: data.status,
103104
tags: data.tags,
104-
tunnelStatusIpv4: data.tunnel_status_ipv4,
105-
tunnelStatusIpv6: data.tunnel_status_ipv6,
105+
tunnelStatus: data.tunnel_status,
106+
tunnelStatusIpv4: data.tunnel_status_ipv4
107+
? data.tunnel_status_ipv4
108+
: undefined,
109+
tunnelStatusIpv6: data.tunnel_status_ipv6
110+
? data.tunnel_status_ipv6
111+
: undefined,
106112
updatedAt: unmarshalDate(data.updated_at),
107113
vpnGatewayId: data.vpn_gateway_id,
108114
} as Connection
@@ -377,6 +383,7 @@ export const marshalCreateConnectionRequest = (
377383
marshalConnectionCipher(elt, defaults),
378384
),
379385
initiation_policy: request.initiationPolicy,
386+
is_ipv6: request.isIpv6,
380387
name: request.name,
381388
project_id: request.projectId ?? defaults.defaultProjectId,
382389
tags: request.tags,

0 commit comments

Comments
 (0)