@posx/core 5.5.301 → 5.5.304

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 CHANGED
@@ -222,7 +222,6 @@ declare module '@posx/core/helpers/string.helpers' {
222
222
 
223
223
  }
224
224
  declare module '@posx/core/index' {
225
- export * from '@posx/core/types/auto.query.type';
226
225
  export * from '@posx/core/types/wyo.customer.type';
227
226
  export * from '@posx/core/types/wyo.coupon.type';
228
227
  export * from '@posx/core/types/shift.type';
@@ -251,7 +250,6 @@ declare module '@posx/core/index' {
251
250
  export * from '@posx/core/types/ods.type';
252
251
  export * from '@posx/core/types/csv.type';
253
252
  export { createCSVExport, importFromCSV } from '@posx/core/utils/csv.utils';
254
- export * from '@posx/core/utils/autoquery.utils';
255
253
  export * from '@posx/core/libs/electron.socket';
256
254
  export * from '@posx/core/types/condition.type';
257
255
  export * from '@posx/core/types/merchant.type';
@@ -684,10 +682,9 @@ declare module '@posx/core/services/app.service' {
684
682
  import { IAppCoreModel } from '@posx/core/types/abstract.type';
685
683
  import { IAppReport, IReportData, IReportRequest, ReportData } from '@posx/core/types/report.type';
686
684
  import { IPrintCommand } from '@posx/core/libs/escpos.printer';
687
- import { QueryBuilder } from '@posx/core/utils/autoquery.utils';
688
- import { QueryResponse } from '@posx/core/types/auto.query.type';
689
685
  import { IStorage } from '@posx/core/types/storage.type';
690
686
  import { IMenu } from '@posx/core/types/menu.type';
687
+ import { QueryBuilder, QueryResponse } from '@litepos/autoquery';
691
688
  export type IEmployeeRoleService = IAppRemoteService<IEmployeeRole> & IAppRemoteService<IEmployeeRole>;
692
689
  export type INoteService = IAppRemoteService<INote>;
693
690
  export type INoteGroupService = IAppRemoteService<INoteGroup>;
@@ -1270,13 +1267,12 @@ declare module '@posx/core/services/invoice.service' {
1270
1267
  import Dexie from 'dexie';
1271
1268
  import { SwitchInvoiceOptions, PayInvoiceOptions, VoidInvoiceOptions, UpdateInvoiceOptions } from '@posx/core/types/invoice.type';
1272
1269
  import { ITill } from '@posx/core/types/shift.type';
1273
- import { QueryResponse } from '@posx/core/types/auto.query.type';
1274
1270
  import { IChangePaymentMethodOption } from '@posx/core/types/payment.type';
1275
1271
  import { PrinterService } from '@posx/core/services/printer.service';
1276
1272
  import { IPrintJob, IPrinter, PrintJob, PrinterType } from '@posx/core/types/printer.type';
1277
1273
  import { IEmployee } from '@posx/core/types/employee.type';
1278
- import { QueryBuilder } from '@posx/core/utils/autoquery.utils';
1279
1274
  import { ICouponItemized } from '@posx/core/types/wyo.coupon.type';
1275
+ import { QueryBuilder, QueryResponse } from '@litepos/autoquery';
1280
1276
  export interface IInvoiceBaseService extends IAppRemoteService<IInvoice> {
1281
1277
  calculate(invoice: IInvoice, appConfig: IAppConfig, disableRounding?: boolean): IInvoice;
1282
1278
  calculateLines(invoice: IInvoice): void;
@@ -2210,156 +2206,6 @@ declare module '@posx/core/types/abstract.type' {
2210
2206
  export type IAppBase = Omit<IAppBaseModel, "id_in_server" | "_timestamp">;
2211
2207
  export type IAppExtra = Omit<IAppExtraModel, "id_in_server" | "_timestamp">;
2212
2208
 
2213
- }
2214
- declare module '@posx/core/types/auto.query.type' {
2215
- /**
2216
- * The IBaseParams interface provides a structure for query parameters commonly used
2217
- * in API requests to manipulate the presentation and organization of returned data.
2218
- *
2219
- * @property {string} [skip] - The number of records to skip before starting to collect the response set.
2220
- * @property {string} [take] - The limit on the number of records to return in the response set.
2221
- * @property {string} [format] - The desired format of the response (e.g., 'json', 'xml').
2222
- * @property {string} [include] - A way to include data from related tables/entities.
2223
- * @property {string} [jsconfig] - JavaScript configuration for client-side handling of the response.
2224
- * @property {string} [orderBy] - A parameter to specify the field to order the results by in ascending order.
2225
- * @property {string} [orderByDesc] - A parameter to specify the field to order the results by in descending order.
2226
- */
2227
- export interface IBaseParams {
2228
- skip?: number;
2229
- take?: number;
2230
- format?: string;
2231
- include?: string;
2232
- jsconfig?: string;
2233
- orderBy?: string;
2234
- orderByDesc?: string;
2235
- }
2236
- export interface IInvoiceParams extends IBaseParams {
2237
- RefIdContains?: string;
2238
- GrandTotal?: number;
2239
- StatusContains?: string;
2240
- PaidAtAfter?: string;
2241
- PaidAtBefore?: string;
2242
- PaidAtStartsWith?: string;
2243
- }
2244
- export interface IInvoicesQuery {
2245
- params: IInvoiceParams;
2246
- }
2247
- export class InvoicesQuery implements IInvoicesQuery {
2248
- params: {
2249
- format: string;
2250
- Include: string;
2251
- jsconfig: string;
2252
- };
2253
- constructor(params: IInvoiceParams);
2254
- }
2255
- export interface IQueryResponse<T> {
2256
- offset?: number;
2257
- total?: number;
2258
- results?: T[];
2259
- meta?: {
2260
- [index: string]: string;
2261
- };
2262
- responseStatus?: ResponseStatus;
2263
- }
2264
- export interface ResponseStatus {
2265
- errorCode?: string;
2266
- message?: string;
2267
- stackTrace?: string;
2268
- errors?: ValidationError[];
2269
- }
2270
- export interface ValidationError {
2271
- errorCode?: string;
2272
- fieldName?: string;
2273
- message?: string;
2274
- }
2275
- export class QueryResponse<T> {
2276
- offset?: number;
2277
- total?: number;
2278
- results?: T[];
2279
- meta?: {
2280
- [index: string]: string;
2281
- };
2282
- responseStatus?: ResponseStatus;
2283
- }
2284
- export enum SortOrder {
2285
- Asc = "asc",
2286
- Desc = "desc"
2287
- }
2288
- export type EnumToString<T> = T extends string ? string : T;
2289
- export type QueryableType<T> = {
2290
- [K in keyof T]: T[K] extends Date ? Date : T[K] extends number ? number : EnumToString<T[K]>;
2291
- };
2292
- export type Operator<T> = T extends number ? keyof typeof NumericOperators | keyof typeof NullOperators : T extends Date ? keyof typeof DateOperators | keyof typeof NullOperators : T extends string ? keyof typeof StringOperators | keyof typeof ArrayOperators | keyof typeof NullOperators : string extends T ? keyof typeof StringOperators | keyof typeof ArrayOperators | keyof typeof NullOperators : keyof typeof NullOperators;
2293
- export type OperatorValueMap<T = any> = {
2294
- [K in Operator<T>]: T extends Date ? (K extends keyof typeof DateOperators ? DateOperatorValueMap[K] : K extends keyof typeof NullOperators ? boolean : never) : T extends number ? (K extends keyof typeof NumericOperators ? number : K extends keyof typeof NullOperators ? boolean : never) : T extends string ? (K extends keyof typeof StringOperators ? string : K extends keyof typeof ArrayOperators ? string[] : K extends keyof typeof NullOperators ? boolean : never) : string extends T ? (K extends keyof typeof StringOperators ? string : K extends keyof typeof ArrayOperators ? string[] : K extends keyof typeof NullOperators ? boolean : never) : K extends keyof typeof NullOperators ? boolean : never;
2295
- };
2296
- export enum NumericOperators {
2297
- '>' = 0,
2298
- '>=' = 1,
2299
- '<' = 2,
2300
- '<=' = 3,
2301
- '=' = 4,
2302
- 'GreaterThan' = 5,
2303
- 'GreaterThanOrEqualTo' = 6,
2304
- 'LessThan' = 7,
2305
- 'LessThanOrEqualTo' = 8,
2306
- 'EqualTo' = 9,
2307
- 'NotEqualTo' = 10
2308
- }
2309
- export enum StringOperators {
2310
- 'Contains' = 0,
2311
- 'NotContains' = 1,
2312
- 'StartsWith' = 2,
2313
- 'EndsWith' = 3,
2314
- "Like" = 4
2315
- }
2316
- export enum ArrayOperators {
2317
- 'In' = 0,
2318
- 'NotIn' = 1
2319
- }
2320
- export enum NullOperators {
2321
- 'IsNull' = 0,
2322
- 'IsNotNull' = 1
2323
- }
2324
- export enum MonthOperator {
2325
- WithinAMonth = "Contains"
2326
- }
2327
- export enum DayOperator {
2328
- At = "StartsWith"
2329
- }
2330
- export enum DateOperators {
2331
- 'GreaterThan' = 0,
2332
- 'GreaterThanOrEqualTo' = 1,
2333
- 'LessThan' = 2,
2334
- 'LessThanOrEqualTo' = 3,
2335
- 'Between' = 4,
2336
- 'StartsWith' = 5,
2337
- 'Contains' = 6
2338
- }
2339
- export type DateOperatorValueMap = {
2340
- 'GreaterThan': string;
2341
- 'GreaterThanOrEqualTo': string;
2342
- 'LessThan': string;
2343
- 'LessThanOrEqualTo': string;
2344
- 'Between': [string, string];
2345
- 'StartsWith': string;
2346
- 'Contains': MonthValues;
2347
- };
2348
- export enum MonthValues {
2349
- Jan = "-01-",
2350
- Feb = "-02-",
2351
- Mar = "-03-",
2352
- Apr = "-04-",
2353
- May = "-05-",
2354
- Jun = "-06-",
2355
- Jul = "-07-",
2356
- Aug = "-08-",
2357
- Sep = "-09-",
2358
- Oct = "-10-",
2359
- Nov = "-11-",
2360
- Dec = "-12-"
2361
- }
2362
-
2363
2209
  }
2364
2210
  declare module '@posx/core/types/condition.type' {
2365
2211
  export enum Condition {
@@ -4083,6 +3929,7 @@ declare module '@posx/core/types/printer.type' {
4083
3929
  yeahpay_client_private_key: string;
4084
3930
  yeahpay_signature_key: string;
4085
3931
  yeahpay_async_url: string;
3932
+ yeahpay_print_copies?: number;
4086
3933
  };
4087
3934
  export type INode = IDevice;
4088
3935
  export class Device extends AppBaseModel implements IDevice {
@@ -5586,25 +5433,6 @@ declare module '@posx/core/types/wyo.customer.type' {
5586
5433
  constructor();
5587
5434
  }
5588
5435
 
5589
- }
5590
- declare module '@posx/core/utils/autoquery.utils' {
5591
- import { Operator, OperatorValueMap, QueryableType, SortOrder } from '@posx/core/types/auto.query.type';
5592
- export class QueryBuilder<T> {
5593
- private params;
5594
- addParam<K extends keyof T, O extends Operator<QueryableType<T>[K]>>(property: K, operator: O, value: OperatorValueMap<QueryableType<T>[K]>[O]): this;
5595
- addRawParam(key: string, value: string): this;
5596
- includeTotal(flag: boolean): this;
5597
- skip(skip: number): this;
5598
- take(take: number): this;
5599
- sortBy<K extends keyof T>(property: K, orderBy: SortOrder): this;
5600
- jsconfig(param: string): this;
5601
- /** @internal */
5602
- _build(): Record<string, string>;
5603
- }
5604
- export type QueryEtcParams = {
5605
- search_keywords?: string;
5606
- };
5607
-
5608
5436
  }
5609
5437
  declare module '@posx/core/utils/csv.utils' {
5610
5438
  import { ICategory, IItem } from '@posx/core/types/product.type';