@scaleway/sdk 1.21.0 → 1.22.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.
@@ -1,7 +1,7 @@
1
1
  import { API as API$1 } from '../../../scw/api.js';
2
2
  import { urlParams, validatePathParam, resolveOneOf } from '../../../helpers/marshalling.js';
3
3
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
4
- import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest, unmarshalListQuotaResponse, unmarshalQuotum, unmarshalListJWTsResponse, unmarshalJWT } from './marshalling.gen.js';
4
+ import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, marshalCreateUserRequest, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest, unmarshalListQuotaResponse, unmarshalQuotum, unmarshalListJWTsResponse, unmarshalJWT } from './marshalling.gen.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -156,6 +156,20 @@ class API extends API$1 {
156
156
  method: 'DELETE',
157
157
  path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
158
158
  });
159
+
160
+ /**
161
+ * Create a new user. Create a new user. You must define the `organization_id`
162
+ * and the `email` in your request.
163
+ *
164
+ * @param request - The request {@link CreateUserRequest}
165
+ * @returns A Promise of User
166
+ */
167
+ createUser = request => this.client.fetch({
168
+ body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)),
169
+ headers: jsonContentHeaders,
170
+ method: 'POST',
171
+ path: `/iam/v1alpha1/users`
172
+ }, unmarshalUser);
159
173
  pageOfListApplications = (() => {
160
174
  var _this5 = this;
161
175
  return function (request) {
@@ -325,6 +325,10 @@ const marshalCreateSSHKeyRequest = (request, defaults) => ({
325
325
  project_id: request.projectId ?? defaults.defaultProjectId,
326
326
  public_key: request.publicKey
327
327
  });
328
+ const marshalCreateUserRequest = (request, defaults) => ({
329
+ email: request.email,
330
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
331
+ });
328
332
  const marshalRemoveGroupMemberRequest = (request, defaults) => ({
329
333
  ...resolveOneOf([{
330
334
  param: 'user_id',
@@ -376,4 +380,4 @@ const marshalUpdateSSHKeyRequest = (request, defaults) => ({
376
380
  name: request.name
377
381
  });
378
382
 
379
- export { marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalCreateAPIKeyRequest, marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalRemoveGroupMemberRequest, marshalSetGroupMembersRequest, marshalSetRulesRequest, marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, unmarshalAPIKey, unmarshalApplication, unmarshalGroup, unmarshalJWT, unmarshalListAPIKeysResponse, unmarshalListApplicationsResponse, unmarshalListGroupsResponse, unmarshalListJWTsResponse, unmarshalListPermissionSetsResponse, unmarshalListPoliciesResponse, unmarshalListQuotaResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListUsersResponse, unmarshalPolicy, unmarshalQuotum, unmarshalSSHKey, unmarshalSetRulesResponse, unmarshalUser };
383
+ export { marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalCreateAPIKeyRequest, marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalCreateUserRequest, marshalRemoveGroupMemberRequest, marshalSetGroupMembersRequest, marshalSetRulesRequest, marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, unmarshalAPIKey, unmarshalApplication, unmarshalGroup, unmarshalJWT, unmarshalListAPIKeysResponse, unmarshalListApplicationsResponse, unmarshalListGroupsResponse, unmarshalListJWTsResponse, unmarshalListPermissionSetsResponse, unmarshalListPoliciesResponse, unmarshalListQuotaResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListUsersResponse, unmarshalPolicy, unmarshalQuotum, unmarshalSSHKey, unmarshalSetRulesResponse, unmarshalUser };
@@ -83,7 +83,7 @@ class API extends API$1 {
83
83
  return _this4.client.fetch({
84
84
  method: 'GET',
85
85
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? _this4.client.settings.defaultZone)}/servers`,
86
- urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? _this4.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
86
+ urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? _this4.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
87
87
  }, unmarshalListServersResponse);
88
88
  };
89
89
  })();
package/dist/index.cjs CHANGED
@@ -497,7 +497,7 @@ const assertValidSettings = obj => {
497
497
  }
498
498
  };
499
499
 
500
- const version = 'v1.20.0';
500
+ const version = 'v1.21.0';
501
501
  const userAgent = `scaleway-sdk-js/${version}`;
502
502
 
503
503
  const isBrowser = () => typeof window !== 'undefined' && typeof window.document !== 'undefined';
@@ -8611,6 +8611,10 @@ const marshalCreateSSHKeyRequest = (request, defaults) => ({
8611
8611
  project_id: request.projectId ?? defaults.defaultProjectId,
8612
8612
  public_key: request.publicKey
8613
8613
  });
8614
+ const marshalCreateUserRequest$1 = (request, defaults) => ({
8615
+ email: request.email,
8616
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
8617
+ });
8614
8618
  const marshalRemoveGroupMemberRequest = (request, defaults) => ({
8615
8619
  ...resolveOneOf([{
8616
8620
  param: 'user_id',
@@ -8783,6 +8787,20 @@ let API$i = class API extends API$s {
8783
8787
  method: 'DELETE',
8784
8788
  path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
8785
8789
  });
8790
+
8791
+ /**
8792
+ * Create a new user. Create a new user. You must define the `organization_id`
8793
+ * and the `email` in your request.
8794
+ *
8795
+ * @param request - The request {@link CreateUserRequest}
8796
+ * @returns A Promise of User
8797
+ */
8798
+ createUser = request => this.client.fetch({
8799
+ body: JSON.stringify(marshalCreateUserRequest$1(request, this.client.settings)),
8800
+ headers: jsonContentHeaders$g,
8801
+ method: 'POST',
8802
+ path: `/iam/v1alpha1/users`
8803
+ }, unmarshalUser$1);
8786
8804
  pageOfListApplications = (request = {}) => this.client.fetch({
8787
8805
  method: 'GET',
8788
8806
  path: `/iam/v1alpha1/applications`,
@@ -10931,7 +10949,7 @@ let API$h = class API extends API$s {
10931
10949
  pageOfListServers = (request = {}) => this.client.fetch({
10932
10950
  method: 'GET',
10933
10951
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,
10934
- urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
10952
+ urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
10935
10953
  }, unmarshalListServersResponse);
10936
10954
 
10937
10955
  /**
package/dist/index.d.ts CHANGED
@@ -129,7 +129,7 @@ interface ResponseInterceptor {
129
129
  * @public
130
130
  */
131
131
  interface ResponseErrorInterceptor {
132
- ({ request, error }: {
132
+ ({ request, error, }: {
133
133
  request: Request;
134
134
  error: unknown;
135
135
  }): unknown | Promise<unknown>;
@@ -8902,6 +8902,12 @@ type DeleteUserRequest$1 = {
8902
8902
  /** ID of the user to delete. */
8903
8903
  userId: string;
8904
8904
  };
8905
+ type CreateUserRequest$1 = {
8906
+ /** ID of the Organization. */
8907
+ organizationId?: string;
8908
+ /** Email of the user. */
8909
+ email: string;
8910
+ };
8905
8911
  type ListApplicationsRequest$1 = {
8906
8912
  /** Criteria for sorting results. */
8907
8913
  orderBy?: ListApplicationsRequestOrderBy;
@@ -9356,6 +9362,14 @@ declare class API$i extends API$s {
9356
9362
  * @param request - The request {@link DeleteUserRequest}
9357
9363
  */
9358
9364
  deleteUser: (request: Readonly<DeleteUserRequest$1>) => Promise<void>;
9365
+ /**
9366
+ * Create a new user. Create a new user. You must define the `organization_id`
9367
+ * and the `email` in your request.
9368
+ *
9369
+ * @param request - The request {@link CreateUserRequest}
9370
+ * @returns A Promise of User
9371
+ */
9372
+ createUser: (request: Readonly<CreateUserRequest$1>) => Promise<User$1>;
9359
9373
  protected pageOfListApplications: (request?: Readonly<ListApplicationsRequest$1>) => Promise<ListApplicationsResponse>;
9360
9374
  /**
9361
9375
  * List applications of an Organization. List the applications of an
@@ -10017,6 +10031,7 @@ declare namespace index_gen$f {
10017
10031
  CreateGroupRequest$1 as CreateGroupRequest,
10018
10032
  CreatePolicyRequest$1 as CreatePolicyRequest,
10019
10033
  CreateSSHKeyRequest$1 as CreateSSHKeyRequest,
10034
+ CreateUserRequest$1 as CreateUserRequest,
10020
10035
  index_gen$f_DeleteAPIKeyRequest as DeleteAPIKeyRequest,
10021
10036
  index_gen$f_DeleteApplicationRequest as DeleteApplicationRequest,
10022
10037
  index_gen$f_DeleteGroupRequest as DeleteGroupRequest,
@@ -10948,6 +10963,11 @@ type ListServersRequest = {
10948
10963
  privateNetwork?: string;
10949
10964
  /** Define the order of the returned servers. */
10950
10965
  order?: ListServersRequestOrder;
10966
+ /**
10967
+ * List Instances from the given Private Networks (use commas to separate
10968
+ * them).
10969
+ */
10970
+ privateNetworks?: string[];
10951
10971
  };
10952
10972
  type DeleteServerRequest = {
10953
10973
  /** Zone to target. If none is passed will use default zone from the config. */
@@ -25079,7 +25099,7 @@ declare namespace index$6 {
25079
25099
  type ListSecretsRequestOrderBy = 'name_asc' | 'name_desc' | 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc';
25080
25100
  type Product = 'unknown';
25081
25101
  type SecretStatus = 'ready' | 'locked';
25082
- type SecretType = 'unknown_secret_type' | 'opaque' | 'network_edge_certificate';
25102
+ type SecretType = 'unknown_secret_type' | 'opaque' | 'certificate';
25083
25103
  type SecretVersionStatus = 'unknown' | 'enabled' | 'disabled' | 'destroyed';
25084
25104
  /** Access secret version response. */
25085
25105
  interface AccessSecretVersionResponse {
@@ -26066,7 +26086,7 @@ declare namespace index$4 {
26066
26086
 
26067
26087
  type DomainLastStatusRecordStatus = 'unknown_record_status' | 'valid' | 'invalid' | 'not_found';
26068
26088
  type DomainStatus = 'unknown' | 'checked' | 'unchecked' | 'invalid' | 'locked' | 'revoked' | 'pending';
26069
- type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce';
26089
+ type EmailFlag = 'unknown_flag' | 'soft_bounce' | 'hard_bounce' | 'spam';
26070
26090
  type EmailRcptType = 'unknown_rcpt_type' | 'to' | 'cc' | 'bcc';
26071
26091
  type EmailStatus = 'unknown' | 'new' | 'sending' | 'sent' | 'failed' | 'canceled';
26072
26092
  type ListEmailsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'updated_at_desc' | 'updated_at_asc' | 'status_desc' | 'status_asc' | 'mail_from_desc' | 'mail_from_asc' | 'mail_rcpt_desc' | 'mail_rcpt_asc' | 'subject_desc' | 'subject_asc';
@@ -1,4 +1,4 @@
1
- const version = 'v1.20.0';
1
+ const version = 'v1.21.0';
2
2
  const userAgent = `scaleway-sdk-js/${version}`;
3
3
 
4
4
  export { userAgent, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk",
3
- "version": "1.21.0",
3
+ "version": "1.22.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Scaleway SDK.",
6
6
  "keywords": [
@@ -35,5 +35,5 @@
35
35
  "bundledDependencies": [
36
36
  "@scaleway/random-name"
37
37
  ],
38
- "gitHead": "1c7dc52ba566eb458d324d3939dc35121722a2b0"
38
+ "gitHead": "66cde1e17baccf8720e9ce92e0a3688295d2be12"
39
39
  }