@posx/core 5.5.109 → 5.5.111

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Francisco Hodge
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Francisco Hodge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,85 +1,85 @@
1
- # 第一阶段
2
- - 1. 创建,更新,删除都是通过 -> Http API
3
- - 2. 读取是通过本地数据库 -> 本地, (例外:订单从云端读取)
4
-
5
- # 第二阶段 (单机版)
6
- 1. 创建,更新,删除,读取都通过本地数据库,然后进行数据和云端同步(Web Worker)
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
- <div align="center">
19
- <img align="center" width="230" src="https://i.imgur.com/iHgtvmg.png" />
20
- <h2>Typescript Library Boilerplate Basic</h2>
21
- <blockquote>Minimal Library Starter Kit for your Typescript projects</blockquote>
22
-
23
- <a href="https://www.npmjs.com/package/@hodgef/ts-library-boilerplate-basic"><img src="https://badgen.net/npm/v/@hodgef/ts-library-boilerplate-basic?color=blue" alt="npm version"></a> <a href="https://github.com/hodgef/ts-library-boilerplate"><img src="https://img.shields.io/github/last-commit/hodgef/ts-library-boilerplate" alt="latest commit"></a> <a href="https://github.com/hodgef/ts-library-boilerplate-basic/actions"><img alt="Build Status" src="https://github.com/hodgef/ts-library-boilerplate-basic/workflows/Build/badge.svg?color=green" /></a> <a href="https://github.com/hodgef/ts-library-boilerplate-basic/actions"> <img alt="Publish Status" src="https://github.com/hodgef/ts-library-boilerplate-basic/workflows/Publish/badge.svg?color=green" /></a>
24
-
25
- <strong>For a plain Javascript alternative, check out [js-library-boilerplate-basic](https://github.com/hodgef/js-library-boilerplate-basic).</strong>
26
-
27
- </div>
28
-
29
- ## ⭐️ Features
30
-
31
- - Webpack 5
32
- - Babel 7
33
- - Hot reloading (`npm start`)
34
- - Automatic Types file generation (index.d.ts)
35
- - UMD exports, so your library works everywhere.
36
- - Jest unit testing
37
- - Customizable file headers for your build [(Example 1)](https://github.com/hodgef/ts-library-boilerplate-basic/blob/master/build/index.js) [(Example2)](https://github.com/hodgef/ts-library-boilerplate-basic/blob/master/build/css/index.css)
38
- - Daily [dependabot](https://dependabot.com) dependency updates
39
-
40
- ## 📦 Getting Started
41
-
42
- ```
43
- git clone https://github.com/hodgef/ts-library-boilerplate-basic.git myLibrary
44
- npm install
45
- ```
46
-
47
- ## 💎 Customization
48
-
49
- > Before shipping, make sure to:
50
-
51
- 1. Edit `LICENSE` file
52
- 2. Edit `package.json` information (These will be used to generate the headers for your built files)
53
- 3. Edit `library: "MyLibrary"` with your library's export name in `./webpack.config.js`
54
-
55
- ## 🚀 Deployment
56
-
57
- 1. `npm publish`
58
- 2. Your users can include your library as usual
59
-
60
- ### npm
61
-
62
- ```
63
- import MyLibrary from 'my-library';
64
- const libraryInstance = new MyLibrary();
65
- ...
66
- ```
67
-
68
- ### self-host/cdn
69
-
70
- ```
71
- <script src="build/index.js"></script>
72
-
73
- const MyLibrary = window.MyLibrary.default;
74
- const libraryInstance = new MyLibrary();
75
- ...
76
- ```
77
-
78
- ## ✅ Libraries built with this boilerplate
79
-
80
- > Made a library using this starter kit? Share it here by [submitting a pull request](https://github.com/hodgef/ts-library-boilerplate-basic/pulls)!
81
-
82
- - [simple-keyboard](https://github.com/hodgef/simple-keyboard) - Javascript Virtual Keyboard
83
- - [react-simple-keyboard](https://github.com/hodgef/react-simple-keyboard) - React Virtual Keyboard
84
- - [simple-keyboard-layouts](https://github.com/hodgef/simple-keyboard-layouts) - Keyboard layouts for simple-keyboard
85
- - [atlas-monaco](https://github.com/datdao/atlas-monaco) - AtlasHCL for monaco editor
1
+ # 第一阶段
2
+ - 1. 创建,更新,删除都是通过 -> Http API
3
+ - 2. 读取是通过本地数据库 -> 本地, (例外:订单从云端读取)
4
+
5
+ # 第二阶段 (单机版)
6
+ 1. 创建,更新,删除,读取都通过本地数据库,然后进行数据和云端同步(Web Worker)
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+ <div align="center">
19
+ <img align="center" width="230" src="https://i.imgur.com/iHgtvmg.png" />
20
+ <h2>Typescript Library Boilerplate Basic</h2>
21
+ <blockquote>Minimal Library Starter Kit for your Typescript projects</blockquote>
22
+
23
+ <a href="https://www.npmjs.com/package/@hodgef/ts-library-boilerplate-basic"><img src="https://badgen.net/npm/v/@hodgef/ts-library-boilerplate-basic?color=blue" alt="npm version"></a> <a href="https://github.com/hodgef/ts-library-boilerplate"><img src="https://img.shields.io/github/last-commit/hodgef/ts-library-boilerplate" alt="latest commit"></a> <a href="https://github.com/hodgef/ts-library-boilerplate-basic/actions"><img alt="Build Status" src="https://github.com/hodgef/ts-library-boilerplate-basic/workflows/Build/badge.svg?color=green" /></a> <a href="https://github.com/hodgef/ts-library-boilerplate-basic/actions"> <img alt="Publish Status" src="https://github.com/hodgef/ts-library-boilerplate-basic/workflows/Publish/badge.svg?color=green" /></a>
24
+
25
+ <strong>For a plain Javascript alternative, check out [js-library-boilerplate-basic](https://github.com/hodgef/js-library-boilerplate-basic).</strong>
26
+
27
+ </div>
28
+
29
+ ## ⭐️ Features
30
+
31
+ - Webpack 5
32
+ - Babel 7
33
+ - Hot reloading (`npm start`)
34
+ - Automatic Types file generation (index.d.ts)
35
+ - UMD exports, so your library works everywhere.
36
+ - Jest unit testing
37
+ - Customizable file headers for your build [(Example 1)](https://github.com/hodgef/ts-library-boilerplate-basic/blob/master/build/index.js) [(Example2)](https://github.com/hodgef/ts-library-boilerplate-basic/blob/master/build/css/index.css)
38
+ - Daily [dependabot](https://dependabot.com) dependency updates
39
+
40
+ ## 📦 Getting Started
41
+
42
+ ```
43
+ git clone https://github.com/hodgef/ts-library-boilerplate-basic.git myLibrary
44
+ npm install
45
+ ```
46
+
47
+ ## 💎 Customization
48
+
49
+ > Before shipping, make sure to:
50
+
51
+ 1. Edit `LICENSE` file
52
+ 2. Edit `package.json` information (These will be used to generate the headers for your built files)
53
+ 3. Edit `library: "MyLibrary"` with your library's export name in `./webpack.config.js`
54
+
55
+ ## 🚀 Deployment
56
+
57
+ 1. `npm publish`
58
+ 2. Your users can include your library as usual
59
+
60
+ ### npm
61
+
62
+ ```
63
+ import MyLibrary from 'my-library';
64
+ const libraryInstance = new MyLibrary();
65
+ ...
66
+ ```
67
+
68
+ ### self-host/cdn
69
+
70
+ ```
71
+ <script src="build/index.js"></script>
72
+
73
+ const MyLibrary = window.MyLibrary.default;
74
+ const libraryInstance = new MyLibrary();
75
+ ...
76
+ ```
77
+
78
+ ## ✅ Libraries built with this boilerplate
79
+
80
+ > Made a library using this starter kit? Share it here by [submitting a pull request](https://github.com/hodgef/ts-library-boilerplate-basic/pulls)!
81
+
82
+ - [simple-keyboard](https://github.com/hodgef/simple-keyboard) - Javascript Virtual Keyboard
83
+ - [react-simple-keyboard](https://github.com/hodgef/react-simple-keyboard) - React Virtual Keyboard
84
+ - [simple-keyboard-layouts](https://github.com/hodgef/simple-keyboard-layouts) - Keyboard layouts for simple-keyboard
85
+ - [atlas-monaco](https://github.com/datdao/atlas-monaco) - AtlasHCL for monaco editor
package/build/index.d.ts CHANGED
@@ -32,17 +32,6 @@ declare module '@posx/core/index' {
32
32
  export * from '@posx/core/types/condition.type';
33
33
  export * from '@posx/core/types/merchant.type';
34
34
 
35
- }
36
- declare module '@posx/core/libs/FindOptions' {
37
- export const Include: (query?: string) => (val: any) => any;
38
- export const In: (query?: never[]) => (val: never) => boolean;
39
- export const Between: (begin: number, end: number) => (val: number) => boolean;
40
- export const Not: (query?: any) => (val: any, values: any) => boolean;
41
- export const Raw: (fn: any) => any;
42
- export const filterByParams: (params: {
43
- [key: string]: any;
44
- }) => (values: any) => boolean;
45
-
46
35
  }
47
36
  declare module '@posx/core/libs/electron.socket' {
48
37
  export class ElectronSocket {
@@ -258,6 +247,17 @@ declare module '@posx/core/libs/escpos.printer' {
258
247
  items: IPrintCommandLine[];
259
248
  }
260
249
 
250
+ }
251
+ declare module '@posx/core/libs/FindOptions' {
252
+ export const Include: (query?: string) => (val: any) => any;
253
+ export const In: (query?: never[]) => (val: never) => boolean;
254
+ export const Between: (begin: number, end: number) => (val: number) => boolean;
255
+ export const Not: (query?: any) => (val: any, values: any) => boolean;
256
+ export const Raw: (fn: any) => any;
257
+ export const filterByParams: (params: {
258
+ [key: string]: any;
259
+ }) => (values: any) => boolean;
260
+
261
261
  }
262
262
  declare module '@posx/core/service.factory' {
263
263
  import { IServiceOptions } from '@posx/core/types/misc.type';
@@ -280,6 +280,7 @@ declare module '@posx/core/service.factory' {
280
280
  print_templates: string;
281
281
  employee_roles: string;
282
282
  order_displays: string;
283
+ storage: string;
283
284
  };
284
285
  export class ServiceFactory {
285
286
  readonly options: IServiceOptions;
@@ -449,6 +450,7 @@ declare module '@posx/core/services/app.service' {
449
450
  import { IPrintCommand } from '@posx/core/libs/escpos.printer';
450
451
  import { QueryBuilder } from '@posx/core/utils/autoquery.utils';
451
452
  import { QueryResponse } from '@posx/core/types/auto.query.type';
453
+ import { TStorage } from '@posx/core/types/storage.type';
452
454
  export type IEmployeeRoleService = IAppRemoteService<IEmployeeRole> & IAppRemoteService<IEmployeeRole>;
453
455
  export type INoteService = IAppRemoteService<INote>;
454
456
  export type INoteGroupService = IAppRemoteService<INoteGroup>;
@@ -976,6 +978,15 @@ declare module '@posx/core/services/app.service' {
976
978
  private getCodepageByCountryCode;
977
979
  private renderPrintCommand;
978
980
  }
981
+ export type TStorageService<T = Record<string, unknown>> = IAppRemoteService<TStorage<T>>;
982
+ export class StorageService<T = Record<string, unknown>> extends AppRemoteService<TStorage<T>> implements TStorageService<T> {
983
+ readonly http: AxiosInstance;
984
+ readonly db: Dexie;
985
+ readonly options: IServiceOptions;
986
+ readonly moduleName: string;
987
+ readonly methodName: string;
988
+ constructor(http: AxiosInstance, db: Dexie, options: IServiceOptions, moduleName?: string, methodName?: string);
989
+ }
979
990
 
980
991
  }
981
992
  declare module '@posx/core/services/invoice.service' {
@@ -3115,7 +3126,8 @@ declare module '@posx/core/types/misc.type' {
3115
3126
  OrderDisplaySystem = "ods_",
3116
3127
  Charge = "chr_",
3117
3128
  Price = "prc_",
3118
- ComboGroup = "cbo_"
3129
+ ComboGroup = "cbo_",
3130
+ Storage = "sto_"
3119
3131
  }
3120
3132
  export enum ModelType {
3121
3133
  Merchant = "mnt",
@@ -4418,7 +4430,7 @@ declare module '@posx/core/types/section.type' {
4418
4430
  /** Number of persons */
4419
4431
  pax: number;
4420
4432
  /** Invoice created timestamp */
4421
- invoice_created_at: string;
4433
+ invoice_created_at: Date;
4422
4434
  /** Number of child persons */
4423
4435
  child_pax: number;
4424
4436
  /** Number of baby persons */
@@ -4450,7 +4462,7 @@ declare module '@posx/core/types/section.type' {
4450
4462
  total: number;
4451
4463
  time: number;
4452
4464
  pax: number;
4453
- invoice_created_at: string;
4465
+ invoice_created_at: Date;
4454
4466
  child_pax: number;
4455
4467
  baby_pax: number;
4456
4468
  uid: string;
@@ -4541,6 +4553,15 @@ declare module '@posx/core/types/shift.type' {
4541
4553
  constructor();
4542
4554
  }
4543
4555
 
4556
+ }
4557
+ declare module '@posx/core/types/storage.type' {
4558
+ import { AppBaseModel, IAppBaseModel } from '@posx/core/types/abstract.type';
4559
+ export type TStorage<T = Record<string, unknown>> = IAppBaseModel & T;
4560
+ export class Storage<T = Record<string, unknown>> extends AppBaseModel {
4561
+ uid: string;
4562
+ constructor(extensions?: Partial<T>);
4563
+ }
4564
+
4544
4565
  }
4545
4566
  declare module '@posx/core/types/wyo.coupon.type' {
4546
4567
  enum ApplyingType {