@scaleway/sdk-audit-trail 1.4.0 → 1.5.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.
@@ -2,4 +2,4 @@
2
2
  * This file is automatically generated
3
3
  * PLEASE DO NOT EDIT HERE
4
4
  */
5
- export * as AuditTrailv1alpha1 from './v1alpha1/index.gen';
5
+ export * as AuditTrailv1alpha1 from './v1alpha1/index.gen.js';
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const sdkClient = require("@scaleway/sdk-client");
4
4
  const marshalling_gen = require("./marshalling.gen.cjs");
5
+ const jsonContentHeaders = {
6
+ "Content-Type": "application/json; charset=utf-8"
7
+ };
5
8
  class API extends sdkClient.API {
6
9
  /**
7
10
  * Locality of this API.
@@ -32,6 +35,7 @@ class API extends sdkClient.API {
32
35
  request.pageSize ?? this.client.settings.defaultPageSize
33
36
  ],
34
37
  ["page_token", request.pageToken],
38
+ ["principal_id", request.principalId],
35
39
  ["product_name", request.productName],
36
40
  ["project_id", request.projectId],
37
41
  ["recorded_after", request.recordedAfter],
@@ -39,11 +43,62 @@ class API extends sdkClient.API {
39
43
  ["resource_id", request.resourceId],
40
44
  ["resource_type", request.resourceType],
41
45
  ["service_name", request.serviceName],
46
+ ["source_ip", request.sourceIp],
42
47
  ["status", request.status]
43
48
  )
44
49
  },
45
50
  marshalling_gen.unmarshalListEventsResponse
46
51
  );
52
+ /**
53
+ * List authentication events. Retrieve the list of Audit Trail authentication events for a Scaleway Organization. You must specify the `organization_id`.
54
+ *
55
+ * @param request - The request {@link ListAuthenticationEventsRequest}
56
+ * @returns A Promise of ListAuthenticationEventsResponse
57
+ */
58
+ listAuthenticationEvents = (request = {}) => this.client.fetch(
59
+ {
60
+ method: "GET",
61
+ path: `/audit-trail/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/authentication-events`,
62
+ urlParams: sdkClient.urlParams(
63
+ ["order_by", request.orderBy],
64
+ [
65
+ "organization_id",
66
+ request.organizationId ?? this.client.settings.defaultOrganizationId
67
+ ],
68
+ [
69
+ "page_size",
70
+ request.pageSize ?? this.client.settings.defaultPageSize
71
+ ],
72
+ ["page_token", request.pageToken],
73
+ ["recorded_after", request.recordedAfter],
74
+ ["recorded_before", request.recordedBefore]
75
+ )
76
+ },
77
+ marshalling_gen.unmarshalListAuthenticationEventsResponse
78
+ );
79
+ listCombinedEvents = (request = {}) => this.client.fetch(
80
+ {
81
+ method: "GET",
82
+ path: `/audit-trail/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/combined-events`,
83
+ urlParams: sdkClient.urlParams(
84
+ ["order_by", request.orderBy],
85
+ [
86
+ "organization_id",
87
+ request.organizationId ?? this.client.settings.defaultOrganizationId
88
+ ],
89
+ [
90
+ "page_size",
91
+ request.pageSize ?? this.client.settings.defaultPageSize
92
+ ],
93
+ ["page_token", request.pageToken],
94
+ ["project_id", request.projectId],
95
+ ["recorded_after", request.recordedAfter],
96
+ ["recorded_before", request.recordedBefore],
97
+ ["resource_type", request.resourceType]
98
+ )
99
+ },
100
+ marshalling_gen.unmarshalListCombinedEventsResponse
101
+ );
47
102
  /**
48
103
  * Retrieve the list of Scaleway resources for which you have Audit Trail events.
49
104
  *
@@ -61,5 +116,53 @@ class API extends sdkClient.API {
61
116
  },
62
117
  marshalling_gen.unmarshalListProductsResponse
63
118
  );
119
+ /**
120
+ * Create an export job. Create an export job for a specified organization. This allows you to export audit trail events to a destination, such as an S3 bucket. The request requires the organization ID, a name for the export, and a destination configuration.
121
+ *
122
+ * @param request - The request {@link CreateExportJobRequest}
123
+ * @returns A Promise of ExportJob
124
+ */
125
+ createExportJob = (request) => this.client.fetch(
126
+ {
127
+ body: JSON.stringify(
128
+ marshalling_gen.marshalCreateExportJobRequest(request, this.client.settings)
129
+ ),
130
+ headers: jsonContentHeaders,
131
+ method: "POST",
132
+ path: `/audit-trail/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/export-jobs`
133
+ },
134
+ marshalling_gen.unmarshalExportJob
135
+ );
136
+ /**
137
+ * Delete an export job. Deletes an export job for a specified id.
138
+ *
139
+ * @param request - The request {@link DeleteExportJobRequest}
140
+ */
141
+ deleteExportJob = (request) => this.client.fetch({
142
+ method: "DELETE",
143
+ path: `/audit-trail/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/export-jobs/${sdkClient.validatePathParam("exportJobId", request.exportJobId)}`
144
+ });
145
+ pageOfListExportJobs = (request = {}) => this.client.fetch(
146
+ {
147
+ method: "GET",
148
+ path: `/audit-trail/v1alpha1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/export-jobs`,
149
+ urlParams: sdkClient.urlParams(
150
+ ["name", request.name],
151
+ ["order_by", request.orderBy],
152
+ [
153
+ "organization_id",
154
+ request.organizationId ?? this.client.settings.defaultOrganizationId
155
+ ],
156
+ ["page", request.page],
157
+ [
158
+ "page_size",
159
+ request.pageSize ?? this.client.settings.defaultPageSize
160
+ ],
161
+ ["tags", request.tags]
162
+ )
163
+ },
164
+ marshalling_gen.unmarshalListExportJobsResponse
165
+ );
166
+ listExportJobs = (request = {}) => sdkClient.enrichForPagination("exportJobs", this.pageOfListExportJobs, request);
64
167
  }
65
168
  exports.API = API;
@@ -1,6 +1,6 @@
1
- import type { ApiLocality } from '@scaleway/sdk-client';
2
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
3
- import type { ListEventsRequest, ListEventsResponse, ListProductsRequest, ListProductsResponse } from './types.gen';
2
+ import type { ApiLocality } from '@scaleway/sdk-client';
3
+ import type { CreateExportJobRequest, DeleteExportJobRequest, ExportJob, ListAuthenticationEventsRequest, ListAuthenticationEventsResponse, ListCombinedEventsRequest, ListCombinedEventsResponse, ListEventsRequest, ListEventsResponse, ListExportJobsRequest, ListExportJobsResponse, ListProductsRequest, ListProductsResponse } from './types.gen.js';
4
4
  /**
5
5
  * Audit Trail API.
6
6
 
@@ -19,6 +19,14 @@ export declare class API extends ParentAPI {
19
19
  * @returns A Promise of ListEventsResponse
20
20
  */
21
21
  listEvents: (request?: Readonly<ListEventsRequest>) => Promise<ListEventsResponse>;
