@scaleway/sdk 2.56.0 → 2.57.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.
- package/dist/api/audit_trail/index.gen.cjs +4 -0
- package/dist/api/audit_trail/index.gen.d.ts +5 -0
- package/dist/api/audit_trail/index.gen.js +4 -0
- package/dist/api/audit_trail/v1alpha1/api.gen.cjs +59 -0
- package/dist/api/audit_trail/v1alpha1/api.gen.d.ts +30 -0
- package/dist/api/audit_trail/v1alpha1/api.gen.js +59 -0
- package/dist/api/audit_trail/v1alpha1/index.gen.cjs +6 -0
- package/dist/api/audit_trail/v1alpha1/index.gen.d.ts +3 -0
- package/dist/api/audit_trail/v1alpha1/index.gen.js +6 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.cjs +155 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.d.ts +5 -0
- package/dist/api/audit_trail/v1alpha1/marshalling.gen.js +155 -0
- package/dist/api/audit_trail/v1alpha1/types.gen.d.ts +142 -0
- package/dist/api/audit_trail/v1alpha1/validation-rules.gen.cjs +19 -0
- package/dist/api/audit_trail/v1alpha1/validation-rules.gen.d.ts +16 -0
- package/dist/api/audit_trail/v1alpha1/validation-rules.gen.js +19 -0
- package/dist/api/billing/v2beta1/types.gen.d.ts +1 -1
- package/dist/api/edge_services/v1alpha1/types.gen.d.ts +5 -1
- package/dist/api/index.gen.d.ts +2 -1
- package/dist/api/instance/v1/api.gen.cjs +11 -0
- package/dist/api/instance/v1/api.gen.d.ts +2 -1
- package/dist/api/instance/v1/api.gen.js +12 -1
- package/dist/api/instance/v1/index.gen.d.ts +1 -1
- package/dist/api/instance/v1/marshalling.gen.cjs +5 -1
- package/dist/api/instance/v1/marshalling.gen.d.ts +2 -1
- package/dist/api/instance/v1/marshalling.gen.js +5 -1
- package/dist/api/instance/v1/types.gen.d.ts +10 -5
- package/dist/api/ipam/v1/types.gen.d.ts +1 -1
- package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +6 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.d.ts +6 -0
- package/dist/api/jobs/v1alpha1/validation-rules.gen.js +6 -0
- package/dist/api/rdb/v1/types.gen.d.ts +15 -3
- package/dist/index.cjs +46 -44
- package/dist/index.js +46 -44
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const api = require("../../../scw/api.cjs");
|
|
4
|
+
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
|
+
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
7
|
+
class API extends api.API {
|
|
8
|
+
/** Lists the available regions of the API. */
|
|
9
|
+
static LOCALITIES = ["fr-par", "nl-ams"];
|
|
10
|
+
/**
|
|
11
|
+
* List events. Retrieve the list of Audit Trail events for a Scaleway
|
|
12
|
+
* Organization and/or Project. You must specify the `organization_id` and
|
|
13
|
+
* optionally, the `project_id`.
|
|
14
|
+
*
|
|
15
|
+
* @param request - The request {@link ListEventsRequest}
|
|
16
|
+
* @returns A Promise of ListEventsResponse
|
|
17
|
+
*/
|
|
18
|
+
listEvents = (request = {}) => this.client.fetch(
|
|
19
|
+
{
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: `/audit-trail/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/events`,
|
|
22
|
+
urlParams: marshalling.urlParams(
|
|
23
|
+
["method_name", request.methodName],
|
|
24
|
+
["order_by", request.orderBy],
|
|
25
|
+
[
|
|
26
|
+
"organization_id",
|
|
27
|
+
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"page_size",
|
|
31
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
32
|
+
],
|
|
33
|
+
["page_token", request.pageToken],
|
|
34
|
+
["product_name", request.productName],
|
|
35
|
+
["project_id", request.projectId],
|
|
36
|
+
["recorded_after", request.recordedAfter],
|
|
37
|
+
["recorded_before", request.recordedBefore],
|
|
38
|
+
["resource_type", request.resourceType],
|
|
39
|
+
["status", request.status]
|
|
40
|
+
)
|
|
41
|
+
},
|
|
42
|
+
marshalling_gen.unmarshalListEventsResponse
|
|
43
|
+
);
|
|
44
|
+
/**
|
|
45
|
+
* Retrieve the list of Scaleway resources for which you have Audit Trail
|
|
46
|
+
* events.
|
|
47
|
+
*
|
|
48
|
+
* @param request - The request {@link ListProductsRequest}
|
|
49
|
+
* @returns A Promise of ListProductsResponse
|
|
50
|
+
*/
|
|
51
|
+
listProducts = (request = {}) => this.client.fetch(
|
|
52
|
+
{
|
|
53
|
+
method: "GET",
|
|
54
|
+
path: `/audit-trail/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/products`
|
|
55
|
+
},
|
|
56
|
+
marshalling_gen.unmarshalListProductsResponse
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
exports.API = API;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { API as ParentAPI } from '../../../bridge';
|
|
2
|
+
import type { Region } from '../../../bridge';
|
|
3
|
+
import type { ListEventsRequest, ListEventsResponse, ListProductsRequest, ListProductsResponse } from './types.gen';
|
|
4
|
+
/**
|
|
5
|
+
* Audit Trail API.
|
|
6
|
+
*
|
|
7
|
+
* This API allows you to ensure accountability and security by recording events
|
|
8
|
+
* and changes performed within your Scaleway Organization.
|
|
9
|
+
*/
|
|
10
|
+
export declare class API extends ParentAPI {
|
|
11
|
+
/** Lists the available regions of the API. */
|
|
12
|
+
static readonly LOCALITIES: Region[];
|
|
13
|
+
/**
|
|
14
|
+
* List events. Retrieve the list of Audit Trail events for a Scaleway
|
|
15
|
+
* Organization and/or Project. You must specify the `organization_id` and
|
|
16
|
+
* optionally, the `project_id`.
|
|
17
|
+
*
|
|
18
|
+
* @param request - The request {@link ListEventsRequest}
|
|
19
|
+
* @returns A Promise of ListEventsResponse
|
|
20
|
+
*/
|
|
21
|
+
listEvents: (request?: Readonly<ListEventsRequest>) => Promise<ListEventsResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve the list of Scaleway resources for which you have Audit Trail
|
|
24
|
+
* events.
|
|
25
|
+
*
|
|
26
|
+
* @param request - The request {@link ListProductsRequest}
|
|
27
|
+
* @returns A Promise of ListProductsResponse
|
|
28
|
+
*/
|
|
29
|
+
listProducts: (request?: Readonly<ListProductsRequest>) => Promise<ListProductsResponse>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { API as API$1 } from "../../../scw/api.js";
|
|
2
|
+
import { validatePathParam, urlParams } from "../../../helpers/marshalling.js";
|
|
3
|
+
import "../../../vendor/base64/index.js";
|
|
4
|
+
import { unmarshalListEventsResponse, unmarshalListProductsResponse } from "./marshalling.gen.js";
|
|
5
|
+
class API extends API$1 {
|
|
6
|
+
/** Lists the available regions of the API. */
|
|
7
|
+
static LOCALITIES = ["fr-par", "nl-ams"];
|
|
8
|
+
/**
|
|
9
|
+
* List events. Retrieve the list of Audit Trail events for a Scaleway
|
|
10
|
+
* Organization and/or Project. You must specify the `organization_id` and
|
|
11
|
+
* optionally, the `project_id`.
|
|
12
|
+
*
|
|
13
|
+
* @param request - The request {@link ListEventsRequest}
|
|
14
|
+
* @returns A Promise of ListEventsResponse
|
|
15
|
+
*/
|
|
16
|
+
listEvents = (request = {}) => this.client.fetch(
|
|
17
|
+
{
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/events`,
|
|
20
|
+
urlParams: urlParams(
|
|
21
|
+
["method_name", request.methodName],
|
|
22
|
+
["order_by", request.orderBy],
|
|
23
|
+
[
|
|
24
|
+
"organization_id",
|
|
25
|
+
request.organizationId ?? this.client.settings.defaultOrganizationId
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"page_size",
|
|
29
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
30
|
+
],
|
|
31
|
+
["page_token", request.pageToken],
|
|
32
|
+
["product_name", request.productName],
|
|
33
|
+
["project_id", request.projectId],
|
|
34
|
+
["recorded_after", request.recordedAfter],
|
|
35
|
+
["recorded_before", request.recordedBefore],
|
|
36
|
+
["resource_type", request.resourceType],
|
|
37
|
+
["status", request.status]
|
|
38
|
+
)
|
|
39
|
+
},
|
|
40
|
+
unmarshalListEventsResponse
|
|
41
|
+
);
|
|
42
|
+
/**
|
|
43
|
+
* Retrieve the list of Scaleway resources for which you have Audit Trail
|
|
44
|
+
* events.
|
|
45
|
+
*
|
|
46
|
+
* @param request - The request {@link ListProductsRequest}
|
|
47
|
+
* @returns A Promise of ListProductsResponse
|
|
48
|
+
*/
|
|
49
|
+
listProducts = (request = {}) => this.client.fetch(
|
|
50
|
+
{
|
|
51
|
+
method: "GET",
|
|
52
|
+
path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/products`
|
|
53
|
+
},
|
|
54
|
+
unmarshalListProductsResponse
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
API
|
|
59
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const api_gen = require("./api.gen.cjs");
|
|
4
|
+
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
5
|
+
exports.API = api_gen.API;
|
|
6
|
+
exports.ValidationRules = validationRules_gen;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { API } from './api.gen';
|
|
2
|
+
export type { Event, EventPrincipal, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListProductsRequest, ListProductsResponse, Product, Resource, ResourceType, SecretManagerSecretInfo, SecretManagerSecretVersionInfo, } from './types.gen';
|
|
3
|
+
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const json = require("../../../helpers/json.cjs");
|
|
4
|
+
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
5
|
+
require("../../../vendor/base64/index.cjs");
|
|
6
|
+
const unmarshalKubernetesACLInfo = (data) => {
|
|
7
|
+
if (!json.isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(
|
|
9
|
+
`Unmarshalling the type 'KubernetesACLInfo' failed as data isn't a dictionary.`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return {};
|
|
13
|
+
};
|
|
14
|
+
const unmarshalKubernetesClusterInfo = (data) => {
|
|
15
|
+
if (!json.isJSONObject(data)) {
|
|
16
|
+
throw new TypeError(
|
|
17
|
+
`Unmarshalling the type 'KubernetesClusterInfo' failed as data isn't a dictionary.`
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
return {};
|
|
21
|
+
};
|
|
22
|
+
const unmarshalKubernetesNodeInfo = (data) => {
|
|
23
|
+
if (!json.isJSONObject(data)) {
|
|
24
|
+
throw new TypeError(
|
|
25
|
+
`Unmarshalling the type 'KubernetesNodeInfo' failed as data isn't a dictionary.`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
id: data.id,
|
|
30
|
+
name: data.name
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const unmarshalKubernetesPoolInfo = (data) => {
|
|
34
|
+
if (!json.isJSONObject(data)) {
|
|
35
|
+
throw new TypeError(
|
|
36
|
+
`Unmarshalling the type 'KubernetesPoolInfo' failed as data isn't a dictionary.`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
id: data.id,
|
|
41
|
+
name: data.name
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const unmarshalSecretManagerSecretInfo = (data) => {
|
|
45
|
+
if (!json.isJSONObject(data)) {
|
|
46
|
+
throw new TypeError(
|
|
47
|
+
`Unmarshalling the type 'SecretManagerSecretInfo' failed as data isn't a dictionary.`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
path: data.path
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const unmarshalSecretManagerSecretVersionInfo = (data) => {
|
|
55
|
+
if (!json.isJSONObject(data)) {
|
|
56
|
+
throw new TypeError(
|
|
57
|
+
`Unmarshalling the type 'SecretManagerSecretVersionInfo' failed as data isn't a dictionary.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
revision: data.revision
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const unmarshalEventPrincipal = (data) => {
|
|
65
|
+
if (!json.isJSONObject(data)) {
|
|
66
|
+
throw new TypeError(
|
|
67
|
+
`Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
id: data.id
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const unmarshalResource = (data) => {
|
|
75
|
+
if (!json.isJSONObject(data)) {
|
|
76
|
+
throw new TypeError(
|
|
77
|
+
`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
82
|
+
deletedAt: marshalling.unmarshalDate(data.deleted_at),
|
|
83
|
+
id: data.id,
|
|
84
|
+
kubeAclInfo: data.kube_acl_info ? unmarshalKubernetesACLInfo(data.kube_acl_info) : void 0,
|
|
85
|
+
kubeClusterInfo: data.kube_cluster_info ? unmarshalKubernetesClusterInfo(data.kube_cluster_info) : void 0,
|
|
86
|
+
kubeNodeInfo: data.kube_node_info ? unmarshalKubernetesNodeInfo(data.kube_node_info) : void 0,
|
|
87
|
+
kubePoolInfo: data.kube_pool_info ? unmarshalKubernetesPoolInfo(data.kube_pool_info) : void 0,
|
|
88
|
+
name: data.name,
|
|
89
|
+
secmSecretInfo: data.secm_secret_info ? unmarshalSecretManagerSecretInfo(data.secm_secret_info) : void 0,
|
|
90
|
+
secmSecretVersionInfo: data.secm_secret_version_info ? unmarshalSecretManagerSecretVersionInfo(data.secm_secret_version_info) : void 0,
|
|
91
|
+
type: data.type,
|
|
92
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const unmarshalEvent = (data) => {
|
|
96
|
+
if (!json.isJSONObject(data)) {
|
|
97
|
+
throw new TypeError(
|
|
98
|
+
`Unmarshalling the type 'Event' failed as data isn't a dictionary.`
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
id: data.id,
|
|
103
|
+
locality: data.locality,
|
|
104
|
+
methodName: data.method_name,
|
|
105
|
+
organizationId: data.organization_id,
|
|
106
|
+
principal: data.principal ? unmarshalEventPrincipal(data.principal) : void 0,
|
|
107
|
+
productName: data.product_name,
|
|
108
|
+
projectId: data.project_id,
|
|
109
|
+
recordedAt: marshalling.unmarshalDate(data.recorded_at),
|
|
110
|
+
requestBody: data.request_body,
|
|
111
|
+
requestId: data.request_id,
|
|
112
|
+
resource: data.resource ? unmarshalResource(data.resource) : void 0,
|
|
113
|
+
serviceName: data.service_name,
|
|
114
|
+
sourceIp: data.source_ip,
|
|
115
|
+
statusCode: data.status_code,
|
|
116
|
+
userAgent: data.user_agent
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const unmarshalListEventsResponse = (data) => {
|
|
120
|
+
if (!json.isJSONObject(data)) {
|
|
121
|
+
throw new TypeError(
|
|
122
|
+
`Unmarshalling the type 'ListEventsResponse' failed as data isn't a dictionary.`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
events: marshalling.unmarshalArrayOfObject(data.events, unmarshalEvent),
|
|
127
|
+
nextPageToken: data.next_page_token
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const unmarshalProduct = (data) => {
|
|
131
|
+
if (!json.isJSONObject(data)) {
|
|
132
|
+
throw new TypeError(
|
|
133
|
+
`Unmarshalling the type 'Product' failed as data isn't a dictionary.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
name: data.name,
|
|
138
|
+
title: data.title
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
const unmarshalListProductsResponse = (data) => {
|
|
142
|
+
if (!json.isJSONObject(data)) {
|
|
143
|
+
throw new TypeError(
|
|
144
|
+
`Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
products: marshalling.unmarshalArrayOfObject(data.products, unmarshalProduct),
|
|
149
|
+
totalCount: data.total_count
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
exports.unmarshalEvent = unmarshalEvent;
|
|
153
|
+
exports.unmarshalListEventsResponse = unmarshalListEventsResponse;
|
|
154
|
+
exports.unmarshalListProductsResponse = unmarshalListProductsResponse;
|
|
155
|
+
exports.unmarshalResource = unmarshalResource;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Event, ListEventsResponse, ListProductsResponse, Resource } from './types.gen';
|
|
2
|
+
export declare const unmarshalResource: (data: unknown) => Resource;
|
|
3
|
+
export declare const unmarshalEvent: (data: unknown) => Event;
|
|
4
|
+
export declare const unmarshalListEventsResponse: (data: unknown) => ListEventsResponse;
|
|
5
|
+
export declare const unmarshalListProductsResponse: (data: unknown) => ListProductsResponse;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { isJSONObject } from "../../../helpers/json.js";
|
|
2
|
+
import { unmarshalArrayOfObject, unmarshalDate } from "../../../helpers/marshalling.js";
|
|
3
|
+
import "../../../vendor/base64/index.js";
|
|
4
|
+
const unmarshalKubernetesACLInfo = (data) => {
|
|
5
|
+
if (!isJSONObject(data)) {
|
|
6
|
+
throw new TypeError(
|
|
7
|
+
`Unmarshalling the type 'KubernetesACLInfo' failed as data isn't a dictionary.`
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
return {};
|
|
11
|
+
};
|
|
12
|
+
const unmarshalKubernetesClusterInfo = (data) => {
|
|
13
|
+
if (!isJSONObject(data)) {
|
|
14
|
+
throw new TypeError(
|
|
15
|
+
`Unmarshalling the type 'KubernetesClusterInfo' failed as data isn't a dictionary.`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return {};
|
|
19
|
+
};
|
|
20
|
+
const unmarshalKubernetesNodeInfo = (data) => {
|
|
21
|
+
if (!isJSONObject(data)) {
|
|
22
|
+
throw new TypeError(
|
|
23
|
+
`Unmarshalling the type 'KubernetesNodeInfo' failed as data isn't a dictionary.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
id: data.id,
|
|
28
|
+
name: data.name
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const unmarshalKubernetesPoolInfo = (data) => {
|
|
32
|
+
if (!isJSONObject(data)) {
|
|
33
|
+
throw new TypeError(
|
|
34
|
+
`Unmarshalling the type 'KubernetesPoolInfo' failed as data isn't a dictionary.`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
id: data.id,
|
|
39
|
+
name: data.name
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const unmarshalSecretManagerSecretInfo = (data) => {
|
|
43
|
+
if (!isJSONObject(data)) {
|
|
44
|
+
throw new TypeError(
|
|
45
|
+
`Unmarshalling the type 'SecretManagerSecretInfo' failed as data isn't a dictionary.`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
path: data.path
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const unmarshalSecretManagerSecretVersionInfo = (data) => {
|
|
53
|
+
if (!isJSONObject(data)) {
|
|
54
|
+
throw new TypeError(
|
|
55
|
+
`Unmarshalling the type 'SecretManagerSecretVersionInfo' failed as data isn't a dictionary.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
revision: data.revision
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const unmarshalEventPrincipal = (data) => {
|
|
63
|
+
if (!isJSONObject(data)) {
|
|
64
|
+
throw new TypeError(
|
|
65
|
+
`Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
id: data.id
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
const unmarshalResource = (data) => {
|
|
73
|
+
if (!isJSONObject(data)) {
|
|
74
|
+
throw new TypeError(
|
|
75
|
+
`Unmarshalling the type 'Resource' failed as data isn't a dictionary.`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
createdAt: unmarshalDate(data.created_at),
|
|
80
|
+
deletedAt: unmarshalDate(data.deleted_at),
|
|
81
|
+
id: data.id,
|
|
82
|
+
kubeAclInfo: data.kube_acl_info ? unmarshalKubernetesACLInfo(data.kube_acl_info) : void 0,
|
|
83
|
+
kubeClusterInfo: data.kube_cluster_info ? unmarshalKubernetesClusterInfo(data.kube_cluster_info) : void 0,
|
|
84
|
+
kubeNodeInfo: data.kube_node_info ? unmarshalKubernetesNodeInfo(data.kube_node_info) : void 0,
|
|
85
|
+
kubePoolInfo: data.kube_pool_info ? unmarshalKubernetesPoolInfo(data.kube_pool_info) : void 0,
|
|
86
|
+
name: data.name,
|
|
87
|
+
secmSecretInfo: data.secm_secret_info ? unmarshalSecretManagerSecretInfo(data.secm_secret_info) : void 0,
|
|
88
|
+
secmSecretVersionInfo: data.secm_secret_version_info ? unmarshalSecretManagerSecretVersionInfo(data.secm_secret_version_info) : void 0,
|
|
89
|
+
type: data.type,
|
|
90
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
const unmarshalEvent = (data) => {
|
|
94
|
+
if (!isJSONObject(data)) {
|
|
95
|
+
throw new TypeError(
|
|
96
|
+
`Unmarshalling the type 'Event' failed as data isn't a dictionary.`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
id: data.id,
|
|
101
|
+
locality: data.locality,
|
|
102
|
+
methodName: data.method_name,
|
|
103
|
+
organizationId: data.organization_id,
|
|
104
|
+
principal: data.principal ? unmarshalEventPrincipal(data.principal) : void 0,
|
|
105
|
+
productName: data.product_name,
|
|
106
|
+
projectId: data.project_id,
|
|
107
|
+
recordedAt: unmarshalDate(data.recorded_at),
|
|
108
|
+
requestBody: data.request_body,
|
|
109
|
+
requestId: data.request_id,
|
|
110
|
+
resource: data.resource ? unmarshalResource(data.resource) : void 0,
|
|
111
|
+
serviceName: data.service_name,
|
|
112
|
+
sourceIp: data.source_ip,
|
|
113
|
+
statusCode: data.status_code,
|
|
114
|
+
userAgent: data.user_agent
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const unmarshalListEventsResponse = (data) => {
|
|
118
|
+
if (!isJSONObject(data)) {
|
|
119
|
+
throw new TypeError(
|
|
120
|
+
`Unmarshalling the type 'ListEventsResponse' failed as data isn't a dictionary.`
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
events: unmarshalArrayOfObject(data.events, unmarshalEvent),
|
|
125
|
+
nextPageToken: data.next_page_token
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
const unmarshalProduct = (data) => {
|
|
129
|
+
if (!isJSONObject(data)) {
|
|
130
|
+
throw new TypeError(
|
|
131
|
+
`Unmarshalling the type 'Product' failed as data isn't a dictionary.`
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
name: data.name,
|
|
136
|
+
title: data.title
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
const unmarshalListProductsResponse = (data) => {
|
|
140
|
+
if (!isJSONObject(data)) {
|
|
141
|
+
throw new TypeError(
|
|
142
|
+
`Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
products: unmarshalArrayOfObject(data.products, unmarshalProduct),
|
|
147
|
+
totalCount: data.total_count
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
export {
|
|
151
|
+
unmarshalEvent,
|
|
152
|
+
unmarshalListEventsResponse,
|
|
153
|
+
unmarshalListProductsResponse,
|
|
154
|
+
unmarshalResource
|
|
155
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { Region } from '../../../bridge';
|
|
2
|
+
export type ListEventsRequestOrderBy = 'recorded_at_desc' | 'recorded_at_asc';
|
|
3
|
+
export type ResourceType = 'unknown_type' | 'secm_secret' | 'secm_secret_version' | 'kube_cluster' | 'kube_pool' | 'kube_node' | 'kube_acl';
|
|
4
|
+
export interface KubernetesACLInfo {
|
|
5
|
+
}
|
|
6
|
+
export interface KubernetesClusterInfo {
|
|
7
|
+
}
|
|
8
|
+
export interface KubernetesNodeInfo {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export interface KubernetesPoolInfo {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SecretManagerSecretInfo {
|
|
17
|
+
path: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SecretManagerSecretVersionInfo {
|
|
20
|
+
revision: number;
|
|
21
|
+
}
|
|
22
|
+
export interface EventPrincipal {
|
|
23
|
+
id: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Resource {
|
|
26
|
+
id: string;
|
|
27
|
+
type: ResourceType;
|
|
28
|
+
createdAt?: Date;
|
|
29
|
+
updatedAt?: Date;
|
|
30
|
+
deletedAt?: Date;
|
|
31
|
+
name?: string;
|
|
32
|
+
/**
|
|
33
|
+
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
|
|
34
|
+
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
|
|
35
|
+
* set.
|
|
36
|
+
*/
|
|
37
|
+
secmSecretInfo?: SecretManagerSecretInfo;
|
|
38
|
+
/**
|
|
39
|
+
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
|
|
40
|
+
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
|
|
41
|
+
* set.
|
|
42
|
+
*/
|
|
43
|
+
secmSecretVersionInfo?: SecretManagerSecretVersionInfo;
|
|
44
|
+
/**
|
|
45
|
+
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
|
|
46
|
+
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
|
|
47
|
+
* set.
|
|
48
|
+
*/
|
|
49
|
+
kubeClusterInfo?: KubernetesClusterInfo;
|
|
50
|
+
/**
|
|
51
|
+
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
|
|
52
|
+
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
|
|
53
|
+
* set.
|
|
54
|
+
*/
|
|
55
|
+
kubePoolInfo?: KubernetesPoolInfo;
|
|
56
|
+
/**
|
|
57
|
+
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
|
|
58
|
+
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
|
|
59
|
+
* set.
|
|
60
|
+
*/
|
|
61
|
+
kubeNodeInfo?: KubernetesNodeInfo;
|
|
62
|
+
/**
|
|
63
|
+
* One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo',
|
|
64
|
+
* 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo' could be
|
|
65
|
+
* set.
|
|
66
|
+
*/
|
|
67
|
+
kubeAclInfo?: KubernetesACLInfo;
|
|
68
|
+
}
|
|
69
|
+
export interface Event {
|
|
70
|
+
id: string;
|
|
71
|
+
recordedAt?: Date;
|
|
72
|
+
locality: string;
|
|
73
|
+
principal?: EventPrincipal;
|
|
74
|
+
organizationId: string;
|
|
75
|
+
projectId?: string;
|
|
76
|
+
sourceIp: string;
|
|
77
|
+
userAgent?: string;
|
|
78
|
+
productName: string;
|
|
79
|
+
serviceName: string;
|
|
80
|
+
methodName: string;
|
|
81
|
+
resource?: Resource;
|
|
82
|
+
requestId: string;
|
|
83
|
+
requestBody?: Record<string, unknown>;
|
|
84
|
+
statusCode: number;
|
|
85
|
+
}
|
|
86
|
+
export interface Product {
|
|
87
|
+
title: string;
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
export type ListEventsRequest = {
|
|
91
|
+
/**
|
|
92
|
+
* Region to target. If none is passed will use default region from the
|
|
93
|
+
* config.
|
|
94
|
+
*/
|
|
95
|
+
region?: Region;
|
|
96
|
+
/** (Optional) ID of the Project containing the Audit Trail events. */
|
|
97
|
+
projectId?: string;
|
|
98
|
+
/** ID of the Organization containing the Audit Trail events. */
|
|
99
|
+
organizationId?: string;
|
|
100
|
+
/** (Optional) Returns a paginated list of Scaleway resources' features. */
|
|
101
|
+
resourceType?: ResourceType;
|
|
102
|
+
/** (Optional) Name of the method or the API call performed. */
|
|
103
|
+
methodName?: string;
|
|
104
|
+
/**
|
|
105
|
+
* (Optional) HTTP status code of the request. Returns either `200` if the
|
|
106
|
+
* request was successful or `403` if the permission was denied.
|
|
107
|
+
*/
|
|
108
|
+
status?: number;
|
|
109
|
+
/**
|
|
110
|
+
* (Optional) The `recorded_after` parameter defines the earliest timestamp
|
|
111
|
+
* from which Audit Trail events are retrieved. Returns `one hour ago` by
|
|
112
|
+
* default.
|
|
113
|
+
*/
|
|
114
|
+
recordedAfter?: Date;
|
|
115
|
+
/**
|
|
116
|
+
* (Optional) The `recorded_before` parameter defines the latest timestamp up
|
|
117
|
+
* to which Audit Trail events are retrieved. Returns `now` by default.
|
|
118
|
+
*/
|
|
119
|
+
recordedBefore?: Date;
|
|
120
|
+
orderBy?: ListEventsRequestOrderBy;
|
|
121
|
+
pageSize?: number;
|
|
122
|
+
pageToken?: string;
|
|
123
|
+
/** (Optional) Name of the Scaleway resource in a hyphenated format. */
|
|
124
|
+
productName?: string;
|
|
125
|
+
};
|
|
126
|
+
export interface ListEventsResponse {
|
|
127
|
+
/** Single page of events matching the requested criteria. */
|
|
128
|
+
events: Event[];
|
|
129
|
+
/** Page token to use in following calls to keep listing. */
|
|
130
|
+
nextPageToken?: string;
|
|
131
|
+
}
|
|
132
|
+
export type ListProductsRequest = {
|
|
133
|
+
/**
|
|
134
|
+
* Region to target. If none is passed will use default region from the
|
|
135
|
+
* config.
|
|
136
|
+
*/
|
|
137
|
+
region?: Region;
|
|
138
|
+
};
|
|
139
|
+
export interface ListProductsResponse {
|
|
140
|
+
products: Product[];
|
|
141
|
+
totalCount: number;
|
|
142
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ListEventsRequest = {
|
|
4
|
+
methodName: {
|
|
5
|
+
pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/
|
|
6
|
+
},
|
|
7
|
+
pageSize: {
|
|
8
|
+
greaterThanOrEqual: 1,
|
|
9
|
+
lessThanOrEqual: 1e3
|
|
10
|
+
},
|
|
11
|
+
productName: {
|
|
12
|
+
pattern: /^[a-z]+(-[a-z]+)*$/
|
|
13
|
+
},
|
|
14
|
+
status: {
|
|
15
|
+
greaterThanOrEqual: 200,
|
|
16
|
+
lessThan: 600
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.ListEventsRequest = ListEventsRequest;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const ListEventsRequest: {
|
|
2
|
+
methodName: {
|
|
3
|
+
pattern: RegExp;
|
|
4
|
+
};
|
|
5
|
+
pageSize: {
|
|
6
|
+
greaterThanOrEqual: number;
|
|
7
|
+
lessThanOrEqual: number;
|
|
8
|
+
};
|
|
9
|
+
productName: {
|
|
10
|
+
pattern: RegExp;
|
|
11
|
+
};
|
|
12
|
+
status: {
|
|
13
|
+
greaterThanOrEqual: number;
|
|
14
|
+
lessThan: number;
|
|
15
|
+
};
|
|
16
|
+
};
|