@commercelayer/provisioning-sdk 2.0.0-beta.1 → 2.0.0-beta.10

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/lib/index.d.mts CHANGED
@@ -1,7 +1,5 @@
1
- import { DocWithData } from 'jsonapi-typescript';
2
-
3
1
  type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
4
- type FetchResponse = DocWithData;
2
+ type FetchResponse = any;
5
3
  type FetchRequestOptions = RequestInit;
6
4
  declare class FetchError extends Error {
7
5
  #private;
@@ -106,7 +104,12 @@ interface QueryParamsList<R extends Resource = Resource> extends QueryParamsRetr
106
104
  pageNumber?: QueryPageNumber;
107
105
  pageSize?: QueryPageSize;
108
106
  }
109
- type QueryParams<R extends Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
107
+ type QueryParams<R extends Resource = Resource> = QueryParamsRetrieve<R> | QueryParamsList<R>;
108
+
109
+ declare const isParamsList: <R extends Resource>(params: any) => params is QueryParamsList<R>;
110
+ type QueryStringParams = Record<string, string>;
111
+ declare const generateQueryStringParams: <R extends Resource>(params: QueryParams<R> | undefined, res: string | ResourceType) => QueryStringParams;
112
+ declare const generateSearchString: (params?: QueryStringParams, questionMark?: boolean) => string;
110
113
 