22
+ /**
23
+ * List authentication events. Retrieve the list of Audit Trail authentication events for a Scaleway Organization. You must specify the `organization_id`.
24
+ *
25
+ * @param request - The request {@link ListAuthenticationEventsRequest}
26
+ * @returns A Promise of ListAuthenticationEventsResponse
27
+ */
28
+ listAuthenticationEvents: (request?: Readonly<ListAuthenticationEventsRequest>) => Promise<ListAuthenticationEventsResponse>;
29
+ listCombinedEvents: (request?: Readonly<ListCombinedEventsRequest>) => Promise<ListCombinedEventsResponse>;
22
30
  /**
23
31
  * Retrieve the list of Scaleway resources for which you have Audit Trail events.
24
32
  *
@@ -26,4 +34,22 @@ export declare class API extends ParentAPI {
26
34
  * @returns A Promise of ListProductsResponse
27
35
  */
28
36
  listProducts: (request?: Readonly<ListProductsRequest>) => Promise<ListProductsResponse>;
37
+ /**
38
+ * Create an export job. Create an export job for a specified organization. This allows you to export audit trail events to a destination, such as an S3 bucket. The request requires the organization ID, a name for the export, and a destination configuration.
39
+ *
40
+ * @param request - The request {@link CreateExportJobRequest}
41
+ * @returns A Promise of ExportJob
42
+ */
43
+ createExportJob: (request: Readonly<CreateExportJobRequest>) => Promise<ExportJob>;
44
+ /**
45
+ * Delete an export job. Deletes an export job for a specified id.
46
+ *
47
+ * @param request - The request {@link DeleteExportJobRequest}
48
+ */
49
+ deleteExportJob: (request: Readonly<DeleteExportJobRequest>) => Promise<void>;
50
+ protected pageOfListExportJobs: (request?: Readonly<ListExportJobsRequest>) => Promise<ListExportJobsResponse>;
51
+ listExportJobs: (request?: Readonly<ListExportJobsRequest>) => Promise<ListExportJobsResponse> & {
52
+ all: () => Promise<ExportJob[]>;
53
+ [Symbol.asyncIterator]: () => AsyncGenerator<ExportJob[], void, void>;
54
+ };
29
55
  }
@@ -1,5 +1,8 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
2
- import { unmarshalListEventsResponse, unmarshalListProductsResponse } from "./marshalling.gen.js";
1
+ import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination } from "@scaleway/sdk-client";
2
+ import { unmarshalListEventsResponse, unmarshalListAuthenticationEventsResponse, unmarshalListCombinedEventsResponse, unmarshalListProductsResponse, marshalCreateExportJobRequest, unmarshalExportJob, unmarshalListExportJobsResponse } from "./marshalling.gen.js";
3
+ const jsonContentHeaders = {
4
+ "Content-Type": "application/json; charset=utf-8"
5
+ };
3
6
  class API extends API$1 {
4
7
  /**
5
8
  * Locality of this API.
@@ -30,6 +33,7 @@ class API extends API$1 {
30
33
  request.pageSize ?? this.client.settings.defaultPageSize
31
34
  ],
32
35
  ["page_token", request.pageToken],
36
+ ["principal_id", request.principalId],
33
37
  ["product_name", request.productName],
34
38
  ["project_id", request.projectId],
35
39
  ["recorded_after", request.recordedAfter],
@@ -37,11 +41,62 @@ class API extends API$1 {
37
41
  ["resource_id", request.resourceId],
38
42
  ["resource_type", request.resourceType],
39
43
  ["service_name", request.serviceName],
44
+ ["source_ip", request.sourceIp],
40
45
  ["status", request.status]
41
46
  )
42
47
  },
43
48
  unmarshalListEventsResponse
44
49
  );
50
+ /**
51
+ * List authentication events. Retrieve the list of Audit Trail authentication events for a Scaleway Organization. You must specify the `organization_id`.
52
+ *
53
+ * @param request - The request {@link ListAuthenticationEventsRequest}
54
+ * @returns A Promise of ListAuthenticationEventsResponse
55
+ */
56
+ listAuthenticationEvents = (request = {}) => this.client.fetch(
57
+ {
58
+ method: "GET",
59
+ path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/authentication-events`,
60
+ urlParams: urlParams(
61
+ ["order_by", request.orderBy],
62
+ [
63
+ "organization_id",
64
+ request.organizationId ?? this.client.settings.defaultOrganizationId
65
+ ],
66
+ [
67
+ "page_size",
68
+ request.pageSize ?? this.client.settings.defaultPageSize
69
+ ],
70
+ ["page_token", request.pageToken],
71
+ ["recorded_after", request.recordedAfter],
72
+ ["recorded_before", request.recordedBefore]
73
+ )
74
+ },
75
+ unmarshalListAuthenticationEventsResponse
76
+ );
77
+ listCombinedEvents = (request = {}) => this.client.fetch(
78
+ {
79
+ method: "GET",
80
+ path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/combined-events`,
81
+ urlParams: urlParams(
82
+ ["order_by", request.orderBy],
83
+ [
84
+ "organization_id",
85
+ request.organizationId ?? this.client.settings.defaultOrganizationId
86
+ ],
87
+ [
88
+ "page_size",
89
+ request.pageSize ?? this.client.settings.defaultPageSize
90
+ ],
91
+ ["page_token", request.pageToken],
92
+ ["project_id", request.projectId],
93
+ ["recorded_after", request.recordedAfter],
94
+ ["recorded_before", request.recordedBefore],
95
+ ["resource_type", request.resourceType]
96
+ )
97
+ },
98
+ unmarshalListCombinedEventsResponse
99
+ );
45
100
  /**
46
101
  * Retrieve the list of Scaleway resources for which you have Audit Trail events.
47
102
  *
@@ -59,6 +114,54 @@ class API extends API$1 {
59
114
  },
60
115
  unmarshalListProductsResponse
61
116
  );
117
+ /**
118
+ * Create an export job. Create an export job for a specified organization. This allows you to export audit trail events to a destination, such as an S3 bucket. The request requires the organization ID, a name for the export, and a destination configuration.
119
+ *
120
+ * @param request - The request {@link CreateExportJobRequest}
121
+ * @returns A Promise of ExportJob
122
+ */
123
+ createExportJob = (request) => this.client.fetch(
124
+ {
125
+ body: JSON.stringify(
126
+ marshalCreateExportJobRequest(request, this.client.settings)
127
+ ),
128
+ headers: jsonContentHeaders,
129
+ method: "POST",
130
+ path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/export-jobs`
131
+ },
132
+ unmarshalExportJob
133
+ );
134
+ /**
135
+ * Delete an export job. Deletes an export job for a specified id.
136
+ *
137
+ * @param request - The request {@link DeleteExportJobRequest}
138
+ */
139
+ deleteExportJob = (request) => this.client.fetch({
140
+ method: "DELETE",
141
+ path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/export-jobs/${validatePathParam("exportJobId", request.exportJobId)}`
142
+ });
143
+ pageOfListExportJobs = (request = {}) => this.client.fetch(
144
+ {
145
+ method: "GET",
146
+ path: `/audit-trail/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/export-jobs`,
147
+ urlParams: urlParams(
148
+ ["name", request.name],
149
+ ["order_by", request.orderBy],
150
+ [
151
+ "organization_id",
152
+ request.organizationId ?? this.client.settings.defaultOrganizationId
153
+ ],
154
+ ["page", request.page],
155
+ [
156
+ "page_size",
157
+ request.pageSize ?? this.client.settings.defaultPageSize
158
+ ],
159
+ ["tags", request.tags]
160
+ )
161
+ },
162
+ unmarshalListExportJobsResponse
163
+ );
164
+ listExportJobs = (request = {}) => enrichForPagination("exportJobs", this.pageOfListExportJobs, request);
62
165
  }
