@vitalfit/sdk 0.0.33 → 0.0.34

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.cts CHANGED
@@ -82,7 +82,6 @@ type ClientProfile = {
82
82
  type Role = {
83
83
  role_id: string;
84
84
  name: string;
85
- level: number;
86
85
  description: string;
87
86
  created_at: string;
88
87
  updated_at: string;
@@ -121,10 +120,18 @@ type PaymentMethod = {
121
120
  name: string;
122
121
  type: string;
123
122
  description: string;
123
+ processing_type: string;
124
124
  global_status: boolean;
125
125
  created_at: string;
126
126
  updated_at: string;
127
127
  };
128
+ type PaymentMethodTypes = {};
129
+ type CreatePaymentMethod = {
130
+ description: string;
131
+ name: string;
132
+ processing_type: 'Gateway' | 'Offline';
133
+ type: 'Cash' | 'Card' | 'Transfer' | 'Other';
134
+ };
128
135
 
129
136
  type PaginatedBranch = {
130
137
  branch_id: string;
@@ -262,6 +269,154 @@ type PaginatedInstructor = PaginationRequest & {
262
269
  identity_doc?: string;
263
270
  };
264
271
 
272
+ interface Permission {
273
+ created_at?: string;
274
+ description?: string;
275
+ name?: string;
276
+ permission_id: string;
277
+ updated_at?: string;
278
+ }
279
+ interface RoleResponse {
280
+ created_at: string;
281
+ description: string;
282
+ name: string;
283
+ permissions: Permission[];
284
+ role_id: string;
285
+ updated_at: string;
286
+ }
287
+ type CreateRole = {
288
+ description: string;
289
+ name: string;
290
+ permissionsID: string[];
291
+ };
292
+
293
+ type Banner = {
294
+ banner_id?: string;
295
+ image_url?: string;
296
+ is_active?: boolean;
297
+ link_url?: string;
298
+ name?: string;
299
+ };
300
+ type CreateBanner = Omit<Banner, 'banner_id'>;
301
+ type UpdateBanner = {
302
+ image_url?: string;
303
+ is_active?: boolean;
304
+ link_url?: string;
305
+ name?: string;
306
+ };
307
+
308
+ type MembershipType = {
309
+ description: string;
310
+ duration_days: number;
311
+ is_active: boolean;
312
+ membership_type_id: string;
313
+ name: string;
314
+ price: number;
315
+ };
316
+ type CreateMembershipType = {
317
+ description: string;
318
+ duration_days: number;
319
+ is_active: boolean;
320
+ name: string;
321
+ price: number;
322
+ };
323
+ type UpdateMembershipType = {
324
+ description?: string;
325
+ duration_days?: number;
326
+ is_active?: boolean;
327
+ name?: string;
328
+ price?: number;
329
+ };
330
+
331
+ type BranchInfo = {
332
+ address: string;
333
+ branch_id: string;
334
+ latitude: number;
335
+ longitude: number;
336
+ name: string;
337
+ phone: string;
338
+ };
339
+
340
+ interface ServiceCategoryInfo {
341
+ category_id: string;
342
+ name: string;
343
+ }
344
+ interface ServiceImageResponse {
345
+ image_id: string;
346
+ image_url: string;
347
+ alt_text: string;
348
+ display_order: number;
349
+ is_primary: boolean;
350
+ }
351
+ interface BannerResponse {
352
+ banner_id: string;
353
+ name: string;
354
+ image_url: string;
355
+ link_url: string;
356
+ is_active: boolean;
357
+ }
358
+ interface ServiceFullDetail {
359
+ service_id: string;
360
+ category_id: string;
361
+ name: string;
362
+ description: string;
363
+ duration_minutes: number;
364
+ priority_score: number;
365
+ is_featured: boolean;
366
+ created_at: string;
367
+ updated_at: string;
368
+ service_category: ServiceCategoryInfo;
369
+ images: ServiceImageResponse[];
370
+ banners: BannerResponse[];
371
+ }
372
+ type CreateServiceImage = {
373
+ alt_text: string;
374
+ display_order: number;
375
+ image_url: string;
376
+ is_primary: boolean;
377
+ };
378
+ type CreateService = {
379
+ banner_id: string;
380
+ category_id: string;
381
+ description: string;
382
+ duration: number;
383
+ is_featured: boolean;
384
+ name: string;
385
+ priority: number;
386
+ service_images: CreateServiceImage[];
387
+ };
388
+ type UpdateServiceImageManual = {
389
+ alt_text?: string;
390
+ display_order?: number;
391
+ image_url?: string;
392
+ is_primary?: boolean;
393
+ };
394
+ type UpdateServiceManual = {
395
+ banner_id?: string;
396
+ category_id?: string;
397
+ description?: string;
398
+ duration?: number;
399
+ is_featured?: boolean;
400
+ name?: string;
401
+ priority?: number;
402
+ service_images?: UpdateServiceImageManual[];
403
+ };
404
+
405
+ type EquipmentCategory = 'Cardio' | 'Strength' | 'FreeWeight' | 'Functional' | 'Accessory';
406
+ type Equipment = {
407
+ equipment_id: string;
408
+ name: string;
409
+ brand: string;
410
+ model: string;
411
+ category: EquipmentCategory;
412
+ description: string;
413
+ created_at: string;
414
+ updated_at: string;
415
+ deleted_at: string | null;
416
+ };
417
+ type CreateEquipment = Omit<Equipment, 'equipment_id' | 'created_at' | 'updated_at' | 'deleted_at'>;
418
+ type UpdateEquipment = Partial<CreateEquipment>;
419
+
265
420
  declare class AuthService {
266
421
  private client;
267
422
  constructor(client: Client);
@@ -273,6 +428,7 @@ declare class AuthService {
273
428
  forgotPassword(email: string): Promise<void>;
274
429
  resetPassword(otp: string, password: string, repeatPassword: string): Promise<void>;
275
430
  verifyEmail(otp: string): Promise<void>;
431
+ verifyStaff(token: string, password: string, repeatPassword: string): Promise<void>;
276
432
  }
277
433
 
278
434
  declare class UserService {
@@ -299,6 +455,10 @@ declare class PaymentMethodService {
299
455
  private client;
300
456
  constructor(client: Client);
301
457
  getPaymentMethods(jwt: string): Promise<DataResponse<PaymentMethod[]>>;
458
+ createPaymentMethod(paymentMethodData: CreatePaymentMethod, jwt: string): Promise<void>;
459
+ getPaymentMethodByID(paymentMethodId: string, jwt: string): Promise<DataResponse<PaymentMethod>>;
460
+ updatePaymentMethod(paymentMethodId: string, data: CreatePaymentMethod, jwt: string): Promise<void>;
461
+ deletePaymentMethod(paymentMethodId: string, jwt: string): Promise<void>;
302
462
  }
303
463
 
304
464
  declare class InstructorService {
@@ -313,6 +473,56 @@ declare class InstructorService {
313
473
  removeSpecialty(instructorId: string, specialtyId: string, jwt: string): Promise<void>;
314
474
  }
315
475
 
476
+ declare class RBACService {
477
+ private client;
478
+ constructor(client: Client);
479
+ getPermissions(jwt: string): Promise<DataResponse<Permission[]>>;
480
+ getRoles(jwt: string): Promise<DataResponse<RoleResponse[]>>;
481
+ createRole(roleData: CreateRole, jwt: string): Promise<void>;
482
+ updateRole(roleId: string, roleData: CreateRole, jwt: string): Promise<void>;
483
+ getRoleByID(roleId: string, jwt: string): Promise<DataResponse<RoleResponse>>;
484
+ deleteRole(roleId: string, jwt: string): Promise<void>;
485
+ addPermission(roleId: string, permissionData: Permission[], jwt: string): Promise<void>;
486
+ removePermission(roleId: string, permissionData: Permission[], jwt: string): Promise<void>;
487
+ }
488
+
489
+ declare class MarketingService {
490
+ private client;
491
+ constructor(client: Client);
492
+ createBanners(BannerData: CreateBanner, jwt: string): Promise<void>;
493
+ getBanner(jwt: string): Promise<DataResponse<Banner[]>>;
494
+ getBannerByID(BannerId: string, jwt: string): Promise<DataResponse<Banner>>;
495
+ updateBanner(BannerId: string, BannerData: UpdateBanner, jwt: string): Promise<void>;
496
+ deleteBanner(BannerId: string, jwt: string): Promise<void>;
497
+ }
498
+
499
+ declare class MembershipService {
500
+ private client;
501
+ constructor(client: Client);
502
+ createMembershipType(data: any, jwt: string): Promise<void>;
503
+ getMembershipTypes(jwt: string): Promise<DataResponse<MembershipType[]>>;
504
+ getMembershipTypeByID(membershipTypeId: string, jwt: string): Promise<DataResponse<MembershipType>>;
505
+ updateMembershipType(membershipTypeId: string, data: UpdateMembershipType, jwt: string): Promise<void>;
506
+ deleteMembershipType(membershipTypeId: string, jwt: string): Promise<void>;
507
+ }
508
+
509
+ declare class PublicService {
510
+ private client;
511
+ constructor(client: Client);
512
+ getBranchMap(jwt: string): Promise<DataResponse<BranchInfo>>;
513
+ }
514
+
515
+ declare class ProductsService {
516
+ private client;
517
+ constructor(client: Client);
518
+ createService(data: CreateService, jwt: string): Promise<void>;
519
+ getServices(jwt: string): Promise<DataResponse<ServiceFullDetail[]>>;
520
+ getServiceByID(serviceId: string, jwt: string): Promise<DataResponse<ServiceFullDetail>>;
521
+ updateService(serviceId: string, data: UpdateServiceManual, jwt: string): Promise<void>;
522
+ deleteService(serviceId: string, jwt: string): Promise<void>;
523
+ getCategories(jwt: string): Promise<DataResponse<ServiceCategoryInfo[]>>;
524
+ }
525
+
316
526
  declare class APIError extends Error {
317
527
  status: number;
318
528
  messages: string[];
@@ -328,9 +538,14 @@ declare class VitalFit {
328
538
  branch: BranchService;
329
539
  paymentMethod: PaymentMethodService;
330
540
  instructor: InstructorService;
541
+ RBAC: RBACService;
542
+ marketing: MarketingService;
543
+ membership: MembershipService;
544
+ public: PublicService;
545
+ products: ProductsService;
331
546
  constructor(isDevMode: boolean, origin?: string);
332
547
  static getInstance(isDevMode?: boolean): VitalFit;
333
548
  version(): string;
334
549
  }
335
550
 
336
- export { APIError, type BaseModel, type BranchDetails, type BranchPaymentMethod, type BranchStatusCount, type ClientProfile, type CreateBranchRequest, type DataResponse, type Instructor, type InstructorData, type InstructorDataList, type LoginRequest, type LoginResponse, type OperatingHour, type PaginatedBranch, type PaginatedInstructor, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaymentMethod, type Role, type SignUpRequest, type Specialty, type UUIDModel, type UpdateBranchRequest, type UpdateOperatingHour, type User, type UserApiResponse, UserGender, type UserPaginationOptions, VitalFit, isAPIError };
551
+ export { APIError, type Banner, type BannerResponse, type BaseModel, type BranchDetails, type BranchInfo, type BranchPaymentMethod, type BranchStatusCount, type ClientProfile, type CreateBanner, type CreateBranchRequest, type CreateEquipment, type CreateMembershipType, type CreatePaymentMethod, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type Instructor, type InstructorData, type InstructorDataList, type LoginRequest, type LoginResponse, type MembershipType, type OperatingHour, type PaginatedBranch, type PaginatedInstructor, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaymentMethod, type PaymentMethodTypes, type Permission, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type SignUpRequest, type Specialty, type UUIDModel, type UpdateBanner, type UpdateBranchRequest, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdateServiceImageManual, type UpdateServiceManual, type User, type UserApiResponse, UserGender, type UserPaginationOptions, VitalFit, isAPIError };
package/dist/index.d.ts CHANGED
@@ -82,7 +82,6 @@ type ClientProfile = {
82
82
  type Role = {
83
83
  role_id: string;
84
84
  name: string;
85
- level: number;
86
85
  description: string;
87
86
  created_at: string;
88
87
  updated_at: string;
@@ -121,10 +120,18 @@ type PaymentMethod = {
121
120
  name: string;
122
121
  type: string;
123
122
  description: string;
123
+ processing_type: string;
124
124
  global_status: boolean;
125
125
  created_at: string;
126
126
  updated_at: string;
127
127
  };
128
+ type PaymentMethodTypes = {};
129
+ type CreatePaymentMethod = {
130
+ description: string;
131
+ name: string;
132
+ processing_type: 'Gateway' | 'Offline';
133
+ type: 'Cash' | 'Card' | 'Transfer' | 'Other';
134
+ };
128
135
 
129
136
  type PaginatedBranch = {
130
137
  branch_id: string;
@@ -262,6 +269,154 @@ type PaginatedInstructor = PaginationRequest & {
262
269
  identity_doc?: string;
263
270
  };
264
271
 
272
+ interface Permission {
273
+ created_at?: string;
274
+ description?: string;
275
+ name?: string;
276
+ permission_id: string;
277
+ updated_at?: string;
278
+ }
279
+ interface RoleResponse {
280
+ created_at: string;
281
+ description: string;
282
+ name: string;
283
+ permissions: Permission[];
284
+ role_id: string;
285
+ updated_at: string;
286
+ }
287
+ type CreateRole = {
288
+ description: string;
289
+ name: string;
290
+ permissionsID: string[];
291
+ };
292
+
293
+ type Banner = {
294
+ banner_id?: string;
295
+ image_url?: string;
296
+ is_active?: boolean;
297
+ link_url?: string;
298
+ name?: string;
299
+ };
300
+ type CreateBanner = Omit<Banner, 'banner_id'>;
301
+ type UpdateBanner = {
302
+ image_url?: string;
303
+ is_active?: boolean;
304
+ link_url?: string;
305
+ name?: string;
306
+ };
307
+
308
+ type MembershipType = {
309
+ description: string;
310
+ duration_days: number;
311
+ is_active: boolean;
312
+ membership_type_id: string;
313
+ name: string;
314
+ price: number;
315
+ };
316
+ type CreateMembershipType = {
317
+ description: string;
318
+ duration_days: number;
319
+ is_active: boolean;
320
+ name: string;
321
+ price: number;
322
+ };
323
+ type UpdateMembershipType = {
324
+ description?: string;
325
+ duration_days?: number;
326
+ is_active?: boolean;
327
+ name?: string;
328
+ price?: number;
329
+ };
330
+
331
+ type BranchInfo = {
332
+ address: string;
333
+ branch_id: string;
334
+ latitude: number;
335
+ longitude: number;
336
+ name: string;
337
+ phone: string;
338
+ };
339
+
340
+ interface ServiceCategoryInfo {
341
+ category_id: string;
342
+ name: string;
343
+ }
344
+ interface ServiceImageResponse {
345
+ image_id: string;
346
+ image_url: string;
347
+ alt_text: string;
348
+ display_order: number;
349
+ is_primary: boolean;
350
+ }
351
+ interface BannerResponse {
352
+ banner_id: string;
353
+ name: string;
354
+ image_url: string;
355
+ link_url: string;
356
+ is_active: boolean;
357
+ }
358
+ interface ServiceFullDetail {
359
+ service_id: string;
360
+ category_id: string;
361
+ name: string;
362
+ description: string;
363
+ duration_minutes: number;
364
+ priority_score: number;
365
+ is_featured: boolean;
366
+ created_at: string;
367
+ updated_at: string;
368
+ service_category: ServiceCategoryInfo;
369
+ images: ServiceImageResponse[];
370
+ banners: BannerResponse[];
371
+ }
372
+ type CreateServiceImage = {
373
+ alt_text: string;
374
+ display_order: number;
375
+ image_url: string;
376
+ is_primary: boolean;
377
+ };
378
+ type CreateService = {
379
+ banner_id: string;
380
+ category_id: string;
381
+ description: string;
382
+ duration: number;
383
+ is_featured: boolean;
384
+ name: string;
385
+ priority: number;
386
+ service_images: CreateServiceImage[];
387
+ };
388
+ type UpdateServiceImageManual = {
389
+ alt_text?: string;
390
+ display_order?: number;
391
+ image_url?: string;
392
+ is_primary?: boolean;
393
+ };
394
+ type UpdateServiceManual = {
395
+ banner_id?: string;
396
+ category_id?: string;
397
+ description?: string;
398
+ duration?: number;
399
+ is_featured?: boolean;
400
+ name?: string;
401
+ priority?: number;
402
+ service_images?: UpdateServiceImageManual[];
403
+ };
404
+
405
+ type EquipmentCategory = 'Cardio' | 'Strength' | 'FreeWeight' | 'Functional' | 'Accessory';
406
+ type Equipment = {
407
+ equipment_id: string;
408
+ name: string;
409
+ brand: string;
410
+ model: string;
411
+ category: EquipmentCategory;
412
+ description: string;
413
+ created_at: string;
414
+ updated_at: string;
415
+ deleted_at: string | null;
416
+ };
417
+ type CreateEquipment = Omit<Equipment, 'equipment_id' | 'created_at' | 'updated_at' | 'deleted_at'>;
418
+ type UpdateEquipment = Partial<CreateEquipment>;
419
+
265
420
  declare class AuthService {
266
421
  private client;
267
422
  constructor(client: Client);
@@ -273,6 +428,7 @@ declare class AuthService {
273
428
  forgotPassword(email: string): Promise<void>;
274
429
  resetPassword(otp: string, password: string, repeatPassword: string): Promise<void>;
275
430
  verifyEmail(otp: string): Promise<void>;
431
+ verifyStaff(token: string, password: string, repeatPassword: string): Promise<void>;
276
432
  }
277
433
 
278
434
  declare class UserService {
@@ -299,6 +455,10 @@ declare class PaymentMethodService {
299
455
  private client;
300
456
  constructor(client: Client);
301
457
  getPaymentMethods(jwt: string): Promise<DataResponse<PaymentMethod[]>>;
458
+ createPaymentMethod(paymentMethodData: CreatePaymentMethod, jwt: string): Promise<void>;
459
+ getPaymentMethodByID(paymentMethodId: string, jwt: string): Promise<DataResponse<PaymentMethod>>;
460
+ updatePaymentMethod(paymentMethodId: string, data: CreatePaymentMethod, jwt: string): Promise<void>;
461
+ deletePaymentMethod(paymentMethodId: string, jwt: string): Promise<void>;
302
462
  }
303
463
 
304
464
  declare class InstructorService {
@@ -313,6 +473,56 @@ declare class InstructorService {
313
473
  removeSpecialty(instructorId: string, specialtyId: string, jwt: string): Promise<void>;
314
474
  }
315
475
 
476
+ declare class RBACService {
477
+ private client;
478
+ constructor(client: Client);
479
+ getPermissions(jwt: string): Promise<DataResponse<Permission[]>>;
480
+ getRoles(jwt: string): Promise<DataResponse<RoleResponse[]>>;
481
+ createRole(roleData: CreateRole, jwt: string): Promise<void>;
482
+ updateRole(roleId: string, roleData: CreateRole, jwt: string): Promise<void>;
483
+ getRoleByID(roleId: string, jwt: string): Promise<DataResponse<RoleResponse>>;
484
+ deleteRole(roleId: string, jwt: string): Promise<void>;
485
+ addPermission(roleId: string, permissionData: Permission[], jwt: string): Promise<void>;
486
+ removePermission(roleId: string, permissionData: Permission[], jwt: string): Promise<void>;
487
+ }
488
+
489
+ declare class MarketingService {
490
+ private client;
491
+ constructor(client: Client);
492
+ createBanners(BannerData: CreateBanner, jwt: string): Promise<void>;
493
+ getBanner(jwt: string): Promise<DataResponse<Banner[]>>;
494
+ getBannerByID(BannerId: string, jwt: string): Promise<DataResponse<Banner>>;
495
+ updateBanner(BannerId: string, BannerData: UpdateBanner, jwt: string): Promise<void>;
496
+ deleteBanner(BannerId: string, jwt: string): Promise<void>;
497
+ }
498
+
499
+ declare class MembershipService {
500
+ private client;
501
+ constructor(client: Client);
502
+ createMembershipType(data: any, jwt: string): Promise<void>;
503
+ getMembershipTypes(jwt: string): Promise<DataResponse<MembershipType[]>>;
504
+ getMembershipTypeByID(membershipTypeId: string, jwt: string): Promise<DataResponse<MembershipType>>;
505
+ updateMembershipType(membershipTypeId: string, data: UpdateMembershipType, jwt: string): Promise<void>;
506
+ deleteMembershipType(membershipTypeId: string, jwt: string): Promise<void>;
507
+ }
508
+
509
+ declare class PublicService {
510
+ private client;
511
+ constructor(client: Client);
512
+ getBranchMap(jwt: string): Promise<DataResponse<BranchInfo>>;
513
+ }
514
+
515
+ declare class ProductsService {
516
+ private client;
517
+ constructor(client: Client);
518
+ createService(data: CreateService, jwt: string): Promise<void>;
519
+ getServices(jwt: string): Promise<DataResponse<ServiceFullDetail[]>>;
520
+ getServiceByID(serviceId: string, jwt: string): Promise<DataResponse<ServiceFullDetail>>;
521
+ updateService(serviceId: string, data: UpdateServiceManual, jwt: string): Promise<void>;
522
+ deleteService(serviceId: string, jwt: string): Promise<void>;
523
+ getCategories(jwt: string): Promise<DataResponse<ServiceCategoryInfo[]>>;
524
+ }
525
+
316
526
  declare class APIError extends Error {
317
527
  status: number;
318
528
  messages: string[];
@@ -328,9 +538,14 @@ declare class VitalFit {
328
538
  branch: BranchService;
329
539
  paymentMethod: PaymentMethodService;
330
540
  instructor: InstructorService;
541
+ RBAC: RBACService;
542
+ marketing: MarketingService;
543
+ membership: MembershipService;
544
+ public: PublicService;
545
+ products: ProductsService;
331
546
  constructor(isDevMode: boolean, origin?: string);
332
547
  static getInstance(isDevMode?: boolean): VitalFit;
333
548
  version(): string;
334
549
  }
335
550
 
336
- export { APIError, type BaseModel, type BranchDetails, type BranchPaymentMethod, type BranchStatusCount, type ClientProfile, type CreateBranchRequest, type DataResponse, type Instructor, type InstructorData, type InstructorDataList, type LoginRequest, type LoginResponse, type OperatingHour, type PaginatedBranch, type PaginatedInstructor, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaymentMethod, type Role, type SignUpRequest, type Specialty, type UUIDModel, type UpdateBranchRequest, type UpdateOperatingHour, type User, type UserApiResponse, UserGender, type UserPaginationOptions, VitalFit, isAPIError };
551
+ export { APIError, type Banner, type BannerResponse, type BaseModel, type BranchDetails, type BranchInfo, type BranchPaymentMethod, type BranchStatusCount, type ClientProfile, type CreateBanner, type CreateBranchRequest, type CreateEquipment, type CreateMembershipType, type CreatePaymentMethod, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type Instructor, type InstructorData, type InstructorDataList, type LoginRequest, type LoginResponse, type MembershipType, type OperatingHour, type PaginatedBranch, type PaginatedInstructor, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaymentMethod, type PaymentMethodTypes, type Permission, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type SignUpRequest, type Specialty, type UUIDModel, type UpdateBanner, type UpdateBranchRequest, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdateServiceImageManual, type UpdateServiceManual, type User, type UserApiResponse, UserGender, type UserPaginationOptions, VitalFit, isAPIError };