@scaleway/sdk 0.1.0-alpha.11 → 0.1.0-alpha.12
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.
- package/README.md +1 -1
- package/dist/api/iam/v1alpha1/api.gen.js +16 -48
- package/dist/index.cjs +16 -38
- package/dist/index.d.ts +27 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
|
|
|
6
6
|
|
|
7
7
|
const unmarshal0ECB = data => unmarshalAnyRes(data, [], ['created_at', 'updated_at']);
|
|
8
8
|
|
|
9
|
+
const unmarshal49E6 = data => unmarshalAnyRes(data, [], ['created_at', 'last_login_at', 'updated_at']);
|
|
10
|
+
|
|
9
11
|
const unmarshal8FAE = data => unmarshalAnyRes(data, [], ['created_at', 'expired_at', 'updated_at']);
|
|
10
12
|
|
|
11
13
|
const jsonContentHeaders = {
|
|
@@ -73,21 +75,21 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
73
75
|
method: 'GET',
|
|
74
76
|
path: `/iam/v1alpha1/users`,
|
|
75
77
|
urlParams: urlParams(['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], ['user_ids', request.userIds])
|
|
76
|
-
},
|
|
78
|
+
}, unmarshal49E6);
|
|
77
79
|
|
|
78
80
|
this.listUsers = request => enrichForPagination('users', this.pageOfListUsers, request);
|
|
79
81
|
|
|
80
82
|
this.getUser = request => this.client.fetch({
|
|
81
83
|
method: 'GET',
|
|
82
84
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
83
|
-
},
|
|
85
|
+
}, unmarshal49E6);
|
|
84
86
|
|
|
85
87
|
this.updateUser = request => this.client.fetch({
|
|
86
88
|
body: '{}',
|
|
87
89
|
headers: jsonContentHeaders,
|
|
88
90
|
method: 'PATCH',
|
|
89
91
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
90
|
-
},
|
|
92
|
+
}, unmarshal49E6);
|
|
91
93
|
|
|
92
94
|
this.deleteUser = request => this.client.fetch({
|
|
93
95
|
method: 'DELETE',
|
|
@@ -133,20 +135,11 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
133
135
|
path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`
|
|
134
136
|
});
|
|
135
137
|
|
|
136
|
-
this.pageOfListGroups = request => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
param: 'user_id',
|
|
142
|
-
value: request.userId
|
|
143
|
-
}]);
|
|
144
|
-
return this.client.fetch({
|
|
145
|
-
method: 'GET',
|
|
146
|
-
path: `/iam/v1alpha1/groups`,
|
|
147
|
-
urlParams: urlParams(['group_ids', request.groupIds], ['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], ...Object.entries(principal))
|
|
148
|
-
}, unmarshal0ECB);
|
|
149
|
-
};
|
|
138
|
+
this.pageOfListGroups = request => this.client.fetch({
|
|
139
|
+
method: 'GET',
|
|
140
|
+
path: `/iam/v1alpha1/groups`,
|
|
141
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['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], ['user_ids', request.userIds])
|
|
142
|
+
}, unmarshal0ECB);
|
|
150
143
|
|
|
151
144
|
this.listGroups = request => enrichForPagination('groups', this.pageOfListGroups, request);
|
|
152
145
|
|
|
@@ -191,38 +184,13 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
191
184
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
192
185
|
});
|
|
193
186
|
|
|
194
|
-
this.pageOfListPolicies =
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
const principal = resolveOneOf([{
|
|
200
|
-
param: 'user_id',
|
|
201
|
-
value: request.userId
|
|
202
|
-
}, {
|
|
203
|
-
param: 'group_id',
|
|
204
|
-
value: request.groupId
|
|
205
|
-
}, {
|
|
206
|
-
param: 'application_id',
|
|
207
|
-
value: request.applicationId
|
|
208
|
-
}, {
|
|
209
|
-
param: 'no_principal',
|
|
210
|
-
value: request.noPrincipal
|
|
211
|
-
}]);
|
|
212
|
-
return _this.client.fetch({
|
|
213
|
-
method: 'GET',
|
|
214
|
-
path: `/iam/v1alpha1/policies`,
|
|
215
|
-
urlParams: urlParams(['editable', request.editable], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? _this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ...Object.entries(principal))
|
|
216
|
-
}, unmarshal0ECB);
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
this.listPolicies = function (request) {
|
|
220
|
-
if (request === void 0) {
|
|
221
|
-
request = {};
|
|
222
|
-
}
|
|
187
|
+
this.pageOfListPolicies = request => this.client.fetch({
|
|
188
|
+
method: 'GET',
|
|
189
|
+
path: `/iam/v1alpha1/policies`,
|
|
190
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds])
|
|
191
|
+
}, unmarshal0ECB);
|
|
223
192
|
|
|
224
|
-
|
|
225
|
-
};
|
|
193
|
+
this.listPolicies = request => enrichForPagination('policies', this.pageOfListPolicies, request);
|
|
226
194
|
|
|
227
195
|
this.createPolicy = request => {
|
|
228
196
|
const principal = resolveOneOf([{
|
package/dist/index.cjs
CHANGED
|
@@ -5181,6 +5181,8 @@ var types_gen$b = /*#__PURE__*/Object.freeze({
|
|
|
5181
5181
|
|
|
5182
5182
|
const unmarshal0ECB$7 = data => unmarshalAnyRes(data, [], ['created_at', 'updated_at']);
|
|
5183
5183
|
|
|
5184
|
+
const unmarshal49E6 = data => unmarshalAnyRes(data, [], ['created_at', 'last_login_at', 'updated_at']);
|
|
5185
|
+
|
|
5184
5186
|
const unmarshal8FAE = data => unmarshalAnyRes(data, [], ['created_at', 'expired_at', 'updated_at']);
|
|
5185
5187
|
|
|
5186
5188
|
const jsonContentHeaders$a = {
|
|
@@ -5258,7 +5260,7 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
5258
5260
|
method: 'GET',
|
|
5259
5261
|
path: `/iam/v1alpha1/users`,
|
|
5260
5262
|
urlParams: urlParams(['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], ['user_ids', request.userIds])
|
|
5261
|
-
},
|
|
5263
|
+
}, unmarshal49E6);
|
|
5262
5264
|
/**
|
|
5263
5265
|
* List users of an organization
|
|
5264
5266
|
*
|
|
@@ -5277,7 +5279,7 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
5277
5279
|
getUser = request => this.client.fetch({
|
|
5278
5280
|
method: 'GET',
|
|
5279
5281
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
5280
|
-
},
|
|
5282
|
+
}, unmarshal49E6);
|
|
5281
5283
|
/**
|
|
5282
5284
|
* Update an existing user
|
|
5283
5285
|
*
|
|
@@ -5290,7 +5292,7 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
5290
5292
|
headers: jsonContentHeaders$a,
|
|
5291
5293
|
method: 'PATCH',
|
|
5292
5294
|
path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`
|
|
5293
|
-
},
|
|
5295
|
+
}, unmarshal49E6);
|
|
5294
5296
|
/**
|
|
5295
5297
|
* Remove a user
|
|
5296
5298
|
*
|
|
@@ -5368,20 +5370,11 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
5368
5370
|
method: 'DELETE',
|
|
5369
5371
|
path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`
|
|
5370
5372
|
});
|
|
5371
|
-
pageOfListGroups = request => {
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
param: 'user_id',
|
|
5377
|
-
value: request.userId
|
|
5378
|
-
}]);
|
|
5379
|
-
return this.client.fetch({
|
|
5380
|
-
method: 'GET',
|
|
5381
|
-
path: `/iam/v1alpha1/groups`,
|
|
5382
|
-
urlParams: urlParams(['group_ids', request.groupIds], ['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], ...Object.entries(principal))
|
|
5383
|
-
}, unmarshal0ECB$7);
|
|
5384
|
-
};
|
|
5373
|
+
pageOfListGroups = request => this.client.fetch({
|
|
5374
|
+
method: 'GET',
|
|
5375
|
+
path: `/iam/v1alpha1/groups`,
|
|
5376
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['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], ['user_ids', request.userIds])
|
|
5377
|
+
}, unmarshal0ECB$7);
|
|
5385
5378
|
/**
|
|
5386
5379
|
* List groups
|
|
5387
5380
|
*
|
|
@@ -5460,26 +5453,11 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
5460
5453
|
method: 'DELETE',
|
|
5461
5454
|
path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`
|
|
5462
5455
|
});
|
|
5463
|
-
pageOfListPolicies =
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
param: 'group_id',
|
|
5469
|
-
value: request.groupId
|
|
5470
|
-
}, {
|
|
5471
|
-
param: 'application_id',
|
|
5472
|
-
value: request.applicationId
|
|
5473
|
-
}, {
|
|
5474
|
-
param: 'no_principal',
|
|
5475
|
-
value: request.noPrincipal
|
|
5476
|
-
}]);
|
|
5477
|
-
return this.client.fetch({
|
|
5478
|
-
method: 'GET',
|
|
5479
|
-
path: `/iam/v1alpha1/policies`,
|
|
5480
|
-
urlParams: urlParams(['editable', request.editable], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(principal))
|
|
5481
|
-
}, unmarshal0ECB$7);
|
|
5482
|
-
};
|
|
5456
|
+
pageOfListPolicies = request => this.client.fetch({
|
|
5457
|
+
method: 'GET',
|
|
5458
|
+
path: `/iam/v1alpha1/policies`,
|
|
5459
|
+
urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds])
|
|
5460
|
+
}, unmarshal0ECB$7);
|
|
5483
5461
|
/**
|
|
5484
5462
|
* List policies of an organization
|
|
5485
5463
|
*
|
|
@@ -5487,7 +5465,7 @@ class IamV1Alpha1GenAPI extends API {
|
|
|
5487
5465
|
* @returns A Promise of ListPoliciesResponse
|
|
5488
5466
|
*/
|
|
5489
5467
|
|
|
5490
|
-
listPolicies =
|
|
5468
|
+
listPolicies = request => enrichForPagination('policies', this.pageOfListPolicies, request);
|
|
5491
5469
|
/**
|
|
5492
5470
|
* Create a new policy
|
|
5493
5471
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -7604,6 +7604,8 @@ declare type ListPoliciesRequestOrderBy = 'policy_name_asc' | 'policy_name_desc'
|
|
|
7604
7604
|
declare type ListSSHKeysRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'name_asc' | 'name_desc';
|
|
7605
7605
|
declare type ListUsersRequestOrderBy$1 = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'email_asc' | 'email_desc';
|
|
7606
7606
|
declare type PermissionSetScopeType = 'unknown_scope_type' | 'projects' | 'organization' | 'account_root_user';
|
|
7607
|
+
declare type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated';
|
|
7608
|
+
declare type UserType = 'unknown_type' | 'guest' | 'owner';
|
|
7607
7609
|
/** Api key */
|
|
7608
7610
|
interface APIKey {
|
|
7609
7611
|
/** Access key of API key */
|
|
@@ -7826,6 +7828,14 @@ interface User$1 {
|
|
|
7826
7828
|
organizationId: string;
|
|
7827
7829
|
/** Deletion status of user. Owner user cannot be deleted */
|
|
7828
7830
|
deletable: boolean;
|
|
7831
|
+
/** Last login date */
|
|
7832
|
+
lastLoginAt?: Date;
|
|
7833
|
+
/** Type of the user */
|
|
7834
|
+
type: UserType;
|
|
7835
|
+
/** 2FA enabled */
|
|
7836
|
+
twoFactorEnabled: boolean;
|
|
7837
|
+
/** Status of invitation for the user */
|
|
7838
|
+
status: UserStatus;
|
|
7829
7839
|
}
|
|
7830
7840
|
declare type ListSSHKeysRequest = {
|
|
7831
7841
|
/** Sort order of SSH keys */
|
|
@@ -7949,11 +7959,11 @@ declare type ListGroupsRequest = {
|
|
|
7949
7959
|
organizationId?: string;
|
|
7950
7960
|
/** Name of group to find */
|
|
7951
7961
|
name?: string;
|
|
7952
|
-
/** Filter by application ID */
|
|
7953
|
-
|
|
7954
|
-
/** Filter by user ID */
|
|
7955
|
-
|
|
7956
|
-
/** Filter out by a list of ID */
|
|
7962
|
+
/** Filter out by a list of application ID */
|
|
7963
|
+
applicationIds: Array<string>;
|
|
7964
|
+
/** Filter out by a list of user ID */
|
|
7965
|
+
userIds: Array<string>;
|
|
7966
|
+
/** Filter out by a list of group ID */
|
|
7957
7967
|
groupIds: Array<string>;
|
|
7958
7968
|
};
|
|
7959
7969
|
declare type CreateGroupRequest = {
|
|
@@ -7999,12 +8009,12 @@ declare type ListPoliciesRequest = {
|
|
|
7999
8009
|
organizationId?: string;
|
|
8000
8010
|
/** Filter out editable policies or not */
|
|
8001
8011
|
editable?: boolean;
|
|
8002
|
-
/**
|
|
8003
|
-
|
|
8004
|
-
/**
|
|
8005
|
-
|
|
8006
|
-
/**
|
|
8007
|
-
|
|
8012
|
+
/** Filter out by a list of user ID */
|
|
8013
|
+
userIds: Array<string>;
|
|
8014
|
+
/** Filter out by a list of group ID */
|
|
8015
|
+
groupIds: Array<string>;
|
|
8016
|
+
/** Filter out by a list of application ID */
|
|
8017
|
+
applicationIds: Array<string>;
|
|
8008
8018
|
/** True when the policy do not belong to any principal */
|
|
8009
8019
|
noPrincipal?: boolean;
|
|
8010
8020
|
};
|
|
@@ -8125,6 +8135,8 @@ type types_gen$b_ListPermissionSetsRequestOrderBy = ListPermissionSetsRequestOrd
|
|
|
8125
8135
|
type types_gen$b_ListPoliciesRequestOrderBy = ListPoliciesRequestOrderBy;
|
|
8126
8136
|
type types_gen$b_ListSSHKeysRequestOrderBy = ListSSHKeysRequestOrderBy;
|
|
8127
8137
|
type types_gen$b_PermissionSetScopeType = PermissionSetScopeType;
|
|
8138
|
+
type types_gen$b_UserStatus = UserStatus;
|
|
8139
|
+
type types_gen$b_UserType = UserType;
|
|
8128
8140
|
type types_gen$b_APIKey = APIKey;
|
|
8129
8141
|
type types_gen$b_Application = Application;
|
|
8130
8142
|
type types_gen$b_Group = Group;
|
|
@@ -8181,6 +8193,8 @@ declare namespace types_gen$b {
|
|
|
8181
8193
|
types_gen$b_ListSSHKeysRequestOrderBy as ListSSHKeysRequestOrderBy,
|
|
8182
8194
|
ListUsersRequestOrderBy$1 as ListUsersRequestOrderBy,
|
|
8183
8195
|
types_gen$b_PermissionSetScopeType as PermissionSetScopeType,
|
|
8196
|
+
types_gen$b_UserStatus as UserStatus,
|
|
8197
|
+
types_gen$b_UserType as UserType,
|
|
8184
8198
|
types_gen$b_APIKey as APIKey,
|
|
8185
8199
|
types_gen$b_Application as Application,
|
|
8186
8200
|
types_gen$b_Group as Group,
|
|
@@ -8388,14 +8402,14 @@ declare class IamV1Alpha1GenAPI extends API {
|
|
|
8388
8402
|
* @param request - The request {@link DeleteGroupRequest}
|
|
8389
8403
|
*/
|
|
8390
8404
|
deleteGroup: (request: Readonly<DeleteGroupRequest>) => Promise<void>;
|
|
8391
|
-
protected pageOfListPolicies: (request
|
|
8405
|
+
protected pageOfListPolicies: (request: Readonly<ListPoliciesRequest>) => Promise<ListPoliciesResponse>;
|
|
8392
8406
|
/**
|
|
8393
8407
|
* List policies of an organization
|
|
8394
8408
|
*
|
|
8395
8409
|
* @param request - The request {@link ListPoliciesRequest}
|
|
8396
8410
|
* @returns A Promise of ListPoliciesResponse
|
|
8397
8411
|
*/
|
|
8398
|
-
listPolicies: (request
|
|
8412
|
+
listPolicies: (request: Readonly<ListPoliciesRequest>) => Promise<ListPoliciesResponse> & {
|
|
8399
8413
|
all: () => Promise<Policy[]>;
|
|
8400
8414
|
[Symbol.asyncIterator]: () => AsyncGenerator<Policy[], void, void>;
|
|
8401
8415
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Scaleway SDK.",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"bundledDependencies": [
|
|
28
28
|
"@scaleway/random-name"
|
|
29
29
|
],
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "1c8f4699544d2410814abd66e5af8cec553dd571"
|
|
31
31
|
}
|