@posx/core 5.5.275 → 5.5.277
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/CLAUDE.md +21 -21
- package/LICENSE +21 -21
- package/README.md +85 -85
- package/build/index.d.ts +23 -11
- package/build/index.js +1 -1
- package/jest.setup.js +80 -80
- package/package.json +1 -1
- package/package.publish.json +116 -116
package/CLAUDE.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# Claude AI Development Guidelines
|
|
2
|
-
|
|
3
|
-
## Rules you have to follow strictly
|
|
4
|
-
|
|
5
|
-
- You are top-notch programmer who always write simplest code to achieve the ideal result
|
|
6
|
-
- you are one liner engineers and we believe "The Great Tao is Simple", so try to keep changes small and focused
|
|
7
|
-
- keep the changes as minimal as possible
|
|
8
|
-
- if or else has one line of code, then { } are not needed and it should be wrote into same line
|
|
9
|
-
- DO NOT write uncessary comment do not make newlines within a function and try to make the code compact
|
|
10
|
-
- All crucial code should have proper explanation in English
|
|
11
|
-
|
|
12
|
-
## Best Practices for AI-Assisted Development
|
|
13
|
-
|
|
14
|
-
1. **在开始编码前先充分讨论和规划架构,确保理解用户的真实需求和使用场景,避免过度设计。**
|
|
15
|
-
|
|
16
|
-
2. **不要急于提交代码,应该等待用户明确指示后再进行 commit 和 push 操作。**
|
|
17
|
-
|
|
18
|
-
3. **优先选择简洁的实现方式(如函数导出而非类),并删除冗余的中间层方法以保持代码清晰。**
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
1
|
+
# Claude AI Development Guidelines
|
|
2
|
+
|
|
3
|
+
## Rules you have to follow strictly
|
|
4
|
+
|
|
5
|
+
- You are top-notch programmer who always write simplest code to achieve the ideal result
|
|
6
|
+
- you are one liner engineers and we believe "The Great Tao is Simple", so try to keep changes small and focused
|
|
7
|
+
- keep the changes as minimal as possible
|
|
8
|
+
- if or else has one line of code, then { } are not needed and it should be wrote into same line
|
|
9
|
+
- DO NOT write uncessary comment do not make newlines within a function and try to make the code compact
|
|
10
|
+
- All crucial code should have proper explanation in English
|
|
11
|
+
|
|
12
|
+
## Best Practices for AI-Assisted Development
|
|
13
|
+
|
|
14
|
+
1. **在开始编码前先充分讨论和规划架构,确保理解用户的真实需求和使用场景,避免过度设计。**
|
|
15
|
+
|
|
16
|
+
2. **不要急于提交代码,应该等待用户明确指示后再进行 commit 和 push 操作。**
|
|
17
|
+
|
|
18
|
+
3. **优先选择简洁的实现方式(如函数导出而非类),并删除冗余的中间层方法以保持代码清晰。**
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
22
|
*This file contains guidelines learned from AI-human collaboration to improve development efficiency and code quality.*
|
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
|
@@ -258,6 +258,17 @@ declare module '@posx/core/index' {
|
|
|
258
258
|
export * from '@posx/core/types/storage.type';
|
|
259
259
|
export * from '@posx/core/types/menu.type';
|
|
260
260
|
|
|
261
|
+
}
|
|
262
|
+
declare module '@posx/core/libs/FindOptions' {
|
|
263
|
+
export const Include: (query?: string) => (val: any) => any;
|
|
264
|
+
export const In: (query?: never[]) => (val: never) => boolean;
|
|
265
|
+
export const Between: (begin: number, end: number) => (val: number) => boolean;
|
|
266
|
+
export const Not: (query?: any) => (val: any, values: any) => boolean;
|
|
267
|
+
export const Raw: (fn: any) => any;
|
|
268
|
+
export const filterByParams: (params: {
|
|
269
|
+
[key: string]: any;
|
|
270
|
+
}) => (values: any) => boolean;
|
|
271
|
+
|
|
261
272
|
}
|
|
262
273
|
declare module '@posx/core/libs/electron.socket' {
|
|
263
274
|
export class ElectronSocket {
|
|
@@ -477,17 +488,6 @@ declare module '@posx/core/libs/escpos.printer' {
|
|
|
477
488
|
items: IPrintCommandLine[];
|
|
478
489
|
}
|
|
479
490
|
|
|
480
|
-
}
|
|
481
|
-
declare module '@posx/core/libs/FindOptions' {
|
|
482
|
-
export const Include: (query?: string) => (val: any) => any;
|
|
483
|
-
export const In: (query?: never[]) => (val: never) => boolean;
|
|
484
|
-
export const Between: (begin: number, end: number) => (val: number) => boolean;
|
|
485
|
-
export const Not: (query?: any) => (val: any, values: any) => boolean;
|
|
486
|
-
export const Raw: (fn: any) => any;
|
|
487
|
-
export const filterByParams: (params: {
|
|
488
|
-
[key: string]: any;
|
|
489
|
-
}) => (values: any) => boolean;
|
|
490
|
-
|
|
491
491
|
}
|
|
492
492
|
declare module '@posx/core/service.factory' {
|
|
493
493
|
import { IServiceOptions } from '@posx/core/types/misc.type';
|
|
@@ -1858,6 +1858,8 @@ declare module '@posx/core/services/invoice.service' {
|
|
|
1858
1858
|
lines: IInvoiceLine[];
|
|
1859
1859
|
printerUids: string[];
|
|
1860
1860
|
};
|
|
1861
|
+
private filterDeletedLinesForCancelPrint;
|
|
1862
|
+
private createCancelKitchenPrintJobs;
|
|
1861
1863
|
/**
|
|
1862
1864
|
* Sorts print jobs by printer sequence
|
|
1863
1865
|
* @param printJobs - Array of print jobs to sort
|
|
@@ -3266,6 +3268,8 @@ declare module '@posx/core/types/invoice.type' {
|
|
|
3266
3268
|
quantity: number;
|
|
3267
3269
|
/** Whether it is sent to server*/
|
|
3268
3270
|
sent: number;
|
|
3271
|
+
/** Whether cancel slip is printed */
|
|
3272
|
+
cancel_printed: number;
|
|
3269
3273
|
/** Whether it is selected */
|
|
3270
3274
|
selected: boolean;
|
|
3271
3275
|
}
|
|
@@ -3478,6 +3482,7 @@ declare module '@posx/core/types/invoice.type' {
|
|
|
3478
3482
|
unit_of_measure: UomType;
|
|
3479
3483
|
quantity: number;
|
|
3480
3484
|
sent: number;
|
|
3485
|
+
cancel_printed: number;
|
|
3481
3486
|
selected: boolean;
|
|
3482
3487
|
constructor();
|
|
3483
3488
|
}
|
|
@@ -3506,6 +3511,7 @@ declare module '@posx/core/types/invoice.type' {
|
|
|
3506
3511
|
modifiers: any[];
|
|
3507
3512
|
duplicated_from_uid: string;
|
|
3508
3513
|
sent: number;
|
|
3514
|
+
cancel_printed: number;
|
|
3509
3515
|
selected: boolean;
|
|
3510
3516
|
meta: {};
|
|
3511
3517
|
constructor();
|
|
@@ -4166,6 +4172,7 @@ declare module '@posx/core/types/printer.type' {
|
|
|
4166
4172
|
job_id: number;
|
|
4167
4173
|
/** Print sequence order (lower number prints first) */
|
|
4168
4174
|
print_sequence?: number;
|
|
4175
|
+
meta: Record<string, unknown>;
|
|
4169
4176
|
}
|
|
4170
4177
|
export class PrintJob extends AppBaseModel implements IPrintJob {
|
|
4171
4178
|
printer_name: string;
|
|
@@ -4188,6 +4195,7 @@ declare module '@posx/core/types/printer.type' {
|
|
|
4188
4195
|
job_id: number;
|
|
4189
4196
|
print_sequence?: number;
|
|
4190
4197
|
constructor(printer: IPrinter, printData: IPrintCommand, saveOnly?: boolean, printTimes?: number);
|
|
4198
|
+
meta: Record<string, unknown>;
|
|
4191
4199
|
}
|
|
4192
4200
|
export enum PrinterStatus {
|
|
4193
4201
|
Online = "online",
|
|
@@ -4245,6 +4253,7 @@ declare module '@posx/core/types/printer.type' {
|
|
|
4245
4253
|
normalized_printed_at: string;
|
|
4246
4254
|
report_data: IReportData;
|
|
4247
4255
|
meta: Record<string, any>;
|
|
4256
|
+
is_cancel?: boolean;
|
|
4248
4257
|
}
|
|
4249
4258
|
export class TemplateData implements ITemplateData {
|
|
4250
4259
|
config: IConfig;
|
|
@@ -4255,14 +4264,17 @@ declare module '@posx/core/types/printer.type' {
|
|
|
4255
4264
|
printed_at: Date;
|
|
4256
4265
|
normalized_printed_at: string;
|
|
4257
4266
|
meta: Record<string, any>;
|
|
4267
|
+
is_cancel: boolean;
|
|
4258
4268
|
}
|
|
4259
4269
|
export type IRenderPrintTemplateOptions = {
|
|
4260
4270
|
printer_name: string;
|
|
4261
4271
|
kitchen_itemized_print: boolean;
|
|
4272
|
+
is_cancel?: boolean;
|
|
4262
4273
|
};
|
|
4263
4274
|
export class RenderPrintTemplateOptions implements IRenderPrintTemplateOptions {
|
|
4264
4275
|
printer_name: string;
|
|
4265
4276
|
kitchen_itemized_print: boolean;
|
|
4277
|
+
is_cancel: boolean;
|
|
4266
4278
|
}
|
|
4267
4279
|
|
|
4268
4280
|
}
|