@seamapi/types 1.375.2 → 1.376.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.
Files changed (25) hide show
  1. package/dist/connect.cjs +127 -142
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +351 -298
  4. package/lib/seam/connect/models/acs/acs-users/acs-user.d.ts +182 -150
  5. package/lib/seam/connect/models/acs/acs-users/acs-user.js +2 -3
  6. package/lib/seam/connect/models/acs/acs-users/acs-user.js.map +1 -1
  7. package/lib/seam/connect/models/acs/acs-users/index.d.ts +1 -1
  8. package/lib/seam/connect/models/acs/acs-users/index.js +1 -1
  9. package/lib/seam/connect/models/acs/acs-users/index.js.map +1 -1
  10. package/lib/seam/connect/models/acs/acs-users/{pending-modifications.d.ts → pending-mutations.d.ts} +191 -106
  11. package/lib/seam/connect/models/acs/acs-users/pending-mutations.js +90 -0
  12. package/lib/seam/connect/models/acs/acs-users/pending-mutations.js.map +1 -0
  13. package/lib/seam/connect/openapi.d.ts +56 -56
  14. package/lib/seam/connect/openapi.js +80 -98
  15. package/lib/seam/connect/openapi.js.map +1 -1
  16. package/lib/seam/connect/route-types.d.ts +119 -98
  17. package/package.json +1 -1
  18. package/src/lib/seam/connect/models/acs/acs-users/acs-user.ts +2 -3
  19. package/src/lib/seam/connect/models/acs/acs-users/index.ts +1 -1
  20. package/src/lib/seam/connect/models/acs/acs-users/pending-mutations.ts +110 -0
  21. package/src/lib/seam/connect/openapi.ts +80 -98
  22. package/src/lib/seam/connect/route-types.ts +126 -98
  23. package/lib/seam/connect/models/acs/acs-users/pending-modifications.js +0 -85
  24. package/lib/seam/connect/models/acs/acs-users/pending-modifications.js.map +0 -1
  25. package/src/lib/seam/connect/models/acs/acs-users/pending-modifications.ts +0 -109
@@ -7395,32 +7395,35 @@ export interface Routes {
7395
7395
  error_code: 'failed_to_delete_on_acs_system';
7396
7396
  }>;
7397
7397
  /** */
