@gymspace/sdk 1.1.2 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -343,8 +343,53 @@ interface OrganizationWithDetails {
343
343
  name: string;
344
344
  address: string;
345
345
  }>;
346
+ subscription?: {
347
+ planName: string;
348
+ status: string;
349
+ startDate: Date;
350
+ endDate: Date;
351
+ isExpired: boolean;
352
+ };
346
353
  createdAt: Date;
347
354
  }
355
+ interface OrganizationAdminDetails {
356
+ id: string;
357
+ name: string;
358
+ country?: string;
359
+ currency?: string;
360
+ timezone?: string;
361
+ settings?: Record<string, any>;
362
+ owner: {
363
+ id: string;
364
+ email: string;
365
+ fullName: string;
366
+ };
367
+ gyms: Array<{
368
+ id: string;
369
+ name: string;
370
+ address: string;
371
+ }>;
372
+ subscription?: {
373
+ id: string;
374
+ planName: string;
375
+ status: string;
376
+ startDate: Date;
377
+ endDate: Date;
378
+ isActive: boolean;
379
+ isExpired: boolean;
380
+ daysRemaining: number;
381
+ metadata?: Record<string, any>;
382
+ };
383
+ stats: {
384
+ totalGyms: number;
385
+ totalClients: number;
386
+ totalContracts: number;
387
+ activeContracts: number;
388
+ totalRevenue: number;
389
+ };
390
+ createdAt: Date;
391
+ updatedAt: Date;
392
+ }
348
393
 
