@scaleway/sdk-audit-trail 1.1.1 → 1.3.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.
@@ -3,8 +3,13 @@ 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
5
  class API extends sdkClient.API {
6
- /** Lists the available regions of the API. */
7
- static LOCALITIES = ["fr-par", "nl-ams"];
6
+ /**
7
+ * Locality of this API.
8
+ * type ∈ {'zone','region','global','unspecified'}
9
+ */
10
+ static LOCALITY = sdkClient.toApiLocality({
11
+ regions: ["fr-par", "nl-ams"]
12
+ });
8
13
  /**
9
14
  * List events. Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
10
15
  *
@@ -1,5 +1,5 @@
1
1
  import { API as ParentAPI } from '@scaleway/sdk-client';
2
- import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
+ import type { ApiLocality } from '@scaleway/sdk-client';
3
3
  import type { ListEventsRequest, ListEventsResponse, ListProductsRequest, ListProductsResponse } from './types.gen';
4
4
  /**
5
5
  * Audit Trail API.
@@ -7,8 +7,11 @@ import type { ListEventsRequest, ListEventsResponse, ListProductsRequest, ListPr
7
7
  This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.
8
8
  */
9
9
  export declare class API extends ParentAPI {
10
- /** Lists the available regions of the API. */
11
- static readonly LOCALITIES: ScwRegion[];
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
12
15
  /**
13
16
  * List events. Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
14
17
  *
@@ -1,8 +1,13 @@
1
- import { API as API$1, urlParams, validatePathParam } from "@scaleway/sdk-client";
1
+ import { API as API$1, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
2
2
  import { unmarshalListEventsResponse, unmarshalListProductsResponse } from "./marshalling.gen.js";
3
3
  class API extends API$1 {
4
- /** Lists the available regions of the API. */
5
- static LOCALITIES = ["fr-par", "nl-ams"];
4
+ /**
5
+ * Locality of this API.
6
+ * type ∈ {'zone','region','global','unspecified'}
7
+ */
8
+ static LOCALITY = toApiLocality({
9
+ regions: ["fr-par", "nl-ams"]
10
+ });
6
11
  /**
7
12
  * List events. Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`.
8
13
  *
@@ -1,4 +1,4 @@
1
1
  export { API } from './api.gen';
2
2
  export * from './marshalling.gen';
3
- export type { AccountOrganizationInfo, AccountUserInfo, Event, EventPrincipal, KeyManagerKeyInfo, KubernetesACLInfo, KubernetesClusterInfo, KubernetesNodeInfo, KubernetesPoolInfo, ListEventsRequest, ListEventsRequestOrderBy, ListEventsResponse, ListProductsRequest, ListProductsResponse, Product, ProductService, Resource, ResourceType, SecretManagerSecretInfo, SecretManagerSecretVersionInfo, } from './types.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
4
  export * as ValidationRules from './validation-rules.gen';
@@ -16,7 +16,18 @@ const unmarshalAccountUserInfo = (data) => {
16
16
  );
17
17
  }
18
18
  return {
19
- email: data.email
19
+ email: data.email,
20
+ phoneNumber: data.phone_number
21
+ };
22
+ };
23
+ const unmarshalInstanceServerInfo = (data) => {
24
+ if (!sdkClient.isJSONObject(data)) {
25
+ throw new TypeError(
26
+ `Unmarshalling the type 'InstanceServerInfo' failed as data isn't a dictionary.`
27
+ );
28
+ }
29
+ return {
30
+ name: data.name
20
31
  };
21
32
  };
22
33
  const unmarshalKeyManagerKeyInfo = (data) => {
@@ -72,6 +83,7 @@ const unmarshalSecretManagerSecretInfo = (data) => {
72
83
  );
73
84
  }
74
85
  return {
86
+ keyId: data.key_id,
75
87
  path: data.path
76
88
  };
77
89
  };
@@ -107,6 +119,7 @@ const unmarshalResource = (data) => {
107
119
  createdAt: sdkClient.unmarshalDate(data.created_at),
108
120
  deletedAt: sdkClient.unmarshalDate(data.deleted_at),
109
121
  id: data.id,
122
+ instanceServerInfo: data.instance_server_info ? unmarshalInstanceServerInfo(data.instance_server_info) : void 0,
110
123
  keyManagerKeyInfo: data.key_manager_key_info ? unmarshalKeyManagerKeyInfo(data.key_manager_key_info) : void 0,
111
124
  keymKeyInfo: data.keym_key_info ? unmarshalKeyManagerKeyInfo(data.keym_key_info) : void 0,
112
125
  kubeAclInfo: data.kube_acl_info ? unmarshalKubernetesACLInfo(data.kube_acl_info) : void 0,
@@ -1,4 +1,4 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
2
  const unmarshalAccountOrganizationInfo = (data) => {
3
3
  if (!isJSONObject(data)) {
4
4
  throw new TypeError(
@@ -14,7 +14,18 @@ const unmarshalAccountUserInfo = (data) => {
14
14
  );
15
15
  }
16
16
  return {
17
- email: data.email
17
+ email: data.email,
18
+ phoneNumber: data.phone_number
19
+ };
20
+ };
21
+ const unmarshalInstanceServerInfo = (data) => {
22
+ if (!isJSONObject(data)) {
23
+ throw new TypeError(
24
+ `Unmarshalling the type 'InstanceServerInfo' failed as data isn't a dictionary.`
25
+ );
26
+ }
27
+ return {
28
+ name: data.name
18
29
  };
19
30
  };
20
31
  const unmarshalKeyManagerKeyInfo = (data) => {
@@ -70,6 +81,7 @@ const unmarshalSecretManagerSecretInfo = (data) => {
70
81
  );
71
82
  }
72
83
  return {
84
+ keyId: data.key_id,
73
85
  path: data.path
74
86
  };
75
87
  };
@@ -105,6 +117,7 @@ const unmarshalResource = (data) => {
105
117
  createdAt: unmarshalDate(data.created_at),
106
118
  deletedAt: unmarshalDate(data.deleted_at),
107
119
  id: data.id,
120
+ instanceServerInfo: data.instance_server_info ? unmarshalInstanceServerInfo(data.instance_server_info) : void 0,
108
121
  keyManagerKeyInfo: data.key_manager_key_info ? unmarshalKeyManagerKeyInfo(data.key_manager_key_info) : void 0,
109
122
  keymKeyInfo: data.keym_key_info ? unmarshalKeyManagerKeyInfo(data.keym_key_info) : void 0,
110
123
  kubeAclInfo: data.kube_acl_info ? unmarshalKubernetesACLInfo(data.kube_acl_info) : void 0,
@@ -1,10 +1,14 @@
1
1
  import type { Region as ScwRegion } from '@scaleway/sdk-client';
2
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' | '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';
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' | 'instance_server';
4
4
  export interface AccountOrganizationInfo {
5
5
  }
6
6
  export interface AccountUserInfo {
7
7
  email: string;
8
+ phoneNumber?: string;
9
+ }
10
+ export interface InstanceServerInfo {
11
+ name: string;
8
12
  }
9
13
  export interface KeyManagerKeyInfo {
10
14
  }
@@ -22,6 +26,7 @@ export interface KubernetesPoolInfo {
22
26
  }
23
27
  export interface SecretManagerSecretInfo {
24
28
  path: string;
29
+ keyId?: string;
25
30
  }
26
31
  export interface SecretManagerSecretVersionInfo {
27
32
  revision: number;
@@ -39,66 +44,71 @@ export interface Resource {
39
44
  /**
40
45
  * @deprecated
41
46
  *
42
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
47
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
43
48
  */
44
49
  secmSecretInfo?: SecretManagerSecretInfo;
45
50
  /**
46
51
  * @deprecated
47
52
  *
48
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
53
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
49
54
  */
50
55
  secmSecretVersionInfo?: SecretManagerSecretVersionInfo;
51
56
  /**
52
57
  *
53
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
58
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
54
59
  */
55
60
  kubeClusterInfo?: KubernetesClusterInfo;
56
61
  /**
57
62
  *
58
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
63
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
59
64
  */
60
65
  kubePoolInfo?: KubernetesPoolInfo;
61
66
  /**
62
67
  *
63
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
68
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
64
69
  */
65
70
  kubeNodeInfo?: KubernetesNodeInfo;
66
71
  /**
67
72
  *
68
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
73
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
69
74
  */
70
75
  kubeAclInfo?: KubernetesACLInfo;
71
76
  /**
72
77
  * @deprecated
73
78
  *
74
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
79
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
75
80
  */
76
81
  keymKeyInfo?: KeyManagerKeyInfo;
77
82
  /**
78
83
  *
79
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
84
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
80
85
  */
81
86
  secretManagerSecretInfo?: SecretManagerSecretInfo;
82
87
  /**
83
88
  *
84
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
89
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
85
90
  */
86
91
  secretManagerVersionInfo?: SecretManagerSecretVersionInfo;
87
92
  /**
88
93
  *
89
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
94
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
90
95
  */
91
96
  keyManagerKeyInfo?: KeyManagerKeyInfo;
92
97
  /**
93
98
  *
94
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
99
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
95
100
  */
96
101
  accountUserInfo?: AccountUserInfo;
97
102
  /**
98
103
  *
99
- * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo' could be set.
104
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
100
105
  */
101
106
  accountOrganizationInfo?: AccountOrganizationInfo;
107
+ /**
108
+ *
109
+ * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo' could be set.
110
+ */
111
+ instanceServerInfo?: InstanceServerInfo;
102
112
  }
103
113
  export interface ProductService {
104
114
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-audit-trail",
3
- "version": "1.1.1",
3
+ "version": "1.3.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.1",
33
- "@scaleway/sdk-std": "1.0.4"
33
+ "@scaleway/sdk-std": "1.0.5"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.2.3"
36
+ "@scaleway/sdk-client": "^1.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.2.3"
39
+ "@scaleway/sdk-client": "^1.3.0"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",