Skip to content

Commit 461e79b

Browse files
authored
Merge branch 'main' into feat/migrate-to-biome
2 parents 0d30202 + 0aabcd5 commit 461e79b

File tree

14 files changed

+283
-12
lines changed

14 files changed

+283
-12
lines changed

packages_generated/cockpit/src/v1/api.gen.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
unmarshalListGrafanaProductDashboardsResponse,
4141
unmarshalListGrafanaUsersResponse,
4242
unmarshalListPlansResponse,
43+
unmarshalListProductsResponse,
4344
unmarshalListTokensResponse,
4445
unmarshalPlan,
4546
unmarshalToken,
@@ -73,6 +74,7 @@ import type {
7374
ListGrafanaProductDashboardsResponse,
7475
ListGrafanaUsersResponse,
7576
ListPlansResponse,
77+
ListProductsResponse,
7678
ListTokensResponse,
7779
Plan,
7880
RegionalApiCreateContactPointRequest,
@@ -94,6 +96,7 @@ import type {
9496
RegionalApiListAlertsRequest,
9597
RegionalApiListContactPointsRequest,
9698
RegionalApiListDataSourcesRequest,
99+
RegionalApiListProductsRequest,
97100
RegionalApiListTokensRequest,
98101
RegionalApiTriggerTestAlertRequest,
99102
RegionalApiUpdateContactPointRequest,
@@ -627,6 +630,34 @@ You can filter tokens by Project ID and token scopes.
627630
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`,
628631
})
629632

633+
protected pageOfListProducts = (
634+
request: Readonly<RegionalApiListProductsRequest> = {},
635+
) =>
636+
this.client.fetch<ListProductsResponse>(
637+
{
638+
method: 'GET',
639+
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/products`,
640+
urlParams: urlParams(
641+
['order_by', request.orderBy],
642+
['page', request.page],
643+
[
644+
'page_size',
645+
request.pageSize ?? this.client.settings.defaultPageSize,
646+
],
647+
),
648+
},
649+
unmarshalListProductsResponse,
650+
)
651+
652+
/**
653+
* List all Scaleway products that send metrics and/or logs to Cockpit.. List all Scaleway products that send metrics and/or logs to Cockpit.
654+
*
655+
* @param request - The request {@link RegionalApiListProductsRequest}
656+
* @returns A Promise of ListProductsResponse
657+
*/
658+
listProducts = (request: Readonly<RegionalApiListProductsRequest> = {}) =>
659+
enrichForPagination('productsList', this.pageOfListProducts, request)
660+
630661
/**
631662
* Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
632663
The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.

packages_generated/cockpit/src/v1/index.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ export type {
4444
ListGrafanaUsersResponse,
4545
ListPlansRequestOrderBy,
4646
ListPlansResponse,
47+
ListProductsRequestOrderBy,
48+
ListProductsResponse,
4749
ListTokensRequestOrderBy,
4850
ListTokensResponse,
4951
Plan,
5052
PlanName,
5153
PreconfiguredAlertData,
54+
Product,
5255
RegionalApiCreateContactPointRequest,
5356
RegionalApiCreateDataSourceRequest,
5457
RegionalApiCreateTokenRequest,
@@ -68,6 +71,7 @@ export type {
6871
RegionalApiListAlertsRequest,
6972
RegionalApiListContactPointsRequest,
7073
RegionalApiListDataSourcesRequest,
74+
RegionalApiListProductsRequest,
7175
RegionalApiListTokensRequest,
7276
RegionalApiTriggerTestAlertRequest,
7377
RegionalApiUpdateContactPointRequest,

packages_generated/cockpit/src/v1/marshalling.gen.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ import type {
3131
ListGrafanaProductDashboardsResponse,
3232
ListGrafanaUsersResponse,
3333
ListPlansResponse,
34+
ListProductsResponse,
3435
ListTokensResponse,
3536
Plan,
3637
PreconfiguredAlertData,
38+
Product,
3739
RegionalApiCreateContactPointRequest,
3840
RegionalApiCreateDataSourceRequest,
3941
RegionalApiCreateTokenRequest,
@@ -444,6 +446,36 @@ export const unmarshalListPlansResponse = (
444446
} as ListPlansResponse
445447
}
446448

449+
const unmarshalProduct = (data: unknown): Product => {
450+
if (!isJSONObject(data)) {
451+
throw new TypeError(
452+
`Unmarshalling the type 'Product' failed as data isn't a dictionary.`,
453+
)
454+
}
455+
456+
return {
457+
displayName: data.display_name,
458+
familyName: data.family_name,
459+
name: data.name,
460+
resourceTypes: data.resource_types,
461+
} as Product
462+
}
463+
464+
export const unmarshalListProductsResponse = (
465+
data: unknown,
466+
): ListProductsResponse => {
467+
if (!isJSONObject(data)) {
468+
throw new TypeError(
469+
`Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`,
470+
)
471+
}
472+
473+
return {
474+
productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct),
475+
totalCount: data.total_count,
476+
} as ListProductsResponse
477+
}
478+
447479
export const unmarshalListTokensResponse = (
448480
data: unknown,
449481
): ListTokensResponse => {

packages_generated/cockpit/src/v1/types.gen.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export type ListGrafanaUsersRequestOrderBy = 'login_asc' | 'login_desc'
3333

3434
export type ListPlansRequestOrderBy = 'name_asc' | 'name_desc'
3535

36+
export type ListProductsRequestOrderBy =
37+
| 'created_at_asc'
38+
| 'created_at_desc'
39+
| 'display_name_asc'
40+
| 'display_name_desc'
41+
| 'family_name_asc'
42+
| 'family_name_desc'
43+
3644
export type ListTokensRequestOrderBy =
3745
| 'created_at_asc'
3846
| 'created_at_desc'
@@ -308,6 +316,13 @@ export interface Plan {
308316
monthlyPrice: number
309317
}
310318

319+
export interface Product {
320+
name: string
321+
displayName: string
322+
familyName: string
323+
resourceTypes: string[]
324+
}
325+
311326
/**
312327
* Token.
313328
*/
@@ -732,6 +747,11 @@ export interface ListPlansResponse {
732747
plans: Plan[]
733748
}
734749