111
114
  type ResourceNull = {
112
115
  id: null;
@@ -154,9 +157,11 @@ declare class ListResponse<R> extends Array<R> {
154
157
  }
155
158
 
156
159
  type ResourceSort = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'created_at' | 'updated_at'>;
160
+ type ResourceFilter = Pick<Resource, 'id' | 'reference' | 'reference_origin' | 'metadata' | 'created_at' | 'updated_at'>;
157
161
  type ResourceAdapterConfig = {};
158
162
  type ResourcesInitConfig = ResourceAdapterConfig & ApiClientInitConfig;
159
163
  type ResourcesConfig = Partial<ResourcesInitConfig>;
164
+ declare const apiResourceAdapter: (config: ResourcesInitConfig) => ResourceAdapter;
160
165
  declare class ResourceAdapter {
161
166
  #private;
162
167
  constructor(config: ResourcesInitConfig);
@@ -198,10 +203,30 @@ type VersionRel = ResourceRel & {
198
203
  type VersionSort = Pick<Version, 'id'> & ResourceSort;
199
204
  interface Version extends Resource {
200
205
  readonly type: VersionType;
206
+ /**
207
+ * The type of the versioned resource..
208
+ * @example ```"roles"```
209
+ */
201
210
  resource_type: string;
211
+ /**
212
+ * The versioned resource ID..
213
+ * @example ```"PzdJhdLdYV"```
214
+ */
202
215
  resource_id: string;
216
+ /**
217
+ * The event which generates the version..
218
+ * @example ```"update"```
219
+ */
203
220
  event: string;
221
+ /**
222
+ * The object changes payload..
223
+ * @example ```"[object Object]"```
224
+ */
204
225
  changes: Record<string, any>;
226
+ /**
227
+ * Information about who triggered the change, only showed when it's from a JWT token..
228
+ * @example ```"[object Object]"```
229
+ */
205
230
  who: Record<string, any>;
206
231
  }
207
232
  declare class Versions extends ApiResource<Version> {
@@ -222,28 +247,74 @@ type RoleRel$4 = ResourceRel & {
222
247
  type PermissionSort = Pick<Permission, 'id'> & ResourceSort;
223
248
  interface Permission extends Resource {
224
249
  readonly type: PermissionType;
250
+ /**
251
+ * Determines if the permission have access to create rights..
252
+ */
225
253
  can_create: boolean;
254
+ /**
255
+ * Determines if the permission have access to read rights..
256
+ */
226
257
  can_read: boolean;
258
+ /**
259
+ * Determines if the permission have access to update rights..
260
+ */
227
261
  can_update: boolean;
262
+ /**
263
+ * Determines if the permission have access to destroy rights..
264
+ */
228
265
  can_destroy: boolean;
266
+ /**
267
+ * The resource where this permission is applied..
268
+ */
229
269
  subject: string;
270
+ /**
271
+ * An object that contains additional restrictions..
272
+ * @example ```"[object Object]"```
273
+ */
230
274
  restrictions: Record<string, any>;
231
275
  organization?: Nullable<Organization>;
232
276
  role?: Nullable<Role>;
233
277
  versions?: Nullable<Version[]>;
234
278
  }
235
279
  interface PermissionCreate extends ResourceCreate {
280
+ /**
281
+ * Determines if the permission have access to create rights..
282
+ */
236
283
  can_create: boolean;
284
+ /**
285
+ * Determines if the permission have access to read rights..
286
+ */
237
287
  can_read: boolean;
288
+ /**
289
+ * Determines if the permission have access to update rights..
290
+ */
238
291
  can_update: boolean;
292
+ /**
293
+ * Determines if the permission have access to destroy rights..
294
+ */
239
295
  can_destroy: boolean;
296
+ /**
297
+ * The resource where this permission is applied..
298
+ */
240
299
  subject: string;
241
300
  role: RoleRel$4;
242
301
  }
243
302
  interface PermissionUpdate extends ResourceUpdate {
303
+ /**
304
+ * Determines if the permission have access to create rights..
305
+ */
244
306
  can_create?: Nullable<boolean>;
307
+ /**
308
+ * Determines if the permission have access to read rights..
309
+ */
245
310
  can_read?: Nullable<boolean>;
311
+ /**
312
+ * Determines if the permission have access to update rights..
313
+ */
246
314
  can_update?: Nullable<boolean>;
315
+ /**
316
+ * Determines if the permission have access to destroy rights..
317
+ */
247
318
  can_destroy?: Nullable<boolean>;
248
319
  }
249
320
  declare class Permissions extends ApiResource<Permission> {
@@ -269,7 +340,15 @@ type OrganizationRel$4 = ResourceRel & {
269
340
  type RoleSort = Pick<Role, 'id'> & ResourceSort;
270
341
  interface Role extends Resource {
271
342
  readonly type: RoleType;
343
+ /**
344
+ * The role name..
345
+ * @example ```"Custom role"```
346
+ */
272
347
  name: string;
348
+ /**
349
+ * The kind of role, one of: `custom`, `admin`, `read_only`.
350
+ * @example ```"custom"```
351
+ */
273
352
  kind: string;
274
353
  organization?: Nullable<Organization>;
275
354
  permissions?: Nullable<Permission[]>;
@@ -278,10 +357,18 @@ interface Role extends Resource {
278
357
  versions?: Nullable<Version[]>;
279
358
  }
280
359
  interface RoleCreate extends ResourceCreate {
360
+ /**
361
+ * The role name..
362
+ * @example ```"Custom role"```
363
+ */
281
364
  name: string;
282
365
  organization: OrganizationRel$4;
283
366
  }
284
367
  interface RoleUpdate extends ResourceUpdate {
368
+ /**
369
+ * The role name..
370
+ * @example ```"Custom role"```
371
+ */
285
372
  name?: Nullable<string>;
286
373
  }
287
374
  declare class Roles extends ApiResource<Role> {
@@ -318,6 +405,10 @@ type RoleRel$2 = ResourceRel & {
318
405
  type ApplicationMembershipSort = Pick<ApplicationMembership, 'id'> & ResourceSort;
319
406
  interface ApplicationMembership extends Resource {
320
407
  readonly type: ApplicationMembershipType;
408
+ /**
409
+ * Set of key-value pairs that contains restrictions and scopes of the application membership..
410
+ * @example ```"[object Object]"```
411
+ */
321
412
  filters?: Nullable<Record<string, any>>;
322
413
  api_credential?: Nullable<ApiCredential>;
323
414
  membership?: Nullable<Membership>;
@@ -325,6 +416,10 @@ interface ApplicationMembership extends Resource {
325
416
  role?: Nullable<Role>;
326
417
  }
327
418
  interface ApplicationMembershipCreate extends ResourceCreate {
419
+ /**
420
+ * Set of key-value pairs that contains restrictions and scopes of the application membership..
421
+ * @example ```"[object Object]"```
422
+ */
328
423
  filters?: Nullable<Record<string, any>>;
329
424
  api_credential: ApiCredentialRel$1;
330
425
  membership: MembershipRel$1;
@@ -332,6 +427,10 @@ interface ApplicationMembershipCreate extends ResourceCreate {
332
427
  role: RoleRel$2;
333
428
  }
334
429
  interface ApplicationMembershipUpdate extends ResourceUpdate {
430
+ /**
431
+ * Set of key-value pairs that contains restrictions and scopes of the application membership..
432
+ * @example ```"[object Object]"```
433
+ */
335
434
  filters?: Nullable<Record<string, any>>;
336
435
  role?: Nullable<RoleRel$2>;
337
436
  }
@@ -363,13 +462,33 @@ type RoleRel$1 = ResourceRel & {
363
462
  type ApplicationMembershipRel = ResourceRel & {
364
463
  type: ApplicationMembershipType;
365
464
  };
366
- type MembershipSort = Pick<Membership, 'id'> & ResourceSort;
465
+ type MembershipSort = Pick<Membership, 'id' | 'status'> & ResourceSort;
367
466
  interface Membership extends Resource {
368
467
  readonly type: MembershipType;
468
+ /**
469
+ * The user email..
470
+ * @example ```"commercelayer@commercelayer.io"```
471
+ */
369
472
  user_email: string;
473
+ /**
474
+ * The user first name..
475
+ * @example ```"John"```
476
+ */
370
477
  user_first_name: string;
478
+ /**
479
+ * The user last name..
480
+ * @example ```"Doe"```
481
+ */
371
482
  user_last_name: string;
483
+ /**
484
+ * The memberships status. One of `pending` (default), `active`..
485
+ * @example ```"pending"```
486
+ */
372
487
  status: 'pending' | 'active';
488
+ /**
489
+ * Indicates if the user it's the owner of the organization..
490
+ * @example ```"true"```
491
+ */
373
492
  owner: boolean;
374
493
  organization?: Nullable<Organization>;
375
494
  role?: Nullable<Role>;
@@ -377,6 +496,10 @@ interface Membership extends Resource {
377
496
  versions?: Nullable<Version[]>;
378
497
  }
379
498
  interface MembershipCreate extends ResourceCreate {
499
+ /**
500
+ * The user email..
501
+ * @example ```"commercelayer@commercelayer.io"```
502
+ */
380
503
  user_email: string;
381
504
  organization: OrganizationRel$2;
382
505
  role: RoleRel$1;
@@ -409,25 +532,101 @@ type OrganizationRel$1 = ResourceRel & {
409
532
  type OrganizationSort = Pick<Organization, 'id'> & ResourceSort;
410
533
  interface Organization extends Resource {
411
534
  readonly type: OrganizationType;
535
+ /**
536
+ * The organization's internal name..
537
+ * @example ```"The Blue Brand"```
538
+ */
412
539
  name: string;
540
+ /**
541
+ * The organization's slug name..
542
+ * @example ```"the-blue-brand"```
543
+ */
413
544
  slug: string;
545
+ /**
546
+ * The organization's domain..
547
+ * @example ```"the-blue-brand.commercelayer.io"```
548
+ */
414
549
  domain: string;
550
+ /**
551
+ * The organization's configuration..
552
+ * @example ```"[object Object]"```
553
+ */
415
554
  config?: Nullable<Record<string, any>>;
555
+ /**
556
+ * The organization's support phone..
557
+ * @example ```"+01 30800857"```
558
+ */
416
559
  support_phone?: Nullable<string>;
560
+ /**
561
+ * The organization's support email..
562
+ * @example ```"support@bluebrand.com"```
563
+ */
417
564
  support_email?: Nullable<string>;
565
+ /**
566
+ * The URL to the organization's logo..
567
+ * @example ```"https://bluebrand.com/img/logo.svg"```
568
+ */
418
569
  logo_url?: Nullable<string>;
570
+ /**
571
+ * The URL to the organization's favicon..
572
+ * @example ```"https://bluebrand.com/img/favicon.ico"```
573
+ */
419
574
  favicon_url?: Nullable<string>;
575
+ /**
576
+ * The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers)..
577
+ * @example ```"#C8984E"```
578
+ */
420
579
  primary_color?: Nullable<string>;
580
+ /**
581
+ * The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers)..
582
+ * @example ```"#FFFFCC"```
583
+ */
421
584
  contrast_color?: Nullable<string>;
585
+ /**
586
+ * The organization's Google Tag Manager ID..
587
+ * @example ```"GTM-5FJXX6"```
588
+ */
422
589
  gtm_id?: Nullable<string>;
590
+ /**
591
+ * The organization's Google Tag Manager ID for test..
592
+ * @example ```"GTM-5FJXX7"```
593
+ */
423
594
  gtm_id_test?: Nullable<string>;
595
+ /**
596
+ * Indicates if organization has discount disabled..
597
+ */
424
598
  discount_disabled?: Nullable<boolean>;
599
+ /**
600
+ * Indicates if organization has account disabled..
601
+ */
425
602
  account_disabled?: Nullable<boolean>;
603
+ /**
604
+ * Indicates if organization has acceptance disabled..
605
+ */
426
606
  acceptance_disabled?: Nullable<boolean>;
607
+ /**
608
+ * The maximum number of active concurrent promotions allowed for your organization..
609
+ * @example ```"10"```
610
+ */
427
611
  max_concurrent_promotions: number;
612
+ /**
613
+ * The maximum number of concurrent imports allowed for your organization..
614
+ * @example ```"30"```
615
+ */
428
616
  max_concurrent_imports: number;
617
+ /**
618
+ * The region where the organization it's located, default value it's `eu-west-1`..
619
+ * @example ```"eu-west-1"```
620
+ */
429
621
  region?: Nullable<string>;
622
+ /**
623
+ * Indicates if the organization can switch to live mode..
624
+ */
430
625
  can_switch_live: boolean;
626
+ /**
627
+ * Information about the current subscription such as the plan type, limits and subscription totals counter..
628
+ * @example ```"[object Object]"```
629
+ */
431
630
  subscription_info: Record<string, any>;
432
631
  memberships?: Nullable<Membership[]>;
433
632
  roles?: Nullable<Role[]>;
@@ -435,34 +634,136 @@ interface Organization extends Resource {
435
634
  api_credentials?: Nullable<ApiCredential[]>;
436
635
  }
437
636
  interface OrganizationCreate extends ResourceCreate {
637
+ /**
638
+ * The organization's internal name..
639
+ * @example ```"The Blue Brand"```
640
+ */
438
641
  name: string;
642
+ /**
643
+ * The organization's configuration..
644
+ * @example ```"[object Object]"```
645
+ */
439
646
  config?: Nullable<Record<string, any>>;
647
+ /**
648
+ * The organization's support phone..
649
+ * @example ```"+01 30800857"```
650
+ */
440
651
  support_phone?: Nullable<string>;
652
+ /**
653
+ * The organization's support email..
654
+ * @example ```"support@bluebrand.com"```
655
+ */
441
656
  support_email?: Nullable<string>;
657
+ /**
658
+ * The URL to the organization's logo..
659
+ * @example ```"https://bluebrand.com/img/logo.svg"```
660
+ */
442
661
  logo_url?: Nullable<string>;
662
+ /**
663
+ * The URL to the organization's favicon..
664
+ * @example ```"https://bluebrand.com/img/favicon.ico"```
665
+ */
443
666
  favicon_url?: Nullable<string>;
667
+ /**
668
+ * The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers)..
669
+ * @example ```"#C8984E"```
670
+ */
444
671
  primary_color?: Nullable<string>;
672
+ /**
673
+ * The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers)..
674
+ * @example ```"#FFFFCC"```
675
+ */
445
676
  contrast_color?: Nullable<string>;
677
+ /**
678
+ * The organization's Google Tag Manager ID..
679
+ * @example ```"GTM-5FJXX6"```
680
+ */
446
681
  gtm_id?: Nullable<string>;
682
+ /**
683
+ * The organization's Google Tag Manager ID for test..
684
+ * @example ```"GTM-5FJXX7"```
685
+ */
447
686
  gtm_id_test?: Nullable<string>;
687
+ /**
688
+ * Indicates if organization has discount disabled..
689
+ */
448
690
  discount_disabled?: Nullable<boolean>;
691
+ /**
692
+ * Indicates if organization has account disabled..
693
+ */
449
694
  account_disabled?: Nullable<boolean>;
695
+ /**
696
+ * Indicates if organization has acceptance disabled..
697
+ */
450
698
  acceptance_disabled?: Nullable<boolean>;
699
+ /**
700
+ * The region where the organization it's located, default value it's `eu-west-1`..
701
+ * @example ```"eu-west-1"```
702
+ */
451
703
  region?: Nullable<string>;
452
704
  }
453
705
  interface OrganizationUpdate extends ResourceUpdate {
706
+ /**
707
+ * The organization's internal name..
708
+ * @example ```"The Blue Brand"```
709
+ */
454
710
  name?: Nullable<string>;
711
+ /**
712
+ * The organization's configuration..
713
+ * @example ```"[object Object]"```
714
+ */
455
715
  config?: Nullable<Record<string, any>>;
716
+ /**
717
+ * The organization's support phone..
718
+ * @example ```"+01 30800857"```
719
+ */
456
720
  support_phone?: Nullable<string>;
721
+ /**
722
+ * The organization's support email..
723
+ * @example ```"support@bluebrand.com"```
724
+ */
457
725
  support_email?: Nullable<string>;
726
+ /**
727
+ * The URL to the organization's logo..
728
+ * @example ```"https://bluebrand.com/img/logo.svg"```
729
+ */
458
730
  logo_url?: Nullable<string>;
731
+ /**
732
+ * The URL to the organization's favicon..
733
+ * @example ```"https://bluebrand.com/img/favicon.ico"```
734
+ */
459
735
  favicon_url?: Nullable<string>;
736
+ /**
737
+ * The organization's primary color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers)..
738
+ * @example ```"#C8984E"```
739
+ */
460
740
  primary_color?: Nullable<string>;
741
+ /**
742
+ * The organization's contrast color. Format is HEX (starts with `#` and it's followed by six letters and/or numbers)..
743
+ * @example ```"#FFFFCC"```
744
+ */
461
745
  contrast_color?: Nullable<string>;
746
+ /**
747
+ * The organization's Google Tag Manager ID..
748
+ * @example ```"GTM-5FJXX6"```
749
+ */
462
750
  gtm_id?: Nullable<string>;
751
+ /**
752
+ * The organization's Google Tag Manager ID for test..
753
+ * @example ```"GTM-5FJXX7"```
754
+ */
463
755
  gtm_id_test?: Nullable<string>;
756
+ /**
757
+ * Indicates if organization has discount disabled..
758
+ */
464
759
  discount_disabled?: Nullable<boolean>;
760
+ /**
761
+ * Indicates if organization has account disabled..
762
+ */
465
763
  account_disabled?: Nullable<boolean>;
764
+ /**
765
+ * Indicates if organization has acceptance disabled..
766
+ */
466
767
  acceptance_disabled?: Nullable<boolean>;
467
768
  }
468
769
  declare class Organizations extends ApiResource<Organization> {
@@ -499,32 +800,106 @@ type RoleRel = ResourceRel & {
499
800
  type ApiCredentialSort = Pick<ApiCredential, 'id' | 'mode'> & ResourceSort;
500
801
  interface ApiCredential extends Resource {
501
802
  readonly type: ApiCredentialType;
803
+ /**
804
+ * The API credential internal name..
805
+ * @example ```"My app"```
806
+ */
502
807
  name: string;
808
+ /**
809
+ * The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.)..
810
+ * @example ```"sales_channel"```
811
+ */
503
812
  kind: string;
813
+ /**
814
+ * Indicates if the API credential it's confidential..
815
+ * @example ```"true"```
816
+ */
504
817
  confidential: boolean;
818
+ /**
819
+ * The API credential redirect URI..
820
+ * @example ```"https://bluebrand.com/img/logo.svg"```
821
+ */
505
822
  redirect_uri?: Nullable<string>;
823
+ /**
824
+ * The API credential unique ID..
825
+ * @example ```"xxxx-yyyy-zzzz"```
826
+ */
506
827
  client_id: string;
828
+ /**
829
+ * The API credential unique secret..
830
+ * @example ```"xxxx-yyyy-zzzz"```
831
+ */
507
832
  client_secret: string;
833
+ /**
834
+ * The API credential scopes..
835
+ * @example ```"market:all market:9 market:122 market:6 stock_location:6 stock_location:33"```
836
+ */
508
837
  scopes: string;
838
+ /**
839
+ * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types)..
840
+ * @example ```"7200"```
841
+ */
509
842
  expires_in?: Nullable<number>;
843
+ /**
844
+ * Indicates the environment the resource belongs to (one of `test` or `live`)..
845
+ * @example ```"test"```
846
+ */
510
847
  mode?: Nullable<string>;
848
+ /**
849
+ * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app)..
850
+ */
511
851
  custom?: Nullable<boolean>;
512
852
  organization?: Nullable<Organization>;
513
853
  role?: Nullable<Role>;
514
854
  }
515
855
  interface ApiCredentialCreate extends ResourceCreate {
856
+ /**
857
+ * The API credential internal name..
858
+ * @example ```"My app"```
859
+ */
516
860
  name: string;
861
+ /**
862
+ * The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.)..
863
+ * @example ```"sales_channel"```
864
+ */
517
865
  kind: string;
866
+ /**
867
+ * The API credential redirect URI..
868
+ * @example ```"https://bluebrand.com/img/logo.svg"```
869
+ */
518
870
  redirect_uri?: Nullable<string>;
871
+ /**
872
+ * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types)..
873
+ * @example ```"7200"```
874
+ */
519
875
  expires_in?: Nullable<number>;
876
+ /**
877
+ * Indicates the environment the resource belongs to (one of `test` or `live`)..
878
+ * @example ```"test"```
879
+ */
520
880
  mode?: Nullable<string>;
881
+ /**
882
+ * Indicates if the API credential is used to create a custom app (e.g. fork a hosted app)..
883
+ */
521
884
  custom?: Nullable<boolean>;
522
885
  organization: OrganizationRel;
523
886
  role?: Nullable<RoleRel>;
524
887
  }
525
888
  interface ApiCredentialUpdate extends ResourceUpdate {
889
+ /**
890
+ * The API credential internal name..
891
+ * @example ```"My app"```
892
+ */
526
893
  name?: Nullable<string>;
894
+ /**
895
+ * The API credential redirect URI..
896
+ * @example ```"https://bluebrand.com/img/logo.svg"```
897
+ */
527
898
  redirect_uri?: Nullable<string>;
899
+ /**
900
+ * The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types)..
901
+ * @example ```"7200"```
902
+ */
528
903
  expires_in?: Nullable<number>;
529
904
  role?: Nullable<RoleRel>;
530
905
  }
@@ -548,16 +923,51 @@ type UserRel = ResourceRel & {
548
923
  type UserSort = Pick<User, 'id'> & ResourceSort;
549
924
  interface User extends Resource {
550
925
  readonly type: UserType;
926
+ /**
927
+ * The user email..
928
+ * @example ```"user@commercelayer.io"```
929
+ */
551
930
  email: string;
931
+ /**
932
+ * The user first name..
933
+ * @example ```"John"```
934
+ */
552
935
  first_name: string;
936
+ /**
937
+ * The user last name..
938
+ * @example ```"Doe"```
939
+ */
553
940
  last_name: string;
941
+ /**
942
+ * The user preferred timezone..
943
+ * @example ```"UTC"```
944
+ */
554
945
  time_zone?: Nullable<string>;
946
+ /**
947
+ * The user 2FA setting..
948
+ */
555
949
  otp_required_for_login: boolean;
556
950
  }
557
951
  interface UserUpdate extends ResourceUpdate {
952
+ /**
953
+ * The user email..
954
+ * @example ```"user@commercelayer.io"```
955
+ */
558
956
  email?: Nullable<string>;
957
+ /**
958
+ * The user first name..
959
+ * @example ```"John"```
960
+ */
559
961
  first_name?: Nullable<string>;
962
+ /**
963
+ * The user last name..
964
+ * @example ```"Doe"```
965
+ */
560
966
  last_name?: Nullable<string>;
967
+ /**
968
+ * The user preferred timezone..
969
+ * @example ```"UTC"```
970
+ */
561
971
  time_zone?: Nullable<string>;
562
972
  }
563
973
  declare class Users extends ApiSingleton<User> {
@@ -570,6 +980,35 @@ declare class Users extends ApiSingleton<User> {
570
980
  }
571
981
 
572
982
  type ResourceTypeLock = 'api_credentials' | 'application_memberships' | 'memberships' | 'organizations' | 'permissions' | 'roles' | 'user' | 'versions';
983
+ declare const resourceList: readonly ["api_credentials", "application_memberships", "memberships", "organizations", "permissions", "roles", "user", "versions"];
984
+ declare const singletonList: readonly ["user"];
985
+ type RetrievableResourceType = ResourceTypeLock;
986
+ type RetrievableResource = Resource & {
987
+ type: RetrievableResourceType;
988
+ };
989
+ type ListableResourceType = Exclude<ResourceTypeLock, 'user'>;
990
+ type ListableResource = Resource & {
991
+ type: ListableResourceType;
992
+ };
993
+ type CreatableResourceType = 'api_credentials' | 'application_memberships' | 'memberships' | 'organizations' | 'permissions' | 'roles';
994
+ type CreatableResource = Resource & {
995
+ type: CreatableResourceType;
996
+ };
997
+ type UpdatableResourceType = 'api_credentials' | 'application_memberships' | 'memberships' | 'organizations' | 'permissions' | 'roles';
998
+ type UpdatableResource = Resource & {
999
+ type: UpdatableResourceType;
1000
+ };
1001
+ type DeletableResourceType = 'api_credentials' | 'application_memberships' | 'memberships';
1002
+ type DeletableResource = Resource & {
1003
+ type: DeletableResourceType;
1004
+ };
1005
+ type VersionableResourceType = 'memberships' | 'permissions' | 'roles';
1006
+ type VersionableResource = Resource & {
1007
+ type: VersionableResourceType;
1008
+ versions?: Array<ResourceRel & {
1009
+ type: VersionType;
1010
+ }> | null;
1011
+ };
573
1012
  type ResourceFields = {
574
1013
  api_credentials: ApiCredential;
575
1014
  application_memberships: ApplicationMembership;
@@ -592,11 +1031,11 @@ type ResourceSortFields = {
592
1031
  };
593
1032
 
594
1033
  declare enum ErrorType {
595
- CLIENT = "client",
596
- REQUEST = "request",
597
- RESPONSE = "response",
598
- CANCEL = "cancel",
599
- PARSE = "parse",
1034
+ CLIENT = "client",// Generic Client error
1035
+ REQUEST = "request",// Error preparing API request
1036
+ RESPONSE = "response",// Error response from API
1037
+ CANCEL = "cancel",// Forced request abort using interceptor
1038
+ PARSE = "parse",// Error parsing API resource
600
1039
  TIMEOUT = "timeout"
601
1040
  }
602
1041
  declare class SdkError extends Error {
@@ -662,4 +1101,4 @@ declare const CommerceLayerProvisioningStatic: {
662
1101
  readonly schemaVersion: string;
663
1102
  };
664
1103
 
665
- export { type ApiCredential, type ApiCredentialCreate, type ApiCredentialSort, type ApiCredentialUpdate, ApiError, type ApplicationMembership, type ApplicationMembershipCreate, type ApplicationMembershipSort, type ApplicationMembershipUpdate, CommerceLayerProvisioning, CommerceLayerProvisioningClient, CommerceLayerProvisioningStatic, type ErrorObj, ErrorType, type HeadersObj, type Membership, type MembershipCreate, type MembershipSort, type MembershipUpdate, type Organization, type OrganizationCreate, type OrganizationSort, type OrganizationUpdate, type Permission, type PermissionCreate, type PermissionSort, type PermissionUpdate, type QueryParams, type QueryParamsList, type QueryParamsRetrieve, type RequestObj, type ResponseObj, type Role, type RoleCreate, type RoleSort, type RoleUpdate, SdkError, type User, type UserSort, type UserUpdate, type Version, type VersionSort, CommerceLayerProvisioning as default };
1104
+ export { type ApiCredential, type ApiCredentialCreate, type ApiCredentialSort, type ApiCredentialUpdate, ApiCredentials, ApiError, ApiResource, ApiSingleton, type ApplicationMembership, type ApplicationMembershipCreate, type ApplicationMembershipSort, type ApplicationMembershipUpdate, ApplicationMemberships, CommerceLayerProvisioning, CommerceLayerProvisioningClient, CommerceLayerProvisioningStatic, type CreatableResource, type CreatableResourceType, type DeletableResource, type DeletableResourceType, type ErrorObj, ErrorType, type HeadersObj, type ListMeta, ListResponse, type ListableResource, type ListableResourceType, type Membership, type MembershipCreate, type MembershipSort, type MembershipUpdate, Memberships, type Metadata, type Organization, type OrganizationCreate, type OrganizationSort, type OrganizationUpdate, Organizations, type Permission, type PermissionCreate, type PermissionSort, type PermissionUpdate, Permissions, type QueryFilter, type QueryPageSize, type QueryParams, type QueryParamsList, type QueryParamsRetrieve, type RequestObj, type Resource, type ResourceCreate, type ResourceFields, type ResourceFilter, type ResourceId, type ResourceRel, type ResourceSort, type ResourceSortFields, type ResourceType, type ResourceTypeLock, type ResourceUpdate, type ResourcesConfig, type ResourcesInitConfig, type ResponseObj, type RetrievableResource, type RetrievableResourceType, type Role, type RoleCreate, type RoleSort, type RoleUpdate, Roles, SdkError, type UpdatableResource, type UpdatableResourceType, type User, type UserSort, type UserUpdate, Users, type Version, type VersionSort, type VersionableResource, type VersionableResourceType, Versions, apiResourceAdapter, CommerceLayerProvisioning as default, generateQueryStringParams, generateSearchString, isParamsList, resourceList, singletonList };