@scaleway/sdk 0.1.0-beta.1 → 0.1.0-beta.2

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.
@@ -1,2 +1,4 @@
1
1
  import * as index$1 from './v2alpha1/index.js';
2
2
  export { index$1 as v2alpha1 };
3
+ import * as index$2 from './v2/index.js';
4
+ export { index$2 as v2 };
@@ -0,0 +1,88 @@
1
+ import { API } from '../../../scw/api.js';
2
+ import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
3
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
+ import { marshalCreateProjectRequest, unmarshalProject, unmarshalListProjectsResponse, marshalUpdateProjectRequest } from './marshalling.gen.js';
5
+
6
+ // This file was automatically generated. DO NOT EDIT.
7
+ const jsonContentHeaders = {
8
+ 'Content-Type': 'application/json; charset=utf-8'
9
+ };
10
+ /**
11
+ * Account API.
12
+ *
13
+ * This API allows you to manage projects.
14
+ */
15
+
16
+ class AccountV2GenAPI extends API {
17
+ constructor() {
18
+ var _this;
19
+
20
+ super(...arguments);
21
+ _this = this;
22
+
23
+ this.createProject = request => this.client.fetch({
24
+ body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
25
+ headers: jsonContentHeaders,
26
+ method: 'POST',
27
+ path: `/account/v2/projects`
28
+ }, unmarshalProject);
29
+
30
+ this.pageOfListProjects = function (request) {
31
+ if (request === void 0) {
32
+ request = {};
33
+ }
34
+
35
+ return _this.client.fetch({
36
+ method: 'GET',
37
+ path: `/account/v2/projects`,
38
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
39
+ }, unmarshalListProjectsResponse);
40
+ };
41
+
42
+ this.listProjects = function (request) {
43
+ if (request === void 0) {
44
+ request = {};
45
+ }
46
+
47
+ return enrichForPagination('projects', _this.pageOfListProjects, request);
48
+ };
49
+
50
+ this.getProject = function (request) {
51
+ if (request === void 0) {
52
+ request = {};
53
+ }
54
+
55
+ return _this.client.fetch({
56
+ method: 'GET',
57
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
58
+ }, unmarshalProject);
59
+ };
60
+
61
+ this.deleteProject = function (request) {
62
+ if (request === void 0) {
63
+ request = {};
64
+ }
65
+
66
+ return _this.client.fetch({
67
+ method: 'DELETE',
68
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
69
+ });
70
+ };
71
+
72
+ this.updateProject = function (request) {
73
+ if (request === void 0) {
74
+ request = {};
75
+ }
76
+
77
+ return _this.client.fetch({
78
+ body: JSON.stringify(marshalUpdateProjectRequest(request, _this.client.settings)),
79
+ headers: jsonContentHeaders,
80
+ method: 'PATCH',
81
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? _this.client.settings.defaultProjectId)}`
82
+ }, unmarshalProject);
83
+ };
84
+ }
85
+
86
+ }
87
+
88
+ export { AccountV2GenAPI };
@@ -0,0 +1 @@
1
+ export { AccountV2GenAPI as API } from './api.gen.js';
@@ -0,0 +1,39 @@
1
+ import { isJSONObject } from '../../../helpers/json.js';
2
+ import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
3
+
4
+ // This file was automatically generated. DO NOT EDIT.
5
+ const unmarshalProject = data => {
6
+ if (!isJSONObject(data)) {
7
+ throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
8
+ }
9
+
10
+ return {
11
+ createdAt: unmarshalDate(data.created_at),
12
+ description: data.description,
13
+ id: data.id,
14
+ name: data.name,
15
+ organizationId: data.organization_id,
16
+ updatedAt: unmarshalDate(data.updated_at)
17
+ };
18
+ };
19
+ const unmarshalListProjectsResponse = data => {
20
+ if (!isJSONObject(data)) {
21
+ throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
22
+ }
23
+
24
+ return {
25
+ projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
26
+ totalCount: data.total_count
27
+ };
28
+ };
29
+ const marshalCreateProjectRequest = (request, defaults) => ({
30
+ description: request.description,
31
+ name: request.name,
32
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
33
+ });
34
+ const marshalUpdateProjectRequest = (request, defaults) => ({
35
+ description: request.description,
36
+ name: request.name
37
+ });
38
+
39
+ export { marshalCreateProjectRequest, marshalUpdateProjectRequest, unmarshalListProjectsResponse, unmarshalProject };
package/dist/index.cjs CHANGED
@@ -1465,7 +1465,7 @@ const createAdvancedClient = (...configs) => {
1465
1465
 
1466
1466
  const createClient = (profile = {}) => createAdvancedClient(withProfile(profile));
1467
1467
 
1468
- var index$E = /*#__PURE__*/Object.freeze({
1468
+ var index$F = /*#__PURE__*/Object.freeze({
1469
1469
  __proto__: null,
1470
1470
  ScalewayError: ScalewayError,
1471
1471
  AlreadyExistsError: AlreadyExistsError,
@@ -1975,7 +1975,7 @@ const marshalUpdateSSHKeyRequest$1 = (request, defaults) => ({
1975
1975
  });
1976
1976
 
1977
1977
  // This file was automatically generated. DO NOT EDIT.
1978
- const jsonContentHeaders$i = {
1978
+ const jsonContentHeaders$j = {
1979
1979
  'Content-Type': 'application/json; charset=utf-8'
1980
1980
  };
1981
1981
  /** Account API. */
@@ -2003,7 +2003,7 @@ class AccountV2Alpha1GenAPI extends API {
2003
2003
 
2004
2004
  createSSHKey = request => this.client.fetch({
2005
2005
  body: JSON.stringify(marshalCreateSSHKeyRequest$1(request, this.client.settings)),
2006
- headers: jsonContentHeaders$i,
2006
+ headers: jsonContentHeaders$j,
2007
2007
  method: 'POST',
2008
2008
  path: `/account/v2alpha1/ssh-keys`
2009
2009
  }, unmarshalSSHKey$1);
@@ -2027,7 +2027,7 @@ class AccountV2Alpha1GenAPI extends API {
2027
2027
 
2028
2028
  updateSSHKey = request => this.client.fetch({
2029
2029
  body: JSON.stringify(marshalUpdateSSHKeyRequest$1(request, this.client.settings)),
2030
- headers: jsonContentHeaders$i,
2030
+ headers: jsonContentHeaders$j,
2031
2031
  method: 'PATCH',
2032
2032
  path: `/account/v2alpha1/ssh-key/${validatePathParam('sshKeyId', request.sshKeyId)}`
2033
2033
  }, unmarshalSSHKey$1);
@@ -2043,14 +2043,127 @@ class AccountV2Alpha1GenAPI extends API {
2043
2043
  });
2044
2044
  }
2045
2045
 
2046
- var index$D = /*#__PURE__*/Object.freeze({
2046
+ var index$E = /*#__PURE__*/Object.freeze({
2047
2047
  __proto__: null,
2048
2048
  API: AccountV2Alpha1GenAPI
2049
2049
  });
2050
2050
 
2051
+ // This file was automatically generated. DO NOT EDIT.
2052
+ const unmarshalProject = data => {
2053
+ if (!isJSONObject(data)) {
2054
+ throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);
2055
+ }
2056
+
2057
+ return {
2058
+ createdAt: unmarshalDate(data.created_at),
2059
+ description: data.description,
2060
+ id: data.id,
2061
+ name: data.name,
2062
+ organizationId: data.organization_id,
2063
+ updatedAt: unmarshalDate(data.updated_at)
2064
+ };
2065
+ };
2066
+ const unmarshalListProjectsResponse = data => {
2067
+ if (!isJSONObject(data)) {
2068
+ throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);
2069
+ }
2070
+
2071
+ return {
2072
+ projects: unmarshalArrayOfObject(data.projects, unmarshalProject),
2073
+ totalCount: data.total_count
2074
+ };
2075
+ };
2076
+ const marshalCreateProjectRequest = (request, defaults) => ({
2077
+ description: request.description,
2078
+ name: request.name,
2079
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
2080
+ });
2081
+ const marshalUpdateProjectRequest = (request, defaults) => ({
2082
+ description: request.description,
2083
+ name: request.name
2084
+ });
2085
+
2086
+ // This file was automatically generated. DO NOT EDIT.
2087
+ const jsonContentHeaders$i = {
2088
+ 'Content-Type': 'application/json; charset=utf-8'
2089
+ };
2090
+ /**
2091
+ * Account API.
2092
+ *
2093
+ * This API allows you to manage projects.
2094
+ */
2095
+
2096
+ class AccountV2GenAPI extends API {
2097
+ /**
2098
+ * Create project
2099
+ *
2100
+ * @param request - The request {@link CreateProjectRequest}
2101
+ * @returns A Promise of Project
2102
+ */
2103
+ createProject = request => this.client.fetch({
2104
+ body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),
2105
+ headers: jsonContentHeaders$i,
2106
+ method: 'POST',
2107
+ path: `/account/v2/projects`
2108
+ }, unmarshalProject);
2109
+ pageOfListProjects = (request = {}) => this.client.fetch({
2110
+ method: 'GET',
2111
+ path: `/account/v2/projects`,
2112
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
2113
+ }, unmarshalListProjectsResponse);
2114
+ /**
2115
+ * List projects
2116
+ *
2117
+ * @param request - The request {@link ListProjectsRequest}
2118
+ * @returns A Promise of ListProjectsResponse
2119
+ */
2120
+
2121
+ listProjects = (request = {}) => enrichForPagination('projects', this.pageOfListProjects, request);
2122
+ /**
2123
+ * Get project
2124
+ *
2125
+ * @param request - The request {@link GetProjectRequest}
2126
+ * @returns A Promise of Project
2127
+ */
2128
+
2129
+ getProject = (request = {}) => this.client.fetch({
2130
+ method: 'GET',
2131
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`
2132
+ }, unmarshalProject);
2133
+ /**
2134
+ * Delete project
2135
+ *
2136
+ * @param request - The request {@link DeleteProjectRequest}
2137
+ */
2138
+
2139
+ deleteProject = (request = {}) => this.client.fetch({
2140
+ method: 'DELETE',
2141
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`
2142
+ });
2143
+ /**
2144
+ * Update project
2145
+ *
2146
+ * @param request - The request {@link UpdateProjectRequest}
2147
+ * @returns A Promise of Project
2148
+ */
2149
+
2150
+ updateProject = (request = {}) => this.client.fetch({
2151
+ body: JSON.stringify(marshalUpdateProjectRequest(request, this.client.settings)),
2152
+ headers: jsonContentHeaders$i,
2153
+ method: 'PATCH',
2154
+ path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`
2155
+ }, unmarshalProject);
2156
+ }
2157
+
2158
+ var index$D = /*#__PURE__*/Object.freeze({
2159
+ __proto__: null,
2160
+ API: AccountV2GenAPI
2161
+ });
2162
+
2051
2163
  var index$C = /*#__PURE__*/Object.freeze({
2052
2164
  __proto__: null,
2053
- v2alpha1: index$D
2165
+ v2alpha1: index$E,
2166
+ v2: index$D
2054
2167
  });
