@shophost/client 2.0.27 → 2.0.28

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.
@@ -1120,6 +1120,107 @@ export type UpdateProduct = {
1120
1120
  */
1121
1121
  categories?: Array<string>;
1122
1122
  };
1123
+ export type Member = {
1124
+ /**
1125
+ * ID of the member
1126
+ */
1127
+ id: string;
1128
+ /**
1129
+ * ID of the organization
1130
+ */
1131
+ organizationId: string;
1132
+ /**
1133
+ * ID of the user
1134
+ */
1135
+ userId: string;
1136
+ /**
1137
+ * Role of the member in the organization
1138
+ */
1139
+ role: string;
1140
+ createdAt: string;
1141
+ /**
1142
+ * User details
1143
+ */
1144
+ user: {
1145
+ id: string;
1146
+ firstname: string;
1147
+ lastname: string;
1148
+ email: string;
1149
+ image?: string | null;
1150
+ };
1151
+ };
1152
+ export type UpdateMemberRole = {
1153
+ /**
1154
+ * New role for the member
1155
+ */
1156
+ role: string;
1157
+ };
1158
+ export type Invitation = {
1159
+ /**
1160
+ * ID of the invitation
1161
+ */
1162
+ id: string;
1163
+ /**
1164
+ * ID of the organization
1165
+ */
1166
+ organizationId: string;
1167
+ /**
1168
+ * Email of the invited user
1169
+ */
1170
+ email: string;
1171
+ /**
1172
+ * Role assigned to the invitation
1173
+ */
1174
+ role?: string | null;
1175
+ /**
1176
+ * Status of the invitation
1177
+ */
1178
+ status: string;
1179
+ /**
1180
+ * Expiration date of the invitation
1181
+ */
1182
+ expiresAt: string;
1183
+ /**
1184
+ * ID of the user who created the invitation
1185
+ */
1186
+ inviterId: string;
1187
+ createdAt?: string;
1188
+ };
1189
+ export type CreateInvitation = {
1190
+ /**
1191
+ * Email of the user to invite
1192
+ */
1193
+ email: string;
1194
+ /**
1195
+ * Role to assign to the invited user
1196
+ */
1197
+ role: string;
1198
+ };
1199
+ export type UserInvitation = {
1200
+ /**
1201
+ * ID of the invitation
1202
+ */
1203
+ id: string;
1204
+ /**
1205
+ * ID of the organization
1206
+ */
1207
+ organizationId: string;
1208
+ /**
1209
+ * Role assigned to the invitation
1210
+ */
1211
+ role?: string | null;
1212
+ /**
1213
+ * Expiration date of the invitation
1214
+ */
1215
+ expiresAt: string;
1216
+ /**
1217
+ * Organization details
1218
+ */
1219
+ organization: {
1220
+ id: string;
1221
+ name: string;
1222
+ };
1223
+ };
1123
1224
  export type ShippingMethod = {
1124
1225
  /**
1125
1226
  * ID of the shipping method
@@ -3288,6 +3389,580 @@ export type GetProductsByCategoryResponses = {
3288
3389
  };
3289
3390
  };
3290
3391
  export type GetProductsByCategoryResponse = GetProductsByCategoryResponses[keyof GetProductsByCategoryResponses];
3392
+ export type GetMembersData = {
3393
+ body?: never;
3394
+ headers?: {
3395
+ /**
3396
+ * Accept-Language header
3397
+ */
3398
+ 'accept-language'?: string;
3399
+ /**
3400
+ * Cookie header
3401
+ */
3402
+ cookie?: string;
3403
+ };
3404
+ path: {
3405
+ /**
3406
+ * The organization ID
3407
+ */
3408
+ organizationId: string;
3409
+ };
3410
+ query?: {
3411
+ /**
3412
+ * Page number
3413
+ */
3414
+ page?: number | null;
3415
+ /**
3416
+ * Number of items per page
3417
+ */
3418
+ limit?: number | null;
3419
+ /**
3420
+ * Search query
3421
+ */
3422
+ search?: string;
3423
+ /**
3424
+ * Whether to filter by published items
3425
+ */
3426
+ published?: boolean | null;
3427
+ /**
3428
+ * Enum for locale values
3429
+ */
3430
+ locale?: 'af' | 'sq' | 'ar_dz' | 'ar_bh' | 'ar_eg' | 'ar_iq' | 'ar_jo' | 'ar_kw' | 'ar_lb' | 'ar_ly' | 'ar_ma' | 'ar_om' | 'ar_qa' | 'ar_sa' | 'ar_sy' | 'ar_tn' | 'ar_ae' | 'ar_ye' | 'eu' | 'be' | 'bg' | 'ca' | 'zh_hk' | 'zh_cn' | 'zh_sg' | 'zh_tw' | 'hr' | 'cs' | 'da' | 'nl_be' | 'nl' | 'en' | 'en_au' | 'en_bz' | 'en_ca' | 'en_ie' | 'en_jm' | 'en_nz' | 'en_za' | 'en_tt' | 'en_gb' | 'en_us' | 'et' | 'fo' | 'fa' | 'fi' | 'fr_be' | 'fr_ca' | 'fr_lu' | 'fr' | 'fr_ch' | 'gd' | 'de_at' | 'de_li' | 'de_lu' | 'de' | 'de_ch' | 'el' | 'he' | 'hi' | 'hu' | 'is' | 'id' | 'ga' | 'it' | 'it_ch' | 'ja' | 'ko' | 'ku' | 'lv' | 'lt' | 'mk' | 'ml' | 'ms' | 'mt' | 'no' | 'nb' | 'nn' | 'pl' | 'pt_br' | 'pt' | 'pa' | 'rm' | 'ro' | 'ro_md' | 'ru' | 'ru_md' | 'sr' | 'sk' | 'sl' | 'sb' | 'es_ar' | 'es_bo' | 'es_cl' | 'es_co' | 'es_cr' | 'es_do' | 'es_ec' | 'es_sv' | 'es_gt' | 'es_hn' | 'es_mx' | 'es' | 'sv' | 'sv_fi' | 'th' | 'tr' | 'uk' | 'ur' | 'vi' | 'cy' | 'ji' | 'zu';
3431
+ };
3432
+ url: '/{organizationId}/access/members';
3433
+ };
3434
+ export type GetMembersErrors = {
3435
+ /**
3436
+ * Bad Request
3437
+ */
3438
+ 400: {
3439
+ /**
3440
+ * The HTTP status code
3441
+ */
3442
+ status: number;
3443
+ /**
3444
+ * The error message
3445
+ */
3446
+ message: string;
3447
+ };
3448
+ /**
3449
+ * Unauthorized
3450
+ */
3451
+ 401: {
3452
+ /**
3453
+ * The HTTP status code
3454
+ */
3455
+ status: number;
3456
+ /**
3457
+ * The error message
3458
+ */
3459
+ message: string;
3460
+ };
3461
+ };
3462
+ export type GetMembersError = GetMembersErrors[keyof GetMembersErrors];
3463
+ export type GetMembersResponses = {
3464
+ /**
3465
+ * OK
3466
+ */
3467
+ 200: {
3468
+ list: Array<Member>;
3469
+ meta: PaginationMeta;
3470
+ };
3471
+ };
3472
+ export type GetMembersResponse = GetMembersResponses[keyof GetMembersResponses];
3473
+ export type DeleteMemberData = {
3474
+ body?: never;
3475
+ headers?: {
3476
+ /**
3477
+ * Accept-Language header
3478
+ */
3479
+ 'accept-language'?: string;
3480
+ /**
3481
+ * Cookie header
3482
+ */
3483
+ cookie?: string;
3484
+ };
3485
+ path: {
3486
+ /**
3487
+ * ID of the member
3488
+ */
3489
+ memberId: string;
3490
+ /**
3491
+ * ID of the organization
3492
+ */
3493
+ organizationId: string;
3494
+ };
3495
+ query?: never;
3496
+ url: '/{organizationId}/access/members/{memberId}';
3497
+ };
3498
+ export type DeleteMemberErrors = {
3499
+ /**
3500
+ * Bad Request
3501
+ */
3502
+ 400: {
3503
+ /**
3504
+ * The HTTP status code
3505
+ */
3506
+ status: number;
3507
+ /**
3508
+ * The error message
3509
+ */
3510
+ message: string;
3511
+ };
3512
+ /**
3513
+ * Unauthorized
3514
+ */
3515
+ 401: {
3516
+ /**
3517
+ * The HTTP status code
3518
+ */
3519
+ status: number;
3520
+ /**
3521
+ * The error message
3522
+ */
3523
+ message: string;
3524
+ };
3525
+ /**
3526
+ * Not Found
3527
+ */
3528
+ 404: {
3529
+ /**
3530
+ * The HTTP status code
3531
+ */
3532
+ status: number;
3533
+ /**
3534
+ * The error message
3535
+ */
3536
+ message: string;
3537
+ };
3538
+ };
3539
+ export type DeleteMemberError = DeleteMemberErrors[keyof DeleteMemberErrors];
3540
+ export type DeleteMemberResponses = {
3541
+ /**
3542
+ * No Content
3543
+ */
3544
+ 204: void;
3545
+ };
3546
+ export type DeleteMemberResponse = DeleteMemberResponses[keyof DeleteMemberResponses];
3547
+ export type GetMemberData = {
3548
+ body?: never;
3549
+ headers?: {
3550
+ /**
3551
+ * Accept-Language header
3552
+ */
3553
+ 'accept-language'?: string;
3554
+ /**
3555
+ * Cookie header
3556
+ */
3557
+ cookie?: string;
3558
+ };
3559
+ path: {
3560
+ /**
3561
+ * ID of the member
3562
+ */
3563
+ memberId: string;
3564
+ /**
3565
+ * ID of the organization
3566
+ */
3567
+ organizationId: string;
3568
+ };
3569
+ query?: never;
3570
+ url: '/{organizationId}/access/members/{memberId}';
3571
+ };
3572
+ export type GetMemberErrors = {
3573
+ /**
3574
+ * Unauthorized
3575
+ */
3576
+ 401: {
3577
+ /**
3578
+ * The HTTP status code
3579
+ */
3580
+ status: number;
3581
+ /**
3582
+ * The error message
3583
+ */
3584
+ message: string;
3585
+ };
3586
+ /**
3587
+ * Not Found
3588
+ */
3589
+ 404: {
3590
+ /**
3591
+ * The HTTP status code
3592
+ */
3593
+ status: number;
3594
+ /**
3595
+ * The error message
3596
+ */
3597
+ message: string;
3598
+ };
3599
+ };
3600
+ export type GetMemberError = GetMemberErrors[keyof GetMemberErrors];
3601
+ export type GetMemberResponses = {
3602
+ /**
3603
+ * OK
3604
+ */
3605
+ 200: Member;
3606
+ };
3607
+ export type GetMemberResponse = GetMemberResponses[keyof GetMemberResponses];
3608
+ export type UpdateMemberRoleData = {
3609
+ body: UpdateMemberRole;
3610
+ headers?: {
3611
+ /**
3612
+ * Accept-Language header
3613
+ */
3614
+ 'accept-language'?: string;
3615
+ /**
3616
+ * Cookie header
3617
+ */
3618
+ cookie?: string;
3619
+ };
3620
+ path: {
3621
+ /**
3622
+ * ID of the member
3623
+ */
3624
+ memberId: string;
3625
+ /**
3626
+ * ID of the organization
3627
+ */
3628
+ organizationId: string;
3629
+ };
3630
+ query?: never;
3631
+ url: '/{organizationId}/access/members/{memberId}';
3632
+ };
3633
+ export type UpdateMemberRoleErrors = {
3634
+ /**
3635
+ * Bad Request
3636
+ */
3637
+ 400: {
3638
+ /**
3639
+ * The HTTP status code
3640
+ */
3641
+ status: number;
3642
+ /**
3643
+ * The error message
3644
+ */
3645
+ message: string;
3646
+ };
3647
+ /**
3648
+ * Unauthorized
3649
+ */
3650
+ 401: {
3651
+ /**
3652
+ * The HTTP status code
3653
+ */
3654
+ status: number;
3655
+ /**
3656
+ * The error message
3657
+ */
3658
+ message: string;
3659
+ };
3660
+ /**
3661
+ * Not Found
3662
+ */
3663
+ 404: {
3664
+ /**
3665
+ * The HTTP status code
3666
+ */
3667
+ status: number;
3668
+ /**
3669
+ * The error message
3670
+ */
3671
+ message: string;
3672
+ };
3673
+ };
3674
+ export type UpdateMemberRoleError = UpdateMemberRoleErrors[keyof UpdateMemberRoleErrors];
3675
+ export type UpdateMemberRoleResponses = {
3676
+ /**
3677
+ * OK
3678
+ */
3679
+ 200: Member;
3680
+ };
3681
+ export type UpdateMemberRoleResponse = UpdateMemberRoleResponses[keyof UpdateMemberRoleResponses];
3682
+ export type GetInvitationsData = {
3683
+ body?: never;
3684
+ headers?: {
3685
+ /**
3686
+ * Accept-Language header
3687
+ */
3688
+ 'accept-language'?: string;
3689
+ /**
3690
+ * Cookie header
3691
+ */
3692
+ cookie?: string;
3693
+ };
3694
+ path: {
3695
+ /**
3696
+ * The organization ID
3697
+ */
3698
+ organizationId: string;
3699
+ };
3700
+ query?: never;
3701
+ url: '/{organizationId}/access/invitations';
3702
+ };
3703
+ export type GetInvitationsErrors = {
3704
+ /**
3705
+ * Unauthorized
3706
+ */
3707
+ 401: {
3708
+ /**
3709
+ * The HTTP status code
3710
+ */
3711
+ status: number;
3712
+ /**
3713
+ * The error message
3714
+ */
3715
+ message: string;
3716
+ };
3717
+ };
3718
+ export type GetInvitationsError = GetInvitationsErrors[keyof GetInvitationsErrors];
3719
+ export type GetInvitationsResponses = {
3720
+ /**
3721
+ * OK
3722
+ */
3723
+ 200: Array<Invitation>;
3724
+ };
3725
+ export type GetInvitationsResponse = GetInvitationsResponses[keyof GetInvitationsResponses];
3726
+ export type CreateInvitationData = {
3727
+ body: CreateInvitation;
3728
+ headers?: {
3729
+ /**
3730
+ * Accept-Language header
3731
+ */
3732
+ 'accept-language'?: string;
3733
+ /**
3734
+ * Cookie header
3735
+ */
3736
+ cookie?: string;
3737
+ };
3738
+ path: {
3739
+ /**
3740
+ * The organization ID
3741
+ */
3742
+ organizationId: string;
3743
+ };
3744
+ query?: never;
3745
+ url: '/{organizationId}/access/invitations';
3746
+ };
3747
+ export type CreateInvitationErrors = {
3748
+ /**
3749
+ * Bad Request
3750
+ */
3751
+ 400: {
3752
+ /**
3753
+ * The HTTP status code
3754
+ */
3755
+ status: number;
3756
+ /**
3757
+ * The error message
3758
+ */
3759
+ message: string;
3760
+ };
3761
+ /**
3762
+ * Unauthorized
3763
+ */
3764
+ 401: {
3765
+ /**
3766
+ * The HTTP status code
3767
+ */
3768
+ status: number;
3769
+ /**
3770
+ * The error message
3771
+ */
3772
+ message: string;
3773
+ };
3774
+ };
3775
+ export type CreateInvitationError = CreateInvitationErrors[keyof CreateInvitationErrors];
3776
+ export type CreateInvitationResponses = {
3777
+ /**
3778
+ * Created
3779
+ */
3780
+ 201: Invitation;
3781
+ };
3782
+ export type CreateInvitationResponse = CreateInvitationResponses[keyof CreateInvitationResponses];
3783
+ export type DeleteInvitationData = {
3784
+ body?: never;
3785
+ headers?: {
3786
+ /**
3787
+ * Accept-Language header
3788
+ */
3789
+ 'accept-language'?: string;
3790
+ /**
3791
+ * Cookie header
3792
+ */
3793
+ cookie?: string;
3794
+ };
3795
+ path: {
3796
+ /**
3797
+ * ID of the invitation
3798
+ */
3799
+ invitationId: string;
3800
+ /**
3801
+ * ID of the organization
3802
+ */
3803
+ organizationId: string;
3804
+ };
3805
+ query?: never;
3806
+ url: '/{organizationId}/access/invitations/{invitationId}';
3807
+ };
3808
+ export type DeleteInvitationErrors = {
3809
+ /**
3810
+ * Bad Request
3811
+ */
3812
+ 400: {
3813
+ /**
3814
+ * The HTTP status code
3815
+ */
3816
+ status: number;
3817
+ /**
3818
+ * The error message
3819
+ */
3820
+ message: string;
3821
+ };
3822
+ /**
3823
+ * Unauthorized
3824
+ */
3825
+ 401: {
3826
+ /**
3827
+ * The HTTP status code
3828
+ */
3829
+ status: number;
3830
+ /**
3831
+ * The error message
3832
+ */
3833
+ message: string;
3834
+ };
3835
+ /**
3836
+ * Not Found
3837
+ */
3838
+ 404: {
3839
+ /**
3840
+ * The HTTP status code
3841
+ */
3842
+ status: number;
3843
+ /**
3844
+ * The error message
3845
+ */
3846
+ message: string;
3847
+ };
3848
+ };
3849
+ export type DeleteInvitationError = DeleteInvitationErrors[keyof DeleteInvitationErrors];
3850
+ export type DeleteInvitationResponses = {
3851
+ /**
3852
+ * No Content
3853
+ */
3854
+ 204: void;
3855
+ };
3856
+ export type DeleteInvitationResponse = DeleteInvitationResponses[keyof DeleteInvitationResponses];
3857
+ export type GetUserInvitationsData = {
3858
+ body?: never;
3859
+ headers?: {
3860
+ /**
3861
+ * Accept-Language header
3862
+ */
3863
+ 'accept-language'?: string;
3864
+ /**
3865
+ * Cookie header
3866
+ */
3867
+ cookie?: string;
3868
+ };
3869
+ path?: never;
3870
+ query?: never;
3871
+ url: '/access/invitations/me';
3872
+ };
3873
+ export type GetUserInvitationsErrors = {
3874
+ /**
3875
+ * Unauthorized
3876
+ */
3877
+ 401: {
3878
+ /**
3879
+ * The HTTP status code
3880
+ */
3881
+ status: number;
3882
+ /**
3883
+ * The error message
3884
+ */
3885
+ message: string;
3886
+ };
3887
+ };
3888
+ export type GetUserInvitationsError = GetUserInvitationsErrors[keyof GetUserInvitationsErrors];
3889
+ export type GetUserInvitationsResponses = {
3890
+ /**
3891
+ * OK
3892
+ */
3893
+ 200: Array<UserInvitation>;
3894
+ };
3895
+ export type GetUserInvitationsResponse = GetUserInvitationsResponses[keyof GetUserInvitationsResponses];
3896
+ export type AcceptInvitationData = {
3897
+ body?: never;
3898
+ headers?: {
3899
+ /**
3900
+ * Accept-Language header
3901
+ */
3902
+ 'accept-language'?: string;
3903
+ /**
3904
+ * Cookie header
3905
+ */
3906
+ cookie?: string;
3907
+ };
3908
+ path: {
3909
+ /**
3910
+ * ID of the invitation
3911
+ */
3912
+ invitationId: string;
3913
+ };
3914
+ query?: never;
3915
+ url: '/access/invitations/{invitationId}/accept';
3916
+ };
3917
+ export type AcceptInvitationErrors = {
3918
+ /**
3919
+ * Bad Request
3920
+ */
3921
+ 400: {
3922
+ /**
3923
+ * The HTTP status code
3924
+ */
3925
+ status: number;
3926
+ /**
3927
+ * The error message
3928
+ */
3929
+ message: string;
3930
+ };
3931
+ /**
3932
+ * Unauthorized
3933
+ */
3934
+ 401: {
3935
+ /**
3936
+ * The HTTP status code
3937
+ */
3938
+ status: number;
3939
+ /**
3940
+ * The error message
3941
+ */
3942
+ message: string;
3943
+ };
3944
+ /**
3945
+ * Not Found
3946
+ */
3947
+ 404: {
3948
+ /**
3949
+ * The HTTP status code
3950
+ */
3951
+ status: number;
3952
+ /**
3953
+ * The error message
3954
+ */
3955
+ message: string;
3956
+ };
3957
+ };
3958
+ export type AcceptInvitationError = AcceptInvitationErrors[keyof AcceptInvitationErrors];
3959
+ export type AcceptInvitationResponses = {
3960
+ /**
3961
+ * OK
3962
+ */
3963
+ 200: Member;
3964
+ };
3965
+ export type AcceptInvitationResponse = AcceptInvitationResponses[keyof AcceptInvitationResponses];
3291
3966
  export type GetShippingMethodsData = {
3292
3967
  body?: never;
3293
3968
  headers?: {
package/src/index.d.ts CHANGED
@@ -29,6 +29,17 @@ export interface ClientResponse<TBody = any> {
29
29
  status: number;
30
30
  }
31
31
  export declare const initClient: ({ baseHeaders, baseUrl, credentials, fetch, throwOnUnknownStatus, }: InitClientOptions) => {
32
+ access: {
33
+ acceptInvitation: (input?: RequestInput) => Promise<ClientResponse<any>>;
34
+ createInvitation: (input?: RequestInput) => Promise<ClientResponse<any>>;
35
+ deleteInvitation: (input?: RequestInput) => Promise<ClientResponse<any>>;
36
+ deleteMember: (input?: RequestInput) => Promise<ClientResponse<any>>;
37
+ getInvitations: (input?: RequestInput) => Promise<ClientResponse<any>>;
38
+ getMember: (input?: RequestInput) => Promise<ClientResponse<any>>;
39
+ getMembers: (input?: RequestInput) => Promise<ClientResponse<any>>;
40
+ getUserInvitations: (input?: RequestInput) => Promise<ClientResponse<any>>;
41
+ updateMemberRole: (input?: RequestInput) => Promise<ClientResponse<any>>;
42
+ };
32
43
  cart: {
33
44
  getCartData: (input?: RequestInput) => Promise<ClientResponse<any>>;
34
45
  };
package/src/index.js CHANGED
@@ -62,6 +62,17 @@ export const initClient = ({ baseHeaders, baseUrl, credentials, fetch, throwOnUn
62
62
  throwOnError: false,
63
63
  });
64
64
  return {
65
+ access: {
66
+ acceptInvitation: createWrappedMethod(client, "acceptInvitation", sdk.acceptInvitation, throwOnUnknownStatus),
67
+ createInvitation: createWrappedMethod(client, "createInvitation", sdk.createInvitation, throwOnUnknownStatus),
68
+ deleteInvitation: createWrappedMethod(client, "deleteInvitation", sdk.deleteInvitation, throwOnUnknownStatus),
69
+ deleteMember: createWrappedMethod(client, "deleteMember", sdk.deleteMember, throwOnUnknownStatus),
70
+ getInvitations: createWrappedMethod(client, "getInvitations", sdk.getInvitations, throwOnUnknownStatus),
71
+ getMember: createWrappedMethod(client, "getMember", sdk.getMember, throwOnUnknownStatus),
72
+ getMembers: createWrappedMethod(client, "getMembers", sdk.getMembers, throwOnUnknownStatus),
73
+ getUserInvitations: createWrappedMethod(client, "getUserInvitations", sdk.getUserInvitations, throwOnUnknownStatus),
74
+ updateMemberRole: createWrappedMethod(client, "updateMemberRole", sdk.updateMemberRole, throwOnUnknownStatus),
75
+ },
65
76
  cart: {
66
77
  getCartData: createWrappedMethod(client, "getCartData", sdk.getCartData, throwOnUnknownStatus),
67
78
  },