7398
- pending_modifications?: Array<{
7398
+ pending_mutations?: Array<{
7399
7399
  created_at: string;
7400
- modification_code: 'create';
7400
+ mutation_code: 'creating';
7401
7401
  } | {
7402
7402
  created_at: string;
7403
- modification_code: 'profile';
7404
- modified_from: {
7403
+ mutation_code: 'deleting';
7404
+ } | {
7405
+ created_at: string;
7406
+ mutation_code: 'updating_user_information';
7407
+ from: {
7405
7408
  email_address?: (string | null) | undefined;
7406
7409
  full_name?: (string | null) | undefined;
7407
7410
  phone_number?: ((string | undefined) | null) | undefined;
7408
7411
  };
7409
- modified_to: {
7412
+ to: {
7410
7413
  email_address?: (string | null) | undefined;
7411
7414
  full_name?: (string | null) | undefined;
7412
7415
  phone_number?: ((string | undefined) | null) | undefined;
7413
7416
  };
7414
7417
  } | {
7415
7418
  created_at: string;
7416
- modification_code: 'access_schedule';
7417
- modified_from: {
7419
+ mutation_code: 'updating_access_schedule';
7420
+ from: {
7418
7421
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
7419
7422
  starts_at: string;
7420
7423
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
7421
7424
  ends_at: string | null;
7422
7425
  };
7423
- modified_to: {
7426
+ to: {
7424
7427
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
7425
7428
  starts_at: string;
7426
7429
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -7428,20 +7431,20 @@ export interface Routes {
7428
7431
  };
7429
7432
  } | {
7430
7433
  created_at: string;
7431
- modification_code: 'suspension_state';
7432
- modified_from: {
7434
+ mutation_code: 'updating_suspension_state';
7435
+ from: {
7433
7436
  is_suspended: boolean;
7434
7437
  };
7435
- modified_to: {
7438
+ to: {
7436
7439
  is_suspended: boolean;
7437
7440
  };
7438
7441
  } | {
7439
7442
  created_at: string;
7440
- modification_code: 'acs_access_group_membership';
7441
- modified_from: {
7443
+ mutation_code: 'updating_group_membership';
7444
+ from: {
7442
7445
  acs_access_group_id: string | null;
7443
7446
  };
7444
- modified_to: {
7447
+ to: {
7445
7448
  acs_access_group_id: string | null;
7446
7449
  };
7447
7450
  }> | undefined;
@@ -11841,32 +11844,35 @@ export interface Routes {
11841
11844
  error_code: 'failed_to_delete_on_acs_system';
11842
11845
  }>;
11843
11846
  /** */
11844
- pending_modifications?: Array<{
11847
+ pending_mutations?: Array<{
11848
+ created_at: string;
11849
+ mutation_code: 'creating';
11850
+ } | {
11845
11851
  created_at: string;
11846
- modification_code: 'create';
11852
+ mutation_code: 'deleting';
11847
11853
  } | {
11848
11854
  created_at: string;
11849
- modification_code: 'profile';
11850
- modified_from: {
11855
+ mutation_code: 'updating_user_information';
11856
+ from: {
11851
11857
  email_address?: (string | null) | undefined;
11852
11858
  full_name?: (string | null) | undefined;
11853
11859
  phone_number?: ((string | undefined) | null) | undefined;
11854
11860
  };
11855
- modified_to: {
11861
+ to: {
11856
11862
  email_address?: (string | null) | undefined;
11857
11863
  full_name?: (string | null) | undefined;
11858
11864
  phone_number?: ((string | undefined) | null) | undefined;
11859
11865
  };
11860
11866
  } | {
11861
11867
  created_at: string;
11862
- modification_code: 'access_schedule';
11863
- modified_from: {
11868
+ mutation_code: 'updating_access_schedule';
11869
+ from: {
11864
11870
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
11865
11871
  starts_at: string;
11866
11872
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
11867
11873
  ends_at: string | null;
11868
11874
  };
11869
- modified_to: {
11875
+ to: {
11870
11876
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
11871
11877
  starts_at: string;
11872
11878
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -11874,20 +11880,20 @@ export interface Routes {
11874
11880
  };
11875
11881
  } | {
11876
11882
  created_at: string;
11877
- modification_code: 'suspension_state';
11878
- modified_from: {
11883
+ mutation_code: 'updating_suspension_state';
11884
+ from: {
11879
11885
  is_suspended: boolean;
11880
11886
  };
11881
- modified_to: {
11887
+ to: {
11882
11888
  is_suspended: boolean;
11883
11889
  };
11884
11890
  } | {
11885
11891
  created_at: string;
11886
- modification_code: 'acs_access_group_membership';
11887
- modified_from: {
11892
+ mutation_code: 'updating_group_membership';
11893
+ from: {
11888
11894
  acs_access_group_id: string | null;
11889
11895
  };
11890
- modified_to: {
11896
+ to: {
11891
11897
  acs_access_group_id: string | null;
11892
11898
  };
11893
11899
  }> | undefined;
@@ -12022,32 +12028,35 @@ export interface Routes {
12022
12028
  error_code: 'failed_to_delete_on_acs_system';
12023
12029
  }>;
12024
12030
  /** */
12025
- pending_modifications?: Array<{
12031
+ pending_mutations?: Array<{
12026
12032
  created_at: string;
12027
- modification_code: 'create';
12033
+ mutation_code: 'creating';
12028
12034
  } | {
12029
12035
  created_at: string;
12030
- modification_code: 'profile';
12031
- modified_from: {
12036
+ mutation_code: 'deleting';
12037
+ } | {
12038
+ created_at: string;
12039
+ mutation_code: 'updating_user_information';
12040
+ from: {
12032
12041
  email_address?: (string | null) | undefined;
12033
12042
  full_name?: (string | null) | undefined;
12034
12043
  phone_number?: ((string | undefined) | null) | undefined;
12035
12044
  };
12036
- modified_to: {
12045
+ to: {
12037
12046
  email_address?: (string | null) | undefined;
12038
12047
  full_name?: (string | null) | undefined;
12039
12048
  phone_number?: ((string | undefined) | null) | undefined;
12040
12049
  };
12041
12050
  } | {
12042
12051
  created_at: string;
12043
- modification_code: 'access_schedule';
12044
- modified_from: {
12052
+ mutation_code: 'updating_access_schedule';
12053
+ from: {
12045
12054
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12046
12055
  starts_at: string;
12047
12056
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12048
12057
  ends_at: string | null;
12049
12058
  };
12050
- modified_to: {
12059
+ to: {
12051
12060
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12052
12061
  starts_at: string;
12053
12062
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -12055,20 +12064,20 @@ export interface Routes {
12055
12064
  };
12056
12065
  } | {
12057
12066
  created_at: string;
12058
- modification_code: 'suspension_state';
12059
- modified_from: {
12067
+ mutation_code: 'updating_suspension_state';
12068
+ from: {
12060
12069
  is_suspended: boolean;
12061
12070
  };
12062
- modified_to: {
12071
+ to: {
12063
12072
  is_suspended: boolean;
12064
12073
  };
12065
12074
  } | {
12066
12075
  created_at: string;
12067
- modification_code: 'acs_access_group_membership';
12068
- modified_from: {
12076
+ mutation_code: 'updating_group_membership';
12077
+ from: {
12069
12078
  acs_access_group_id: string | null;
12070
12079
  };
12071
- modified_to: {
12080
+ to: {
12072
12081
  acs_access_group_id: string | null;
12073
12082
  };
12074
12083
  }> | undefined;
@@ -12199,32 +12208,35 @@ export interface Routes {
12199
12208
  error_code: 'failed_to_delete_on_acs_system';
12200
12209
  }>;
12201
12210
  /** */
12202
- pending_modifications?: Array<{
12211
+ pending_mutations?: Array<{
12212
+ created_at: string;
12213
+ mutation_code: 'creating';
12214
+ } | {
12203
12215
  created_at: string;
12204
- modification_code: 'create';
12216
+ mutation_code: 'deleting';
12205
12217
  } | {
12206
12218
  created_at: string;
12207
- modification_code: 'profile';
12208
- modified_from: {
12219
+ mutation_code: 'updating_user_information';
12220
+ from: {
12209
12221
  email_address?: (string | null) | undefined;
12210
12222
  full_name?: (string | null) | undefined;
12211
12223
  phone_number?: ((string | undefined) | null) | undefined;
12212
12224
  };
12213
- modified_to: {
12225
+ to: {
12214
12226
  email_address?: (string | null) | undefined;
12215
12227
  full_name?: (string | null) | undefined;
12216
12228
  phone_number?: ((string | undefined) | null) | undefined;
12217
12229
  };
12218
12230
  } | {
12219
12231
  created_at: string;
12220
- modification_code: 'access_schedule';
12221
- modified_from: {
12232
+ mutation_code: 'updating_access_schedule';
12233
+ from: {
12222
12234
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12223
12235
  starts_at: string;
12224
12236
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12225
12237
  ends_at: string | null;
12226
12238
  };
12227
- modified_to: {
12239
+ to: {
12228
12240
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12229
12241
  starts_at: string;
12230
12242
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -12232,20 +12244,20 @@ export interface Routes {
12232
12244
  };
12233
12245
  } | {
12234
12246
  created_at: string;
12235
- modification_code: 'suspension_state';
12236
- modified_from: {
12247
+ mutation_code: 'updating_suspension_state';
12248
+ from: {
12237
12249
  is_suspended: boolean;
12238
12250
  };
12239
- modified_to: {
12251
+ to: {
12240
12252
  is_suspended: boolean;
12241
12253
  };
12242
12254
  } | {
12243
12255
  created_at: string;
12244
- modification_code: 'acs_access_group_membership';
12245
- modified_from: {
12256
+ mutation_code: 'updating_group_membership';
12257
+ from: {
12246
12258
  acs_access_group_id: string | null;
12247
12259
  };
12248
- modified_to: {
12260
+ to: {
12249
12261
  acs_access_group_id: string | null;
12250
12262
  };
12251
12263
  }> | undefined;
@@ -12485,32 +12497,35 @@ export interface Routes {
12485
12497
  error_code: 'failed_to_delete_on_acs_system';
12486
12498
  }>;
12487
12499
  /** */
12488
- pending_modifications?: Array<{
12500
+ pending_mutations?: Array<{
12501
+ created_at: string;
12502
+ mutation_code: 'creating';
12503
+ } | {
12489
12504
  created_at: string;
12490
- modification_code: 'create';
12505
+ mutation_code: 'deleting';
12491
12506
  } | {
12492
12507
  created_at: string;
12493
- modification_code: 'profile';
12494
- modified_from: {
12508
+ mutation_code: 'updating_user_information';
12509
+ from: {
12495
12510
  email_address?: (string | null) | undefined;
12496
12511
  full_name?: (string | null) | undefined;
12497
12512
  phone_number?: ((string | undefined) | null) | undefined;
12498
12513
  };
12499
- modified_to: {
12514
+ to: {
12500
12515
  email_address?: (string | null) | undefined;
12501
12516
  full_name?: (string | null) | undefined;
12502
12517
  phone_number?: ((string | undefined) | null) | undefined;
12503
12518
  };
12504
12519
  } | {
12505
12520
  created_at: string;
12506
- modification_code: 'access_schedule';
12507
- modified_from: {
12521
+ mutation_code: 'updating_access_schedule';
12522
+ from: {
12508
12523
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12509
12524
  starts_at: string;
12510
12525
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12511
12526
  ends_at: string | null;
12512
12527
  };
12513
- modified_to: {
12528
+ to: {
12514
12529
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12515
12530
  starts_at: string;
12516
12531
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -12518,20 +12533,20 @@ export interface Routes {
12518
12533
  };
12519
12534
  } | {
12520
12535
  created_at: string;
12521
- modification_code: 'suspension_state';
12522
- modified_from: {
12536
+ mutation_code: 'updating_suspension_state';
12537
+ from: {
12523
12538
  is_suspended: boolean;
12524
12539
  };
12525
- modified_to: {
12540
+ to: {
12526
12541
  is_suspended: boolean;
12527
12542
  };
12528
12543
  } | {
12529
12544
  created_at: string;
12530
- modification_code: 'acs_access_group_membership';
12531
- modified_from: {
12545
+ mutation_code: 'updating_group_membership';
12546
+ from: {
12532
12547
  acs_access_group_id: string | null;
12533
12548
  };
12534
- modified_to: {
12549
+ to: {
12535
12550
  acs_access_group_id: string | null;
12536
12551
  };
12537
12552
  }> | undefined;
@@ -12652,32 +12667,35 @@ export interface Routes {
12652
12667
  error_code: 'failed_to_delete_on_acs_system';
12653
12668
  }>;
12654
12669
  /** */
12655
- pending_modifications?: Array<{
12670
+ pending_mutations?: Array<{
12656
12671
  created_at: string;
12657
- modification_code: 'create';
12672
+ mutation_code: 'creating';
12658
12673
  } | {
12659
12674
  created_at: string;
12660
- modification_code: 'profile';
12661
- modified_from: {
12675
+ mutation_code: 'deleting';
12676
+ } | {
12677
+ created_at: string;
12678
+ mutation_code: 'updating_user_information';
12679
+ from: {
12662
12680
  email_address?: (string | null) | undefined;
12663
12681
  full_name?: (string | null) | undefined;
12664
12682
  phone_number?: ((string | undefined) | null) | undefined;
12665
12683
  };
12666
- modified_to: {
12684
+ to: {
12667
12685
  email_address?: (string | null) | undefined;
12668
12686
  full_name?: (string | null) | undefined;
12669
12687
  phone_number?: ((string | undefined) | null) | undefined;
12670
12688
  };
12671
12689
  } | {
12672
12690
  created_at: string;
12673
- modification_code: 'access_schedule';
12674
- modified_from: {
12691
+ mutation_code: 'updating_access_schedule';
12692
+ from: {
12675
12693
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12676
12694
  starts_at: string;
12677
12695
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12678
12696
  ends_at: string | null;
12679
12697
  };
12680
- modified_to: {
12698
+ to: {
12681
12699
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
12682
12700
  starts_at: string;
12683
12701
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -12685,20 +12703,20 @@ export interface Routes {
12685
12703
  };
12686
12704
  } | {
12687
12705
  created_at: string;
12688
- modification_code: 'suspension_state';
12689
- modified_from: {
12706
+ mutation_code: 'updating_suspension_state';
12707
+ from: {
12690
12708
  is_suspended: boolean;
12691
12709
  };
12692
- modified_to: {
12710
+ to: {
12693
12711
  is_suspended: boolean;
12694
12712
  };
12695
12713
  } | {
12696
12714
  created_at: string;
12697
- modification_code: 'acs_access_group_membership';
12698
- modified_from: {
12715
+ mutation_code: 'updating_group_membership';
12716
+ from: {
12699
12717
  acs_access_group_id: string | null;
12700
12718
  };
12701
- modified_to: {
12719
+ to: {
12702
12720
  acs_access_group_id: string | null;
12703
12721
  };
12704
12722
  }> | undefined;
@@ -41074,32 +41092,35 @@ export interface Routes {
41074
41092
  error_code: 'failed_to_delete_on_acs_system';
41075
41093
  }>;
41076
41094
  /** */
41077
- pending_modifications?: Array<{
41095
+ pending_mutations?: Array<{
41096
+ created_at: string;
41097
+ mutation_code: 'creating';
41098
+ } | {
41078
41099
  created_at: string;
41079
- modification_code: 'create';
41100
+ mutation_code: 'deleting';
41080
41101
  } | {
41081
41102
  created_at: string;
41082
- modification_code: 'profile';
41083
- modified_from: {
41103
+ mutation_code: 'updating_user_information';
41104
+ from: {
41084
41105
  email_address?: (string | null) | undefined;
41085
41106
  full_name?: (string | null) | undefined;
41086
41107
  phone_number?: ((string | undefined) | null) | undefined;
41087
41108
  };
41088
- modified_to: {
41109
+ to: {
41089
41110
  email_address?: (string | null) | undefined;
41090
41111
  full_name?: (string | null) | undefined;
41091
41112
  phone_number?: ((string | undefined) | null) | undefined;
41092
41113
  };
41093
41114
  } | {
41094
41115
  created_at: string;
41095
- modification_code: 'access_schedule';
41096
- modified_from: {
41116
+ mutation_code: 'updating_access_schedule';
41117
+ from: {
41097
41118
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
41098
41119
  starts_at: string;
41099
41120
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
41100
41121
  ends_at: string | null;
41101
41122
  };
41102
- modified_to: {
41123
+ to: {
41103
41124
  /** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
41104
41125
  starts_at: string;
41105
41126
  /** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
@@ -41107,20 +41128,20 @@ export interface Routes {
41107
41128
  };
41108
41129
  } | {
41109
41130
  created_at: string;
41110
- modification_code: 'suspension_state';
41111
- modified_from: {
41131
+ mutation_code: 'updating_suspension_state';
41132
+ from: {
41112
41133
  is_suspended: boolean;
41113
41134
  };
41114
- modified_to: {
41135
+ to: {
41115
41136
  is_suspended: boolean;
41116
41137
  };
41117
41138
  } | {
41118
41139
  created_at: string;
41119
- modification_code: 'acs_access_group_membership';
41120
- modified_from: {
41140
+ mutation_code: 'updating_group_membership';
41141
+ from: {
41121
41142
  acs_access_group_id: string | null;
41122
41143
  };
41123
- modified_to: {
41144
+ to: {
41124
41145
  acs_access_group_id: string | null;
41125
41146
  };
41126
41147
  }> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.375.2",
3
+ "version": "1.376.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -2,7 +2,7 @@ import { z } from 'zod'
2
2
 
3
3
  import { phone_number } from '../../phone-number.js'
4
4
  import { schedule } from '../../schedule.js'
5
- import { acs_user_pending_modification } from './pending-modifications.js'
5
+ import { acs_user_pending_mutations } from './pending-mutations.js'
6
6
 
7
7
  export const acs_user_external_type = z.enum([
8
8
  'pti_user',
@@ -326,8 +326,7 @@ const common_acs_user = z
326
326
  .describe(
327
327
  'Errors associated with the [ACS user](https://docs.seam.co/latest/capability-guides/access-systems/user-management).',
328
328
  ),
329
- pending_modifications: z.array(acs_user_pending_modification).optional()
330
- .describe(`
329
+ pending_mutations: z.array(acs_user_pending_mutations).optional().describe(`
331
330
  ---
332
331
  undocumented: Experimental.
333
332
  ---
@@ -1,2 +1,2 @@
1
1
  export * from './acs-user.js'
2
- export * from './pending-modifications.js'
2
+ export * from './pending-mutations.js'
@@ -0,0 +1,110 @@
1
+ import { z } from 'zod'
2
+
3
+ import { phone_number } from '../../phone-number.js'
4
+ import { schedule } from '../../schedule.js'
5
+
6
+ const common_pending_mutation = z.object({
7
+ created_at: z.string().datetime(),
8
+ })
9
+
10
+ const creating = common_pending_mutation.extend({
11
+ mutation_code: z.literal('creating'),
12
+ })
13
+
14
+ const deleting = common_pending_mutation.extend({
15
+ mutation_code: z.literal('deleting'),
16
+ })
17
+
18
+ const acs_user_info = z.object({
19
+ email_address: z.string().email().nullable(),
20
+ full_name: z.string().nullable(),
21
+ phone_number: phone_number.optional().nullable(),
22
+ })
23
+
24
+ export const updating_user_information_mutation =
25
+ common_pending_mutation.extend({
26
+ mutation_code: z.literal('updating_user_information'),
27
+ from: acs_user_info.partial(),
28
+ to: acs_user_info.partial(),
29
+ })
30
+
31
+ const updating_access_schedule_mutation = common_pending_mutation.extend({
32
+ mutation_code: z.literal('updating_access_schedule'),
33
+ from: schedule,
34
+ to: schedule,
35
+ })
36
+
37
+ const updating_suspension_state_mutation = common_pending_mutation.extend({
38
+ mutation_code: z.literal('updating_suspension_state'),
39
+ from: z.object({ is_suspended: z.boolean() }),
40
+ to: z.object({ is_suspended: z.boolean() }),
41
+ })
42
+
43
+ const updating_group_membership_mutation = common_pending_mutation.extend({
44
+ mutation_code: z.literal('updating_group_membership'),
45
+ from: z.object({
46
+ acs_access_group_id: z.string().uuid().nullable(),
47
+ }),
48
+ to: z.object({
49
+ acs_access_group_id: z.string().uuid().nullable(),
50
+ }),
51
+ })
52
+
53
+ export const acs_user_pending_mutations = z.discriminatedUnion(
54
+ 'mutation_code',
55
+ [
56
+ creating,
57
+ deleting,
58
+ updating_user_information_mutation,
59
+ updating_access_schedule_mutation,
60
+ updating_suspension_state_mutation,
61
+ updating_group_membership_mutation,
62
+ ],
63
+ )
64
+
65
+ export type AcsUserPendingMutation = z.infer<typeof acs_user_pending_mutations>
66
+
67
+ export const acs_user_pending_mutations_map = z.object({
68
+ creating: creating.optional().nullable(),
69
+ deleting: deleting.optional().nullable(),
70
+ 'updating_user_information.full_name': common_pending_mutation
71
+ .extend({
72
+ mutation_code: z.literal('updating_user_information'),
73
+ from: z.object({
74
+ full_name: z.string().nullable(),
75
+ }),
76
+ to: z.object({
77
+ full_name: z.string().nullable(),
78
+ }),
79
+ })
80
+ .optional()
81
+ .nullable(),
82
+ 'updating_user_information.email_address': common_pending_mutation
83
+ .extend({
84
+ mutation_code: z.literal('updating_user_information'),
85
+ from: z.object({
86
+ email_address: z.string().email().nullable(),
87
+ }),
88
+ to: z.object({
89
+ email_address: z.string().email().nullable(),
90
+ }),
91
+ })
92
+ .optional()
93
+ .nullable(),
94
+ 'updating_user_information.phone_number': common_pending_mutation
95
+ .extend({
96
+ mutation_code: z.literal('updating_user_information'),
97
+ from: z.object({
98
+ phone_number: phone_number.nullable(),
99
+ }),
100
+ to: z.object({
101
+ phone_number: phone_number.nullable(),
102
+ }),
103
+ })
104
+ .optional()
105
+ .nullable(),
106
+ })
107
+
108
+ export type AcsUserPendingMutationsMap = z.infer<
109
+ typeof acs_user_pending_mutations_map
110
+ >