63
166
  export {
64
167
  API
@@ -4,8 +4,13 @@ const api_gen = require("./api.gen.cjs");
4
4
  const marshalling_gen = require("./marshalling.gen.cjs");
5
5
  const validationRules_gen = require("./validation-rules.gen.cjs");
6
6
  exports.API = api_gen.API;
7
+ exports.marshalCreateExportJobRequest = marshalling_gen.marshalCreateExportJobRequest;
7
8
  exports.unmarshalEvent = marshalling_gen.unmarshalEvent;
9
+ exports.unmarshalExportJob = marshalling_gen.unmarshalExportJob;
10
+ exports.unmarshalListAuthenticationEventsResponse = marshalling_gen.unmarshalListAuthenticationEventsResponse;
11
+ exports.unmarshalListCombinedEventsResponse = marshalling_gen.unmarshalListCombinedEventsResponse;
8
12
  exports.unmarshalListEventsResponse = marshalling_gen.unmarshalListEventsResponse;
13
+ exports.unmarshalListExportJobsResponse = marshalling_gen.unmarshalListExportJobsResponse;
9
14
  exports.unmarshalListProductsResponse = marshalling_gen.unmarshalListProductsResponse;
10
15
  exports.unmarshalResource = marshalling_gen.unmarshalResource;
11
16
  exports.ValidationRules = validationRules_gen;
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen';
2
- export * from './marshalling.gen';
3
- export type { AccountOrganizationInfo, AccountProjectInfo, AccountUserInfo, AppleSiliconServerInfo, BaremetalServerInfo, BaremetalSettingInfo, Event, EventPrincipal, EventSystem, InstanceServerInfo, IpamIpInfo, KeyManagerKeyInfo, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListProductsRequest, ListProductsResponse, LoadBalancerAclInfo, LoadBalancerBackendInfo, LoadBalancerCertificateInfo, LoadBalancerFrontendInfo, LoadBalancerIpInfo, LoadBalancerLbInfo, LoadBalancerRouteInfo, Product, ProductService, Resource, ResourceType, SecretManagerSecretInfo, SecretManagerSecretVersionInfo, } from './types.gen';
4
- export * as ValidationRules from './validation-rules.gen';
1
+ export { API } from './api.gen.js';
2
+ export * from './marshalling.gen.js';
3
+ export type { AccountOrganizationInfo, AccountProjectInfo, AccountUserInfo, AppleSiliconServerInfo, AuthenticationEvent, AuthenticationEventFailureReason, AuthenticationEventMFAType, AuthenticationEventMethod, AuthenticationEventOrigin, AuthenticationEventResult, BaremetalServerInfo, BaremetalSettingInfo, CreateExportJobRequest, DeleteExportJobRequest, Event, EventPrincipal, ExportJob, ExportJobS3, ExportJobStatus, ExportJobStatusCode, InstanceServerInfo, IpamIpInfo, KeyManagerKeyInfo, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListAuthenticationEventsRequest, ListAuthenticationEventsRequestOrderBy, ListAuthenticationEventsResponse, ListCombinedEventsRequest, ListCombinedEventsRequestOrderBy, ListCombinedEventsResponse, ListCombinedEventsResponseCombinedEvent, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListExportJobsRequest, ListExportJobsRequestOrderBy, ListExportJobsResponse, ListProductsRequest, ListProductsResponse, LoadBalancerAclInfo, LoadBalancerBackendInfo, LoadBalancerCertificateInfo, LoadBalancerFrontendInfo, LoadBalancerIpInfo, LoadBalancerLbInfo, LoadBalancerRouteInfo, Product, ProductService, Resource, ResourceType, SecretManagerSecretInfo, SecretManagerSecretVersionInfo, SystemEvent, SystemEventKind, } from './types.gen.js';
4
+ export * as ValidationRules from './validation-rules.gen.js';
@@ -1,11 +1,16 @@
1
1
  import { API } from "./api.gen.js";
2
- import { unmarshalEvent, unmarshalListEventsResponse, unmarshalListProductsResponse, unmarshalResource } from "./marshalling.gen.js";
2
+ import { marshalCreateExportJobRequest, unmarshalEvent, unmarshalExportJob, unmarshalListAuthenticationEventsResponse, unmarshalListCombinedEventsResponse, unmarshalListEventsResponse, unmarshalListExportJobsResponse, unmarshalListProductsResponse, unmarshalResource } from "./marshalling.gen.js";
3
3
  import * as validationRules_gen from "./validation-rules.gen.js";
4
4
  export {
5
5
  API,
6
6
  validationRules_gen as ValidationRules,
7
+ marshalCreateExportJobRequest,
7
8
  unmarshalEvent,
9
+ unmarshalExportJob,
10
+ unmarshalListAuthenticationEventsResponse,
11
+ unmarshalListCombinedEventsResponse,
8
12
  unmarshalListEventsResponse,
13
+ unmarshalListExportJobsResponse,
9
14
  unmarshalListProductsResponse,
10
15
  unmarshalResource
11
16
  };
@@ -1,6 +1,47 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const sdkClient = require("@scaleway/sdk-client");
4
+ const unmarshalExportJobS3 = (data) => {
5
+ if (!sdkClient.isJSONObject(data)) {
6
+ throw new TypeError(
7
+ `Unmarshalling the type 'ExportJobS3' failed as data isn't a dictionary.`
8
+ );
9
+ }
10
+ return {
11
+ bucket: data.bucket,
12
+ prefix: data.prefix,
13
+ projectId: data.project_id,
14
+ region: data.region
15
+ };
16
+ };
17
+ const unmarshalExportJobStatus = (data) => {
18
+ if (!sdkClient.isJSONObject(data)) {
19
+ throw new TypeError(
20
+ `Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary.`
21
+ );
22
+ }
23
+ return {
24
+ code: data.code,
25
+ message: data.message
26
+ };
27
+ };
28
+ const unmarshalExportJob = (data) => {
29
+ if (!sdkClient.isJSONObject(data)) {
30
+ throw new TypeError(
31
+ `Unmarshalling the type 'ExportJob' failed as data isn't a dictionary.`
32
+ );
33
+ }
34
+ return {
35
+ createdAt: sdkClient.unmarshalDate(data.created_at),
36
+ id: data.id,
37
+ lastRunAt: sdkClient.unmarshalDate(data.last_run_at),
38
+ lastStatus: data.last_status ? unmarshalExportJobStatus(data.last_status) : void 0,
39
+ name: data.name,
40
+ organizationId: data.organization_id,
41
+ s3: data.s3 ? unmarshalExportJobS3(data.s3) : void 0,
42
+ tags: data.tags
43
+ };
44
+ };
4
45
  const unmarshalAccountOrganizationInfo = (data) => {
5
46
  if (!sdkClient.isJSONObject(data)) {
6
47
  throw new TypeError(
@@ -224,26 +265,6 @@ const unmarshalSecretManagerSecretVersionInfo = (data) => {
224
265
  revision: data.revision
225
266
  };
226
267
  };
227
- const unmarshalEventPrincipal = (data) => {
228
- if (!sdkClient.isJSONObject(data)) {
229
- throw new TypeError(
230
- `Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
231
- );
232
- }
233
- return {
234
- id: data.id
235
- };
236
- };
237
- const unmarshalEventSystem = (data) => {
238
- if (!sdkClient.isJSONObject(data)) {
239
- throw new TypeError(
240
- `Unmarshalling the type 'EventSystem' failed as data isn't a dictionary.`
241
- );
242
- }
243
- return {
244
- name: data.name
245
- };
246
- };
247
268
  const unmarshalResource = (data) => {
248
269
  if (!sdkClient.isJSONObject(data)) {
249
270
  throw new TypeError(
@@ -288,6 +309,48 @@ const unmarshalResource = (data) => {
288
309
  updatedAt: sdkClient.unmarshalDate(data.updated_at)
289
310
  };
290
311
  };
312
+ const unmarshalAuthenticationEvent = (data) => {
313
+ if (!sdkClient.isJSONObject(data)) {
314
+ throw new TypeError(
315
+ `Unmarshalling the type 'AuthenticationEvent' failed as data isn't a dictionary.`
316
+ );
317
+ }
318
+ return {
319
+ countryCode: data.country_code ? data.country_code : void 0,
320
+ failureReason: data.failure_reason ? data.failure_reason : void 0,
321
+ id: data.id,
322
+ method: data.method,
323
+ mfaType: data.mfa_type ? data.mfa_type : void 0,
324
+ organizationId: data.organization_id,
325
+ origin: data.origin,
326
+ recordedAt: sdkClient.unmarshalDate(data.recorded_at),
327
+ resources: sdkClient.unmarshalArrayOfObject(data.resources, unmarshalResource),
328
+ result: data.result,
329
+ sourceIp: data.source_ip,
330
+ userAgent: data.user_agent
331
+ };
332
+ };
333
+ const unmarshalListAuthenticationEventsResponse = (data) => {
334
+ if (!sdkClient.isJSONObject(data)) {
335
+ throw new TypeError(
336
+ `Unmarshalling the type 'ListAuthenticationEventsResponse' failed as data isn't a dictionary.`
337
+ );
338
+ }
339
+ return {
340
+ events: sdkClient.unmarshalArrayOfObject(data.events, unmarshalAuthenticationEvent),
341
+ nextPageToken: data.next_page_token
342
+ };
343
+ };
344
+ const unmarshalEventPrincipal = (data) => {
345
+ if (!sdkClient.isJSONObject(data)) {
346
+ throw new TypeError(
347
+ `Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
348
+ );
349
+ }
350
+ return {
351
+ id: data.id
352
+ };
353
+ };
291
354
  const unmarshalEvent = (data) => {
292
355
  if (!sdkClient.isJSONObject(data)) {
293
356
  throw new TypeError(
@@ -309,10 +372,54 @@ const unmarshalEvent = (data) => {
309
372
  serviceName: data.service_name,
310
373
  sourceIp: data.source_ip,
311
374
  statusCode: data.status_code,
312
- system: data.system ? unmarshalEventSystem(data.system) : void 0,
313
375
  userAgent: data.user_agent
314
376
  };
315
377
  };
378
+ const unmarshalSystemEvent = (data) => {
379
+ if (!sdkClient.isJSONObject(data)) {
380
+ throw new TypeError(
381
+ `Unmarshalling the type 'SystemEvent' failed as data isn't a dictionary.`
382
+ );
383
+ }
384
+ return {
385
+ id: data.id,
386
+ kind: data.kind,
387
+ locality: data.locality,
388
+ organizationId: data.organization_id,
389
+ productName: data.product_name,
390
+ projectId: data.project_id,
391
+ recordedAt: sdkClient.unmarshalDate(data.recorded_at),
392
+ resources: sdkClient.unmarshalArrayOfObject(data.resources, unmarshalResource),
393
+ source: data.source,
394
+ systemName: data.system_name
395
+ };
396
+ };
397
+ const unmarshalListCombinedEventsResponseCombinedEvent = (data) => {
398
+ if (!sdkClient.isJSONObject(data)) {
399
+ throw new TypeError(
400
+ `Unmarshalling the type 'ListCombinedEventsResponseCombinedEvent' failed as data isn't a dictionary.`
401
+ );
402
+ }
403
+ return {
404
+ api: data.api ? unmarshalEvent(data.api) : void 0,
405
+ auth: data.auth ? unmarshalAuthenticationEvent(data.auth) : void 0,
406
+ system: data.system ? unmarshalSystemEvent(data.system) : void 0
407
+ };
408
+ };
409
+ const unmarshalListCombinedEventsResponse = (data) => {
410
+ if (!sdkClient.isJSONObject(data)) {
411
+ throw new TypeError(
412
+ `Unmarshalling the type 'ListCombinedEventsResponse' failed as data isn't a dictionary.`
413
+ );
414
+ }
415
+ return {
416
+ events: sdkClient.unmarshalArrayOfObject(
417
+ data.events,
418
+ unmarshalListCombinedEventsResponseCombinedEvent
419
+ ),
420
+ nextPageToken: data.next_page_token
421
+ };
422
+ };
316
423
  const unmarshalListEventsResponse = (data) => {
317
424
  if (!sdkClient.isJSONObject(data)) {
318
425
  throw new TypeError(
@@ -324,6 +431,17 @@ const unmarshalListEventsResponse = (data) => {
324
431
  nextPageToken: data.next_page_token
325
432
  };
326
433
  };
434
+ const unmarshalListExportJobsResponse = (data) => {
435
+ if (!sdkClient.isJSONObject(data)) {
436
+ throw new TypeError(
437
+ `Unmarshalling the type 'ListExportJobsResponse' failed as data isn't a dictionary.`
438
+ );
439
+ }
440
+ return {
441
+ exportJobs: sdkClient.unmarshalArrayOfObject(data.export_jobs, unmarshalExportJob),
442
+ totalCount: data.total_count
443
+ };
444
+ };
327
445
  const unmarshalProductService = (data) => {
328
446
  if (!sdkClient.isJSONObject(data)) {
329
447
  throw new TypeError(
@@ -358,7 +476,29 @@ const unmarshalListProductsResponse = (data) => {
358
476
  totalCount: data.total_count
359
477
  };
360
478
  };
479
+ const marshalExportJobS3 = (request, defaults) => ({
480
+ bucket: request.bucket,
481
+ prefix: request.prefix,
482
+ project_id: request.projectId,
483
+ region: request.region
484
+ });
485
+ const marshalCreateExportJobRequest = (request, defaults) => ({
486
+ name: request.name,
487
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId,
488
+ tags: request.tags,
489
+ ...sdkClient.resolveOneOf([
490
+ {
491
+ param: "s3",
492
+ value: request.s3 !== void 0 ? marshalExportJobS3(request.s3) : void 0
493
+ }
494
+ ])
495
+ });
496
+ exports.marshalCreateExportJobRequest = marshalCreateExportJobRequest;
361
497
  exports.unmarshalEvent = unmarshalEvent;
498
+ exports.unmarshalExportJob = unmarshalExportJob;
499
+ exports.unmarshalListAuthenticationEventsResponse = unmarshalListAuthenticationEventsResponse;
500
+ exports.unmarshalListCombinedEventsResponse = unmarshalListCombinedEventsResponse;
362
501
  exports.unmarshalListEventsResponse = unmarshalListEventsResponse;
502
+ exports.unmarshalListExportJobsResponse = unmarshalListExportJobsResponse;
363
503
  exports.unmarshalListProductsResponse = unmarshalListProductsResponse;
364
504
  exports.unmarshalResource = unmarshalResource;
@@ -1,5 +1,11 @@
1
- import type { Event, ListEventsResponse, ListProductsResponse, Resource } from './types.gen';
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { CreateExportJobRequest, Event, ExportJob, ListAuthenticationEventsResponse, ListCombinedEventsResponse, ListEventsResponse, ListExportJobsResponse, ListProductsResponse, Resource } from './types.gen.js';
3
+ export declare const unmarshalExportJob: (data: unknown) => ExportJob;
2
4
  export declare const unmarshalResource: (data: unknown) => Resource;
5
+ export declare const unmarshalListAuthenticationEventsResponse: (data: unknown) => ListAuthenticationEventsResponse;
3
6
  export declare const unmarshalEvent: (data: unknown) => Event;
7
+ export declare const unmarshalListCombinedEventsResponse: (data: unknown) => ListCombinedEventsResponse;
4
8
  export declare const unmarshalListEventsResponse: (data: unknown) => ListEventsResponse;
9
+ export declare const unmarshalListExportJobsResponse: (data: unknown) => ListExportJobsResponse;
5
10
  export declare const unmarshalListProductsResponse: (data: unknown) => ListProductsResponse;
11
+ export declare const marshalCreateExportJobRequest: (request: CreateExportJobRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -1,4 +1,45 @@
1
- import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
+ import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ const unmarshalExportJobS3 = (data) => {
3
+ if (!isJSONObject(data)) {
4
+ throw new TypeError(
5
+ `Unmarshalling the type 'ExportJobS3' failed as data isn't a dictionary.`
6
+ );
7
+ }
8
+ return {
9
+ bucket: data.bucket,
10
+ prefix: data.prefix,
11
+ projectId: data.project_id,
12
+ region: data.region
13
+ };
14
+ };
15
+ const unmarshalExportJobStatus = (data) => {
16
+ if (!isJSONObject(data)) {
17
+ throw new TypeError(
18
+ `Unmarshalling the type 'ExportJobStatus' failed as data isn't a dictionary.`
19
+ );
20
+ }
21
+ return {
22
+ code: data.code,
23
+ message: data.message
24
+ };
25
+ };
26
+ const unmarshalExportJob = (data) => {
27
+ if (!isJSONObject(data)) {
28
+ throw new TypeError(
29
+ `Unmarshalling the type 'ExportJob' failed as data isn't a dictionary.`
30
+ );
31
+ }
32
+ return {
33
+ createdAt: unmarshalDate(data.created_at),
34
+ id: data.id,
35
+ lastRunAt: unmarshalDate(data.last_run_at),
36
+ lastStatus: data.last_status ? unmarshalExportJobStatus(data.last_status) : void 0,
37
+ name: data.name,
38
+ organizationId: data.organization_id,
39
+ s3: data.s3 ? unmarshalExportJobS3(data.s3) : void 0,
40
+ tags: data.tags
41
+ };
42
+ };
2
43
  const unmarshalAccountOrganizationInfo = (data) => {
3
44
  if (!isJSONObject(data)) {
4
45
  throw new TypeError(
@@ -222,26 +263,6 @@ const unmarshalSecretManagerSecretVersionInfo = (data) => {
222
263
  revision: data.revision
223
264
  };
224
265
  };
225
- const unmarshalEventPrincipal = (data) => {
226
- if (!isJSONObject(data)) {
227
- throw new TypeError(
228
- `Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
229
- );
230
- }
231
- return {
232
- id: data.id
233
- };
234
- };
235
- const unmarshalEventSystem = (data) => {
236
- if (!isJSONObject(data)) {
237
- throw new TypeError(
238
- `Unmarshalling the type 'EventSystem' failed as data isn't a dictionary.`
239
- );
240
- }
241
- return {
242
- name: data.name
243
- };
244
- };
245
266
  const unmarshalResource = (data) => {
246
267
  if (!isJSONObject(data)) {
247
268
  throw new TypeError(
@@ -286,6 +307,48 @@ const unmarshalResource = (data) => {
286
307
  updatedAt: unmarshalDate(data.updated_at)
287
308
  };
288
309
  };
310
+ const unmarshalAuthenticationEvent = (data) => {
311
+ if (!isJSONObject(data)) {
312
+ throw new TypeError(
313
+ `Unmarshalling the type 'AuthenticationEvent' failed as data isn't a dictionary.`
314
+ );
315
+ }
316
+ return {
317
+ countryCode: data.country_code ? data.country_code : void 0,
318
+ failureReason: data.failure_reason ? data.failure_reason : void 0,
319
+ id: data.id,
320
+ method: data.method,
321
+ mfaType: data.mfa_type ? data.mfa_type : void 0,
322
+ organizationId: data.organization_id,
323
+ origin: data.origin,
324
+ recordedAt: unmarshalDate(data.recorded_at),
325
+ resources: unmarshalArrayOfObject(data.resources, unmarshalResource),
326
+ result: data.result,
327
+ sourceIp: data.source_ip,
328
+ userAgent: data.user_agent
329
+ };
330
+ };
331
+ const unmarshalListAuthenticationEventsResponse = (data) => {
332
+ if (!isJSONObject(data)) {
333
+ throw new TypeError(
334
+ `Unmarshalling the type 'ListAuthenticationEventsResponse' failed as data isn't a dictionary.`
335
+ );
336
+ }
337
+ return {
338
+ events: unmarshalArrayOfObject(data.events, unmarshalAuthenticationEvent),
339
+ nextPageToken: data.next_page_token
340
+ };
341
+ };
342
+ const unmarshalEventPrincipal = (data) => {
343
+ if (!isJSONObject(data)) {
344
+ throw new TypeError(
345
+ `Unmarshalling the type 'EventPrincipal' failed as data isn't a dictionary.`
346
+ );
347
+ }
348
+ return {
349
+ id: data.id
350
+ };
351
+ };
289
352
  const unmarshalEvent = (data) => {
290
353
  if (!isJSONObject(data)) {
291
354
  throw new TypeError(
@@ -307,10 +370,54 @@ const unmarshalEvent = (data) => {
307
370
  serviceName: data.service_name,
308
371
  sourceIp: data.source_ip,
309
372
  statusCode: data.status_code,
310
- system: data.system ? unmarshalEventSystem(data.system) : void 0,
311
373
  userAgent: data.user_agent
312
374
  };
313
375
  };
376
+ const unmarshalSystemEvent = (data) => {
377
+ if (!isJSONObject(data)) {
378
+ throw new TypeError(
379
+ `Unmarshalling the type 'SystemEvent' failed as data isn't a dictionary.`
380
+ );
381
+ }
382
+ return {
383
+ id: data.id,
384
+ kind: data.kind,
385
+ locality: data.locality,
386
+ organizationId: data.organization_id,
387
+ productName: data.product_name,
388
+ projectId: data.project_id,
389
+ recordedAt: unmarshalDate(data.recorded_at),
390
+ resources: unmarshalArrayOfObject(data.resources, unmarshalResource),
391
+ source: data.source,
392
+ systemName: data.system_name
393
+ };
394
+ };
395
+ const unmarshalListCombinedEventsResponseCombinedEvent = (data) => {
396
+ if (!isJSONObject(data)) {
397
+ throw new TypeError(
398
+ `Unmarshalling the type 'ListCombinedEventsResponseCombinedEvent' failed as data isn't a dictionary.`
399
+ );
400
+ }
401
+ return {
402
+ api: data.api ? unmarshalEvent(data.api) : void 0,
403
+ auth: data.auth ? unmarshalAuthenticationEvent(data.auth) : void 0,
404
+ system: data.system ? unmarshalSystemEvent(data.system) : void 0
405
+ };
406
+ };
407
+ const unmarshalListCombinedEventsResponse = (data) => {
408
+ if (!isJSONObject(data)) {
409
+ throw new TypeError(
410
+ `Unmarshalling the type 'ListCombinedEventsResponse' failed as data isn't a dictionary.`
411
+ );
412
+ }
413
+ return {
414
+ events: unmarshalArrayOfObject(
415
+ data.events,
416
+ unmarshalListCombinedEventsResponseCombinedEvent
417
+ ),
418
+ nextPageToken: data.next_page_token
419
+ };
420
+ };
314
421
  const unmarshalListEventsResponse = (data) => {
315
422
  if (!isJSONObject(data)) {
316
423
  throw new TypeError(
@@ -322,6 +429,17 @@ const unmarshalListEventsResponse = (data) => {
322
429
  nextPageToken: data.next_page_token
323
430
  };
324
431
  };
432
+ const unmarshalListExportJobsResponse = (data) => {
433
+ if (!isJSONObject(data)) {
434
+ throw new TypeError(
435
+ `Unmarshalling the type 'ListExportJobsResponse' failed as data isn't a dictionary.`
436
+ );
437
+ }
438
+ return {
439
+ exportJobs: unmarshalArrayOfObject(data.export_jobs, unmarshalExportJob),
440
+ totalCount: data.total_count
441
+ };
442
+ };
325
443
  const unmarshalProductService = (data) => {
326
444
  if (!isJSONObject(data)) {
327
445
  throw new TypeError(
@@ -356,9 +474,31 @@ const unmarshalListProductsResponse = (data) => {
356
474
  totalCount: data.total_count
357
475
  };
358
476
  };
477
+ const marshalExportJobS3 = (request, defaults) => ({
478
+ bucket: request.bucket,
479
+ prefix: request.prefix,
480
+ project_id: request.projectId,
481
+ region: request.region
482
+ });
483
+ const marshalCreateExportJobRequest = (request, defaults) => ({
484
+ name: request.name,
485
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId,
486
+ tags: request.tags,
487
+ ...resolveOneOf([
488
+ {
489
+ param: "s3",
490
+ value: request.s3 !== void 0 ? marshalExportJobS3(request.s3) : void 0
491
+ }
492
+ ])
493
+ });
359
494
  export {
495
+ marshalCreateExportJobRequest,
360
496
  unmarshalEvent,
497
+ unmarshalExportJob,
498
+ unmarshalListAuthenticationEventsResponse,
499
+ unmarshalListCombinedEventsResponse,
361
500
  unmarshalListEventsResponse,
501
+ unmarshalListExportJobsResponse,
362
502
  unmarshalListProductsResponse,
363
503
  unmarshalResource
364
504
  };
@@ -1,6 +1,17 @@
1
1
  import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
+ import type { CountryCode as StdCountryCode } from '@scaleway/sdk-std';
3
+ export type AuthenticationEventFailureReason = 'unknown_failure_reason' | 'invalid_mfa' | 'invalid_password';
4
+ export type AuthenticationEventMFAType = 'unknown_mfa_type' | 'totp';
5
+ export type AuthenticationEventMethod = 'unknown_method' | 'password' | 'authentication_code' | 'oauth2' | 'saml';
6
+ export type AuthenticationEventOrigin = 'unknown_origin' | 'public_api' | 'admin_api';
7
+ export type AuthenticationEventResult = 'unknown_result' | 'success' | 'failure';
8
+ export type ExportJobStatusCode = 'unknown_code' | 'success' | 'failure';
9
+ export type ListAuthenticationEventsRequestOrderBy = 'recorded_at_desc' | 'recorded_at_asc';
10
+ export type ListCombinedEventsRequestOrderBy = 'recorded_at_desc' | 'recorded_at_asc';
2
11
  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' | 'keym_key' | 'iam_user' | 'iam_application' | 'iam_group' | 'iam_policy' | 'iam_api_key' | 'iam_ssh_key' | 'iam_rule' | 'secret_manager_secret' | 'secret_manager_version' | 'key_manager_key' | 'account_user' | 'account_organization' | 'account_project' | 'instance_server' | 'instance_placement_group' | 'instance_security_group' | 'instance_volume' | 'instance_snapshot' | 'instance_image' | 'apple_silicon_server' | 'baremetal_server' | 'baremetal_setting' | 'ipam_ip' | 'sbs_volume' | 'sbs_snapshot' | 'load_balancer_lb' | 'load_balancer_ip' | 'load_balancer_frontend' | 'load_balancer_backend' | 'load_balancer_route' | 'load_balancer_acl' | 'load_balancer_certificate';
12
+ export type ListExportJobsRequestOrderBy = 'name_asc' | 'name_desc' | 'created_at_asc' | 'created_at_desc';
13
+ export type ResourceType = 'unknown_type' | 'secm_secret' | 'secm_secret_version' | 'kube_cluster' | 'kube_pool' | 'kube_node' | 'kube_acl' | 'keym_key' | 'iam_user' | 'iam_application' | 'iam_group' | 'iam_policy' | 'iam_api_key' | 'iam_ssh_key' | 'iam_rule' | 'iam_saml' | 'iam_saml_certificate' | 'secret_manager_secret' | 'secret_manager_version' | 'key_manager_key' | 'account_user' | 'account_organization' | 'account_project' | 'instance_server' | 'instance_placement_group' | 'instance_security_group' | 'instance_volume' | 'instance_snapshot' | 'instance_image' | 'apple_silicon_server' | 'baremetal_server' | 'baremetal_setting' | 'ipam_ip' | 'sbs_volume' | 'sbs_snapshot' | 'load_balancer_lb' | 'load_balancer_ip' | 'load_balancer_frontend' | 'load_balancer_backend' | 'load_balancer_route' | 'load_balancer_acl' | 'load_balancer_certificate' | 'sfs_filesystem' | 'vpc_private_network';
14
+ export type SystemEventKind = 'unknown_kind' | 'cron' | 'notification';
4
15
  export interface AccountOrganizationInfo {
5
16
  }
6
17
  export interface AccountProjectInfo {
@@ -74,12 +85,6 @@ export interface SecretManagerSecretInfo {
74
85
  export interface SecretManagerSecretVersionInfo {
75
86
  revision: number;
76
87
  }
77
- export interface EventPrincipal {
78
- id: string;
79
- }
80
- export interface EventSystem {
81
- name: string;
82
- }
83
88
  export interface Resource {
84
89
  id: string;
85
90
  type: ResourceType;
@@ -217,9 +222,58 @@ export interface Resource {
217
222
  */
218
223
  loadBalancerCertificateInfo?: LoadBalancerCertificateInfo;
219
224
  }
220
- export interface ProductService {
221
- name: string;
222
- methods: string[];
225
+ export interface EventPrincipal {
226
+ id: string;
227
+ }
228
+ export interface AuthenticationEvent {
229
+ /**
230
+ * ID of the event.
231
+ */
232
+ id: string;
233
+ /**
234
+ * Timestamp of the event.
235
+ */
236
+ recordedAt?: Date;
237
+ /**
238
+ * Organization ID containing the event.
239
+ */
240
+ organizationId: string;
241
+ /**
242
+ * IP address at the origin of the event.
243
+ */
244
+ sourceIp: string;
245
+ /**
246
+ * User Agent at the origin of the event.
247
+ */
248
+ userAgent?: string;
249
+ /**
250
+ * Resources attached to the event.
251
+ */
252
+ resources: Resource[];
253
+ /**
254
+ * Result of the authentication attempt.
255
+ */
256
+ result: AuthenticationEventResult;
257
+ /**
258
+ * (Optional) Reason for authentication failure.
259
+ */
260
+ failureReason?: AuthenticationEventFailureReason;
261
+ /**
262
+ * (Optional) ISO 3166-1 alpha-2 country code of the source IP.
263
+ */
264
+ countryCode?: StdCountryCode;
265
+ /**
266
+ * Authentication method used.
267
+ */
268
+ method: AuthenticationEventMethod;
269
+ /**
270
+ * Origin of the authentication attempt.
271
+ */
272
+ origin: AuthenticationEventOrigin;
273
+ /**
274
+ * (Optional) MFA type used for the authentication attempt.
275
+ */
276
+ mfaType?: AuthenticationEventMFAType;
223
277
  }
224
278
  export interface Event {
225
279
  /**
@@ -237,15 +291,9 @@ export interface Event {
237
291
  /**
238
292
  * User or IAM application at the origin of the event.
239
293
  *
240
- * One-of ('source'): at most one of 'principal', 'system' could be set.
294
+ * One-of ('source'): at most one of 'principal' could be set.
241
295
  */
242
296
  principal?: EventPrincipal;
243
- /**
244
- * The Scaleway system that performed an action on behalf of the client.
245
- *
246
- * One-of ('source'): at most one of 'principal', 'system' could be set.
247
- */
248
- system?: EventSystem;
249
297
  /**
250
298
  * Organization ID containing the event.
251
299
  */
@@ -291,6 +339,88 @@ export interface Event {
291
339
  */
292
340
  statusCode: number;
293
341
  }
342
+ export interface SystemEvent {
343
+ id: string;
344
+ recordedAt?: Date;
345
+ locality: string;
346
+ organizationId: string;
347
+ projectId?: string;
348
+ source: string;
349
+ systemName: string;
350
+ resources: Resource[];
351
+ kind: SystemEventKind;
352
+ productName: string;
353
+ }
354
+ export interface ExportJobS3 {
355
+ bucket: string;
356
+ /**
357
+ * Region to target. If none is passed will use default region from the config.
358
+ */
359
+ region: ScwRegion;
360
+ prefix?: string;
361
+ projectId?: string;
362
+ }
363
+ export interface ExportJobStatus {
364
+ code: ExportJobStatusCode;
365
+ message?: string;
366
+ }
367
+ export interface ProductService {
368
+ name: string;
369
+ methods: string[];
370
+ }
371
+ export interface ListCombinedEventsResponseCombinedEvent {
372
+ /**
373
+ *
374
+ * One-of ('event'): at most one of 'api', 'auth', 'system' could be set.
375
+ */
376
+ api?: Event;
377
+ /**
378
+ *
379
+ * One-of ('event'): at most one of 'api', 'auth', 'system' could be set.
380
+ */
381
+ auth?: AuthenticationEvent;
382
+ /**
383
+ *
384
+ * One-of ('event'): at most one of 'api', 'auth', 'system' could be set.
385
+ */
386
+ system?: SystemEvent;
387
+ }
388
+ export interface ExportJob {
389
+ /**
390
+ * ID of the export job.
391
+ */
392
+ id: string;
393
+ /**
394
+ * ID of the targeted Organization.
395
+ */
396
+ organizationId: string;
397
+ /**
398
+ * Name of the export job.
399
+ */
400
+ name: string;
401
+ /**
402
+ * Destination in an S3 storage.
403
+ *
404
+ * One-of ('destination'): at most one of 's3' could be set.
405
+ */
406
+ s3?: ExportJobS3;
407
+ /**
408
+ * Export job creation date.
409
+ */
410
+ createdAt?: Date;
411
+ /**
412
+ * Last run of export job.
413
+ */
414
+ lastRunAt?: Date;
415
+ /**
416
+ * Tags of the export job.
417
+ */
418
+ tags: string[];
419
+ /**
420
+ * Status of last export job.
421
+ */
422
+ lastStatus?: ExportJobStatus;
423
+ }
294
424
  export interface Product {
295
425
  /**
296
426
  * Product title.
@@ -305,6 +435,74 @@ export interface Product {
305
435
  */
306
436
  services: ProductService[];
307
437
  }
438
+ export type CreateExportJobRequest = {
439
+ /**
440
+ * Region to target. If none is passed will use default region from the config.
441
+ */
442
+ region?: ScwRegion;
443
+ /**
444
+ * ID of the Organization to target.
445
+ */
446
+ organizationId?: string;
447
+ /**
448
+ * Name of the export.
449
+ */
450
+ name: string;
451
+ /**
452
+ * The configuration specifying the bucket where the audit trail events will be exported.
453
+ *
454
+ * One-of ('destination'): at most one of 's3' could be set.
455
+ */
456
+ s3?: ExportJobS3;
457
+ /**
458
+ * Tags of the export.
459
+ */
460
+ tags?: string[];
461
+ };
462
+ export type DeleteExportJobRequest = {
463
+ /**
464
+ * Region to target. If none is passed will use default region from the config.
465
+ */
466
+ region?: ScwRegion;
467
+ /**
468
+ * ID of the export job.
469
+ */
470
+ exportJobId: string;
471
+ };
472
+ export type ListAuthenticationEventsRequest = {
473
+ /**
474
+ * Region to target. If none is passed will use default region from the config.
475
+ */
476
+ region?: ScwRegion;
477
+ organizationId?: string;
478
+ recordedAfter?: Date;
479
+ recordedBefore?: Date;
480
+ orderBy?: ListAuthenticationEventsRequestOrderBy;
481
+ pageSize?: number;
482
+ pageToken?: string;
483
+ };
484
+ export interface ListAuthenticationEventsResponse {
485
+ events: AuthenticationEvent[];
486
+ nextPageToken?: string;
487
+ }
488
+ export type ListCombinedEventsRequest = {
489
+ /**
490
+ * Region to target. If none is passed will use default region from the config.
491
+ */
492
+ region?: ScwRegion;
493
+ organizationId?: string;
494
+ projectId?: string;
495
+ resourceType?: ResourceType;
496
+ recordedAfter?: Date;
497
+ recordedBefore?: Date;
498
+ orderBy?: ListCombinedEventsRequestOrderBy;
499
+ pageSize?: number;
500
+ pageToken?: string;
501
+ };
502
+ export interface ListCombinedEventsResponse {
503
+ events: ListCombinedEventsResponseCombinedEvent[];
504
+ nextPageToken?: string;
505
+ }
308
506
  export type ListEventsRequest = {
309
507
  /**
310
508
  * Region to target. If none is passed will use default region from the config.
@@ -353,6 +551,14 @@ export type ListEventsRequest = {
353
551
  * (Optional) ID of the Scaleway resource.
354
552
  */
355
553
  resourceId?: string;
554
+ /**
555
+ * (Optional) ID of the User or IAM application at the origin of the event.
556
+ */
557
+ principalId?: string;
558
+ /**
559
+ * (Optional) IP address at the origin of the event.
560
+ */
561
+ sourceIp?: string;
356
562
  };
357
563
  export interface ListEventsResponse {
358
564
  /**
@@ -364,6 +570,37 @@ export interface ListEventsResponse {
364
570
  */
365
571
  nextPageToken?: string;
366
572
  }
573
+ export type ListExportJobsRequest = {
574
+ /**
575
+ * Region to target. If none is passed will use default region from the config.
576
+ */
577
+ region?: ScwRegion;
578
+ /**
579
+ * Filter by Organization ID.
580
+ */
581
+ organizationId?: string;
582
+ /**
583
+ * (Optional) Filter by export name.
584
+ */
585
+ name?: string;
586
+ /**
587
+ * (Optional) List of tags to filter on.
588
+ */
589
+ tags?: string[];
590
+ page?: number;
591
+ pageSize?: number;
592
+ orderBy?: ListExportJobsRequestOrderBy;
593
+ };
594
+ export interface ListExportJobsResponse {
595
+ /**
596
+ * Single page of export jobs matching the requested criteria.
597
+ */
598
+ exportJobs: ExportJob[];
599
+ /**
600
+ * Total count of export jobs matching the requested criteria.
601
+ */
602
+ totalCount: number;
603
+ }
367
604
  export type ListProductsRequest = {
368
605
  /**
369
606
  * Region to target. If none is passed will use default region from the config.
@@ -1,5 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const CreateExportJobRequest = {
4
+ name: {
5
+ maxLength: 255,
6
+ minLength: 1,
7
+ pattern: /^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$/
8
+ }
9
+ };
10
+ const ExportJobS3 = {
11
+ bucket: {
12
+ maxLength: 63,
13
+ minLength: 3,
14
+ pattern: /^[a-z0-9][a-z0-9.-]{2,}$/
15
+ },
16
+ prefix: {
17
+ maxLength: 255,
18
+ pattern: /^[a-zA-Z0-9\._\-]+(?:\/[a-zA-Z0-9\._\-]+)*$/
19
+ },
20
+ region: {
21
+ pattern: /^[a-z]{2}-[a-z]{3}$/
22
+ }
23
+ };
24
+ const ListAuthenticationEventsRequest = {
25
+ pageSize: {
26
+ greaterThanOrEqual: 1,
27
+ lessThanOrEqual: 1e3
28
+ }
29
+ };
30
+ const ListCombinedEventsRequest = {
31
+ pageSize: {
32
+ greaterThanOrEqual: 1,
33
+ lessThanOrEqual: 1e3
34
+ }
35
+ };
3
36
  const ListEventsRequest = {
4
37
  methodName: {
5
38
  pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/
@@ -23,4 +56,8 @@ const ListEventsRequest = {
23
56
  lessThan: 600
24
57
  }
25
58
  };
59
+ exports.CreateExportJobRequest = CreateExportJobRequest;
60
+ exports.ExportJobS3 = ExportJobS3;
61
+ exports.ListAuthenticationEventsRequest = ListAuthenticationEventsRequest;
62
+ exports.ListCombinedEventsRequest = ListCombinedEventsRequest;
26
63
  exports.ListEventsRequest = ListEventsRequest;
@@ -1,3 +1,36 @@
1
+ export declare const CreateExportJobRequest: {
2
+ name: {
3
+ maxLength: number;
4
+ minLength: number;
5
+ pattern: RegExp;
6
+ };
7
+ };
8
+ export declare const ExportJobS3: {
9
+ bucket: {
10
+ maxLength: number;
11
+ minLength: number;
12
+ pattern: RegExp;
13
+ };
14
+ prefix: {
15
+ maxLength: number;
16
+ pattern: RegExp;
17
+ };
18
+ region: {
19
+ pattern: RegExp;
20
+ };
21
+ };
22
+ export declare const ListAuthenticationEventsRequest: {
23
+ pageSize: {
24
+ greaterThanOrEqual: number;
25
+ lessThanOrEqual: number;
26
+ };
27
+ };
28
+ export declare const ListCombinedEventsRequest: {
29
+ pageSize: {
30
+ greaterThanOrEqual: number;
31
+ lessThanOrEqual: number;
32
+ };
33
+ };
1
34
  export declare const ListEventsRequest: {
2
35
  methodName: {
3
36
  pattern: RegExp;
@@ -1,3 +1,36 @@
1
+ const CreateExportJobRequest = {
2
+ name: {
3
+ maxLength: 255,
4
+ minLength: 1,
5
+ pattern: /^[a-zA-Z0-9]([-_.a-zA-Z0-9]*[a-zA-Z0-9])?$/
6
+ }
7
+ };
8
+ const ExportJobS3 = {
9
+ bucket: {
10
+ maxLength: 63,
11
+ minLength: 3,
12
+ pattern: /^[a-z0-9][a-z0-9.-]{2,}$/
13
+ },
14
+ prefix: {
15
+ maxLength: 255,
16
+ pattern: /^[a-zA-Z0-9\._\-]+(?:\/[a-zA-Z0-9\._\-]+)*$/
17
+ },
18
+ region: {
19
+ pattern: /^[a-z]{2}-[a-z]{3}$/
20
+ }
21
+ };
22
+ const ListAuthenticationEventsRequest = {
23
+ pageSize: {
24
+ greaterThanOrEqual: 1,
25
+ lessThanOrEqual: 1e3
26
+ }
27
+ };
28
+ const ListCombinedEventsRequest = {
29
+ pageSize: {
30
+ greaterThanOrEqual: 1,
31
+ lessThanOrEqual: 1e3
32
+ }
33
+ };
1
34
  const ListEventsRequest = {
2
35
  methodName: {
3
36
  pattern: /^[a-zA-Z][a-zA-Z0-9_]*$/
@@ -22,5 +55,9 @@ const ListEventsRequest = {
22
55
  }
23
56
  };
24
57
  export {
58
+ CreateExportJobRequest,
59
+ ExportJobS3,
60
+ ListAuthenticationEventsRequest,
61
+ ListCombinedEventsRequest,
25
62
  ListEventsRequest
26
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-audit-trail",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Scaleway SDK audit-trail",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@scaleway/random-name": "5.1.2",
33
- "@scaleway/sdk-std": "1.0.6"
33
+ "@scaleway/sdk-std": "1.1.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.1"
36
+ "@scaleway/sdk-client": "^1.3.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.1"
39
+ "@scaleway/sdk-client": "^1.3.2"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",