@posx/core 5.5.379 → 5.5.381
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/build/index.d.ts +45 -38
- package/build/index.js +5 -6351
- package/jest.config.cjs +1 -1
- package/package.json +2 -3
- package/package.publish.json +3 -4
- package/tsdown.config.ts +2 -0
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
1
2
|
import { QueryBuilder, QueryResponse } from "@litepos/autoquery";
|
|
2
3
|
|
|
3
4
|
//#region src/types/wyo.customer.type.d.ts
|
|
@@ -1496,7 +1497,7 @@ interface IAppRemoteService<T extends IAppCoreModel> extends IAppCoreService<T>
|
|
|
1496
1497
|
hardDeleteOne(model: T): Promise<T>;
|
|
1497
1498
|
}
|
|
1498
1499
|
declare class AppRemoteService<T extends IAppCoreModel> extends AppCoreService<T> implements IAppRemoteService<T> {
|
|
1499
|
-
protected readonly http: AxiosInstance
|
|
1500
|
+
protected readonly http: AxiosInstance;
|
|
1500
1501
|
readonly moduleName: string;
|
|
1501
1502
|
protected readonly methodName: string;
|
|
1502
1503
|
protected readonly options: IServiceOptions;
|
|
@@ -2453,6 +2454,10 @@ interface IPaymentMethod extends IAppBaseModel, IAppModelSequence {
|
|
|
2453
2454
|
api_key: string;
|
|
2454
2455
|
/** Is Sales Exclusive */
|
|
2455
2456
|
is_sales_exclusive: boolean;
|
|
2457
|
+
/** Requires invoice.minus_credit > 0 for validation */
|
|
2458
|
+
enable_credit_validation: boolean;
|
|
2459
|
+
/** Requires invoice.customer_id > 0 for validation */
|
|
2460
|
+
enable_customer_validation: boolean;
|
|
2456
2461
|
}
|
|
2457
2462
|
interface IPaymentMethodHistory extends IPaymentMethod {
|
|
2458
2463
|
changed_at: Date;
|
|
@@ -2478,6 +2483,8 @@ declare class PaymentMethod extends AppBaseModel implements IPaymentMethod {
|
|
|
2478
2483
|
api_id: string;
|
|
2479
2484
|
api_key: string;
|
|
2480
2485
|
is_sales_exclusive: boolean;
|
|
2486
|
+
enable_credit_validation: boolean;
|
|
2487
|
+
enable_customer_validation: boolean;
|
|
2481
2488
|
uid: string;
|
|
2482
2489
|
constructor();
|
|
2483
2490
|
}
|
|
@@ -4363,12 +4370,12 @@ type INoteGroupService = IAppRemoteService<INoteGroup>;
|
|
|
4363
4370
|
type ISectionService = IAppRemoteService<ISection>;
|
|
4364
4371
|
type ISubcategoryService = IAppRemoteService<ISubcategory>;
|
|
4365
4372
|
declare class EmployeeRoleService extends AppRemoteService<IEmployeeRole> implements IEmployeeRoleService {
|
|
4366
|
-
readonly http: AxiosInstance
|
|
4373
|
+
readonly http: AxiosInstance;
|
|
4367
4374
|
readonly db: Dexie;
|
|
4368
4375
|
readonly options: IServiceOptions;
|
|
4369
4376
|
readonly moduleName: string;
|
|
4370
4377
|
readonly methodName: string;
|
|
4371
|
-
constructor(http: AxiosInstance
|
|
4378
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4372
4379
|
}
|
|
4373
4380
|
/**
|
|
4374
4381
|
* Represents a service for managing items.
|
|
@@ -4542,12 +4549,12 @@ interface IItemService extends IAppRemoteService<IItem> {
|
|
|
4542
4549
|
copyModifierGroupToItems(sourceModifierCategory: ICoreCategory, sourceModifiers: ICoreItem[], targetItems: IItem[]): Promise<IItem[]>;
|
|
4543
4550
|
}
|
|
4544
4551
|
declare class ItemService extends AppRemoteService<IItem> implements IItemService {
|
|
4545
|
-
readonly http: AxiosInstance
|
|
4552
|
+
readonly http: AxiosInstance;
|
|
4546
4553
|
readonly db: Dexie;
|
|
4547
4554
|
readonly options: IServiceOptions;
|
|
4548
4555
|
readonly moduleName: string;
|
|
4549
4556
|
readonly methodName: string;
|
|
4550
|
-
constructor(http: AxiosInstance
|
|
4557
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4551
4558
|
search(query: string): Promise<IItem[]>;
|
|
4552
4559
|
addModifierCategory(item: IItem, category: ICoreCategory): Promise<IItem>;
|
|
4553
4560
|
updateModifierCategory(item: IItem, category: ICoreCategory): Promise<IItem>;
|
|
@@ -4598,12 +4605,12 @@ interface ICategoryService extends IAppRemoteService<ICategory> {
|
|
|
4598
4605
|
removeSubcategory(category: ICategory, subcategoryUid: string): Promise<ICategory>;
|
|
4599
4606
|
}
|
|
4600
4607
|
declare class CategoryService extends AppRemoteService<Category> {
|
|
4601
|
-
readonly http: AxiosInstance
|
|
4608
|
+
readonly http: AxiosInstance;
|
|
4602
4609
|
readonly db: Dexie;
|
|
4603
4610
|
readonly options: IServiceOptions;
|
|
4604
4611
|
readonly moduleName: string;
|
|
4605
4612
|
readonly methodName: string;
|
|
4606
|
-
constructor(http: AxiosInstance
|
|
4613
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4607
4614
|
addSubcategory(category: ICategory, subcategory: ISubcategory): Promise<ICategory>;
|
|
4608
4615
|
updateSubcategory(category: ICategory, subcategory: ISubcategory): Promise<ICategory>;
|
|
4609
4616
|
removeSubcategory(category: ICategory, subcategoryUid: string): Promise<ICategory>;
|
|
@@ -4632,12 +4639,12 @@ interface IConfigService extends IAppRemoteService<IAppConfig> {
|
|
|
4632
4639
|
uploadFile(file: File): Promise<IFileUploadResponse>;
|
|
4633
4640
|
}
|
|
4634
4641
|
declare class ConfigService extends AppRemoteService<IAppConfig> implements IConfigService {
|
|
4635
|
-
readonly http: AxiosInstance
|
|
4642
|
+
readonly http: AxiosInstance;
|
|
4636
4643
|
readonly db: Dexie;
|
|
4637
4644
|
readonly options: IServiceOptions;
|
|
4638
4645
|
readonly moduleName: string;
|
|
4639
4646
|
readonly methodName: string;
|
|
4640
|
-
constructor(http: AxiosInstance
|
|
4647
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4641
4648
|
private configFactories;
|
|
4642
4649
|
updateConfig<T extends keyof IConfig>(configKey: T, options: Partial<IConfig[T]>): Promise<IAppConfig>;
|
|
4643
4650
|
updateGeneralConfig(options: UpdateGeneralConfigOptions): Promise<IAppConfig>;
|
|
@@ -4645,32 +4652,32 @@ declare class ConfigService extends AppRemoteService<IAppConfig> implements ICon
|
|
|
4645
4652
|
uploadFile(file: File): Promise<IFileUploadResponse>;
|
|
4646
4653
|
}
|
|
4647
4654
|
declare class SectionService extends AppRemoteService<ISection> implements ISectionService {
|
|
4648
|
-
readonly http: AxiosInstance
|
|
4655
|
+
readonly http: AxiosInstance;
|
|
4649
4656
|
readonly db: Dexie;
|
|
4650
4657
|
readonly options: IServiceOptions;
|
|
4651
4658
|
readonly moduleName: string;
|
|
4652
4659
|
readonly methodName: string;
|
|
4653
|
-
constructor(http: AxiosInstance
|
|
4660
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4654
4661
|
}
|
|
4655
4662
|
declare class SectionItemService extends AppRemoteService<ISectionItem> implements ISectionItemService {
|
|
4656
|
-
readonly http: AxiosInstance
|
|
4663
|
+
readonly http: AxiosInstance;
|
|
4657
4664
|
readonly db: Dexie;
|
|
4658
4665
|
readonly options: IServiceOptions;
|
|
4659
4666
|
readonly moduleName: string;
|
|
4660
4667
|
readonly methodName: string;
|
|
4661
|
-
constructor(http: AxiosInstance
|
|
4668
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4662
4669
|
changeToTakeOut(uid: string): Promise<ISectionItem>;
|
|
4663
4670
|
reset(sectionItem: ISectionItem): void;
|
|
4664
4671
|
syncInvoiceData(sectionItem: ISectionItem, invoice: IInvoice): void;
|
|
4665
4672
|
}
|
|
4666
4673
|
type IProductService = IAppRemoteService<IItem>;
|
|
4667
4674
|
declare class ProductService extends AppRemoteService<IItem> implements IProductService {
|
|
4668
|
-
readonly http: AxiosInstance
|
|
4675
|
+
readonly http: AxiosInstance;
|
|
4669
4676
|
readonly db: Dexie;
|
|
4670
4677
|
readonly options: IServiceOptions;
|
|
4671
4678
|
readonly moduleName: string;
|
|
4672
4679
|
readonly methodName: string;
|
|
4673
|
-
constructor(http: AxiosInstance
|
|
4680
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4674
4681
|
}
|
|
4675
4682
|
interface IShiftService extends IAppRemoteService<IShift> {
|
|
4676
4683
|
closeShift(declareAmount: number, userUid: string): Promise<IShift>;
|
|
@@ -4679,13 +4686,13 @@ interface IShiftService extends IAppRemoteService<IShift> {
|
|
|
4679
4686
|
cashOut(amount: number, note: string): Promise<ITill>;
|
|
4680
4687
|
}
|
|
4681
4688
|
declare class ShiftService extends AppRemoteService<IShift> implements IShiftService {
|
|
4682
|
-
readonly http: AxiosInstance
|
|
4689
|
+
readonly http: AxiosInstance;
|
|
4683
4690
|
readonly db: Dexie;
|
|
4684
4691
|
readonly options: IServiceOptions;
|
|
4685
4692
|
readonly moduleName: string;
|
|
4686
4693
|
readonly methodName: string;
|
|
4687
4694
|
private tillService;
|
|
4688
|
-
constructor(http: AxiosInstance
|
|
4695
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4689
4696
|
cashIn(amount: number, note: string): Promise<ITill>;
|
|
4690
4697
|
cashOut(amount: number, note: string): Promise<ITill>;
|
|
4691
4698
|
closeShift(declareAmount: number, userUid: string): Promise<IShift>;
|
|
@@ -4709,12 +4716,12 @@ interface ITillService extends IAppRemoteService<ITill> {
|
|
|
4709
4716
|
createCashInvoiceTill(payments: IPayment[], shift_uid: string, user_uid: string, note?: string, invoice_uid?: string): ITill;
|
|
4710
4717
|
}
|
|
4711
4718
|
declare class TillService extends AppRemoteService<ITill> implements ITillService {
|
|
4712
|
-
readonly http: AxiosInstance
|
|
4719
|
+
readonly http: AxiosInstance;
|
|
4713
4720
|
readonly db: Dexie;
|
|
4714
4721
|
readonly options: IServiceOptions;
|
|
4715
4722
|
readonly moduleName: string;
|
|
4716
4723
|
readonly methodName: string;
|
|
4717
|
-
constructor(http: AxiosInstance
|
|
4724
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4718
4725
|
createCashInvoiceTill(payments: IPayment[], shift_uid: string, user_uid: string, note?: string, invoice_uid?: string): ITill;
|
|
4719
4726
|
}
|
|
4720
4727
|
/**
|
|
@@ -4749,12 +4756,12 @@ interface IPaymentMethodService extends IAppRemoteService<IPaymentMethod> {
|
|
|
4749
4756
|
changeSequence(paymentMethod: IPaymentMethod, sequence: number): Promise<IPaymentMethod>;
|
|
4750
4757
|
}
|
|
4751
4758
|
declare class PaymentMethodService extends AppRemoteService<IPaymentMethod> implements IPaymentMethodService {
|
|
4752
|
-
readonly http: AxiosInstance
|
|
4759
|
+
readonly http: AxiosInstance;
|
|
4753
4760
|
readonly db: Dexie;
|
|
4754
4761
|
readonly options: IServiceOptions;
|
|
4755
4762
|
readonly moduleName: string;
|
|
4756
4763
|
readonly methodName: string;
|
|
4757
|
-
constructor(http: AxiosInstance
|
|
4764
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4758
4765
|
syncStandardPaymentMethods(): Promise<IPaymentMethod[]>;
|
|
4759
4766
|
enablePaymentMethod(paymentMethod: IPaymentMethod): Promise<IPaymentMethod>;
|
|
4760
4767
|
disablePaymentMethod(paymentMethod: IPaymentMethod): Promise<IPaymentMethod>;
|
|
@@ -4782,12 +4789,12 @@ interface IPaymentService extends IAppRemoteService<IPayment> {
|
|
|
4782
4789
|
removePayment(invoice: IInvoice, payment_uid: string): Promise<IInvoice>;
|
|
4783
4790
|
}
|
|
4784
4791
|
declare class PaymentService extends AppRemoteService<IPayment> implements IPaymentService {
|
|
4785
|
-
readonly http: AxiosInstance
|
|
4792
|
+
readonly http: AxiosInstance;
|
|
4786
4793
|
readonly db: Dexie;
|
|
4787
4794
|
readonly options: IServiceOptions;
|
|
4788
4795
|
readonly moduleName: string;
|
|
4789
4796
|
readonly methodName: string;
|
|
4790
|
-
constructor(http: AxiosInstance
|
|
4797
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4791
4798
|
addPayment(invoice: IInvoice, amount: number, paymentMethod: IPaymentMethod): Promise<IInvoice>;
|
|
4792
4799
|
removePayment(invoice: IInvoice, payment_uid: string): Promise<IInvoice>;
|
|
4793
4800
|
}
|
|
@@ -4832,7 +4839,7 @@ interface IAppReportService extends IAppRemoteService<IAppReport> {
|
|
|
4832
4839
|
printReport(request: IReportRequest): Promise<void>;
|
|
4833
4840
|
}
|
|
4834
4841
|
declare class AppReportService extends AppRemoteService<IAppReport> implements IAppReportService {
|
|
4835
|
-
readonly http: AxiosInstance
|
|
4842
|
+
readonly http: AxiosInstance;
|
|
4836
4843
|
readonly db: Dexie;
|
|
4837
4844
|
readonly options: IServiceOptions;
|
|
4838
4845
|
readonly moduleName: string;
|
|
@@ -4844,7 +4851,7 @@ declare class AppReportService extends AppRemoteService<IAppReport> implements I
|
|
|
4844
4851
|
private printTemplateService;
|
|
4845
4852
|
private printJobService;
|
|
4846
4853
|
private configService;
|
|
4847
|
-
constructor(http: AxiosInstance
|
|
4854
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4848
4855
|
syncStandardReports(): Promise<IAppReport>;
|
|
4849
4856
|
printReport(request: IReportRequest): Promise<void>;
|
|
4850
4857
|
private getReportData;
|
|
@@ -4865,23 +4872,23 @@ type IPrintJobService = IAppRemoteService<IPrintJob> & {
|
|
|
4865
4872
|
replacePrinter(printJob: IPrintJob, printer: IPrinter): IPrintJob;
|
|
4866
4873
|
};
|
|
4867
4874
|
declare class PrintJobService extends AppRemoteService<IPrintJob> implements IPrintJobService {
|
|
4868
|
-
readonly http: AxiosInstance
|
|
4875
|
+
readonly http: AxiosInstance;
|
|
4869
4876
|
readonly db: Dexie;
|
|
4870
4877
|
readonly options: IServiceOptions;
|
|
4871
4878
|
readonly moduleName: string;
|
|
4872
4879
|
readonly methodName: string;
|
|
4873
|
-
constructor(http: AxiosInstance
|
|
4880
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4874
4881
|
autoquery(builder: QueryBuilder<IPrintJob>): Promise<QueryResponse<IPrintJob>>;
|
|
4875
4882
|
replacePrinter(printJob: IPrintJob, printer: IPrinter): IPrintJob;
|
|
4876
4883
|
}
|
|
4877
4884
|
type IMenuService = IAppRemoteService<IMenu>;
|
|
4878
4885
|
declare class MenuService extends AppRemoteService<IMenu> implements IMenuService {
|
|
4879
|
-
readonly http: AxiosInstance
|
|
4886
|
+
readonly http: AxiosInstance;
|
|
4880
4887
|
readonly db: Dexie;
|
|
4881
4888
|
readonly options: IServiceOptions;
|
|
4882
4889
|
readonly moduleName: string;
|
|
4883
4890
|
readonly methodName: string;
|
|
4884
|
-
constructor(http: AxiosInstance
|
|
4891
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4885
4892
|
}
|
|
4886
4893
|
interface IPrintTemplateService extends IAppRemoteService<IPrintTemplate> {
|
|
4887
4894
|
/**
|
|
@@ -4914,14 +4921,14 @@ interface IPrintTemplateService extends IAppRemoteService<IPrintTemplate> {
|
|
|
4914
4921
|
renderPrintTemplateByData(template: IPrintTemplate, templateData: ITemplateData, options?: IRenderPrintTemplateOptions): Promise<IPrintCommand>;
|
|
4915
4922
|
}
|
|
4916
4923
|
declare class PrintTemplateService extends AppRemoteService<IPrintTemplate> implements IPrintTemplateService {
|
|
4917
|
-
readonly http: AxiosInstance
|
|
4924
|
+
readonly http: AxiosInstance;
|
|
4918
4925
|
readonly db: Dexie;
|
|
4919
4926
|
readonly options: IServiceOptions;
|
|
4920
4927
|
readonly moduleName: string;
|
|
4921
4928
|
readonly methodName: string;
|
|
4922
|
-
httpClient: AxiosInstance
|
|
4929
|
+
httpClient: AxiosInstance;
|
|
4923
4930
|
private secretKey;
|
|
4924
|
-
constructor(http: AxiosInstance
|
|
4931
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4925
4932
|
initialize(): Promise<void>;
|
|
4926
4933
|
renderPrintTemplate(invoice: IInvoice, config: IConfig, template: IPrintTemplate, options?: RenderPrintTemplateOptions): Promise<IPrintCommand>;
|
|
4927
4934
|
renderReportPrintTemplate(reportData: ReportData, config: IConfig, template: IPrintTemplate, options?: RenderPrintTemplateOptions): Promise<IPrintCommand>;
|
|
@@ -4932,12 +4939,12 @@ declare class PrintTemplateService extends AppRemoteService<IPrintTemplate> impl
|
|
|
4932
4939
|
}
|
|
4933
4940
|
type TStorageService<T = Record<string, unknown>> = IAppRemoteService<IStorage<T>>;
|
|
4934
4941
|
declare class StorageService<T = Record<string, unknown>> extends AppRemoteService<IStorage<T>> implements TStorageService<T> {
|
|
4935
|
-
readonly http: AxiosInstance
|
|
4942
|
+
readonly http: AxiosInstance;
|
|
4936
4943
|
readonly db: Dexie;
|
|
4937
4944
|
readonly options: IServiceOptions;
|
|
4938
4945
|
readonly moduleName: string;
|
|
4939
4946
|
readonly methodName: string;
|
|
4940
|
-
constructor(http: AxiosInstance
|
|
4947
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
4941
4948
|
}
|
|
4942
4949
|
//#endregion
|
|
4943
4950
|
//#region src/service.factory.d.ts
|
|
@@ -5033,7 +5040,7 @@ interface IPrinterService extends IAppRemoteService<IPrinter> {
|
|
|
5033
5040
|
openCashDrawer(): Promise<void>;
|
|
5034
5041
|
}
|
|
5035
5042
|
declare class PrinterService extends AppRemoteService<IPrinter> implements IPrinterService {
|
|
5036
|
-
readonly http: AxiosInstance
|
|
5043
|
+
readonly http: AxiosInstance;
|
|
5037
5044
|
readonly db: Dexie;
|
|
5038
5045
|
readonly options: IServiceOptions;
|
|
5039
5046
|
readonly moduleName: string;
|
|
@@ -5041,7 +5048,7 @@ declare class PrinterService extends AppRemoteService<IPrinter> implements IPrin
|
|
|
5041
5048
|
private configService;
|
|
5042
5049
|
protected printJobService: PrintJobService;
|
|
5043
5050
|
private printersFromCache;
|
|
5044
|
-
constructor(http: AxiosInstance
|
|
5051
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
5045
5052
|
private init;
|
|
5046
5053
|
getPhysicalPrintersFromNode(): Promise<INodePrinter[]>;
|
|
5047
5054
|
getUnpairedNode(): Promise<CustomResponse<INode>>;
|
|
@@ -5097,12 +5104,12 @@ interface IOrderDisplayService extends IAppRemoteService<IOrderDisplay> {
|
|
|
5097
5104
|
undo(): Promise<IOrderDisplay>;
|
|
5098
5105
|
}
|
|
5099
5106
|
declare class OrderDisplayService extends AppRemoteService<IOrderDisplay> implements IOrderDisplayService {
|
|
5100
|
-
readonly http: AxiosInstance
|
|
5107
|
+
readonly http: AxiosInstance;
|
|
5101
5108
|
readonly db: Dexie;
|
|
5102
5109
|
readonly options: IServiceOptions;
|
|
5103
5110
|
readonly moduleName: string;
|
|
5104
5111
|
readonly methodName: string;
|
|
5105
|
-
constructor(http: AxiosInstance
|
|
5112
|
+
constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
|
|
5106
5113
|
toPickUp(uid: string): Promise<IOrderDisplay>;
|
|
5107
5114
|
toPreparing(uid: string): Promise<IOrderDisplay>;
|
|
5108
5115
|
undo(): Promise<IOrderDisplay>;
|