349
394
  declare class OrganizationsResource extends BaseResource {
350
395
  private basePath;
@@ -352,6 +397,7 @@ declare class OrganizationsResource extends BaseResource {
352
397
  updateOrganization(id: string, data: UpdateOrganizationDto, options?: RequestOptions): Promise<Organization>;
353
398
  getOrganizationStats(id: string, options?: RequestOptions): Promise<OrganizationStats>;
354
399
  listOrganizations(options?: RequestOptions): Promise<OrganizationWithDetails[]>;
400
+ getOrganizationForAdmin(id: string, options?: RequestOptions): Promise<OrganizationAdminDetails>;
355
401
  }
356
402
 
357
403
  interface CreateGymDto {
@@ -1964,6 +2010,165 @@ declare class SubscriptionsResource extends BaseResource {
1964
2010
  checkSubscriptionLimit(organizationId: string, limitType: 'gyms' | 'clients' | 'users', options?: RequestOptions): Promise<CheckLimitResponse>;
1965
2011
  }
1966
2012
 
2013
+ interface SubscriptionPlanDto {
2014
+ id: string;
2015
+ name: string;
2016
+ price: {
2017
+ PEN?: {
2018
+ currency: 'PEN';
2019
+ value: number;
2020
+ };
2021
+ USD?: {
2022
+ currency: 'USD';
2023
+ value: number;
2024
+ };
2025
+ COP?: {
2026
+ currency: 'COP';
2027
+ value: number;
2028
+ };
2029
+ MXN?: {
2030
+ currency: 'MXN';
2031
+ value: number;
2032
+ };
2033
+ };
2034
+ billingFrequency: string;
2035
+ duration?: number;
2036
+ durationPeriod?: string;
2037
+ maxGyms: number;
2038
+ maxClientsPerGym: number;
2039
+ maxUsersPerGym: number;
2040
+ features: Record<string, any>;
2041
+ description?: string;
2042
+ isActive: boolean;
2043
+ createdAt: Date;
2044
+ updatedAt: Date;
2045
+ activeSubscriptions?: number;
2046
+ totalOrganizations?: number;
2047
+ }
2048
+ interface PriceDto {
2049
+ currency: string;
2050
+ value: number;
2051
+ }
2052
+ interface PricingDto {
2053
+ PEN: PriceDto;
2054
+ }
2055
+ interface CreateSubscriptionPlanDto {
2056
+ name: string;
2057
+ price: PricingDto;
2058
+ billingFrequency: string;
2059
+ duration?: number;
2060
+ durationPeriod?: 'DAY' | 'MONTH';
2061
+ maxGyms: number;
2062
+ maxClientsPerGym: number;
2063
+ maxUsersPerGym: number;
2064
+ features: Record<string, any>;
2065
+ description?: string;
2066
+ isActive?: boolean;
2067
+ }
2068
+ interface UpdateSubscriptionPlanDto {
2069
+ name?: string;
2070
+ price?: PricingDto;
2071
+ billingFrequency?: string;
2072
+ duration?: number;
2073
+ durationPeriod?: 'DAY' | 'MONTH';
2074
+ maxGyms?: number;
2075
+ maxClientsPerGym?: number;
2076
+ maxUsersPerGym?: number;
2077
+ features?: Record<string, any>;
2078
+ description?: string;
2079
+ isActive?: boolean;
2080
+ }
2081
+ declare class SubscriptionPlansResource extends BaseResource {
2082
+ private basePath;
2083
+ /**
2084
+ * List all subscription plans (Super Admin only)
2085
+ */
2086
+ listPlans(options?: RequestOptions): Promise<SubscriptionPlanDto[]>;
2087
+ /**
2088
+ * Create new subscription plan (Super Admin only)
2089
+ */
2090
+ createPlan(data: CreateSubscriptionPlanDto, options?: RequestOptions): Promise<SubscriptionPlanDto>;
2091
+ /**
2092
+ * Get subscription plan details (Super Admin only)
2093
+ */
2094
+ getPlan(id: string, options?: RequestOptions): Promise<SubscriptionPlanDto>;
2095
+ /**
2096
+ * Update subscription plan (Super Admin only)
2097
+ */
2098
+ updatePlan(id: string, data: UpdateSubscriptionPlanDto, options?: RequestOptions): Promise<SubscriptionPlanDto>;
2099
+ /**
2100
+ * Soft delete subscription plan (Super Admin only)
2101
+ */
2102
+ deletePlan(id: string, options?: RequestOptions): Promise<{
2103
+ success: boolean;
2104
+ }>;
2105
+ }
2106
+
2107
+ interface AdminSubscriptionStatusDto {
2108
+ id: string;
2109
+ organizationId: string;
2110
+ subscriptionPlanId: string;
2111
+ planName: string;
2112
+ status: string;
2113
+ startDate: Date;
2114
+ endDate: Date;
2115
+ isActive: boolean;
2116
+ isExpired: boolean;
2117
+ daysRemaining: number;
2118
+ metadata?: Record<string, any>;
2119
+ createdAt: Date;
2120
+ updatedAt: Date;
2121
+ }
2122
+ interface ActivateRenewalDto {
2123
+ subscriptionPlanId?: string;
2124
+ durationMonths?: number;
2125
+ notes?: string;
2126
+ }
2127
+ interface CancelSubscriptionDto {
2128
+ reason: string;
2129
+ immediateTermination?: boolean;
2130
+ notes?: string;
2131
+ }
2132
+ interface UpgradeSubscriptionDto {
2133
+ newSubscriptionPlanId: string;
2134
+ immediateUpgrade?: boolean;
2135
+ notes?: string;
2136
+ }
2137
+ interface SubscriptionHistoryDto {
2138
+ id: string;
2139
+ planName: string;
2140
+ status: string;
2141
+ startDate: Date;
2142
+ endDate: Date;
2143
+ isActive: boolean;
2144
+ metadata?: Record<string, any>;
2145
+ createdBy: {
2146
+ id: string;
2147
+ name: string;
2148
+ email: string;
2149
+ };
2150
+ createdAt: Date;
2151
+ }
2152
+ declare class AdminSubscriptionManagementResource extends BaseResource {
2153
+ private basePath;
2154
+ /**
2155
+ * Activate subscription renewal for an organization (Super Admin only)
2156
+ */
2157
+ activateRenewal(organizationId: string, data: ActivateRenewalDto, options?: RequestOptions): Promise<AdminSubscriptionStatusDto>;
2158
+ /**
2159
+ * Cancel subscription for an organization (Super Admin only)
2160
+ */
2161
+ cancelSubscription(organizationId: string, data: CancelSubscriptionDto, options?: RequestOptions): Promise<AdminSubscriptionStatusDto>;
2162
+ /**
2163
+ * Upgrade subscription plan for an organization (Super Admin only)
2164
+ */
2165
+ upgradeSubscription(organizationId: string, data: UpgradeSubscriptionDto, options?: RequestOptions): Promise<AdminSubscriptionStatusDto>;
2166
+ /**
2167
+ * Get subscription history for an organization (Super Admin only)
2168
+ */
2169
+ getSubscriptionHistory(organizationId: string, options?: RequestOptions): Promise<SubscriptionHistoryDto[]>;
2170
+ }
2171
+
1967
2172
  interface CreatePaymentMethodDto {
1968
2173
  name: string;
1969
2174
  description?: string;
@@ -2034,6 +2239,8 @@ declare class GymSpaceSdk {
2034
2239
  suppliers: SuppliersResource;
2035
2240
  users: UsersResource;
2036
2241
  subscriptions: SubscriptionsResource;
2242
+ subscriptionPlans: SubscriptionPlansResource;
2243
+ adminSubscriptionManagement: AdminSubscriptionManagementResource;
2037
2244
  paymentMethods: PaymentMethodsResource;
2038
2245
  constructor(config: GymSpaceConfig);
2039
2246
  /**
@@ -2089,4 +2296,4 @@ declare class NetworkError extends GymSpaceError {
2089
2296
  constructor(message?: string);
2090
2297
  }
2091
2298
 
2092
- export { type AcceptInvitationDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, 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 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 OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaySaleDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, 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 SubscriptionPlan, 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 UpdateSupplierDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
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 };
package/dist/index.d.ts CHANGED
@@ -343,8 +343,53 @@ interface OrganizationWithDetails {
343
343
  name: string;
344
344
  address: string;
345
345
  }>;
346
+ subscription?: {
347
+ planName: string;
348
+ status: string;
349
+ startDate: Date;
350
+ endDate: Date;
351
+ isExpired: boolean;
352
+ };
346
353
  createdAt: Date;
347
354
  }
355
+ interface OrganizationAdminDetails {
356
+ id: string;
357
+ name: string;
358
+ country?: string;
359
+ currency?: string;
360
+ timezone?: string;
361
+ settings?: Record<string, any>;
362
+ owner: {
363
+ id: string;
364
+ email: string;
365
+ fullName: string;
366
+ };
367
+ gyms: Array<{
368
+ id: string;
369
+ name: string;
370
+ address: string;
371
+ }>;
372
+ subscription?: {
373
+ id: string;
374
+ planName: string;
375
+ status: string;
376
+ startDate: Date;
377
+ endDate: Date;
378
+ isActive: boolean;
379
+ isExpired: boolean;
380
+ daysRemaining: number;
381
+ metadata?: Record<string, any>;
382
+ };
383
+ stats: {
384
+ totalGyms: number;
385
+ totalClients: number;
386
+ totalContracts: number;
387
+ activeContracts: number;
388
+ totalRevenue: number;
389
+ };
390
+ createdAt: Date;
391
+ updatedAt: Date;
392
+ }
348
393
 
349
394
  declare class OrganizationsResource extends BaseResource {
350
395
  private basePath;
@@ -352,6 +397,7 @@ declare class OrganizationsResource extends BaseResource {
352
397
  updateOrganization(id: string, data: UpdateOrganizationDto, options?: RequestOptions): Promise<Organization>;
353
398
  getOrganizationStats(id: string, options?: RequestOptions): Promise<OrganizationStats>;
354
399
  listOrganizations(options?: RequestOptions): Promise<OrganizationWithDetails[]>;
400
+ getOrganizationForAdmin(id: string, options?: RequestOptions): Promise<OrganizationAdminDetails>;
355
401
  }
356
402
 
357
403
  interface CreateGymDto {
@@ -1964,6 +2010,165 @@ declare class SubscriptionsResource extends BaseResource {
1964
2010
  checkSubscriptionLimit(organizationId: string, limitType: 'gyms' | 'clients' | 'users', options?: RequestOptions): Promise<CheckLimitResponse>;
1965
2011
  }
1966
2012
 
2013
+ interface SubscriptionPlanDto {
2014
+ id: string;
2015
+ name: string;
2016
+ price: {
2017
+ PEN?: {
2018
+ currency: 'PEN';
2019
+ value: number;
2020
+ };
2021
+ USD?: {
2022
+ currency: 'USD';
2023
+ value: number;
2024
+ };
2025
+ COP?: {
2026
+ currency: 'COP';
2027
+ value: number;
2028
+ };
2029
+ MXN?: {
2030
+ currency: 'MXN';
2031
+ value: number;
2032
+ };
2033
+ };
2034
+ billingFrequency: string;
2035
+ duration?: number;
2036
+ durationPeriod?: string;
2037
+ maxGyms: number;
2038
+ maxClientsPerGym: number;
2039
+ maxUsersPerGym: number;
2040
+ features: Record<string, any>;
2041
+ description?: string;
2042
+ isActive: boolean;
2043
+ createdAt: Date;
2044
+ updatedAt: Date;
2045
+ activeSubscriptions?: number;
2046
+ totalOrganizations?: number;
2047
+ }
2048
+ interface PriceDto {
2049
+ currency: string;
2050
+ value: number;
2051
+ }
2052
+ interface PricingDto {
2053
+ PEN: PriceDto;
2054
+ }
2055
+ interface CreateSubscriptionPlanDto {
2056
+ name: string;
2057
+ price: PricingDto;
2058
+ billingFrequency: string;
2059
+ duration?: number;
2060
+ durationPeriod?: 'DAY' | 'MONTH';
2061
+ maxGyms: number;
2062
+ maxClientsPerGym: number;
2063
+ maxUsersPerGym: number;
2064
+ features: Record<string, any>;
2065
+ description?: string;
2066
+ isActive?: boolean;
2067
+ }
2068
+ interface UpdateSubscriptionPlanDto {
2069
+ name?: string;
2070
+ price?: PricingDto;
2071
+ billingFrequency?: string;
2072
+ duration?: number;
2073
+ durationPeriod?: 'DAY' | 'MONTH';
2074
+ maxGyms?: number;
2075
+ maxClientsPerGym?: number;
2076
+ maxUsersPerGym?: number;
2077
+ features?: Record<string, any>;
2078
+ description?: string;
2079
+ isActive?: boolean;
2080
+ }
2081
+ declare class SubscriptionPlansResource extends BaseResource {
2082
+ private basePath;
2083
+ /**
2084
+ * List all subscription plans (Super Admin only)
2085
+ */
2086
+ listPlans(options?: RequestOptions): Promise<SubscriptionPlanDto[]>;
2087
+ /**
2088
+ * Create new subscription plan (Super Admin only)
2089
+ */
2090
+ createPlan(data: CreateSubscriptionPlanDto, options?: RequestOptions): Promise<SubscriptionPlanDto>;
2091
+ /**
2092
+ * Get subscription plan details (Super Admin only)
2093
+ */
2094
+ getPlan(id: string, options?: RequestOptions): Promise<SubscriptionPlanDto>;
2095
+ /**
2096
+ * Update subscription plan (Super Admin only)
2097
+ */
2098
+ updatePlan(id: string, data: UpdateSubscriptionPlanDto, options?: RequestOptions): Promise<SubscriptionPlanDto>;
2099
+ /**
2100
+ * Soft delete subscription plan (Super Admin only)
2101
+ */
2102
+ deletePlan(id: string, options?: RequestOptions): Promise<{
2103
+ success: boolean;
2104
+ }>;
2105
+ }
2106
+
2107
+ interface AdminSubscriptionStatusDto {
2108
+ id: string;
2109
+ organizationId: string;
2110
+ subscriptionPlanId: string;
2111
+ planName: string;
2112
+ status: string;
2113
+ startDate: Date;
2114
+ endDate: Date;
2115
+ isActive: boolean;
2116
+ isExpired: boolean;
2117
+ daysRemaining: number;
2118
+ metadata?: Record<string, any>;
2119
+ createdAt: Date;
2120
+ updatedAt: Date;
2121
+ }
2122
+ interface ActivateRenewalDto {
2123
+ subscriptionPlanId?: string;
2124
+ durationMonths?: number;
2125
+ notes?: string;
2126
+ }
2127
+ interface CancelSubscriptionDto {
2128
+ reason: string;
2129
+ immediateTermination?: boolean;
2130
+ notes?: string;
2131
+ }
2132
+ interface UpgradeSubscriptionDto {
2133
+ newSubscriptionPlanId: string;
2134
+ immediateUpgrade?: boolean;
2135
+ notes?: string;
2136
+ }
2137
+ interface SubscriptionHistoryDto {
2138
+ id: string;
2139
+ planName: string;
2140
+ status: string;
2141
+ startDate: Date;
2142
+ endDate: Date;
2143
+ isActive: boolean;
2144
+ metadata?: Record<string, any>;
2145
+ createdBy: {
2146
+ id: string;
2147
+ name: string;
2148
+ email: string;
2149
+ };
2150
+ createdAt: Date;
2151
+ }
2152
+ declare class AdminSubscriptionManagementResource extends BaseResource {
2153
+ private basePath;
2154
+ /**
2155
+ * Activate subscription renewal for an organization (Super Admin only)
2156
+ */
2157
+ activateRenewal(organizationId: string, data: ActivateRenewalDto, options?: RequestOptions): Promise<AdminSubscriptionStatusDto>;
2158
+ /**
2159
+ * Cancel subscription for an organization (Super Admin only)
2160
+ */
2161
+ cancelSubscription(organizationId: string, data: CancelSubscriptionDto, options?: RequestOptions): Promise<AdminSubscriptionStatusDto>;
2162
+ /**
2163
+ * Upgrade subscription plan for an organization (Super Admin only)
2164
+ */
2165
+ upgradeSubscription(organizationId: string, data: UpgradeSubscriptionDto, options?: RequestOptions): Promise<AdminSubscriptionStatusDto>;
2166
+ /**
2167
+ * Get subscription history for an organization (Super Admin only)
2168
+ */
2169
+ getSubscriptionHistory(organizationId: string, options?: RequestOptions): Promise<SubscriptionHistoryDto[]>;
2170
+ }
2171
+
1967
2172
  interface CreatePaymentMethodDto {
1968
2173
  name: string;
1969
2174
  description?: string;
@@ -2034,6 +2239,8 @@ declare class GymSpaceSdk {
2034
2239
  suppliers: SuppliersResource;
2035
2240
  users: UsersResource;
2036
2241
  subscriptions: SubscriptionsResource;
2242
+ subscriptionPlans: SubscriptionPlansResource;
2243
+ adminSubscriptionManagement: AdminSubscriptionManagementResource;
2037
2244
  paymentMethods: PaymentMethodsResource;
2038
2245
  constructor(config: GymSpaceConfig);
2039
2246
  /**
@@ -2089,4 +2296,4 @@ declare class NetworkError extends GymSpaceError {
2089
2296
  constructor(message?: string);
2090
2297
  }
2091
2298
 
2092
- export { type AcceptInvitationDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, 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 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 OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaySaleDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, 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 SubscriptionPlan, 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 UpdateSupplierDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
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 };
package/dist/index.js CHANGED
@@ -323,6 +323,9 @@ var OrganizationsResource = class extends BaseResource {
323
323
  async listOrganizations(options) {
324
324
  return this.client.get(`${this.basePath}/list`, void 0, options);
325
325
  }
326
+ async getOrganizationForAdmin(id, options) {
327
+ return this.client.get(`${this.basePath}/admin/${id}`, void 0, options);
328
+ }
326
329
  };
327
330
 
328
331
  // src/resources/gyms.ts
@@ -1102,6 +1105,92 @@ var SubscriptionsResource = class extends BaseResource {
1102
1105
  }
1103
1106
  };
1104
1107
 
1108
+ // src/resources/subscription-plans.ts
1109
+ var SubscriptionPlansResource = class extends BaseResource {
1110
+ constructor() {
1111
+ super(...arguments);
1112
+ this.basePath = "admin/subscription-plans";
1113
+ }
1114
+ /**
1115
+ * List all subscription plans (Super Admin only)
1116
+ */
1117
+ async listPlans(options) {
1118
+ return this.client.get(`${this.basePath}`, void 0, options);
1119
+ }
1120
+ /**
1121
+ * Create new subscription plan (Super Admin only)
1122
+ */
1123
+ async createPlan(data, options) {
1124
+ return this.client.post(`${this.basePath}`, data, options);
1125
+ }
1126
+ /**
1127
+ * Get subscription plan details (Super Admin only)
1128
+ */
1129
+ async getPlan(id, options) {
1130
+ return this.client.get(`${this.basePath}/${id}`, void 0, options);
1131
+ }
1132
+ /**
1133
+ * Update subscription plan (Super Admin only)
1134
+ */
1135
+ async updatePlan(id, data, options) {
1136
+ return this.client.put(`${this.basePath}/${id}`, data, options);
1137
+ }
1138
+ /**
1139
+ * Soft delete subscription plan (Super Admin only)
1140
+ */
1141
+ async deletePlan(id, options) {
1142
+ return this.client.delete(`${this.basePath}/${id}`, options);
1143
+ }
1144
+ };
1145
+
1146
+ // src/resources/admin-subscription-management.ts
1147
+ var AdminSubscriptionManagementResource = class extends BaseResource {
1148
+ constructor() {
1149
+ super(...arguments);
1150
+ this.basePath = "admin/organizations";
1151
+ }
1152
+ /**
1153
+ * Activate subscription renewal for an organization (Super Admin only)
1154
+ */
1155
+ async activateRenewal(organizationId, data, options) {
1156
+ return this.client.post(
1157
+ `${this.basePath}/${organizationId}/subscriptions/activate-renewal`,
1158
+ data,
1159
+ options
1160
+ );
1161
+ }
1162
+ /**
1163
+ * Cancel subscription for an organization (Super Admin only)
1164
+ */
1165
+ async cancelSubscription(organizationId, data, options) {
1166
+ return this.client.post(
1167
+ `${this.basePath}/${organizationId}/subscriptions/cancel`,
1168
+ data,
1169
+ options
1170
+ );
1171
+ }
1172
+ /**
1173
+ * Upgrade subscription plan for an organization (Super Admin only)
1174
+ */
1175
+ async upgradeSubscription(organizationId, data, options) {
1176
+ return this.client.post(
1177
+ `${this.basePath}/${organizationId}/subscriptions/upgrade`,
1178
+ data,
1179
+ options
1180
+ );
1181
+ }
1182
+ /**
1183
+ * Get subscription history for an organization (Super Admin only)
1184
+ */
1185
+ async getSubscriptionHistory(organizationId, options) {
1186
+ return this.client.get(
1187
+ `${this.basePath}/${organizationId}/subscriptions/history`,
1188
+ void 0,
1189
+ options
1190
+ );
1191
+ }
1192
+ };
1193
+
1105
1194
  // src/resources/payment-methods.ts
1106
1195
  var PaymentMethodsResource = class extends BaseResource {
1107
1196
  constructor() {
@@ -1156,6 +1245,8 @@ var GymSpaceSdk = class {
1156
1245
  this.suppliers = new SuppliersResource(this.client);
1157
1246
  this.users = new UsersResource(this.client);
1158
1247
  this.subscriptions = new SubscriptionsResource(this.client);
1248
+ this.subscriptionPlans = new SubscriptionPlansResource(this.client);
1249
+ this.adminSubscriptionManagement = new AdminSubscriptionManagementResource(this.client);
1159
1250
  this.paymentMethods = new PaymentMethodsResource(this.client);
1160
1251
  }
1161
1252
  /**
@@ -1196,7 +1287,7 @@ var GymSpaceSdk = class {
1196
1287
  }
1197
1288
  };
1198
1289
 
1199
- // ../../node_modules/@gymspace/shared/dist/index.mjs
1290
+ // node_modules/@gymspace/shared/dist/index.mjs
1200
1291
  var UserType = /* @__PURE__ */ ((UserType2) => {
1201
1292
  UserType2["OWNER"] = "owner";
1202
1293
  UserType2["COLLABORATOR"] = "collaborator";
@@ -1497,6 +1588,7 @@ var OnboardingStep = /* @__PURE__ */ ((OnboardingStep2) => {
1497
1588
  return OnboardingStep2;
1498
1589
  })(OnboardingStep || {});
1499
1590
 
1591
+ exports.AdminSubscriptionManagementResource = AdminSubscriptionManagementResource;
1500
1592
  exports.ApiClient = ApiClient;
1501
1593
  exports.AssetCategory = AssetCategory;
1502
1594
  exports.AssetStatus = AssetStatus;
@@ -1546,6 +1638,7 @@ exports.ProductsResource = ProductsResource;
1546
1638
  exports.PublicCatalogResource = PublicCatalogResource;
1547
1639
  exports.ROLE_PERMISSIONS = ROLE_PERMISSIONS;
1548
1640
  exports.SalesResource = SalesResource;
1641
+ exports.SubscriptionPlansResource = SubscriptionPlansResource;
1549
1642
  exports.SubscriptionStatus = SubscriptionStatus;
1550
1643
  exports.SubscriptionsResource = SubscriptionsResource;
1551
1644
  exports.SuppliersResource = SuppliersResource;