@scaleway/sdk-iam 1.6.0 → 2.1.1

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.
@@ -215,6 +215,30 @@ const unmarshalUser = (data) => {
215
215
  username: data.username
216
216
  };
217
217
  };
218
+ const unmarshalScimToken = (data) => {
219
+ if (!isJSONObject(data)) {
220
+ throw new TypeError(
221
+ `Unmarshalling the type 'ScimToken' failed as data isn't a dictionary.`
222
+ );
223
+ }
224
+ return {
225
+ createdAt: unmarshalDate(data.created_at),
226
+ expiresAt: unmarshalDate(data.expires_at),
227
+ id: data.id,
228
+ scimId: data.scim_id
229
+ };
230
+ };
231
+ const unmarshalCreateScimTokenResponse = (data) => {
232
+ if (!isJSONObject(data)) {
233
+ throw new TypeError(
234
+ `Unmarshalling the type 'CreateScimTokenResponse' failed as data isn't a dictionary.`
235
+ );
236
+ }
237
+ return {
238
+ bearerToken: data.bearer_token,
239
+ token: data.token ? unmarshalScimToken(data.token) : void 0
240
+ };
241
+ };
218
242
  const unmarshalEncodedJWT = (data) => {
219
243
  if (!isJSONObject(data)) {
220
244
  throw new TypeError(
@@ -300,10 +324,7 @@ const unmarshalListApplicationsResponse = (data) => {
300
324
  );
301
325
  }
302
326
  return {
303
- applications: unmarshalArrayOfObject(
304
- data.applications,
305
- unmarshalApplication
306
- ),
327
+ applications: unmarshalArrayOfObject(data.applications, unmarshalApplication),
307
328
  totalCount: data.total_count
308
329
  };
309
330
  };
@@ -326,10 +347,7 @@ const unmarshalListGracePeriodsResponse = (data) => {
326
347
  );
327
348
  }
328
349
  return {
329
- gracePeriods: unmarshalArrayOfObject(
330
- data.grace_periods,
331
- unmarshalGracePeriod
332
- )
350
+ gracePeriods: unmarshalArrayOfObject(data.grace_periods, unmarshalGracePeriod)
333
351
  };
334
352
  };
335
353
  const unmarshalListGroupsResponse = (data) => {
@@ -386,10 +404,7 @@ const unmarshalListPermissionSetsResponse = (data) => {
386
404
  );
387
405
  }
388
406
  return {
389
- permissionSets: unmarshalArrayOfObject(
390
- data.permission_sets,
391
- unmarshalPermissionSet
392
- ),
407
+ permissionSets: unmarshalArrayOfObject(data.permission_sets, unmarshalPermissionSet),
393
408
  totalCount: data.total_count
394
409
  };
395
410
  };
@@ -460,10 +475,18 @@ const unmarshalListSamlCertificatesResponse = (data) => {
460
475
  );
461
476
  }
462
477
  return {
463
- certificates: unmarshalArrayOfObject(
464
- data.certificates,
465
- unmarshalSamlCertificate
466
- )
478
+ certificates: unmarshalArrayOfObject(data.certificates, unmarshalSamlCertificate)
479
+ };
480
+ };
481
+ const unmarshalListScimTokensResponse = (data) => {
482
+ if (!isJSONObject(data)) {
483
+ throw new TypeError(
484
+ `Unmarshalling the type 'ListScimTokensResponse' failed as data isn't a dictionary.`
485
+ );
486
+ }
487
+ return {
488
+ scimTokens: unmarshalArrayOfObject(data.scim_tokens, unmarshalScimToken),
489
+ totalCount: data.total_count
467
490
  };
468
491
  };
469
492
  const unmarshalListUsersResponse = (data) => {
@@ -554,6 +577,17 @@ const unmarshalSaml = (data) => {
554
577
  status: data.status
555
578
  };
556
579
  };