2055
2168
 
2056
2169
  // This file was automatically generated. DO NOT EDIT.
@@ -10028,7 +10141,8 @@ class InstanceV1UtilsAPI extends InstanceV1GenAPI {
10028
10141
 
10029
10142
  createServer = request => this._createServer(request);
10030
10143
  /**
10031
- * Starts an action and wait for the server to be in the correct "terminal state" expected by this action.
10144
+ * Starts an action and wait for the server to be in the correct "terminal
10145
+ * state" expected by this action.
10032
10146
  *
10033
10147
  * @param request - The request {@link ServerActionRequest}
10034
10148
  * @returns A Promise of Server
@@ -18242,7 +18356,7 @@ exports.AppleSilicon = index$A;
18242
18356
  exports.BareMetal = index$y;
18243
18357
  exports.Container = index$w;
18244
18358
  exports.Domain = index$u;
18245
- exports.Errors = index$E;
18359
+ exports.Errors = index$F;
18246
18360
  exports.FlexibleIP = index$s;
18247
18361
  exports.Function = index$q;
18248
18362
  exports.IAM = index$o;
package/dist/index.d.ts CHANGED
@@ -670,57 +670,57 @@ declare class TransientStateError extends ScalewayError {
670
670
  static fromJSON(status: number, obj: Readonly<JSONObject>): ScalewayError | null;
671
671
  }
672
672
 
673
- type index$E_ScalewayError = ScalewayError;
674
- declare const index$E_ScalewayError: typeof ScalewayError;
675
- type index$E_AlreadyExistsError = AlreadyExistsError;
676
- declare const index$E_AlreadyExistsError: typeof AlreadyExistsError;
677
- type index$E_DeniedAuthenticationError = DeniedAuthenticationError;
678
- declare const index$E_DeniedAuthenticationError: typeof DeniedAuthenticationError;
679
- type index$E_InvalidArgumentsError = InvalidArgumentsError;
680
- declare const index$E_InvalidArgumentsError: typeof InvalidArgumentsError;
681
- type index$E_InvalidArgumentsErrorDetails = InvalidArgumentsErrorDetails;
682
- type index$E_OutOfStockError = OutOfStockError;
683
- declare const index$E_OutOfStockError: typeof OutOfStockError;
684
- type index$E_PermissionsDeniedError = PermissionsDeniedError;
685
- declare const index$E_PermissionsDeniedError: typeof PermissionsDeniedError;
686
- type index$E_PermissionsDeniedErrorDetails = PermissionsDeniedErrorDetails;
687
- type index$E_PreconditionFailedError = PreconditionFailedError;
688
- declare const index$E_PreconditionFailedError: typeof PreconditionFailedError;
689
- type index$E_QuotasExceededError = QuotasExceededError;
690
- declare const index$E_QuotasExceededError: typeof QuotasExceededError;
691
- type index$E_QuotasExceededErrorDetails = QuotasExceededErrorDetails;
692
- type index$E_QuotasExceededErrorScope = QuotasExceededErrorScope;
693
- type index$E_ResourceExpiredError = ResourceExpiredError;
694
- declare const index$E_ResourceExpiredError: typeof ResourceExpiredError;
695
- type index$E_ResourceLockedError = ResourceLockedError;
696
- declare const index$E_ResourceLockedError: typeof ResourceLockedError;
697
- type index$E_ResourceNotFoundError = ResourceNotFoundError;
698
- declare const index$E_ResourceNotFoundError: typeof ResourceNotFoundError;
699
- type index$E_TooManyRequestsError = TooManyRequestsError;
700
- declare const index$E_TooManyRequestsError: typeof TooManyRequestsError;
701
- type index$E_TooManyRequestsQuotaPolicy = TooManyRequestsQuotaPolicy;
702
- type index$E_TransientStateError = TransientStateError;
703
- declare const index$E_TransientStateError: typeof TransientStateError;
704
- declare namespace index$E {
673
+ type index$F_ScalewayError = ScalewayError;
674
+ declare const index$F_ScalewayError: typeof ScalewayError;
675
+ type index$F_AlreadyExistsError = AlreadyExistsError;
676
+ declare const index$F_AlreadyExistsError: typeof AlreadyExistsError;
677
+ type index$F_DeniedAuthenticationError = DeniedAuthenticationError;
678
+ declare const index$F_DeniedAuthenticationError: typeof DeniedAuthenticationError;
679
+ type index$F_InvalidArgumentsError = InvalidArgumentsError;
680
+ declare const index$F_InvalidArgumentsError: typeof InvalidArgumentsError;
681
+ type index$F_InvalidArgumentsErrorDetails = InvalidArgumentsErrorDetails;
682
+ type index$F_OutOfStockError = OutOfStockError;
683
+ declare const index$F_OutOfStockError: typeof OutOfStockError;
684
+ type index$F_PermissionsDeniedError = PermissionsDeniedError;
685
+ declare const index$F_PermissionsDeniedError: typeof PermissionsDeniedError;
686
+ type index$F_PermissionsDeniedErrorDetails = PermissionsDeniedErrorDetails;
687
+ type index$F_PreconditionFailedError = PreconditionFailedError;
688
+ declare const index$F_PreconditionFailedError: typeof PreconditionFailedError;
689
+ type index$F_QuotasExceededError = QuotasExceededError;
690
+ declare const index$F_QuotasExceededError: typeof QuotasExceededError;
691
+ type index$F_QuotasExceededErrorDetails = QuotasExceededErrorDetails;
692
+ type index$F_QuotasExceededErrorScope = QuotasExceededErrorScope;
693
+ type index$F_ResourceExpiredError = ResourceExpiredError;
694
+ declare const index$F_ResourceExpiredError: typeof ResourceExpiredError;
695
+ type index$F_ResourceLockedError = ResourceLockedError;
696
+ declare const index$F_ResourceLockedError: typeof ResourceLockedError;
697
+ type index$F_ResourceNotFoundError = ResourceNotFoundError;
698
+ declare const index$F_ResourceNotFoundError: typeof ResourceNotFoundError;
699
+ type index$F_TooManyRequestsError = TooManyRequestsError;
700
+ declare const index$F_TooManyRequestsError: typeof TooManyRequestsError;
701
+ type index$F_TooManyRequestsQuotaPolicy = TooManyRequestsQuotaPolicy;
702
+ type index$F_TransientStateError = TransientStateError;
703
+ declare const index$F_TransientStateError: typeof TransientStateError;
704
+ declare namespace index$F {
705
705
  export {
706
- index$E_ScalewayError as ScalewayError,
707
- index$E_AlreadyExistsError as AlreadyExistsError,
708
- index$E_DeniedAuthenticationError as DeniedAuthenticationError,
709
- index$E_InvalidArgumentsError as InvalidArgumentsError,
710
- index$E_InvalidArgumentsErrorDetails as InvalidArgumentsErrorDetails,
711
- index$E_OutOfStockError as OutOfStockError,
712
- index$E_PermissionsDeniedError as PermissionsDeniedError,
713
- index$E_PermissionsDeniedErrorDetails as PermissionsDeniedErrorDetails,
714
- index$E_PreconditionFailedError as PreconditionFailedError,
715
- index$E_QuotasExceededError as QuotasExceededError,
716
- index$E_QuotasExceededErrorDetails as QuotasExceededErrorDetails,
717
- index$E_QuotasExceededErrorScope as QuotasExceededErrorScope,
718
- index$E_ResourceExpiredError as ResourceExpiredError,
719
- index$E_ResourceLockedError as ResourceLockedError,
720
- index$E_ResourceNotFoundError as ResourceNotFoundError,
721
- index$E_TooManyRequestsError as TooManyRequestsError,
722
- index$E_TooManyRequestsQuotaPolicy as TooManyRequestsQuotaPolicy,
723
- index$E_TransientStateError as TransientStateError,
706
+ index$F_ScalewayError as ScalewayError,
707
+ index$F_AlreadyExistsError as AlreadyExistsError,
708
+ index$F_DeniedAuthenticationError as DeniedAuthenticationError,
709
+ index$F_InvalidArgumentsError as InvalidArgumentsError,
710
+ index$F_InvalidArgumentsErrorDetails as InvalidArgumentsErrorDetails,
711
+ index$F_OutOfStockError as OutOfStockError,
712
+ index$F_PermissionsDeniedError as PermissionsDeniedError,
713
+ index$F_PermissionsDeniedErrorDetails as PermissionsDeniedErrorDetails,
714
+ index$F_PreconditionFailedError as PreconditionFailedError,
715
+ index$F_QuotasExceededError as QuotasExceededError,
716
+ index$F_QuotasExceededErrorDetails as QuotasExceededErrorDetails,
717
+ index$F_QuotasExceededErrorScope as QuotasExceededErrorScope,
718
+ index$F_ResourceExpiredError as ResourceExpiredError,
719
+ index$F_ResourceLockedError as ResourceLockedError,
720
+ index$F_ResourceNotFoundError as ResourceNotFoundError,
721
+ index$F_TooManyRequestsError as TooManyRequestsError,
722
+ index$F_TooManyRequestsQuotaPolicy as TooManyRequestsQuotaPolicy,
723
+ index$F_TransientStateError as TransientStateError,
724
724
  };
725
725
  }
726
726
 
@@ -988,14 +988,14 @@ declare class AccountV2Alpha1GenAPI extends API {
988
988
  deleteSSHKey: (request: Readonly<DeleteSSHKeyRequest$1>) => Promise<void>;
989
989
  }
990
990
 
991
- type index$D_SSHKeyCreationInfo = SSHKeyCreationInfo;
992
- declare namespace index$D {
991
+ type index$E_SSHKeyCreationInfo = SSHKeyCreationInfo;
992
+ declare namespace index$E {
993
993
  export {
994
994
  AccountV2Alpha1GenAPI as API,
995
995
  ListSSHKeysRequestOrderBy$1 as ListSSHKeysRequestOrderBy,
996
996
  ListSSHKeysResponse$1 as ListSSHKeysResponse,
997
997
  SSHKey$1 as SSHKey,
998
- index$D_SSHKeyCreationInfo as SSHKeyCreationInfo,
998
+ index$E_SSHKeyCreationInfo as SSHKeyCreationInfo,
999
999
  ListSSHKeysRequest$1 as ListSSHKeysRequest,
1000
1000
  CreateSSHKeyRequest$1 as CreateSSHKeyRequest,
1001
1001
  GetSSHKeyRequest$1 as GetSSHKeyRequest,
@@ -1004,9 +1004,138 @@ declare namespace index$D {
1004
1004
  };
1005
1005
  }
1006
1006
 
1007
+ declare type ListProjectsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc';
1008
+ /** List projects response */
1009
+ interface ListProjectsResponse {
1010
+ /** The total number of projects */
1011
+ totalCount: number;
1012
+ /** The paginated returned projects */
1013
+ projects: Array<Project>;
1014
+ }
1015
+ /** Project */
1016
+ interface Project {
1017
+ /** The ID of the project */
1018
+ id: string;
1019
+ /** The name of the project */
1020
+ name: string;
1021
+ /** The organization ID of the project */
1022
+ organizationId: string;
1023
+ /** The creation date of the project */
1024
+ createdAt?: Date;
1025
+ /** The update date of the project */
1026
+ updatedAt?: Date;
1027
+ /** The description of the project */
1028
+ description: string;
1029
+ }
1030
+ declare type CreateProjectRequest = {
1031
+ /** The name of the project */
1032
+ name: string;
1033
+ /** The organization ID of the project */
1034
+ organizationId?: string;
1035
+ /** The description of the project */
1036
+ description?: string;
1037
+ };
1038
+ declare type ListProjectsRequest = {
1039
+ /** The organization ID of the project */
1040
+ organizationId?: string;
1041
+ /** The name of the project */
1042
+ name?: string;
1043
+ /** The page number for the returned projects */
1044
+ page?: number;
1045
+ /** The maximum number of project per page */
1046
+ pageSize?: number;
1047
+ /** The sort order of the returned projects */
1048
+ orderBy?: ListProjectsRequestOrderBy;
1049
+ };
1050
+ declare type GetProjectRequest = {
1051
+ /** The project ID of the project */
1052
+ projectId?: string;
1053
+ };
1054
+ declare type DeleteProjectRequest = {
1055
+ /** The project ID of the project */
1056
+ projectId?: string;
1057
+ };
1058
+ declare type UpdateProjectRequest = {
1059
+ /** The project ID of the project */
1060
+ projectId?: string;
1061
+ /** The name of the project */
1062
+ name?: string;
1063
+ /** The description of the project */
1064
+ description?: string;
1065
+ };
1066
+
1067
+ /**
1068
+ * Account API.
1069
+ *
1070
+ * This API allows you to manage projects.
1071
+ */
1072
+ declare class AccountV2GenAPI extends API {
1073
+ /**
1074
+ * Create project
1075
+ *
1076
+ * @param request - The request {@link CreateProjectRequest}
1077
+ * @returns A Promise of Project
1078
+ */
1079
+ createProject: (request: Readonly<CreateProjectRequest>) => Promise<Project>;
1080
+ protected pageOfListProjects: (request?: Readonly<ListProjectsRequest>) => Promise<ListProjectsResponse>;
1081
+ /**
1082
+ * List projects
1083
+ *
1084
+ * @param request - The request {@link ListProjectsRequest}
1085
+ * @returns A Promise of ListProjectsResponse
1086
+ */
1087
+ listProjects: (request?: Readonly<ListProjectsRequest>) => Promise<ListProjectsResponse> & {
1088
+ all: () => Promise<Project[]>;
1089
+ [Symbol.asyncIterator]: () => AsyncGenerator<Project[], void, void>;
1090
+ };
1091
+ /**
1092
+ * Get project
1093
+ *
1094
+ * @param request - The request {@link GetProjectRequest}
1095
+ * @returns A Promise of Project
1096
+ */
1097
+ getProject: (request?: Readonly<GetProjectRequest>) => Promise<Project>;
1098
+ /**
1099
+ * Delete project
1100
+ *
1101
+ * @param request - The request {@link DeleteProjectRequest}
1102
+ */
1103
+ deleteProject: (request?: Readonly<DeleteProjectRequest>) => Promise<void>;
1104
+ /**
1105
+ * Update project
1106
+ *
1107
+ * @param request - The request {@link UpdateProjectRequest}
1108
+ * @returns A Promise of Project
1109
+ */
1110
+ updateProject: (request?: Readonly<UpdateProjectRequest>) => Promise<Project>;
1111
+ }
1112
+
1113
+ type index$D_ListProjectsRequestOrderBy = ListProjectsRequestOrderBy;
1114
+ type index$D_ListProjectsResponse = ListProjectsResponse;
1115
+ type index$D_Project = Project;
1116
+ type index$D_CreateProjectRequest = CreateProjectRequest;
1117
+ type index$D_ListProjectsRequest = ListProjectsRequest;
1118
+ type index$D_GetProjectRequest = GetProjectRequest;
1119
+ type index$D_DeleteProjectRequest = DeleteProjectRequest;
1120
+ type index$D_UpdateProjectRequest = UpdateProjectRequest;
1121
+ declare namespace index$D {
1122
+ export {
1123
+ AccountV2GenAPI as API,
1124
+ index$D_ListProjectsRequestOrderBy as ListProjectsRequestOrderBy,
1125
+ index$D_ListProjectsResponse as ListProjectsResponse,
1126
+ index$D_Project as Project,
1127
+ index$D_CreateProjectRequest as CreateProjectRequest,
1128
+ index$D_ListProjectsRequest as ListProjectsRequest,
1129
+ index$D_GetProjectRequest as GetProjectRequest,
1130
+ index$D_DeleteProjectRequest as DeleteProjectRequest,
1131
+ index$D_UpdateProjectRequest as UpdateProjectRequest,
1132
+ };
1133
+ }
1134
+
1007
1135
  declare namespace index$C {
1008
1136
  export {
1009
- index$D as v2alpha1,
1137
+ index$E as v2alpha1,
1138
+ index$D as v2,
1010
1139
  };
1011
1140
  }
1012
1141
 
@@ -1386,6 +1515,7 @@ interface CPU {
1386
1515
  coreCount: number;
1387
1516
  /** Number of threads of the CPU */
1388
1517
  threadCount: number;
1518
+ /** Frequency of the CPU in MHz */
1389
1519
  frequency: number;
1390
1520
  }
1391
1521
  /** Create server request. install */
@@ -8098,21 +8228,21 @@ declare type UpdatePlacementGroupServersRequest = {
8098
8228
  declare type ListIpsRequest = {
8099
8229
  /** Zone to target. If none is passed will use default zone from the config */
8100
8230
  zone?: Zone;
8231
+ /** The project ID the IPs are reserved in */
8232
+ project?: string;
8101
8233
  /** The organization ID the IPs are reserved in */
8102
8234
  organization?: string;
8235
+ /**
8236
+ * Filter IPs with these exact tags (to filter with several tags, use commas
8237
+ * to separate them)
8238
+ */
8239
+ tags?: Array<string>;
8103
8240
  /** Filter on the IP address (Works as a LIKE operation on the IP address) */
8104
8241
  name?: string;
8105
8242
  /** A positive integer lower or equal to 100 to select the number of items to return */
8106
8243
  perPage?: number;
8107
8244
  /** A positive integer to choose the page to return */
8108
8245
  page?: number;
8109
- /** The project ID the IPs are reserved in */
8110
- project?: string;
8111
- /**
8112
- * Filter IPs with these exact tags (to filter with several tags, use commas
8113
- * to separate them)
8114
- */
8115
- tags?: Array<string>;
8116
8246
  };
8117
8247
  declare type CreateIpRequest$1 = {
8118
8248
  /** Zone to target. If none is passed will use default zone from the config */
@@ -8887,13 +9017,13 @@ declare type UpdateSecurityGroupRuleRequest = {
8887
9017
  ipRange?: string;
8888
9018
  position?: number;
8889
9019
  /**
8890
- * If set to 0, DestPortFrom will be removed.
8891
- * See SecurityGroupRule.DestPortFrom for more information
9020
+ * If set to 0, DestPortFrom will be removed. See
9021
+ * SecurityGroupRule.DestPortFrom for more information
8892
9022
  */
8893
9023
  destPortFrom?: number;
8894
9024
  /**
8895
- * If set to 0, DestPortTo will be removed.
8896
- * See SecurityGroupRule.DestPortTo for more information
9025
+ * If set to 0, DestPortTo will be removed. See SecurityGroupRule.DestPortTo
9026
+ * for more information
8897
9027
  */
8898
9028
  destPortTo?: number;
8899
9029
  };
@@ -8995,7 +9125,8 @@ declare class InstanceV1UtilsAPI extends InstanceV1GenAPI {
8995
9125
  */
8996
9126
  createServer: (request: Readonly<CreateServerRequest>) => Promise<CreateServerResponse>;
8997
9127
  /**
8998
- * Starts an action and wait for the server to be in the correct "terminal state" expected by this action.
9128
+ * Starts an action and wait for the server to be in the correct "terminal
9129
+ * state" expected by this action.
8999
9130
  *
9000
9131
  * @param request - The request {@link ServerActionRequest}
9001
9132
  * @returns A Promise of Server
@@ -9472,8 +9603,18 @@ interface DeviceMessageFilters {
9472
9603
  /** Filtering rule to restrict topics the device can subscribe to */
9473
9604
  subscribe?: DeviceMessageFiltersRule;
9474
9605
  }
9606
+ /** Device. message filters. rule */
9475
9607
  interface DeviceMessageFiltersRule {
9608
+ /**
9609
+ * If accept, the set will accept all topics in the topics list, but no other.
9610
+ * If reject, the set will deny all topics in the topics list, but all others
9611
+ * will be allowed.
9612
+ */
9476
9613
  policy: DeviceMessageFiltersRulePolicy;
9614
+ /**
9615
+ * List of topics to accept or reject. It must be valid MQTT topics and up to
9616
+ * 65535 characters
9617
+ */
9477
9618
  topics?: Array<string>;
9478
9619
  }
9479
9620
  /** Get device certificate response */
@@ -11239,7 +11380,7 @@ declare type CreateClusterRequest$1 = {
11239
11380
  */
11240
11381
  autoscalerConfig?: CreateClusterRequestAutoscalerConfig;
11241
11382
  /**
11242
- * This configuratiom enables to set a speicific 2-hour time window in which
11383
+ * This configuration enables to set a specific 2-hour time window in which
11243
11384
  * the cluster can be automatically updated to the latest patch version in the
11244
11385
  * current minor one.
11245
11386
  */
@@ -11289,8 +11430,8 @@ declare type UpdateClusterRequest$1 = {
11289
11430
  /** @deprecated The new Ingress Controller for the cluster */
11290
11431
  ingress?: Ingress;
11291
11432
  /**
11292
- * The new auo upgrade configuration of the cluster. Note that all the fields
11293
- * needs to be set.
11433
+ * The new auto upgrade configuration of the cluster. Note that all fields
11434
+ * need to be set.
11294
11435
  */
11295
11436
  autoUpgrade?: UpdateClusterRequestAutoUpgrade;
11296
11437
  /** List of feature gates to enable */
@@ -12584,20 +12725,47 @@ declare type GetBackendRequest = {
12584
12725
  declare type UpdateBackendRequest = {
12585
12726
  /** Region to target. If none is passed will use default region from the config */
12586
12727
  region?: Region;
12728
+ /** Backend ID to update */
12587
12729
  backendId: string;
12730
+ /** Resource name */
12588
12731
  name: string;
12732
+ /** Backend protocol. TCP or HTTP */
12589
12733
  forwardProtocol: Protocol;
12734
+ /** User sessions will be forwarded to this port of backend servers */
12590
12735
  forwardPort: number;
12736
+ /** Load balancing algorithm */
12591
12737
  forwardPortAlgorithm: ForwardPortAlgorithm;
12738
+ /** Enable cookie-based session persistence */
12592
12739
  stickySessions: StickySessionsType;
12740
+ /** Cookie name for for sticky sessions */
12593
12741
  stickySessionsCookieName: string;
12594
- /** @deprecated */
12742
+ /** @deprecated Deprecated in favor of proxy_protocol field! */
12595
12743
  sendProxyV2?: boolean;
12744
+ /** Maximum server connection inactivity time */
12596
12745
  timeoutServer?: string;
12746
+ /** Maximum initial server connection establishment time */
12597
12747
  timeoutConnect?: string;
12748
+ /** Maximum tunnel inactivity time */
12598
12749
  timeoutTunnel?: string;
12750
+ /** Modify what occurs when a backend server is marked down */
12599
12751
  onMarkedDownAction: OnMarkedDownAction;
12752
+ /**
12753
+ * The PROXY protocol informs the other end about the incoming connection, so
12754
+ * that it can know the client's address or the public address it accessed to,
12755
+ * whatever the upper layer protocol is.
12756
+ *
12757
+ * `proxy_protocol_none` Disable proxy protocol. `proxy_protocol_v1` Version
12758
+ * one (text format). `proxy_protocol_v2` Version two (binary format).
12759
+ * `proxy_protocol_v2_ssl` Version two with SSL connection.
12760
+ * `proxy_protocol_v2_ssl_cn` Version two with SSL connection and common name
12761
+ * information.
12762
+ */
12600
12763
  proxyProtocol: ProxyProtocol;
12764
+ /**
12765
+ * Only the host part of the Scaleway S3 bucket website is expected. Example:
12766
+ * `failover-website.s3-website.fr-par.scw.cloud` if your bucket website URL
12767
+ * is `https://failover-website.s3-website.fr-par.scw.cloud/`.
12768
+ */
12601
12769
  failoverHost?: string;
12602
12770
  };
12603
12771
  declare type DeleteBackendRequest = {
@@ -13298,20 +13466,47 @@ declare type ZonedApiGetBackendRequest = {
13298
13466
  declare type ZonedApiUpdateBackendRequest = {
13299
13467
  /** Zone to target. If none is passed will use default zone from the config */
13300
13468
  zone?: Zone;
13469
+ /** Backend ID to update */
13301
13470
  backendId: string;
13471
+ /** Resource name */
13302
13472
  name: string;
13473
+ /** Backend protocol. TCP or HTTP */
13303
13474
  forwardProtocol: Protocol;
13475
+ /** User sessions will be forwarded to this port of backend servers */
13304
13476
  forwardPort: number;
13477
+ /** Load balancing algorithm */
13305
13478
  forwardPortAlgorithm: ForwardPortAlgorithm;
13479
+ /** Enable cookie-based session persistence */
13306
13480
  stickySessions: StickySessionsType;
13481
+ /** Cookie name for for sticky sessions */
13307
13482
  stickySessionsCookieName: string;
13308
- /** @deprecated */
13483
+ /** @deprecated Deprecated in favor of proxy_protocol field! */
13309
13484
  sendProxyV2?: boolean;
13485
+ /** Maximum server connection inactivity time */
13310
13486
  timeoutServer?: string;
13487
+ /** Maximum initial server connection establishment time */
13311
13488
  timeoutConnect?: string;
13489
+ /** Maximum tunnel inactivity time */
13312
13490
  timeoutTunnel?: string;
13491
+ /** Modify what occurs when a backend server is marked down */
13313
13492
  onMarkedDownAction: OnMarkedDownAction;
13493
+ /**
13494
+ * The PROXY protocol informs the other end about the incoming connection, so
13495
+ * that it can know the client's address or the public address it accessed to,
13496
+ * whatever the upper layer protocol is.
13497
+ *
13498
+ * `proxy_protocol_none` Disable proxy protocol. `proxy_protocol_v1` Version
13499
+ * one (text format). `proxy_protocol_v2` Version two (binary format).
13500
+ * `proxy_protocol_v2_ssl` Version two with SSL connection.
13501
+ * `proxy_protocol_v2_ssl_cn` Version two with SSL connection and common name
13502
+ * information.
13503
+ */
13314
13504
  proxyProtocol: ProxyProtocol;
13505
+ /**
13506
+ * Only the host part of the Scaleway S3 bucket website is expected. Example:
13507
+ * `failover-website.s3-website.fr-par.scw.cloud` if your bucket website URL
13508
+ * is `https://failover-website.s3-website.fr-par.scw.cloud/`.
13509
+ */
13315
13510
  failoverHost?: string;
13316
13511
  };
13317
13512
  declare type ZonedApiDeleteBackendRequest = {
@@ -15096,7 +15291,7 @@ interface Image$1 {
15096
15291
  modificationDate?: Date;
15097
15292
  /** Expiration date of this image */
15098
15293
  validUntil?: Date;
15099
- /** Label of this image */
15294
+ /** Typically an identifier for a distribution (ex. "ubuntu_focal"). */
15100
15295
  label: string;
15101
15296
  /** List of versions of this image */
15102
15297
  versions: Array<Version>;
@@ -15114,7 +15309,7 @@ interface ListVersionsResponse$1 {
15114
15309
  }
15115
15310
  /** Local image */
15116
15311
  interface LocalImage {
15117
- /** UUID of this local image */
15312
+ /** Version you will typically use to define an image in an API call. */
15118
15313
  id: string;
15119
15314
  /** List of all commercial types that are compatible with this local image */
15120
15315
  compatibleCommercialTypes: Array<string>;
@@ -17618,11 +17813,13 @@ declare type AddEndpointsRequest = {
17618
17813
  declare type DeleteEndpointRequest = {
17619
17814
  /** Zone to target. If none is passed will use default zone from the config */
17620
17815
  zone?: Zone;
17816
+ /** UUID of the endpoint you want to delete */
17621
17817
  endpointId: string;
17622
17818
  };
17623
17819
  declare type GetEndpointRequest = {
17624
17820
  /** Zone to target. If none is passed will use default zone from the config */
17625
17821
  zone?: Zone;
17822
+ /** UUID of the endpoint you want to get */
17626
17823
  endpointId: string;
17627
17824
  };
17628
17825
  declare type UpdateEndpointRequest = {
@@ -19956,4 +20153,4 @@ declare namespace index {
19956
20153
  };
19957
20154
  }
19958
20155
 
19959
- export { API, index$C as Account, index$A as AppleSilicon, index$y as BareMetal, Client, ClientConfig, index$w as Container, DefaultValues, index$u as Domain, index$E as Errors, index$s as FlexibleIP, index$q as Function, index$o as IAM, index$k as IOT, index$m as Instance, index$i as K8S, index$g as LB, Logger, index$c as MNQ, index$e as Marketplace, Money, Profile, index$a as RDB, index$8 as Redis, Region, index$6 as Registry, RequestInterceptor, ResponseInterceptor, ScwFile, ServiceInfo, Settings, index$4 as Test, TimeSeries, index$2 as VPC, index as VPCGW, WaitForOptions, WaitForStopCondition, Zone, authenticateWithSessionToken, createAdvancedClient, createClient, enableConsoleLogger, enrichForPagination, marshalMoney, marshalScwFile, marshalTimeSeries, resolveOneOf, setLogger, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint, urlParams, validatePathParam, waitForResource, withDefaultPageSize, withHTTPClient, withProfile, withUserAgent, withUserAgentSuffix };
20156
+ export { API, index$C as Account, index$A as AppleSilicon, index$y as BareMetal, Client, ClientConfig, index$w as Container, DefaultValues, index$u as Domain, index$F as Errors, index$s as FlexibleIP, index$q as Function, index$o as IAM, index$k as IOT, index$m as Instance, index$i as K8S, index$g as LB, Logger, index$c as MNQ, index$e as Marketplace, Money, Profile, index$a as RDB, index$8 as Redis, Region, index$6 as Registry, RequestInterceptor, ResponseInterceptor, ScwFile, ServiceInfo, Settings, index$4 as Test, TimeSeries, index$2 as VPC, index as VPCGW, WaitForOptions, WaitForStopCondition, Zone, authenticateWithSessionToken, createAdvancedClient, createClient, enableConsoleLogger, enrichForPagination, marshalMoney, marshalScwFile, marshalTimeSeries, resolveOneOf, setLogger, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, unmarshalMoney, unmarshalScwFile, unmarshalServiceInfo, unmarshalTimeSeries, unmarshalTimeSeriesPoint, urlParams, validatePathParam, waitForResource, withDefaultPageSize, withHTTPClient, withProfile, withUserAgent, withUserAgentSuffix };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -33,5 +33,5 @@
33
33
  "bundledDependencies": [
34
34
  "@scaleway/random-name"
35
35
  ],
36
- "gitHead": "9f6b31b84bc81e2f571c12fb369c00fa8d755210"
36
+ "gitHead": "b097ed4b741a306c7c35239bc5e3d496516cc964"
37
37
  }