750+
export interface ListProductsResponse {
751+
productsList: Product[]
752+
totalCount: number
753+
}
754+
735755
/**
736756
* Response returned when listing tokens.
737757
*/
@@ -1082,6 +1102,28 @@ export type RegionalApiListDataSourcesRequest = {
10821102
types?: DataSourceType[]
10831103
}
10841104

1105+
/**
1106+
* List all Scaleway products that send metrics and/or logs to Cockpit.
1107+
*/
1108+
export type RegionalApiListProductsRequest = {
1109+
/**
1110+
* Region to target. If none is passed will use default region from the config.
1111+
*/
1112+
region?: ScwRegion
1113+
/**
1114+
* Page number to return from the paginated results.
1115+
*/
1116+
page?: number
1117+
/**
1118+
* Number of products to return per page.
1119+
*/
1120+
pageSize?: number
1121+
/**
1122+
* Sort order for products in the response.
1123+
*/
1124+
orderBy?: ListProductsRequestOrderBy
1125+
}
1126+
10851127
/**
10861128
* List tokens.
10871129
*/

packages_generated/cockpit/src/v1/validation-rules.gen.ts

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

45+
export const RegionalApiListProductsRequest = {
46+
page: {
47+
greaterThanOrEqual: 1,
48+
lessThanOrEqual: 10000,
49+
},
50+
pageSize: {
51+
greaterThanOrEqual: 1,
52+
lessThanOrEqual: 100,
53+
},
54+
}
55+
4556
export const RegionalApiListTokensRequest = {
4657
page: {
4758
greaterThanOrEqual: 1,

packages_generated/dedibox/src/v1/types.gen.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ export interface Log {
13401340
*/
13411341
group?: RpnV2Group
13421342
/**
1343-
* RPN V2 member (if appliable).
1343+
* RPN V2 member (if applicable).
13441344
*/
13451345
member?: RpnV2Member
13461346
/**
@@ -1619,11 +1619,11 @@ export interface BMCAccess {
16191619
*/
16201620
url: string
16211621
/**
1622-
* The login to use for the BMC (Baseboard Management Controller) access authentification.
1622+
* The login to use for the BMC (Baseboard Management Controller) access authentication.
16231623
*/
16241624
login: string
16251625
/**
1626-
* The password to use for the BMC (Baseboard Management Controller) access authentification.
1626+
* The password to use for the BMC (Baseboard Management Controller) access authentication.
16271627
*/
16281628
password: string
16291629
/**
@@ -2718,7 +2718,7 @@ export interface Rescue {
27182718
*/
27192719
password: string
27202720
/**
2721-
* Protocol of the resuce.
2721+
* Protocol of the rescue.
27222722
*/
27232723
protocol: RescueProtocol
27242724
}

packages_generated/iot/src/v1/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export interface Hub {
291291
*/
292292
organizationId: string
293293
/**
294-
* When an unknown device connects to your hub using a valid certificate chain, it will be automatically provisioned inside your Hub. The Hub uses the common name of the device certifcate to find out if a device with the same name already exists. This setting can only be enabled on a hub with a custom certificate authority.
294+
* When an unknown device connects to your hub using a valid certificate chain, it will be automatically provisioned inside your Hub. The Hub uses the common name of the device certificate to find out if a device with the same name already exists. This setting can only be enabled on a hub with a custom certificate authority.
295295
*/
296296
enableDeviceAutoProvisioning: boolean
297297
/**

packages_generated/ipam/src/v1/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export type ResourceType =
4141
| 'kafka_cluster'
4242
| 'bgp_endpoint'
4343
| 'scbl_sedb_cluster'
44+
| 'dtwh_deployment'
45+
| 'sedb_cluster'
4446

4547
export interface Resource {
4648
/**

packages_generated/kafka/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# @scaleway/sdk-kafka
2+
3+
[![npm version](https://img.shields.io/npm/v/@scaleway/sdk-kafka.svg)](https://www.npmjs.com/package/@scaleway/sdk-kafka)
4+
[![npm downloads](https://img.shields.io/npm/dm/@scaleway/sdk-kafka.svg)](https://www.npmjs.com/package/@scaleway/sdk-kafka)
5+
[![license](https://img.shields.io/npm/l/@scaleway/sdk-kafka.svg)](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
6+
7+
Scaleway SDK for Kafka API.
8+
9+
> **Note**
10+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
11+
12+
## Installation
13+
14+
```bash
15+
npm install @scaleway/sdk-kafka @scaleway/sdk-client
16+
```
17+
18+
or with pnpm:
19+
20+
```bash
21+
pnpm add @scaleway/sdk-kafka @scaleway/sdk-client
22+
```
23+
24+
or with yarn:
25+
26+
```bash
27+
yarn add @scaleway/sdk-kafka @scaleway/sdk-client
28+
```
29+
30+
## Getting Started
31+
32+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
33+
34+
### Basic Usage
35+
36+
```typescript
37+
import { createClient } from '@scaleway/sdk-client'
38+
import { Kafka } from '@scaleway/sdk-kafka'
39+
40+
const client = createClient({
41+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
42+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
43+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
44+
defaultRegion: 'fr-par',
45+
defaultZone: 'fr-par-1',
46+
})
47+
48+
const api = new Kafka.v1.API(client)
49+
50+
// Use the API
51+
// Example: await api.listServers()
52+
```
53+
54+
### Using Configuration Loader
55+
56+
For a simpler setup, you can load credentials from the configuration file or environment variables:
57+
58+
```typescript
59+
import { createClient } from '@scaleway/sdk-client'
60+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
61+
import { Kafka } from '@scaleway/sdk-kafka'
62+
63+
const profile = loadProfileFromConfigurationFile()
64+
const client = createClient(profile)
65+
const api = new Kafka.v1.API(client)
66+
```
67+
68+
## Documentation
69+
70+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
71+
- 🌐 [Scaleway Kafka API Documentation](https://www.scaleway.com/en/developers/api/kafka/)
72+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
73+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
74+
75+
## Features
76+
77+
- ✅ Full TypeScript support with complete type definitions
78+
- ✅ Promise-based API
79+
- ✅ Automatic pagination helpers
80+
- ✅ Built-in error handling
81+
- ✅ Compatible with Node.js ≥ 20
82+
83+
## Support
84+
85+
We love feedback! Feel free to reach us on:
86+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88+
89+
## Contributing
90+
91+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
92+
93+
## License
94+
95+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export interface NodeTypeVolumeType {
156156
*/
157157
description: string
158158
/**
159-
* Mimimum size required for the volume.
159+
* Minimum size required for the volume.
160160
*/
161161
minSizeBytes: number
162162
/**

0 commit comments

Comments
 (0)