580
+ const unmarshalScim = (data) => {
581
+ if (!isJSONObject(data)) {
582
+ throw new TypeError(
583
+ `Unmarshalling the type 'Scim' failed as data isn't a dictionary.`
584
+ );
585
+ }
586
+ return {
587
+ createdAt: unmarshalDate(data.created_at),
588
+ id: data.id
589
+ };
590
+ };
557
591
  const unmarshalSetRulesResponse = (data) => {
558
592
  if (!isJSONObject(data)) {
559
593
  throw new TypeError(
@@ -576,8 +610,14 @@ const unmarshalValidateUserMFAOTPResponse = (data) => {
576
610
  };
577
611
  const marshalAddGroupMemberRequest = (request, defaults) => ({
578
612
  ...resolveOneOf([
579
- { param: "user_id", value: request.userId },
580
- { param: "application_id", value: request.applicationId }
613
+ {
614
+ param: "user_id",
615
+ value: request.userId
616
+ },
617
+ {
618
+ param: "application_id",
619
+ value: request.applicationId
620
+ }
581
621
  ])
582
622
  });
583
623
  const marshalAddGroupMembersRequest = (request, defaults) => ({
@@ -593,8 +633,14 @@ const marshalCreateAPIKeyRequest = (request, defaults) => ({
593
633
  description: request.description,
594
634
  expires_at: request.expiresAt,
595
635
  ...resolveOneOf([
596
- { param: "application_id", value: request.applicationId },
597
- { param: "user_id", value: request.userId }
636
+ {
637
+ param: "application_id",
638
+ value: request.applicationId
639
+ },
640
+ {
641
+ param: "user_id",
642
+ value: request.userId
643
+ }
598
644
  ])
599
645
  });
600
646
  const marshalCreateApplicationRequest = (request, defaults) => ({
@@ -617,8 +663,14 @@ const marshalRuleSpecs = (request, defaults) => ({
617
663
  condition: request.condition,
618
664
  permission_set_names: request.permissionSetNames,
619
665
  ...resolveOneOf([
620
- { param: "project_ids", value: request.projectIds },
621
- { param: "organization_id", value: request.organizationId }
666
+ {
667
+ param: "project_ids",
668
+ value: request.projectIds
669
+ },
670
+ {
671
+ param: "organization_id",
672
+ value: request.organizationId
673
+ }
622
674
  ])
623
675
  });
624
676
  const marshalCreatePolicyRequest = (request, defaults) => ({
@@ -628,10 +680,22 @@ const marshalCreatePolicyRequest = (request, defaults) => ({
628
680
  rules: request.rules !== void 0 ? request.rules.map((elt) => marshalRuleSpecs(elt)) : void 0,
629
681
  tags: request.tags,
630
682
  ...resolveOneOf([
631
- { param: "user_id", value: request.userId },
632
- { param: "group_id", value: request.groupId },
633
- { param: "application_id", value: request.applicationId },
634
- { param: "no_principal", value: request.noPrincipal }
683
+ {
684
+ param: "user_id",
685
+ value: request.userId
686
+ },
687
+ {
688
+ param: "group_id",
689
+ value: request.groupId
690
+ },
691
+ {
692
+ param: "application_id",
693
+ value: request.applicationId
694
+ },
695
+ {
696
+ param: "no_principal",
697
+ value: request.noPrincipal
698
+ }
635
699
  ])
636
700
  });
637
701
  const marshalCreateSSHKeyRequest = (request, defaults) => ({
@@ -654,7 +718,10 @@ const marshalCreateUserRequest = (request, defaults) => ({
654
718
  organization_id: request.organizationId ?? defaults.defaultOrganizationId,
655
719
  tags: request.tags,
656
720
  ...resolveOneOf([
657
- { param: "email", value: request.email },
721
+ {
722
+ param: "email",
723
+ value: request.email
724
+ },
658
725
  {
659
726
  param: "member",
660
727
  value: request.member !== void 0 ? marshalCreateUserRequestMember(request.member) : void 0
@@ -669,8 +736,14 @@ const marshalParseSamlMetadataRequest = async (request, defaults) => ({
669
736
  });
670
737
  const marshalRemoveGroupMemberRequest = (request, defaults) => ({
671
738
  ...resolveOneOf([
672
- { param: "user_id", value: request.userId },
673
- { param: "application_id", value: request.applicationId }
739
+ {
740
+ param: "user_id",
741
+ value: request.userId
742
+ },
743
+ {
744
+ param: "application_id",
745
+ value: request.applicationId
746
+ }
674
747
  ])
675
748
  });
676
749
  const marshalRemoveUserConnectionRequest = (request, defaults) => ({
@@ -720,10 +793,22 @@ const marshalUpdatePolicyRequest = (request, defaults) => ({
720
793
  name: request.name,
721
794
  tags: request.tags,
722
795
  ...resolveOneOf([
723
- { param: "user_id", value: request.userId },
724
- { param: "group_id", value: request.groupId },
725
- { param: "application_id", value: request.applicationId },
726
- { param: "no_principal", value: request.noPrincipal }
796
+ {
797
+ param: "user_id",
798
+ value: request.userId
799
+ },
800
+ {
801
+ param: "group_id",
802
+ value: request.groupId
803
+ },
804
+ {
805
+ param: "application_id",
806
+ value: request.applicationId
807
+ },
808
+ {
809
+ param: "no_principal",
810
+ value: request.noPrincipal
811
+ }
727
812
  ])
728
813
  });
729
814
  const marshalUpdateSSHKeyRequest = (request, defaults) => ({
@@ -783,6 +868,7 @@ export {
783
868
  marshalValidateUserMFAOTPRequest,
784
869
  unmarshalAPIKey,
785
870
  unmarshalApplication,
871
+ unmarshalCreateScimTokenResponse,
786
872
  unmarshalEncodedJWT,
787
873
  unmarshalGetUserConnectionsResponse,
788
874
  unmarshalGroup,
@@ -800,6 +886,7 @@ export {
800
886
  unmarshalListRulesResponse,
801
887
  unmarshalListSSHKeysResponse,
802
888
  unmarshalListSamlCertificatesResponse,
889
+ unmarshalListScimTokensResponse,
803
890
  unmarshalListUsersResponse,
804
891
  unmarshalLog,
805
892
  unmarshalMFAOTP,
@@ -811,6 +898,7 @@ export {
811
898
  unmarshalSSHKey,
812
899
  unmarshalSaml,
813
900
  unmarshalSamlCertificate,
901
+ unmarshalScim,
814
902
  unmarshalSetRulesResponse,
815
903
  unmarshalUser,
816
904
  unmarshalValidateUserMFAOTPResponse
@@ -10,6 +10,7 @@ export type ListPermissionSetsRequestOrderBy = 'name_asc' | 'name_desc' | 'creat
10
10
  export type ListPoliciesRequestOrderBy = 'policy_name_asc' | 'policy_name_desc' | 'created_at_asc' | 'created_at_desc';
11
11
  export type ListQuotaRequestOrderBy = 'name_asc' | 'name_desc';
12
12
  export type ListSSHKeysRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'name_asc' | 'name_desc';
13
+ export type ListScimTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc';
13
14
  export type ListUsersRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'email_asc' | 'email_desc' | 'last_login_asc' | 'last_login_desc' | 'username_asc' | 'username_desc';
14
15
  export type LocalityType = 'global' | 'region' | 'zone';
15
16
  export type LogAction = 'unknown_action' | 'created' | 'updated' | 'deleted';
@@ -118,6 +119,12 @@ export interface RuleSpecs {
118
119
  */
119
120
  organizationId?: string;
120
121
  }
122
+ export interface ScimToken {
123
+ id: string;
124
+ scimId: string;
125
+ createdAt?: Date;
126
+ expiresAt?: Date;
127
+ }
121
128
  export interface CreateUserRequestMember {
122
129
  /**
123
130
  * Email of the user to create.
@@ -869,6 +876,22 @@ export type CreateSSHKeyRequest = {
869
876
  */
870
877
  projectId?: string;
871
878
  };
879
+ export type CreateScimTokenRequest = {
880
+ /**
881
+ * ID of the SCIM configuration.
882
+ */
883
+ scimId: string;
884
+ };
885
+ export interface CreateScimTokenResponse {
886
+ /**
887
+ * The SCIM token metadata.
888
+ */
889
+ token?: ScimToken;
890
+ /**
891
+ * The Bearer Token to use to authenticate to SCIM endpoints.
892
+ */
893
+ bearerToken: string;
894
+ }
872
895
  export type CreateUserMFAOTPRequest = {
873
896
  /**
874
897
  * User ID of the MFA OTP.
@@ -942,6 +965,18 @@ export type DeleteSamlRequest = {
942
965
  */
943
966
  samlId: string;
944
967
  };
968
+ export type DeleteScimRequest = {
969
+ /**
970
+ * ID of the SCIM configuration.
971
+ */
972
+ scimId: string;
973
+ };
974
+ export type DeleteScimTokenRequest = {
975
+ /**
976
+ * The SCIM token ID.
977
+ */
978
+ tokenId: string;
979
+ };
945
980
  export type DeleteUserMFAOTPRequest = {
946
981
  /**
947
982
  * User ID of the MFA OTP.
@@ -960,6 +995,12 @@ export type EnableOrganizationSamlRequest = {
960
995
  */
961
996
  organizationId?: string;
962
997
  };
998
+ export type EnableOrganizationScimRequest = {
999
+ /**
1000
+ * ID of the Organization.
1001
+ */
1002
+ organizationId?: string;
1003
+ };
963
1004
  export interface EncodedJWT {
964
1005
  /**
965
1006
  * The renewed JWT.
@@ -1016,6 +1057,9 @@ export type GetOrganizationSamlRequest = {
1016
1057
  */
1017
1058
  organizationId?: string;
1018
1059
  };
1060
+ export type GetOrganizationScimRequest = {
1061
+ organizationId?: string;
1062
+ };
1019
1063
  export type GetOrganizationSecuritySettingsRequest = {
1020
1064
  /**
1021
1065
  * ID of the Organization.
@@ -1526,6 +1570,34 @@ export interface ListSamlCertificatesResponse {
1526
1570
  */
1527
1571
  certificates: SamlCertificate[];
1528
1572
  }
1573
+ export type ListScimTokensRequest = {
1574
+ /**
1575
+ * ID of the SCIM configuration.
1576
+ */
1577
+ scimId: string;
1578
+ /**
1579
+ * Sort order of SCIM tokens.
1580
+ */
1581
+ orderBy?: ListScimTokensRequestOrderBy;
1582
+ /**
1583
+ * Requested page number. Value must be greater or equal to 1.
1584
+ */
1585
+ page?: number;
1586
+ /**
1587
+ * Number of items per page. Value must be between 1 and 100.
1588
+ */
1589
+ pageSize?: number;
1590
+ };
1591
+ export interface ListScimTokensResponse {
1592
+ /**
1593
+ * List of SCIM tokens.
1594
+ */
1595
+ scimTokens: ScimToken[];
1596
+ /**
1597
+ * Total count of SCIM tokens.
1598
+ */
1599
+ totalCount: number;
1600
+ }
1529
1601
  export type ListUsersRequest = {
1530
1602
  /**
1531
1603
  * Criteria for sorting results.
@@ -1689,6 +1761,16 @@ export interface Saml {
1689
1761
  */
1690
1762
  singleSignOnUrl: string;
1691
1763
  }
1764
+ export interface Scim {
1765
+ /**
1766
+ * ID of the SCIM configuration.
1767
+ */
1768
+ id: string;
1769
+ /**
1770
+ * Date and time of SCIM configuration creation.
1771
+ */
1772
+ createdAt?: Date;
1773
+ }
1692
1774
  export type SetGroupMembersRequest = {
1693
1775
  groupId: string;
1694
1776
  userIds: string[];
@@ -197,6 +197,16 @@ export declare const ListSSHKeysRequest: {
197
197
  lessThanOrEqual: number;
198
198
  };
199
199
  };
200
+ export declare const ListScimTokensRequest: {
201
+ page: {
202
+ greaterThanOrEqual: number;
203
+ lessThanOrEqual: number;
204
+ };
205
+ pageSize: {
206
+ greaterThanOrEqual: number;
207
+ lessThanOrEqual: number;
208
+ };
209
+ };
200
210
  export declare const ListUsersRequest: {
201
211
  page: {
202
212
  greaterThanOrEqual: number;
@@ -64,7 +64,7 @@ const CreateUserRequestMember = {
64
64
  ignoreEmpty: true
65
65
  },
66
66
  username: {
67
- maxLength: 64,
67
+ maxLength: 150,
68
68
  minLength: 2,
69
69
  pattern: /^[a-zA-Z0-9@._-]+$/
70
70
  }
@@ -197,6 +197,16 @@ const ListSSHKeysRequest = {
197
197
  lessThanOrEqual: 100
198
198
  }
199
199
  };
200
+ const ListScimTokensRequest = {
201
+ page: {
202
+ greaterThanOrEqual: 1,
203
+ lessThanOrEqual: 1e4
204
+ },
205
+ pageSize: {
206
+ greaterThanOrEqual: 1,
207
+ lessThanOrEqual: 100
208
+ }
209
+ };
200
210
  const ListUsersRequest = {
201
211
  page: {
202
212
  greaterThanOrEqual: 1,
@@ -281,7 +291,7 @@ const UpdateUserRequest = {
281
291
  };
282
292
  const UpdateUserUsernameRequest = {
283
293
  username: {
284
- maxLength: 64,
294
+ maxLength: 150,
285
295
  minLength: 2,
286
296
  pattern: /^[a-zA-Z0-9@._-]+$/
287
297
  }
@@ -311,6 +321,7 @@ export {
311
321
  ListQuotaRequest,
312
322
  ListRulesRequest,
313
323
  ListSSHKeysRequest,
324
+ ListScimTokensRequest,
314
325
  ListUsersRequest,
315
326
  RuleSpecs,
316
327
  SetOrganizationAliasRequest,
package/package.json CHANGED
@@ -1,23 +1,20 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-iam",
3
- "version": "1.6.0",
3
+ "version": "2.1.1",
4
4
  "description": "Scaleway SDK iam",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
+ "README.md",
7
8
  "dist"
8
9
  ],
9
10
  "type": "module",
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./dist/index.gen.d.ts",
13
- "import": "./dist/index.gen.js",
14
- "require": "./dist/index.gen.cjs",
15
14
  "default": "./dist/index.gen.js"
16
15
  },
17
16
  "./*": {
18
17
  "types": "./dist/*/index.gen.d.ts",
19
- "import": "./dist/*/index.gen.js",
20
- "require": "./dist/*/index.gen.cjs",
21
18
  "default": "./dist/*/index.gen.js"
22
19
  }
23
20
  },
@@ -26,17 +23,17 @@
26
23
  "directory": "packages_generated/iam"
27
24
  },
28
25
  "engines": {
29
- "node": ">=20.19.4"
26
+ "node": ">=20.19.6"
30
27
  },
31
28
  "dependencies": {
32
29
  "@scaleway/random-name": "5.1.2",
33
- "@scaleway/sdk-std": "1.2.0"
30
+ "@scaleway/sdk-std": "2.1.0"
34
31
  },
35
32
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.3"
33
+ "@scaleway/sdk-client": "^2.1.0"
37
34
  },
38
35
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.3"
36
+ "@scaleway/sdk-client": "^2.1.0"
40
37
  },
41
38
  "scripts": {
42
39
  "package:check": "pnpm publint",
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index_gen = require("./v1alpha1/index.gen.cjs");
4
- exports.Iamv1alpha1 = index_gen;