@gymspace/sdk 1.2.11 → 1.2.13
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/.tsbuildinfo +1 -1
- package/dist/index.d.mts +210 -3
- package/dist/index.d.ts +210 -3
- package/dist/index.js +104 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/models/bulk-messaging.ts +119 -0
- package/src/models/clients.ts +0 -1
- package/src/models/gyms.ts +39 -1
- package/src/models/index.ts +1 -0
- package/src/models/onboarding.ts +4 -3
- package/src/models/products.ts +8 -0
- package/src/resources/bulk-messaging.ts +83 -0
- package/src/resources/gyms.ts +65 -27
- package/src/resources/index.ts +2 -1
- package/src/resources/subscription-plans.ts +9 -1
- package/src/sdk.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -459,10 +459,44 @@ interface GymAmenities {
|
|
|
459
459
|
[key: string]: any;
|
|
460
460
|
}
|
|
461
461
|
interface GymSettings {
|
|
462
|
+
inventory?: InventorySettings;
|
|
463
|
+
contracts?: ContractSettings;
|
|
462
464
|
logo?: string;
|
|
463
465
|
primaryColor?: string;
|
|
464
466
|
[key: string]: any;
|
|
465
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Inventory configuration settings
|
|
470
|
+
*/
|
|
471
|
+
interface InventorySettings {
|
|
472
|
+
defaultMinStock?: number;
|
|
473
|
+
defaultMaxStock?: number;
|
|
474
|
+
enableLowStockAlerts?: boolean;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Contract expiration configuration settings
|
|
478
|
+
*/
|
|
479
|
+
interface ContractSettings {
|
|
480
|
+
expiringSoonDays?: number;
|
|
481
|
+
gracePeriodDays?: number;
|
|
482
|
+
enableExpirationNotifications?: boolean;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Update gym inventory settings DTO
|
|
486
|
+
*/
|
|
487
|
+
interface UpdateGymInventorySettingsDto {
|
|
488
|
+
defaultMinStock?: number;
|
|
489
|
+
defaultMaxStock?: number;
|
|
490
|
+
enableLowStockAlerts?: boolean;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Update gym contract settings DTO
|
|
494
|
+
*/
|
|
495
|
+
interface UpdateGymContractSettingsDto {
|
|
496
|
+
expiringSoonDays?: number;
|
|
497
|
+
gracePeriodDays?: number;
|
|
498
|
+
enableExpirationNotifications?: boolean;
|
|
499
|
+
}
|
|
466
500
|
interface Gym {
|
|
467
501
|
id: string;
|
|
468
502
|
organizationId: string;
|
|
@@ -556,6 +590,40 @@ declare class GymsResource extends BaseResource {
|
|
|
556
590
|
}>, options?: RequestOptions): Promise<Gym>;
|
|
557
591
|
updateGymSchedule(id: string, data: UpdateGymScheduleDto, options?: RequestOptions): Promise<Gym>;
|
|
558
592
|
updateGymSocialMedia(id: string, data: UpdateGymSocialMediaDto, options?: RequestOptions): Promise<Gym>;
|
|
593
|
+
/**
|
|
594
|
+
* Update current gym inventory settings (stock configuration)
|
|
595
|
+
* Uses gym from context (x-gym-id header)
|
|
596
|
+
* @param data Inventory settings data
|
|
597
|
+
* @param options Request options
|
|
598
|
+
* @returns Updated gym with new settings
|
|
599
|
+
*
|
|
600
|
+
* @example
|
|
601
|
+
* ```typescript
|
|
602
|
+
* const gym = await sdk.gyms.updateInventorySettings({
|
|
603
|
+
* defaultMinStock: 15,
|
|
604
|
+
* defaultMaxStock: 1000,
|
|
605
|
+
* enableLowStockAlerts: true
|
|
606
|
+
* });
|
|
607
|
+
* ```
|
|
608
|
+
*/
|
|
609
|
+
updateInventorySettings(data: UpdateGymInventorySettingsDto, options?: RequestOptions): Promise<Gym>;
|
|
610
|
+
/**
|
|
611
|
+
* Update current gym contract expiration settings
|
|
612
|
+
* Uses gym from context (x-gym-id header)
|
|
613
|
+
* @param data Contract settings data
|
|
614
|
+
* @param options Request options
|
|
615
|
+
* @returns Updated gym with new settings
|
|
616
|
+
*
|
|
617
|
+
* @example
|
|
618
|
+
* ```typescript
|
|
619
|
+
* const gym = await sdk.gyms.updateContractSettings({
|
|
620
|
+
* expiringSoonDays: 7,
|
|
621
|
+
* gracePeriodDays: 0,
|
|
622
|
+
* enableExpirationNotifications: true
|
|
623
|
+
* });
|
|
624
|
+
* ```
|
|
625
|
+
*/
|
|
626
|
+
updateContractSettings(data: UpdateGymContractSettingsDto, options?: RequestOptions): Promise<Gym>;
|
|
559
627
|
}
|
|
560
628
|
|
|
561
629
|
declare class CollaboratorsResource extends BaseResource {
|
|
@@ -710,7 +778,6 @@ interface ClientStats {
|
|
|
710
778
|
}
|
|
711
779
|
interface SearchClientsParams {
|
|
712
780
|
search?: string;
|
|
713
|
-
activeOnly?: boolean;
|
|
714
781
|
clientNumber?: string;
|
|
715
782
|
documentId?: string;
|
|
716
783
|
includeContractStatus?: boolean;
|
|
@@ -1326,7 +1393,6 @@ interface StartOnboardingData {
|
|
|
1326
1393
|
timezone: string;
|
|
1327
1394
|
}
|
|
1328
1395
|
interface StartOnboardingResponse {
|
|
1329
|
-
success: boolean;
|
|
1330
1396
|
access_token: string;
|
|
1331
1397
|
refresh_token: string;
|
|
1332
1398
|
user: {
|
|
@@ -1335,6 +1401,8 @@ interface StartOnboardingResponse {
|
|
|
1335
1401
|
name: string;
|
|
1336
1402
|
userType: string;
|
|
1337
1403
|
};
|
|
1404
|
+
lastActiveGymId: string;
|
|
1405
|
+
lastActiveOrganizationId: string;
|
|
1338
1406
|
organization: {
|
|
1339
1407
|
id: string;
|
|
1340
1408
|
name: string;
|
|
@@ -1561,6 +1629,14 @@ interface Product {
|
|
|
1561
1629
|
createdAt: string;
|
|
1562
1630
|
updatedAt: string;
|
|
1563
1631
|
category?: ProductCategory;
|
|
1632
|
+
image?: {
|
|
1633
|
+
id: string;
|
|
1634
|
+
filename: string;
|
|
1635
|
+
originalName: string;
|
|
1636
|
+
fileSize: number;
|
|
1637
|
+
mimeType: string;
|
|
1638
|
+
previewUrl?: string;
|
|
1639
|
+
};
|
|
1564
1640
|
createdBy?: {
|
|
1565
1641
|
id: string;
|
|
1566
1642
|
name: string;
|
|
@@ -1976,6 +2052,11 @@ interface UpdateSubscriptionPlanDto {
|
|
|
1976
2052
|
}
|
|
1977
2053
|
declare class SubscriptionPlansResource extends BaseResource {
|
|
1978
2054
|
private basePath;
|
|
2055
|
+
private publicBasePath;
|
|
2056
|
+
/**
|
|
2057
|
+
* List all active subscription plans (Public - no authentication required)
|
|
2058
|
+
*/
|
|
2059
|
+
listPublicPlans(options?: RequestOptions): Promise<SubscriptionPlanDto[]>;
|
|
1979
2060
|
/**
|
|
1980
2061
|
* List all subscription plans (Super Admin only)
|
|
1981
2062
|
*/
|
|
@@ -2316,6 +2397,131 @@ declare class WhatsAppTemplatesResource extends BaseResource {
|
|
|
2316
2397
|
preview(id: string, variables: Record<string, any>, options?: RequestOptions): Promise<PreviewTemplateResponse>;
|
|
2317
2398
|
}
|
|
2318
2399
|
|
|
2400
|
+
interface BulkTemplate {
|
|
2401
|
+
id: string;
|
|
2402
|
+
gymId: string;
|
|
2403
|
+
name: string;
|
|
2404
|
+
message: string;
|
|
2405
|
+
description?: string;
|
|
2406
|
+
tags: string[];
|
|
2407
|
+
isActive: boolean;
|
|
2408
|
+
usageCount: number;
|
|
2409
|
+
lastUsedAt?: Date;
|
|
2410
|
+
createdByUserId: string;
|
|
2411
|
+
createdAt: Date;
|
|
2412
|
+
updatedAt: Date;
|
|
2413
|
+
}
|
|
2414
|
+
interface CreateBulkTemplateDto {
|
|
2415
|
+
name: string;
|
|
2416
|
+
message: string;
|
|
2417
|
+
description?: string;
|
|
2418
|
+
tags?: string[];
|
|
2419
|
+
isActive?: boolean;
|
|
2420
|
+
}
|
|
2421
|
+
interface UpdateBulkTemplateDto {
|
|
2422
|
+
name?: string;
|
|
2423
|
+
message?: string;
|
|
2424
|
+
description?: string;
|
|
2425
|
+
tags?: string[];
|
|
2426
|
+
isActive?: boolean;
|
|
2427
|
+
}
|
|
2428
|
+
interface BulkMessageVariable {
|
|
2429
|
+
name: string;
|
|
2430
|
+
placeholder: string;
|
|
2431
|
+
description: string;
|
|
2432
|
+
example: string;
|
|
2433
|
+
category: 'client' | 'gym' | 'membership' | 'datetime' | 'custom';
|
|
2434
|
+
required: boolean;
|
|
2435
|
+
formatter?: 'text' | 'currency' | 'date' | 'number';
|
|
2436
|
+
}
|
|
2437
|
+
interface SendBulkMessagesDto {
|
|
2438
|
+
templateId?: string;
|
|
2439
|
+
message: string;
|
|
2440
|
+
clientIds: string[];
|
|
2441
|
+
}
|
|
2442
|
+
interface RejectedClientDto {
|
|
2443
|
+
clientId: string;
|
|
2444
|
+
reason: string;
|
|
2445
|
+
}
|
|
2446
|
+
interface BulkMessageResultDto {
|
|
2447
|
+
sendId: string;
|
|
2448
|
+
totalRecipients: number;
|
|
2449
|
+
accepted: number;
|
|
2450
|
+
rejected: number;
|
|
2451
|
+
rejectedReasons: RejectedClientDto[];
|
|
2452
|
+
estimatedTime: number;
|
|
2453
|
+
}
|
|
2454
|
+
type RejectedClient = RejectedClientDto;
|
|
2455
|
+
type BulkMessageResult = BulkMessageResultDto;
|
|
2456
|
+
interface BulkMessageLogDto {
|
|
2457
|
+
sendId: string;
|
|
2458
|
+
clientId: string;
|
|
2459
|
+
clientName: string;
|
|
2460
|
+
phoneNumber: string;
|
|
2461
|
+
message: string;
|
|
2462
|
+
status: 'pending' | 'queued' | 'sent' | 'delivered' | 'failed';
|
|
2463
|
+
sentAt?: string;
|
|
2464
|
+
deliveredAt?: string;
|
|
2465
|
+
failedAt?: string;
|
|
2466
|
+
failureReason?: string;
|
|
2467
|
+
retryCount: number;
|
|
2468
|
+
timestamp: string;
|
|
2469
|
+
}
|
|
2470
|
+
interface GetBulkLogsQueryDto {
|
|
2471
|
+
sendId: string;
|
|
2472
|
+
}
|
|
2473
|
+
interface BulkLogsResponseDto {
|
|
2474
|
+
sendId: string;
|
|
2475
|
+
totalRecipients: number;
|
|
2476
|
+
sent: number;
|
|
2477
|
+
delivered: number;
|
|
2478
|
+
failed: number;
|
|
2479
|
+
pending: number;
|
|
2480
|
+
logs: BulkMessageLogDto[];
|
|
2481
|
+
isComplete: boolean;
|
|
2482
|
+
}
|
|
2483
|
+
type BulkMessageLog = BulkMessageLogDto;
|
|
2484
|
+
type BulkLogsResponse = BulkLogsResponseDto;
|
|
2485
|
+
interface GenerateAIMessageDto {
|
|
2486
|
+
prompt: string;
|
|
2487
|
+
tone?: 'promotional' | 'informational' | 'reminder' | 'greeting' | 'custom' | 'friendly';
|
|
2488
|
+
includeVariables?: string[];
|
|
2489
|
+
additionalRequirements?: string;
|
|
2490
|
+
}
|
|
2491
|
+
interface GenerateAIMessageResponseDto {
|
|
2492
|
+
message: string;
|
|
2493
|
+
variables: string[];
|
|
2494
|
+
tone: string;
|
|
2495
|
+
suggestions?: string[];
|
|
2496
|
+
}
|
|
2497
|
+
type GenerateAIMessageParams = GenerateAIMessageDto;
|
|
2498
|
+
type GenerateAIMessageResponse = GenerateAIMessageResponseDto;
|
|
2499
|
+
|
|
2500
|
+
declare class BulkMessagingResource extends BaseResource {
|
|
2501
|
+
private basePath;
|
|
2502
|
+
private templatesPath;
|
|
2503
|
+
createTemplate(data: CreateBulkTemplateDto, options?: RequestOptions): Promise<BulkTemplate>;
|
|
2504
|
+
getTemplates(options?: RequestOptions): Promise<BulkTemplate[]>;
|
|
2505
|
+
getTemplate(id: string, options?: RequestOptions): Promise<BulkTemplate>;
|
|
2506
|
+
updateTemplate(id: string, data: UpdateBulkTemplateDto, options?: RequestOptions): Promise<BulkTemplate>;
|
|
2507
|
+
deleteTemplate(id: string, options?: RequestOptions): Promise<void>;
|
|
2508
|
+
getAvailableVariables(options?: RequestOptions): Promise<BulkMessageVariable[]>;
|
|
2509
|
+
/**
|
|
2510
|
+
* Generate AI message with streaming support
|
|
2511
|
+
* Note: This proxies to the agent endpoint for streaming responses
|
|
2512
|
+
*/
|
|
2513
|
+
generateAIMessage(data: GenerateAIMessageDto, options?: RequestOptions): Promise<GenerateAIMessageResponseDto>;
|
|
2514
|
+
/**
|
|
2515
|
+
* Send bulk messages to multiple clients
|
|
2516
|
+
* Note: SDK sends clientIds, API fetches full client and gym data before sending to agent
|
|
2517
|
+
*/
|
|
2518
|
+
send(data: SendBulkMessagesDto, options?: RequestOptions): Promise<BulkMessageResultDto>;
|
|
2519
|
+
/**
|
|
2520
|
+
* Get logs for a bulk message send operation
|
|
2521
|
+
*/
|
|
2522
|
+
getLogs(sendId: string, options?: RequestOptions): Promise<BulkLogsResponseDto>;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2319
2525
|
declare class GymSpaceSdk {
|
|
2320
2526
|
client: ApiClient;
|
|
2321
2527
|
private expoFetch?;
|
|
@@ -2345,6 +2551,7 @@ declare class GymSpaceSdk {
|
|
|
2345
2551
|
paymentMethods: PaymentMethodsResource;
|
|
2346
2552
|
whatsapp: WhatsAppResource;
|
|
2347
2553
|
whatsappTemplates: WhatsAppTemplatesResource;
|
|
2554
|
+
bulkMessaging: BulkMessagingResource;
|
|
2348
2555
|
constructor(config: GymSpaceConfig);
|
|
2349
2556
|
/**
|
|
2350
2557
|
* Set the authentication token
|
|
@@ -2414,4 +2621,4 @@ declare class NetworkError extends GymSpaceError {
|
|
|
2414
2621
|
constructor(message?: string);
|
|
2415
2622
|
}
|
|
2416
2623
|
|
|
2417
|
-
export { 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 CheckInDetail, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, type CheckInsList, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientStat, type ClientStats, ClientsResource, type CollaboratorRoleDto, CollaboratorsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type ConnectionStatusResponse, type Contact, type Contract, ContractsResource, type ContractsRevenue, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateGymDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSubscriptionPlanDto, type CreateSupplierDto, type CreateTemplateDto, type CreateWhatsAppConfigDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type DisconnectResponse, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, 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 InitializeConnectionResponse, type InvitationValidationResponse, InvitationsResource, type ListContactsResponse, 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 PreviewTemplateResponse, 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, RolesResource, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SearchTemplatesDto, type SearchWhatsAppMessagesDto, type SendWhatsAppMessageDto, 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 UpdateGymDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateSaleDto, type UpdateStockDto, type UpdateSubscriptionPlanDto, type UpdateSupplierDto, type UpdateTemplateDto, type UpdateWhatsAppConfigDto, type UpgradeSubscriptionDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule, type WhatsAppConfig, type WhatsAppMessage, WhatsAppResource, type WhatsAppTemplate, WhatsAppTemplatesResource };
|
|
2624
|
+
export { type ActivateRenewalDto, AdminSubscriptionManagementResource, type AdminSubscriptionStatusDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BulkLogsResponse, type BulkLogsResponseDto, type BulkMessageLog, type BulkMessageLogDto, type BulkMessageResult, type BulkMessageResultDto, type BulkMessageVariable, BulkMessagingResource, type BulkTemplate, type BusinessHours, type CancelSubscriptionDto, type CatalogGym, type ChangePasswordDto, type ChangePasswordResponseDto, type CheckIn, type CheckInDetail, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, type CheckInsList, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientStat, type ClientStats, ClientsResource, type CollaboratorRoleDto, CollaboratorsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type ConnectionStatusResponse, type Contact, type Contract, type ContractSettings, ContractsResource, type ContractsRevenue, type CreateBulkTemplateDto, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateGymDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSubscriptionPlanDto, type CreateSupplierDto, type CreateTemplateDto, type CreateWhatsAppConfigDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type DisconnectResponse, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GenerateAIMessageDto, type GenerateAIMessageParams, type GenerateAIMessageResponse, type GenerateAIMessageResponseDto, type GetBulkLogsQueryDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, 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 InitializeConnectionResponse, type InventorySettings, type InvitationValidationResponse, InvitationsResource, type ListContactsResponse, 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 PreviewTemplateResponse, type PriceDto, type PricingDto, type Product, type ProductCategory, ProductsResource, PublicCatalogResource, type ReadyResponse, type RegisterCollaboratorDto, type RegisterOwnerDto, type RejectedClient, type RejectedClientDto, type RenewContractDto, type RequestOptions, type RequestPasswordResetDto, type RequestPasswordResetResponseDto, type ResendResetCodeDto, type ResendResetCodeResponseDto, type ResendVerificationDto, type ResetPasswordDto, type ResetPasswordResponseDto, RolesResource, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SearchTemplatesDto, type SearchWhatsAppMessagesDto, type SendBulkMessagesDto, type SendWhatsAppMessageDto, 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 UpdateBulkTemplateDto, type UpdateClientDto, type UpdateGymContractSettingsDto, type UpdateGymDto, type UpdateGymInventorySettingsDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateSaleDto, type UpdateStockDto, type UpdateSubscriptionPlanDto, type UpdateSupplierDto, type UpdateTemplateDto, type UpdateWhatsAppConfigDto, type UpgradeSubscriptionDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule, type WhatsAppConfig, type WhatsAppMessage, WhatsAppResource, type WhatsAppTemplate, WhatsAppTemplatesResource };
|
package/dist/index.js
CHANGED
|
@@ -379,18 +379,10 @@ var GymsResource = class extends BaseResource {
|
|
|
379
379
|
this.basePath = "gyms";
|
|
380
380
|
}
|
|
381
381
|
async createGym(data, options) {
|
|
382
|
-
return this.client.post(
|
|
383
|
-
this.basePath,
|
|
384
|
-
data,
|
|
385
|
-
options
|
|
386
|
-
);
|
|
382
|
+
return this.client.post(this.basePath, data, options);
|
|
387
383
|
}
|
|
388
384
|
async getOrganizationGyms(options) {
|
|
389
|
-
return this.client.get(
|
|
390
|
-
this.basePath,
|
|
391
|
-
void 0,
|
|
392
|
-
options
|
|
393
|
-
);
|
|
385
|
+
return this.client.get(this.basePath, void 0, options);
|
|
394
386
|
}
|
|
395
387
|
async getGym(id, options) {
|
|
396
388
|
return this.client.get(`${this.basePath}/${id}`, void 0, options);
|
|
@@ -413,6 +405,44 @@ var GymsResource = class extends BaseResource {
|
|
|
413
405
|
async updateGymSocialMedia(id, data, options) {
|
|
414
406
|
return this.client.put(`${this.basePath}/${id}/social-media`, data, options);
|
|
415
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* Update current gym inventory settings (stock configuration)
|
|
410
|
+
* Uses gym from context (x-gym-id header)
|
|
411
|
+
* @param data Inventory settings data
|
|
412
|
+
* @param options Request options
|
|
413
|
+
* @returns Updated gym with new settings
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```typescript
|
|
417
|
+
* const gym = await sdk.gyms.updateInventorySettings({
|
|
418
|
+
* defaultMinStock: 15,
|
|
419
|
+
* defaultMaxStock: 1000,
|
|
420
|
+
* enableLowStockAlerts: true
|
|
421
|
+
* });
|
|
422
|
+
* ```
|
|
423
|
+
*/
|
|
424
|
+
async updateInventorySettings(data, options) {
|
|
425
|
+
return this.client.patch(`${this.basePath}/current/inventory-settings`, data, options);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Update current gym contract expiration settings
|
|
429
|
+
* Uses gym from context (x-gym-id header)
|
|
430
|
+
* @param data Contract settings data
|
|
431
|
+
* @param options Request options
|
|
432
|
+
* @returns Updated gym with new settings
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```typescript
|
|
436
|
+
* const gym = await sdk.gyms.updateContractSettings({
|
|
437
|
+
* expiringSoonDays: 7,
|
|
438
|
+
* gracePeriodDays: 0,
|
|
439
|
+
* enableExpirationNotifications: true
|
|
440
|
+
* });
|
|
441
|
+
* ```
|
|
442
|
+
*/
|
|
443
|
+
async updateContractSettings(data, options) {
|
|
444
|
+
return this.client.patch(`${this.basePath}/current/contract-settings`, data, options);
|
|
445
|
+
}
|
|
416
446
|
};
|
|
417
447
|
|
|
418
448
|
// src/resources/collaborators.ts
|
|
@@ -1167,6 +1197,13 @@ var SubscriptionPlansResource = class extends BaseResource {
|
|
|
1167
1197
|
constructor() {
|
|
1168
1198
|
super(...arguments);
|
|
1169
1199
|
this.basePath = "admin/subscription-plans";
|
|
1200
|
+
this.publicBasePath = "subscription-plans/public";
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* List all active subscription plans (Public - no authentication required)
|
|
1204
|
+
*/
|
|
1205
|
+
async listPublicPlans(options) {
|
|
1206
|
+
return this.client.get(`${this.publicBasePath}`, void 0, options);
|
|
1170
1207
|
}
|
|
1171
1208
|
/**
|
|
1172
1209
|
* List all subscription plans (Super Admin only)
|
|
@@ -1400,6 +1437,61 @@ var WhatsAppTemplatesResource = class extends BaseResource {
|
|
|
1400
1437
|
}
|
|
1401
1438
|
};
|
|
1402
1439
|
|
|
1440
|
+
// src/resources/bulk-messaging.ts
|
|
1441
|
+
var BulkMessagingResource = class extends BaseResource {
|
|
1442
|
+
constructor() {
|
|
1443
|
+
super(...arguments);
|
|
1444
|
+
this.basePath = "whatsapp/bulk-messaging";
|
|
1445
|
+
this.templatesPath = "whatsapp/bulk-templates";
|
|
1446
|
+
}
|
|
1447
|
+
async createTemplate(data, options) {
|
|
1448
|
+
return this.client.post(this.templatesPath, data, options);
|
|
1449
|
+
}
|
|
1450
|
+
async getTemplates(options) {
|
|
1451
|
+
return this.client.get(this.templatesPath, void 0, options);
|
|
1452
|
+
}
|
|
1453
|
+
async getTemplate(id, options) {
|
|
1454
|
+
return this.client.get(`${this.templatesPath}/${id}`, void 0, options);
|
|
1455
|
+
}
|
|
1456
|
+
async updateTemplate(id, data, options) {
|
|
1457
|
+
return this.client.put(`${this.templatesPath}/${id}`, data, options);
|
|
1458
|
+
}
|
|
1459
|
+
async deleteTemplate(id, options) {
|
|
1460
|
+
return this.client.delete(`${this.templatesPath}/${id}`, options);
|
|
1461
|
+
}
|
|
1462
|
+
async getAvailableVariables(options) {
|
|
1463
|
+
return this.client.get(
|
|
1464
|
+
`${this.basePath}/available-variables`,
|
|
1465
|
+
void 0,
|
|
1466
|
+
options
|
|
1467
|
+
);
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Generate AI message with streaming support
|
|
1471
|
+
* Note: This proxies to the agent endpoint for streaming responses
|
|
1472
|
+
*/
|
|
1473
|
+
async generateAIMessage(data, options) {
|
|
1474
|
+
return this.client.post(
|
|
1475
|
+
`${this.basePath}/generate-ai`,
|
|
1476
|
+
data,
|
|
1477
|
+
options
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Send bulk messages to multiple clients
|
|
1482
|
+
* Note: SDK sends clientIds, API fetches full client and gym data before sending to agent
|
|
1483
|
+
*/
|
|
1484
|
+
async send(data, options) {
|
|
1485
|
+
return this.client.post(`${this.basePath}/send`, data, options);
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* Get logs for a bulk message send operation
|
|
1489
|
+
*/
|
|
1490
|
+
async getLogs(sendId, options) {
|
|
1491
|
+
return this.client.get(`${this.basePath}/logs`, { sendId }, options);
|
|
1492
|
+
}
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1403
1495
|
// src/sdk.ts
|
|
1404
1496
|
var GymSpaceSdk = class {
|
|
1405
1497
|
constructor(config) {
|
|
@@ -1430,6 +1522,7 @@ var GymSpaceSdk = class {
|
|
|
1430
1522
|
this.paymentMethods = new PaymentMethodsResource(this.client);
|
|
1431
1523
|
this.whatsapp = new WhatsAppResource(this.client);
|
|
1432
1524
|
this.whatsappTemplates = new WhatsAppTemplatesResource(this.client);
|
|
1525
|
+
this.bulkMessaging = new BulkMessagingResource(this.client);
|
|
1433
1526
|
}
|
|
1434
1527
|
/**
|
|
1435
1528
|
* Set the authentication token
|
|
@@ -1873,6 +1966,7 @@ exports.AssetsResource = AssetsResource;
|
|
|
1873
1966
|
exports.AuthResource = AuthResource;
|
|
1874
1967
|
exports.AuthenticationError = AuthenticationError;
|
|
1875
1968
|
exports.AuthorizationError = AuthorizationError;
|
|
1969
|
+
exports.BulkMessagingResource = BulkMessagingResource;
|
|
1876
1970
|
exports.CACHE_TTL = CACHE_TTL;
|
|
1877
1971
|
exports.CheckInsResource = CheckInsResource;
|
|
1878
1972
|
exports.ClientStatus = ClientStatus;
|