@gymspace/sdk 1.2.3 → 1.2.5

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/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
- import { PaginationParams as PaginationParams$1, ContractStatus, LeadStatus } from '@gymspace/shared';
2
+ import { PaginationParams as PaginationParams$1, ContractStatus, InvitationStatus, LeadStatus } from '@gymspace/shared';
3
3
  export * from '@gymspace/shared';
4
4
 
5
5
  interface GymSpaceConfig {
@@ -73,8 +73,15 @@ interface LoginDto {
73
73
  interface LoginResponseDto {
74
74
  access_token: string;
75
75
  refresh_token: string;
76
- user: any;
77
- redirectPath: string;
76
+ user: {
77
+ id: string;
78
+ email: string;
79
+ name?: string;
80
+ userType: string;
81
+ };
82
+ lastActiveGymId?: string;
83
+ lastActiveOrganizationId?: string;
84
+ redirectPath?: string;
78
85
  }
79
86
  interface VerifyEmailDto {
80
87
  email: string;
@@ -142,6 +149,13 @@ interface InvitationValidationResponse {
142
149
  email: string;
143
150
  };
144
151
  }
152
+ interface CollaboratorRoleDto {
153
+ collaboratorId: string;
154
+ roleId: string;
155
+ roleName: string;
156
+ gymId: string;
157
+ gymName: string;
158
+ }
145
159
  interface CurrentSessionResponse {
146
160
  accessToken: string;
147
161
  refreshToken?: string;
@@ -199,6 +213,7 @@ interface CurrentSessionResponse {
199
213
  isActive: boolean;
200
214
  };
201
215
  permissions: string[];
216
+ collaborator?: CollaboratorRoleDto;
202
217
  isAuthenticated: boolean;
203
218
  }
204
219
 
@@ -534,6 +549,137 @@ declare class GymsResource extends BaseResource {
534
549
  updateGymSocialMedia(id: string, data: UpdateGymSocialMediaDto, options?: RequestOptions): Promise<Gym>;
535
550
  }
536
551
 
552
+ interface Collaborator {
553
+ id: string;
554
+ userId: string;
555
+ gymId: string;
556
+ roleId: string;
557
+ status: 'pending' | 'active' | 'inactive';
558
+ hiredDate?: string;
559
+ profilePhotoId?: string;
560
+ coverPhotoId?: string;
561
+ description?: string;
562
+ specialties?: any;
563
+ user?: {
564
+ id: string;
565
+ name: string;
566
+ email: string;
567
+ phone?: string;
568
+ };
569
+ role?: {
570
+ id: string;
571
+ name: string;
572
+ permissions: string[];
573
+ };
574
+ }
575
+ interface ListCollaboratorsParams {
576
+ page: number;
577
+ limit: number;
578
+ status?: 'pending' | 'active' | 'inactive';
579
+ roleId?: string;
580
+ search?: string;
581
+ }
582
+ interface UpdateCollaboratorDto {
583
+ hiredDate?: string;
584
+ profilePhotoId?: string;
585
+ coverPhotoId?: string;
586
+ description?: string;
587
+ specialties?: any;
588
+ }
589
+ interface UpdateStatusDto {
590
+ status: 'active' | 'inactive';
591
+ }
592
+ interface UpdateRoleDto {
593
+ roleId: string;
594
+ }
595
+ interface ActivityQueryParams {
596
+ startDate?: string;
597
+ endDate?: string;
598
+ limit?: number;
599
+ type?: string;
600
+ }
601
+ interface StatsQueryParams {
602
+ startDate?: string;
603
+ endDate?: string;
604
+ }
605
+ interface CollaboratorStats {
606
+ contracts: {
607
+ total: number;
608
+ totalAmount: number;
609
+ averageAmount: number;
610
+ };
611
+ checkIns: {
612
+ total: number;
613
+ };
614
+ sales: {
615
+ total: number;
616
+ totalAmount: number;
617
+ };
618
+ clients: {
619
+ created: number;
620
+ };
621
+ }
622
+ interface ActivityItem {
623
+ type: string;
624
+ timestamp: string;
625
+ description: string;
626
+ metadata: any;
627
+ }
628
+
629
+ declare class CollaboratorsResource extends BaseResource {
630
+ private basePath;
631
+ list(params?: ListCollaboratorsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Collaborator>>;
632
+ get(id: string, options?: RequestOptions): Promise<Collaborator>;
633
+ update(id: string, data: UpdateCollaboratorDto, options?: RequestOptions): Promise<Collaborator>;
634
+ updateRole(id: string, roleId: string, options?: RequestOptions): Promise<Collaborator>;
635
+ updateStatus(id: string, status: 'active' | 'inactive', options?: RequestOptions): Promise<Collaborator>;
636
+ getActivity(id: string, params?: ActivityQueryParams, options?: RequestOptions): Promise<ActivityItem[]>;
637
+ getStats(id: string, params?: StatsQueryParams, options?: RequestOptions): Promise<CollaboratorStats>;
638
+ }
639
+
640
+ interface Role {
641
+ id: string;
642
+ name: string;
643
+ description: string | null;
644
+ permissions: string[];
645
+ canManageEvaluations: boolean;
646
+ organizationId: string;
647
+ createdByUserId: string | null;
648
+ updatedByUserId: string | null;
649
+ createdAt: string;
650
+ updatedAt: string;
651
+ deletedAt: string | null;
652
+ createdBy?: {
653
+ id: string;
654
+ name: string;
655
+ email: string;
656
+ };
657
+ updatedBy?: {
658
+ id: string;
659
+ name: string;
660
+ email: string;
661
+ };
662
+ }
663
+ interface PermissionsGroup {
664
+ [category: string]: string[];
665
+ }
666
+
667
+ declare class RolesResource extends BaseResource {
668
+ private basePath;
669
+ /**
670
+ * Get all roles of the organization (without pagination)
671
+ */
672
+ getRoles(options?: RequestOptions): Promise<Role[]>;
673
+ /**
674
+ * Get a specific role by ID
675
+ */
676
+ getRole(id: string, options?: RequestOptions): Promise<Role>;
677
+ /**
678
+ * Get all available permissions organized by category
679
+ */
680
+ getAvailablePermissions(options?: RequestOptions): Promise<PermissionsGroup>;
681
+ }
682
+
537
683
  interface CreateClientDto {
538
684
  name: string;
539
685
  email?: string;
@@ -1125,26 +1271,40 @@ declare class CheckInsResource extends BaseResource {
1125
1271
 
1126
1272
  interface CreateInvitationDto {
1127
1273
  email: string;
1128
- gymId: string;
1129
1274
  roleId: string;
1130
1275
  }
1131
1276
  interface AcceptInvitationDto {
1277
+ token?: string;
1278
+ code?: string;
1132
1279
  name: string;
1133
1280
  phone: string;
1134
1281
  password: string;
1135
1282
  }
1283
+ interface ValidateByCodeDto {
1284
+ code: string;
1285
+ }
1136
1286
  interface Invitation {
1137
1287
  id: string;
1138
1288
  email: string;
1139
1289
  gymId: string;
1140
1290
  roleId: string;
1141
1291
  token: string;
1142
- status: 'pending' | 'accepted' | 'cancelled' | 'expired';
1143
- invitedById: string;
1292
+ code: string;
1293
+ status: InvitationStatus;
1294
+ invitedByUserId: string;
1144
1295
  acceptedAt?: string;
1145
1296
  expiresAt: string;
1146
1297
  createdAt: string;
1147
1298
  updatedAt: string;
1299
+ role?: {
1300
+ id: string;
1301
+ name: string;
1302
+ };
1303
+ invitedBy?: {
1304
+ id: string;
1305
+ name: string | null;
1306
+ email: string;
1307
+ };
1148
1308
  }
1149
1309
  interface GetGymInvitationsParams {
1150
1310
  gymId: string;
@@ -1154,7 +1314,13 @@ declare class InvitationsResource extends BaseResource {
1154
1314
  private basePath;
1155
1315
  createInvitation(data: CreateInvitationDto, options?: RequestOptions): Promise<Invitation>;
1156
1316
  getGymInvitations(params: GetGymInvitationsParams, options?: RequestOptions): Promise<Invitation[]>;
1157
- acceptInvitation(token: string, data: AcceptInvitationDto, options?: RequestOptions): Promise<void>;
1317
+ validateByCode(data: ValidateByCodeDto, options?: RequestOptions): Promise<{
1318
+ email: string;
1319
+ gymName: string;
1320
+ roleName: string;
1321
+ token: string;
1322
+ }>;
1323
+ acceptInvitation(data: AcceptInvitationDto, options?: RequestOptions): Promise<void>;
1158
1324
  cancelInvitation(id: string, options?: RequestOptions): Promise<void>;
1159
1325
  }
1160
1326
 
@@ -2221,6 +2387,8 @@ declare class GymSpaceSdk {
2221
2387
  auth: AuthResource;
2222
2388
  organizations: OrganizationsResource;
2223
2389
  gyms: GymsResource;
2390
+ collaborators: CollaboratorsResource;
2391
+ roles: RolesResource;
2224
2392
  clients: ClientsResource;
2225
2393
  membershipPlans: MembershipPlansResource;
2226
2394
  contracts: ContractsResource;
@@ -2296,4 +2464,4 @@ declare class NetworkError extends GymSpaceError {
2296
2464
  constructor(message?: string);
2297
2465
  }
2298
2466
 
2299
- export { type AcceptInvitationDto, type ActivateRenewalDto, AdminSubscriptionManagementResource, type AdminSubscriptionStatusDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, type CancelSubscriptionDto, type CatalogGym, type ChangePasswordDto, type ChangePasswordResponseDto, type CheckIn, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientSearchForCheckInResponse, type ClientStat, type ClientStats, ClientsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type Contract, ContractsResource, type ContractsRevenue, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateEvaluationDto, type CreateGymDto, type CreateInvitationDto, type CreateLeadDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSubscriptionPlanDto, type CreateSupplierDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type Evaluation, type EvaluationHealthMetrics, type EvaluationMeasurements, type EvaluationPerformanceMetrics, type EvaluationReport, type EvaluationSystemFeatures, EvaluationsResource, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, type GetClientEvaluationsParams, type GetContractsParams, type GetFeaturedGymsParams, type GetGymInvitationsParams, type GetMembershipPlansParams, type Gym, type GymAmenities, type GymSchedule, type GymSettings, type GymSocialMedia, type GymSpaceConfig, GymSpaceError, GymSpaceSdk, type GymStats, GymsResource, HealthResource, type HealthResponse, type Invitation, type InvitationValidationResponse, InvitationsResource, type Lead, type LeadManagementFeatures, type LeadStats, LeadsResource, type LoginDto, type LoginResponseDto, type MembershipManagementFeatures, type MembershipPlan, type MembershipPlanStats, MembershipPlansResource, NetworkError, type NewClients, NotFoundError, type NotificationSettings, OnboardingResource, type OnboardingResponse, type OnboardingStatus, OnboardingStep, type Organization, type OrganizationAdminDetails, type OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaySaleDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, type PriceDto, type PricingDto, type Product, type ProductCategory, ProductsResource, PublicCatalogResource, type ReadyResponse, type RegisterCollaboratorDto, type RegisterOwnerDto, type RenewContractDto, type RequestOptions, type RequestPasswordResetDto, type RequestPasswordResetResponseDto, type ResendResetCodeDto, type ResendResetCodeResponseDto, type ResendVerificationDto, type ResetPasswordDto, type ResetPasswordResponseDto, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchLeadsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SocialMedia, type StartOnboardingData, type StartOnboardingResponse, type StockMovement, type Subscription, type SubscriptionHistoryDto, type SubscriptionPlan, type SubscriptionPlanDto, SubscriptionPlansResource, type SubscriptionStatusDto, SubscriptionsResource, type Supplier, SuppliersResource, type SuppliersStats, type TimeSlot, type TopSellingProduct, type UpdateClientDto, type UpdateEvaluationDto, type UpdateGymDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateLeadDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateSaleDto, type UpdateStockDto, type UpdateSubscriptionPlanDto, type UpdateSupplierDto, type UpgradeSubscriptionDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
2467
+ export { type AcceptInvitationDto, type ActivateRenewalDto, type ActivityItem, type ActivityQueryParams, AdminSubscriptionManagementResource, type AdminSubscriptionStatusDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, type CancelSubscriptionDto, type CatalogGym, type ChangePasswordDto, type ChangePasswordResponseDto, type CheckIn, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientSearchForCheckInResponse, type ClientStat, type ClientStats, ClientsResource, type Collaborator, type CollaboratorRoleDto, type CollaboratorStats, CollaboratorsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type Contract, ContractsResource, type ContractsRevenue, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateEvaluationDto, type CreateGymDto, type CreateInvitationDto, type CreateLeadDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSubscriptionPlanDto, type CreateSupplierDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type Evaluation, type EvaluationHealthMetrics, type EvaluationMeasurements, type EvaluationPerformanceMetrics, type EvaluationReport, type EvaluationSystemFeatures, EvaluationsResource, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, type GetClientEvaluationsParams, type GetContractsParams, type GetFeaturedGymsParams, type GetGymInvitationsParams, type GetMembershipPlansParams, type Gym, type GymAmenities, type GymSchedule, type GymSettings, type GymSocialMedia, type GymSpaceConfig, GymSpaceError, GymSpaceSdk, type GymStats, GymsResource, HealthResource, type HealthResponse, type Invitation, type InvitationValidationResponse, InvitationsResource, type Lead, type LeadManagementFeatures, type LeadStats, LeadsResource, type ListCollaboratorsParams, type LoginDto, type LoginResponseDto, type MembershipManagementFeatures, type MembershipPlan, type MembershipPlanStats, MembershipPlansResource, NetworkError, type NewClients, NotFoundError, type NotificationSettings, OnboardingResource, type OnboardingResponse, type OnboardingStatus, OnboardingStep, type Organization, type OrganizationAdminDetails, type OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaySaleDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, type PermissionsGroup, type PriceDto, type PricingDto, type Product, type ProductCategory, ProductsResource, PublicCatalogResource, type ReadyResponse, type RegisterCollaboratorDto, type RegisterOwnerDto, type RenewContractDto, type RequestOptions, type RequestPasswordResetDto, type RequestPasswordResetResponseDto, type ResendResetCodeDto, type ResendResetCodeResponseDto, type ResendVerificationDto, type ResetPasswordDto, type ResetPasswordResponseDto, type Role, RolesResource, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchLeadsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SocialMedia, type StartOnboardingData, type StartOnboardingResponse, type StatsQueryParams, type StockMovement, type Subscription, type SubscriptionHistoryDto, type SubscriptionPlan, type SubscriptionPlanDto, SubscriptionPlansResource, type SubscriptionStatusDto, SubscriptionsResource, type Supplier, SuppliersResource, type SuppliersStats, type TimeSlot, type TopSellingProduct, type UpdateClientDto, type UpdateCollaboratorDto, type UpdateEvaluationDto, type UpdateGymDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateLeadDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateRoleDto, type UpdateSaleDto, type UpdateStatusDto, type UpdateStockDto, type UpdateSubscriptionPlanDto, type UpdateSupplierDto, type UpgradeSubscriptionDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, type ValidateByCodeDto, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
- import { PaginationParams as PaginationParams$1, ContractStatus, LeadStatus } from '@gymspace/shared';
2
+ import { PaginationParams as PaginationParams$1, ContractStatus, InvitationStatus, LeadStatus } from '@gymspace/shared';
3
3
  export * from '@gymspace/shared';
4
4
 
5
5
  interface GymSpaceConfig {
@@ -73,8 +73,15 @@ interface LoginDto {
73
73
  interface LoginResponseDto {
74
74
  access_token: string;
75
75
  refresh_token: string;
76
- user: any;
77
- redirectPath: string;
76
+ user: {
77
+ id: string;
78
+ email: string;
79
+ name?: string;
80
+ userType: string;
81
+ };
82
+ lastActiveGymId?: string;
83
+ lastActiveOrganizationId?: string;
84
+ redirectPath?: string;
78
85
  }
79
86
  interface VerifyEmailDto {
80
87
  email: string;
@@ -142,6 +149,13 @@ interface InvitationValidationResponse {
142
149
  email: string;
143
150
  };
144
151
  }
152
+ interface CollaboratorRoleDto {
153
+ collaboratorId: string;
154
+ roleId: string;
155
+ roleName: string;
156
+ gymId: string;
157
+ gymName: string;
158
+ }
145
159
  interface CurrentSessionResponse {
146
160
  accessToken: string;
147
161
  refreshToken?: string;
@@ -199,6 +213,7 @@ interface CurrentSessionResponse {
199
213
  isActive: boolean;
200
214
  };
201
215
  permissions: string[];
216
+ collaborator?: CollaboratorRoleDto;
202
217
  isAuthenticated: boolean;
203
218
  }
204
219
 
@@ -534,6 +549,137 @@ declare class GymsResource extends BaseResource {
534
549
  updateGymSocialMedia(id: string, data: UpdateGymSocialMediaDto, options?: RequestOptions): Promise<Gym>;
535
550
  }
536
551
 
552
+ interface Collaborator {
553
+ id: string;
554
+ userId: string;
555
+ gymId: string;
556
+ roleId: string;
557
+ status: 'pending' | 'active' | 'inactive';
558
+ hiredDate?: string;
559
+ profilePhotoId?: string;
560
+ coverPhotoId?: string;
561
+ description?: string;
562
+ specialties?: any;
563
+ user?: {
564
+ id: string;
565
+ name: string;
566
+ email: string;
567
+ phone?: string;
568
+ };
569
+ role?: {
570
+ id: string;
571
+ name: string;
572
+ permissions: string[];
573
+ };
574
+ }
575
+ interface ListCollaboratorsParams {
576
+ page: number;
577
+ limit: number;
578
+ status?: 'pending' | 'active' | 'inactive';
579
+ roleId?: string;
580
+ search?: string;
581
+ }
582
+ interface UpdateCollaboratorDto {
583
+ hiredDate?: string;
584
+ profilePhotoId?: string;
585
+ coverPhotoId?: string;
586
+ description?: string;
587
+ specialties?: any;
588
+ }
589
+ interface UpdateStatusDto {
590
+ status: 'active' | 'inactive';
591
+ }
592
+ interface UpdateRoleDto {
593
+ roleId: string;
594
+ }
595
+ interface ActivityQueryParams {
596
+ startDate?: string;
597
+ endDate?: string;
598
+ limit?: number;
599
+ type?: string;
600
+ }
601
+ interface StatsQueryParams {
602
+ startDate?: string;
603
+ endDate?: string;
604
+ }
605
+ interface CollaboratorStats {
606
+ contracts: {
607
+ total: number;
608
+ totalAmount: number;
609
+ averageAmount: number;
610
+ };
611
+ checkIns: {
612
+ total: number;
613
+ };
614
+ sales: {
615
+ total: number;
616
+ totalAmount: number;
617
+ };
618
+ clients: {
619
+ created: number;
620
+ };
621
+ }
622
+ interface ActivityItem {
623
+ type: string;
624
+ timestamp: string;
625
+ description: string;
626
+ metadata: any;
627
+ }
628
+
629
+ declare class CollaboratorsResource extends BaseResource {
630
+ private basePath;
631
+ list(params?: ListCollaboratorsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Collaborator>>;
632
+ get(id: string, options?: RequestOptions): Promise<Collaborator>;
633
+ update(id: string, data: UpdateCollaboratorDto, options?: RequestOptions): Promise<Collaborator>;
634
+ updateRole(id: string, roleId: string, options?: RequestOptions): Promise<Collaborator>;
635
+ updateStatus(id: string, status: 'active' | 'inactive', options?: RequestOptions): Promise<Collaborator>;
636
+ getActivity(id: string, params?: ActivityQueryParams, options?: RequestOptions): Promise<ActivityItem[]>;
637
+ getStats(id: string, params?: StatsQueryParams, options?: RequestOptions): Promise<CollaboratorStats>;
638
+ }
639
+
640
+ interface Role {
641
+ id: string;
642
+ name: string;
643
+ description: string | null;
644
+ permissions: string[];
645
+ canManageEvaluations: boolean;
646
+ organizationId: string;
647
+ createdByUserId: string | null;
648
+ updatedByUserId: string | null;
649
+ createdAt: string;
650
+ updatedAt: string;
651
+ deletedAt: string | null;
652
+ createdBy?: {
653
+ id: string;
654
+ name: string;
655
+ email: string;
656
+ };
657
+ updatedBy?: {
658
+ id: string;
659
+ name: string;
660
+ email: string;
661
+ };
662
+ }
663
+ interface PermissionsGroup {
664
+ [category: string]: string[];
665
+ }
666
+
667
+ declare class RolesResource extends BaseResource {
668
+ private basePath;
669
+ /**
670
+ * Get all roles of the organization (without pagination)
671
+ */
672
+ getRoles(options?: RequestOptions): Promise<Role[]>;
673
+ /**
674
+ * Get a specific role by ID
675
+ */
676
+ getRole(id: string, options?: RequestOptions): Promise<Role>;
677
+ /**
678
+ * Get all available permissions organized by category
679
+ */
680
+ getAvailablePermissions(options?: RequestOptions): Promise<PermissionsGroup>;
681
+ }
682
+
537
683
  interface CreateClientDto {
538
684
  name: string;
539
685
  email?: string;
@@ -1125,26 +1271,40 @@ declare class CheckInsResource extends BaseResource {
1125
1271
 
1126
1272
  interface CreateInvitationDto {
1127
1273
  email: string;
1128
- gymId: string;
1129
1274
  roleId: string;
1130
1275
  }
1131
1276
  interface AcceptInvitationDto {
1277
+ token?: string;
1278
+ code?: string;
1132
1279
  name: string;
1133
1280
  phone: string;
1134
1281
  password: string;
1135
1282
  }
1283
+ interface ValidateByCodeDto {
1284
+ code: string;
1285
+ }
1136
1286
  interface Invitation {
1137
1287
  id: string;
1138
1288
  email: string;
1139
1289
  gymId: string;
1140
1290
  roleId: string;
1141
1291
  token: string;
1142
- status: 'pending' | 'accepted' | 'cancelled' | 'expired';
1143
- invitedById: string;
1292
+ code: string;
1293
+ status: InvitationStatus;
1294
+ invitedByUserId: string;
1144
1295
  acceptedAt?: string;
1145
1296
  expiresAt: string;
1146
1297
  createdAt: string;
1147
1298
  updatedAt: string;
1299
+ role?: {
1300
+ id: string;
1301
+ name: string;
1302
+ };
1303
+ invitedBy?: {
1304
+ id: string;
1305
+ name: string | null;
1306
+ email: string;
1307
+ };
1148
1308
  }
1149
1309
  interface GetGymInvitationsParams {
1150
1310
  gymId: string;
@@ -1154,7 +1314,13 @@ declare class InvitationsResource extends BaseResource {
1154
1314
  private basePath;
1155
1315
  createInvitation(data: CreateInvitationDto, options?: RequestOptions): Promise<Invitation>;
1156
1316
  getGymInvitations(params: GetGymInvitationsParams, options?: RequestOptions): Promise<Invitation[]>;
1157
- acceptInvitation(token: string, data: AcceptInvitationDto, options?: RequestOptions): Promise<void>;
1317
+ validateByCode(data: ValidateByCodeDto, options?: RequestOptions): Promise<{
1318
+ email: string;
1319
+ gymName: string;
1320
+ roleName: string;
1321
+ token: string;
1322
+ }>;
1323
+ acceptInvitation(data: AcceptInvitationDto, options?: RequestOptions): Promise<void>;
1158
1324
  cancelInvitation(id: string, options?: RequestOptions): Promise<void>;
1159
1325
  }
1160
1326
 
@@ -2221,6 +2387,8 @@ declare class GymSpaceSdk {
2221
2387
  auth: AuthResource;
2222
2388
  organizations: OrganizationsResource;
2223
2389
  gyms: GymsResource;
2390
+ collaborators: CollaboratorsResource;
2391
+ roles: RolesResource;
2224
2392
  clients: ClientsResource;
2225
2393
  membershipPlans: MembershipPlansResource;
2226
2394
  contracts: ContractsResource;
@@ -2296,4 +2464,4 @@ declare class NetworkError extends GymSpaceError {
2296
2464
  constructor(message?: string);
2297
2465
  }
2298
2466
 
2299
- export { type AcceptInvitationDto, type ActivateRenewalDto, AdminSubscriptionManagementResource, type AdminSubscriptionStatusDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, type CancelSubscriptionDto, type CatalogGym, type ChangePasswordDto, type ChangePasswordResponseDto, type CheckIn, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientSearchForCheckInResponse, type ClientStat, type ClientStats, ClientsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type Contract, ContractsResource, type ContractsRevenue, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateEvaluationDto, type CreateGymDto, type CreateInvitationDto, type CreateLeadDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSubscriptionPlanDto, type CreateSupplierDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type Evaluation, type EvaluationHealthMetrics, type EvaluationMeasurements, type EvaluationPerformanceMetrics, type EvaluationReport, type EvaluationSystemFeatures, EvaluationsResource, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, type GetClientEvaluationsParams, type GetContractsParams, type GetFeaturedGymsParams, type GetGymInvitationsParams, type GetMembershipPlansParams, type Gym, type GymAmenities, type GymSchedule, type GymSettings, type GymSocialMedia, type GymSpaceConfig, GymSpaceError, GymSpaceSdk, type GymStats, GymsResource, HealthResource, type HealthResponse, type Invitation, type InvitationValidationResponse, InvitationsResource, type Lead, type LeadManagementFeatures, type LeadStats, LeadsResource, type LoginDto, type LoginResponseDto, type MembershipManagementFeatures, type MembershipPlan, type MembershipPlanStats, MembershipPlansResource, NetworkError, type NewClients, NotFoundError, type NotificationSettings, OnboardingResource, type OnboardingResponse, type OnboardingStatus, OnboardingStep, type Organization, type OrganizationAdminDetails, type OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaySaleDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, type PriceDto, type PricingDto, type Product, type ProductCategory, ProductsResource, PublicCatalogResource, type ReadyResponse, type RegisterCollaboratorDto, type RegisterOwnerDto, type RenewContractDto, type RequestOptions, type RequestPasswordResetDto, type RequestPasswordResetResponseDto, type ResendResetCodeDto, type ResendResetCodeResponseDto, type ResendVerificationDto, type ResetPasswordDto, type ResetPasswordResponseDto, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchLeadsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SocialMedia, type StartOnboardingData, type StartOnboardingResponse, type StockMovement, type Subscription, type SubscriptionHistoryDto, type SubscriptionPlan, type SubscriptionPlanDto, SubscriptionPlansResource, type SubscriptionStatusDto, SubscriptionsResource, type Supplier, SuppliersResource, type SuppliersStats, type TimeSlot, type TopSellingProduct, type UpdateClientDto, type UpdateEvaluationDto, type UpdateGymDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateLeadDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateSaleDto, type UpdateStockDto, type UpdateSubscriptionPlanDto, type UpdateSupplierDto, type UpgradeSubscriptionDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
2467
+ export { type AcceptInvitationDto, type ActivateRenewalDto, type ActivityItem, type ActivityQueryParams, AdminSubscriptionManagementResource, type AdminSubscriptionStatusDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, type CancelSubscriptionDto, type CatalogGym, type ChangePasswordDto, type ChangePasswordResponseDto, type CheckIn, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientSearchForCheckInResponse, type ClientStat, type ClientStats, ClientsResource, type Collaborator, type CollaboratorRoleDto, type CollaboratorStats, CollaboratorsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type Contract, ContractsResource, type ContractsRevenue, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateEvaluationDto, type CreateGymDto, type CreateInvitationDto, type CreateLeadDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSubscriptionPlanDto, type CreateSupplierDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type Evaluation, type EvaluationHealthMetrics, type EvaluationMeasurements, type EvaluationPerformanceMetrics, type EvaluationReport, type EvaluationSystemFeatures, EvaluationsResource, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, type GetClientEvaluationsParams, type GetContractsParams, type GetFeaturedGymsParams, type GetGymInvitationsParams, type GetMembershipPlansParams, type Gym, type GymAmenities, type GymSchedule, type GymSettings, type GymSocialMedia, type GymSpaceConfig, GymSpaceError, GymSpaceSdk, type GymStats, GymsResource, HealthResource, type HealthResponse, type Invitation, type InvitationValidationResponse, InvitationsResource, type Lead, type LeadManagementFeatures, type LeadStats, LeadsResource, type ListCollaboratorsParams, type LoginDto, type LoginResponseDto, type MembershipManagementFeatures, type MembershipPlan, type MembershipPlanStats, MembershipPlansResource, NetworkError, type NewClients, NotFoundError, type NotificationSettings, OnboardingResource, type OnboardingResponse, type OnboardingStatus, OnboardingStep, type Organization, type OrganizationAdminDetails, type OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaySaleDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, type PermissionsGroup, type PriceDto, type PricingDto, type Product, type ProductCategory, ProductsResource, PublicCatalogResource, type ReadyResponse, type RegisterCollaboratorDto, type RegisterOwnerDto, type RenewContractDto, type RequestOptions, type RequestPasswordResetDto, type RequestPasswordResetResponseDto, type ResendResetCodeDto, type ResendResetCodeResponseDto, type ResendVerificationDto, type ResetPasswordDto, type ResetPasswordResponseDto, type Role, RolesResource, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchLeadsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SocialMedia, type StartOnboardingData, type StartOnboardingResponse, type StatsQueryParams, type StockMovement, type Subscription, type SubscriptionHistoryDto, type SubscriptionPlan, type SubscriptionPlanDto, SubscriptionPlansResource, type SubscriptionStatusDto, SubscriptionsResource, type Supplier, SuppliersResource, type SuppliersStats, type TimeSlot, type TopSellingProduct, type UpdateClientDto, type UpdateCollaboratorDto, type UpdateEvaluationDto, type UpdateGymDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateLeadDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateRoleDto, type UpdateSaleDto, type UpdateStatusDto, type UpdateStockDto, type UpdateSubscriptionPlanDto, type UpdateSupplierDto, type UpgradeSubscriptionDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, type ValidateByCodeDto, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
package/dist/index.js CHANGED
@@ -371,6 +371,61 @@ var GymsResource = class extends BaseResource {
371
371
  }
372
372
  };
373
373
 
374
+ // src/resources/collaborators.ts
375
+ var CollaboratorsResource = class extends BaseResource {
376
+ constructor() {
377
+ super(...arguments);
378
+ this.basePath = "collaborators";
379
+ }
380
+ async list(params, options) {
381
+ return this.paginate(this.basePath, params, options);
382
+ }
383
+ async get(id, options) {
384
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
385
+ }
386
+ async update(id, data, options) {
387
+ return this.client.patch(`${this.basePath}/${id}`, data, options);
388
+ }
389
+ async updateRole(id, roleId, options) {
390
+ return this.client.patch(`${this.basePath}/${id}/role`, { roleId }, options);
391
+ }
392
+ async updateStatus(id, status, options) {
393
+ return this.client.patch(`${this.basePath}/${id}/status`, { status }, options);
394
+ }
395
+ async getActivity(id, params, options) {
396
+ return this.client.get(`${this.basePath}/${id}/activity`, params, options);
397
+ }
398
+ async getStats(id, params, options) {
399
+ return this.client.get(`${this.basePath}/${id}/stats`, params, options);
400
+ }
401
+ };
402
+
403
+ // src/resources/roles.ts
404
+ var RolesResource = class extends BaseResource {
405
+ constructor() {
406
+ super(...arguments);
407
+ this.basePath = "roles";
408
+ }
409
+ /**
410
+ * Get all roles of the organization (without pagination)
411
+ */
412
+ async getRoles(options) {
413
+ return this.client.get(this.basePath, void 0, options);
414
+ }
415
+ /**
416
+ * Get a specific role by ID
417
+ */
418
+ async getRole(id, options) {
419
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
420
+ }
421
+ /**
422
+ * Get all available permissions organized by category
423
+ */
424
+ async getAvailablePermissions(options) {
425
+ return this.client.get(`${this.basePath}/permissions`, void 0, options);
426
+ }
427
+ };
428
+
374
429
  // src/resources/clients.ts
375
430
  var ClientsResource = class extends BaseResource {
376
431
  constructor() {
@@ -625,8 +680,11 @@ var InvitationsResource = class extends BaseResource {
625
680
  async getGymInvitations(params, options) {
626
681
  return this.client.get(this.basePath, params, options);
627
682
  }
628
- async acceptInvitation(token, data, options) {
629
- return this.client.post(`${this.basePath}/${token}/accept`, data, options);
683
+ async validateByCode(data, options) {
684
+ return this.client.post(`${this.basePath}/validate-by-code`, data, options);
685
+ }
686
+ async acceptInvitation(data, options) {
687
+ return this.client.post(`${this.basePath}/accept`, data, options);
630
688
  }
631
689
  async cancelInvitation(id, options) {
632
690
  return this.client.put(`${this.basePath}/${id}/cancel`, void 0, options);
@@ -1227,6 +1285,8 @@ var GymSpaceSdk = class {
1227
1285
  this.auth = new AuthResource(this.client);
1228
1286
  this.organizations = new OrganizationsResource(this.client);
1229
1287
  this.gyms = new GymsResource(this.client);
1288
+ this.collaborators = new CollaboratorsResource(this.client);
1289
+ this.roles = new RolesResource(this.client);
1230
1290
  this.clients = new ClientsResource(this.client);
1231
1291
  this.membershipPlans = new MembershipPlansResource(this.client);
1232
1292
  this.contracts = new ContractsResource(this.client);
@@ -1601,6 +1661,7 @@ exports.CheckInsResource = CheckInsResource;
1601
1661
  exports.ClientStatus = ClientStatus;
1602
1662
  exports.ClientsResource = ClientsResource;
1603
1663
  exports.CollaboratorStatus = CollaboratorStatus;
1664
+ exports.CollaboratorsResource = CollaboratorsResource;
1604
1665
  exports.CommentType = CommentType;
1605
1666
  exports.ContractAssetType = ContractAssetType;
1606
1667
  exports.ContractStatus = ContractStatus;
@@ -1637,6 +1698,7 @@ exports.PlanStatus = PlanStatus;
1637
1698
  exports.ProductsResource = ProductsResource;
1638
1699
  exports.PublicCatalogResource = PublicCatalogResource;
1639
1700
  exports.ROLE_PERMISSIONS = ROLE_PERMISSIONS;
1701
+ exports.RolesResource = RolesResource;
1640
1702
  exports.SalesResource = SalesResource;
1641
1703
  exports.SubscriptionPlansResource = SubscriptionPlansResource;
1642
1704
  exports.SubscriptionStatus = SubscriptionStatus;