@applite/js-sdk 0.0.1 → 0.0.3

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.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { CreateAppWithdraw, CreateAppSchema, CreateAgentSchema, UpdateAgentSchema, CreateAppointmentSchema, UpdateAppointmentStatusSchema, CreateCompanySchema, UpdateCompanySchema, CreateServiceSchema, UpdateServiceSchema } from '@applite/db';
2
+ import { z } from 'zod';
3
+
1
4
  interface HttpClientConfig {
2
5
  /**
3
6
  * Base URL used for every request. Defaults to an empty string so that
@@ -131,12 +134,9 @@ interface TransactionListParams extends AppScopedParams {
131
134
  interface TransactionGetParams extends AppScopedParams {
132
135
  id: string;
133
136
  }
134
- interface WithdrawParams extends AppScopedParams {
135
- amount: number;
136
- phoneNumber: string;
137
- password: string;
138
- paymentMethod: string;
139
- }
137
+ type WithdrawParams = z.infer<typeof CreateAppWithdraw> & {
138
+ appId: string;
139
+ };
140
140
  declare class AppFinanceModule {
141
141
  private readonly http;
142
142
  constructor(http: HttpClient);
@@ -146,11 +146,7 @@ declare class AppFinanceModule {
146
146
  withdraw(params: WithdrawParams): Promise<ApiSuccessResponse<unknown>>;
147
147
  }
148
148
 
149
- interface CreateAppParams extends ApiKeyParams {
150
- name: string;
151
- description?: string | null;
152
- planId: string;
153
- }
149
+ type CreateAppParams = z.infer<typeof CreateAppSchema>;
154
150
  interface AppSummary {
155
151
  id: string;
156
152
  name: string;
@@ -165,10 +161,6 @@ interface AppSummary {
165
161
  totalOrders: number;
166
162
  ownerId: string;
167
163
  balance: number;
168
- plan: {
169
- id: string;
170
- name: string;
171
- };
172
164
  }
173
165
  interface AppDetail extends AppSummary {
174
166
  callbackUrl?: string | null;
@@ -553,7 +545,6 @@ declare class StoreTaxModule {
553
545
  delete(params: GetTaxParams): Promise<ApiSuccessResponse<unknown>>;
554
546
  }
555
547
  declare class StoreModule {
556
- private readonly http;
557
548
  readonly badge: StoreBadgeModule;
558
549
  readonly category: StoreCategoryModule;
559
550
  readonly collection: StoreCollectionModule;
@@ -598,111 +589,109 @@ declare class AppWelcomeItemModule {
598
589
  delete(params: WelcomeItemGetParams): Promise<ApiSuccessResponse<unknown>>;
599
590
  }
600
591
 
601
- interface ListServicesParams extends AppScopedParams {
602
- companyId?: string | null;
603
- }
604
- interface ListCompaniesParams extends AppScopedParams {
605
- }
606
- interface CreateCompanyParams extends AppScopedParams {
607
- name: string;
608
- description?: string | null;
609
- email?: string | null;
610
- telephone?: string | null;
611
- address?: string | null;
612
- logo?: string | null;
613
- logoId?: string | null;
614
- isDefault?: boolean;
615
- }
616
- interface GetCompanyParams extends AppScopedParams {
592
+ type CreateAgentParams = z.infer<typeof CreateAgentSchema> & {
593
+ appId: string;
594
+ };
595
+ type EditAgentParams = z.infer<typeof UpdateAgentSchema> & {
596
+ appId: string;
617
597
  id: string;
618
- }
619
- interface UpdateCompanyParams extends CreateCompanyParams {
598
+ };
599
+ interface GetAgentParams extends AppScopedParams {
620
600
  id: string;
621
- }
622
- interface CreateServiceParams extends AppScopedParams {
623
- name: string;
624
- description?: string | null;
625
- icon?: string | null;
626
- iconId?: string | null;
627
- basePrice?: number | null;
628
- categories?: string[];
629
- fields?: any[];
630
601
  companyId?: string | null;
631
602
  }
632
- interface GetServiceParams extends AppScopedParams {
633
- id: string;
603
+ interface ListAgentsParams extends AppScopedParams {
634
604
  companyId?: string | null;
605
+ serviceId?: string;
606
+ isActive?: boolean;
635
607
  }
636
- interface UpdateServiceParams extends CreateServiceParams {
637
- id: string;
638
- }
639
- interface CreateAppointmentParams extends AppScopedParams {
640
- serviceId: string;
641
- agentId?: string | null;
642
- userId?: string;
643
- filledFields: Record<string, any>;
644
- totalPrice: number;
645
- date: Date | string;
646
- commune: string;
608
+ declare class MultiServiceAgentModule {
609
+ private readonly http;
610
+ constructor(http: HttpClient);
611
+ list(params: ListAgentsParams): Promise<ApiSuccessResponse<unknown>>;
612
+ create(params: CreateAgentParams): Promise<ApiSuccessResponse<unknown>>;
613
+ get(params: GetAgentParams): Promise<ApiSuccessResponse<unknown>>;
614
+ update(params: EditAgentParams): Promise<ApiSuccessResponse<unknown>>;
615
+ delete(params: GetAgentParams): Promise<ApiSuccessResponse<unknown>>;
647
616
  }
617
+
618
+ type CreateAppointmentParams = z.infer<typeof CreateAppointmentSchema> & {
619
+ appId: string;
620
+ };
621
+ type UpdateAppointmentStatusParams = z.infer<typeof UpdateAppointmentStatusSchema> & {
622
+ appId: string;
623
+ id: string;
624
+ companyId?: string | null;
625
+ };
648
626
  interface ListAppointmentsParams extends AppScopedParams {
649
627
  companyId?: string | null;
650
628
  serviceId?: string;
651
629
  status?: string;
652
630
  }
653
- interface UpdateAppointmentStatusParams extends AppScopedParams {
631
+ declare class MultiServiceAppointmentModule {
632
+ private readonly http;
633
+ constructor(http: HttpClient);
634
+ create(params: CreateAppointmentParams): Promise<ApiSuccessResponse<unknown>>;
635
+ list(params: ListAppointmentsParams): Promise<ApiSuccessResponse<unknown>>;
636
+ updateStatus(params: UpdateAppointmentStatusParams): Promise<ApiSuccessResponse<unknown>>;
637
+ }
638
+
639
+ type CreateCompanyParams = z.infer<typeof CreateCompanySchema> & {
640
+ appId: string;
641
+ };
642
+ type EditCompanyParams = z.infer<typeof UpdateCompanySchema> & {
643
+ appId: string;
644
+ id: string;
645
+ };
646
+ interface GetCompanyParams extends AppScopedParams {
654
647
  id: string;
655
- status: string;
656
- companyId?: string | null;
657
648
  }
658
- interface ListAgentsParams extends AppScopedParams {
659
- companyId?: string | null;
660
- serviceId?: string;
661
- isActive?: boolean;
649
+ interface ListCompaniesParams extends AppScopedParams {
662
650
  }
663
- interface CreateAgentParams extends AppScopedParams {
664
- companyId?: string | null;
665
- serviceIds?: string[];
666
- fullname: string;
667
- email?: string | null;
668
- telephone?: string | null;
669
- bio?: string | null;
670
- photo?: string | null;
671
- photoId?: string | null;
672
- isActive?: boolean;
651
+ declare class MultiServiceCompanyModule {
652
+ private readonly http;
653
+ constructor(http: HttpClient);
654
+ list(params: ListCompaniesParams): Promise<ApiSuccessResponse<unknown>>;
655
+ create(params: CreateCompanyParams): Promise<ApiSuccessResponse<unknown>>;
656
+ get(params: GetCompanyParams): Promise<ApiSuccessResponse<unknown>>;
657
+ update(params: EditCompanyParams): Promise<ApiSuccessResponse<unknown>>;
658
+ delete(params: GetCompanyParams): Promise<ApiSuccessResponse<unknown>>;
673
659
  }
674
- interface GetAgentParams extends AppScopedParams {
660
+
661
+ type CreateServiceParams = z.infer<typeof CreateServiceSchema> & {
662
+ appId: string;
663
+ };
664
+ type EditServiceParams = z.infer<typeof UpdateServiceSchema> & {
665
+ appId: string;
666
+ id: string;
667
+ };
668
+ interface GetServiceParams extends AppScopedParams {
675
669
  id: string;
676
670
  companyId?: string | null;
677
671
  }
678
- interface UpdateAgentParams extends CreateAgentParams {
679
- id: string;
672
+ interface ListServicesParams extends AppScopedParams {
673
+ companyId?: string | null;
680
674
  }
675
+ declare class MultiServiceServiceModule {
676
+ private readonly http;
677
+ constructor(http: HttpClient);
678
+ list(params: ListServicesParams): Promise<ApiSuccessResponse<unknown>>;
679
+ create(params: CreateServiceParams): Promise<ApiSuccessResponse<unknown>>;
680
+ get(params: GetServiceParams): Promise<ApiSuccessResponse<unknown>>;
681
+ update(params: EditServiceParams): Promise<ApiSuccessResponse<unknown>>;
682
+ delete(params: GetServiceParams): Promise<ApiSuccessResponse<unknown>>;
683
+ }
684
+
681
685
  declare class MultiServiceModule {
682
686
  private readonly http;
687
+ readonly company: MultiServiceCompanyModule;
688
+ readonly service: MultiServiceServiceModule;
689
+ readonly appointment: MultiServiceAppointmentModule;
690
+ readonly agent: MultiServiceAgentModule;
683
691
  constructor(http: HttpClient);
684
- listCompanies(params: ListCompaniesParams): Promise<ApiSuccessResponse<unknown>>;
685
- createCompany(params: CreateCompanyParams): Promise<ApiSuccessResponse<unknown>>;
686
- getCompany(params: GetCompanyParams): Promise<ApiSuccessResponse<unknown>>;
687
- updateCompany(params: UpdateCompanyParams): Promise<ApiSuccessResponse<unknown>>;
688
- deleteCompany(params: GetCompanyParams): Promise<ApiSuccessResponse<unknown>>;
689
- listServices(params: ListServicesParams): Promise<ApiSuccessResponse<unknown>>;
690
- createService(params: CreateServiceParams): Promise<ApiSuccessResponse<unknown>>;
691
- getService(params: GetServiceParams): Promise<ApiSuccessResponse<unknown>>;
692
- updateService(params: UpdateServiceParams): Promise<ApiSuccessResponse<unknown>>;
693
- deleteService(params: GetServiceParams): Promise<ApiSuccessResponse<unknown>>;
694
- createAppointment(params: CreateAppointmentParams): Promise<ApiSuccessResponse<unknown>>;
695
- listAppointments(params: ListAppointmentsParams): Promise<ApiSuccessResponse<unknown>>;
696
- updateAppointmentStatus(params: UpdateAppointmentStatusParams): Promise<ApiSuccessResponse<unknown>>;
697
- listAgents(params: ListAgentsParams): Promise<ApiSuccessResponse<unknown>>;
698
- createAgent(params: CreateAgentParams): Promise<ApiSuccessResponse<unknown>>;
699
- getAgent(params: GetAgentParams): Promise<ApiSuccessResponse<unknown>>;
700
- updateAgent(params: UpdateAgentParams): Promise<ApiSuccessResponse<unknown>>;
701
- deleteAgent(params: GetAgentParams): Promise<ApiSuccessResponse<unknown>>;
702
692
  }
703
693
 
704
694
  declare class AppModule {
705
- private readonly http;
706
695
  readonly customer: AppCustomerModule;
707
696
  readonly stats: AppStatsModule;
708
697
  readonly finance: AppFinanceModule;
@@ -721,4 +710,4 @@ declare class AppliteUI {
721
710
  constructor(config?: AppliteUIConfig);
722
711
  }
723
712
 
724
- export { type ApiErrorResponse, type ApiKeyParams, type ApiResponse, type ApiSuccessResponse, type AppCustomer, type AppCustomerAuthParams, type AppCustomerCheckParams, type AppCustomerDetail, type AppCustomerGetParams, type AppCustomerListFewItem, type AppCustomerListItem, type AppCustomerListParams, AppCustomerModule, type AppCustomerUpdateParams, type AppDetail, AppFinanceModule, AppInfoModule, AppModule, type AppScopedParams, AppStatsModule, type AppSummary, AppWelcomeItemModule, AppliteUI, type AppliteUIConfig, type BalanceParams, type CreateAgentParams, type CreateAppParams, type CreateAppointmentParams, type CreateBadgeParams, type CreateCategoryParams, type CreateCollectionParams, type CreateCompanyParams, type CreateDiscountParams, type CreateOptionParams, type CreateOrderParams, type CreateProductParams, type CreateSellerParams, type CreateServiceParams, type CreateShippingProfileParams, type CreateStatisticParams, type CreateTagParams, type CreateTaxParams, type CreateWelcomeItemParams, type DeleteBadgeParams, type EditBadgeParams, type EditCategoryParams, type EditCollectionParams, type EditDiscountParams, type EditOptionParams, type EditOrderParams, type EditProductParams, type EditSellerParams, type EditShippingProfileParams, type EditTagParams, type EditTaxParams, type EditWelcomeItemParams, type GetAgentParams, type GetAppBySlugParams, type GetCategoryParams, type GetCollectionParams, type GetCompanyParams, type GetDiscountParams, type GetOptionParams, type GetOrderParams, type GetProductParams, type GetSellerParams, type GetServiceParams, type GetShippingProfileParams, type GetStatisticParams, type GetTagParams, type GetTaxParams, HttpClient, type HttpClientConfig, type ListAgentsParams, type ListAppointmentsParams, type ListCompaniesParams, type ListServicesParams, MultiServiceModule, type PlateformType, type Sexe, StoreBadgeModule, StoreCategoryModule, StoreCollectionModule, StoreDiscountModule, StoreModule, StoreOptionModule, StoreOrderModule, StoreProductModule, StoreSellerModule, StoreShippingModule, StoreTagModule, StoreTaxModule, type TransactionGetParams, type TransactionListParams, type UpdateAgentParams, type UpdateAppointmentStatusParams, type UpdateCompanyParams, type UpdateServiceParams, type UpdateStatisticParams, type WelcomeItemGetParams, type WelcomeItemParams, type WithdrawParams, plateformTypes, sexes };
713
+ export { type ApiErrorResponse, type ApiKeyParams, type ApiResponse, type ApiSuccessResponse, type AppCustomer, type AppCustomerAuthParams, type AppCustomerCheckParams, type AppCustomerDetail, type AppCustomerGetParams, type AppCustomerListFewItem, type AppCustomerListItem, type AppCustomerListParams, AppCustomerModule, type AppCustomerUpdateParams, type AppDetail, AppFinanceModule, AppInfoModule, AppModule, type AppScopedParams, AppStatsModule, type AppSummary, AppWelcomeItemModule, AppliteUI, type AppliteUIConfig, type BalanceParams, type CreateAgentParams, type CreateAppParams, type CreateAppointmentParams, type CreateBadgeParams, type CreateCategoryParams, type CreateCollectionParams, type CreateCompanyParams, type CreateDiscountParams, type CreateOptionParams, type CreateOrderParams, type CreateProductParams, type CreateSellerParams, type CreateServiceParams, type CreateShippingProfileParams, type CreateStatisticParams, type CreateTagParams, type CreateTaxParams, type CreateWelcomeItemParams, type DeleteBadgeParams, type EditAgentParams, type EditBadgeParams, type EditCategoryParams, type EditCollectionParams, type EditCompanyParams, type EditDiscountParams, type EditOptionParams, type EditOrderParams, type EditProductParams, type EditSellerParams, type EditServiceParams, type EditShippingProfileParams, type EditTagParams, type EditTaxParams, type EditWelcomeItemParams, type GetAgentParams, type GetAppBySlugParams, type GetCategoryParams, type GetCollectionParams, type GetCompanyParams, type GetDiscountParams, type GetOptionParams, type GetOrderParams, type GetProductParams, type GetSellerParams, type GetServiceParams, type GetShippingProfileParams, type GetStatisticParams, type GetTagParams, type GetTaxParams, HttpClient, type HttpClientConfig, type ListAgentsParams, type ListAppointmentsParams, type ListCompaniesParams, type ListServicesParams, MultiServiceAgentModule, MultiServiceAppointmentModule, MultiServiceCompanyModule, MultiServiceModule, MultiServiceServiceModule, type PlateformType, type Sexe, StoreBadgeModule, StoreCategoryModule, StoreCollectionModule, StoreDiscountModule, StoreModule, StoreOptionModule, StoreOrderModule, StoreProductModule, StoreSellerModule, StoreShippingModule, StoreTagModule, StoreTaxModule, type TransactionGetParams, type TransactionListParams, type UpdateAppointmentStatusParams, type UpdateStatisticParams, type WelcomeItemGetParams, type WelcomeItemParams, type WithdrawParams, plateformTypes, sexes };