@scaleway/sdk-audit-trail 1.3.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,17 +35,70 @@ 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],
38
42
  ["recorded_before", request.recordedBefore],
43
+ ["resource_id", request.resourceId],
39
44
  ["resource_type", request.resourceType],
40
45
  ["service_name", request.serviceName],
46
+ ["source_ip", request.sourceIp],
41
47
  ["status", request.status]
42
48
  )
43
49
  },
44
50
  marshalling_gen.unmarshalListEventsResponse
45
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
+ );
46
102
  /**
47
103
  * Retrieve the list of Scaleway resources for which you have Audit Trail events.
48
104
  *
@@ -60,5 +116,53 @@ class API extends sdkClient.API {
60
116
  },
61
117
  marshalling_gen.unmarshalListProductsResponse
62
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);
63
167
  }
64
168
  exports.API = API;
@@ -1,6 +1,6 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
2
  import type { ApiLocality } from '@scaleway/sdk-client';
3
- import type { ListEventsRequest, ListEventsResponse, ListProductsRequest, ListProductsResponse } from './types.gen';
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,17 +33,70 @@ 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],
36
40
  ["recorded_before", request.recordedBefore],
41
+ ["resource_id", request.resourceId],
37
42
  ["resource_type", request.resourceType],
38
43
  ["service_name", request.serviceName],
44
+ ["source_ip", request.sourceIp],
39
45
  ["status", request.status]
40
46
  )
41
47
  },
42
48
  unmarshalListEventsResponse
43
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
+ );
44
100
  /**
45
101
  * Retrieve the list of Scaleway resources for which you have Audit Trail events.
46
102
  *
@@ -58,6 +114,54 @@ class API extends API$1 {
58
114
  },
59
115
  unmarshalListProductsResponse
60
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);
61
165
  }
62
166
  export {
63
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, AccountUserInfo, Event, EventPrincipal, InstanceServerInfo, KeyManagerKeyInfo, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListProductsRequest, ListProductsResponse, 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
  };