@stacksjs/commerce 0.69.1
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/README.md +59 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/printer.d.ts +44 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Stacks Ecommerce
|
|
2
|
+
|
|
3
|
+
wip
|
|
4
|
+
|
|
5
|
+
## โ๏ธ Features
|
|
6
|
+
|
|
7
|
+
wip
|
|
8
|
+
|
|
9
|
+
- โก๏ธ
|
|
10
|
+
|
|
11
|
+
wip
|
|
12
|
+
|
|
13
|
+
## ๐ค Usage
|
|
14
|
+
|
|
15
|
+
wip
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bun install -d @stacksjs/commerce
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Now, you can use it in your project:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import * as ecommerce from '@stacksjs/commerce'
|
|
25
|
+
|
|
26
|
+
// wip
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Learn more in the docs.
|
|
30
|
+
|
|
31
|
+
## ๐งช Testing
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
bun test
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## ๐ Changelog
|
|
38
|
+
|
|
39
|
+
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
|
|
40
|
+
|
|
41
|
+
## ๐ Contributing
|
|
42
|
+
|
|
43
|
+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
|
|
44
|
+
|
|
45
|
+
## ๐ Community
|
|
46
|
+
|
|
47
|
+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
48
|
+
|
|
49
|
+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
|
|
50
|
+
|
|
51
|
+
For casual chit-chat with others using this package:
|
|
52
|
+
|
|
53
|
+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
54
|
+
|
|
55
|
+
## ๐ License
|
|
56
|
+
|
|
57
|
+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
|
|
58
|
+
|
|
59
|
+
Made with ๐
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ecommerce: {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={};export{e as ecommerce};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare interface Printer {
|
|
2
|
+
id: string | number
|
|
3
|
+
name: string
|
|
4
|
+
status: string
|
|
5
|
+
}
|
|
6
|
+
declare interface PrintJob {
|
|
7
|
+
printer: Printer
|
|
8
|
+
receipt: Receipt
|
|
9
|
+
}
|
|
10
|
+
declare interface PrinterDriver {
|
|
11
|
+
print: (printJob: PrintJob) => Promise<void>
|
|
12
|
+
cleanUp: (printer: Printer) => Promise<void>
|
|
13
|
+
checkStatus: (printer: Printer) => Promise<boolean>
|
|
14
|
+
findPrinters: () => Promise<Printer[]>
|
|
15
|
+
setup: (printer: Printer) => Promise<void>
|
|
16
|
+
restart: () => Promise<void>
|
|
17
|
+
canInteractWithPrinter: (printer: Printer) => Promise<boolean>
|
|
18
|
+
}
|
|
19
|
+
declare type Path = string
|
|
20
|
+
|
|
21
|
+
interface Receipt {
|
|
22
|
+
id: string | number
|
|
23
|
+
name: string
|
|
24
|
+
price: number
|
|
25
|
+
quantity: number
|
|
26
|
+
template: Path
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class TSPIVPrinter implements PrinterDriver {
|
|
30
|
+
async print(receipt: Receipt): Promise<void> {
|
|
31
|
+
console.log('TSP IV Printer: Printing receipt', receipt)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async cleanUp(): Promise<void> {
|
|
35
|
+
console.log('TSP IV Printer: Cleaning up print job...')
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async checkStatus(): Promise<boolean> {
|
|
39
|
+
console.log('TSP IV Printer: Checking online status...')
|
|
40
|
+
return true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const tspIVPrinter: PrinterDriver = new TSPIVPrinter()
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stacksjs/commerce",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.69.1",
|
|
5
|
+
"description": "Stacks ecommerce utilities.",
|
|
6
|
+
"author": "Chris Breuer",
|
|
7
|
+
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
10
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/ecommerce#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
14
|
+
"directory": "./storage/framework/core/ecommerce"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/stacksjs/stacks/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": ["ecommerce", "utilities", "functions", "bun", "stacks"],
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./*": {
|
|
25
|
+
"import": "./dist/*"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"module": "dist/index.js",
|
|
29
|
+
"types": "dist/index.d.ts",
|
|
30
|
+
"files": ["README.md", "dist"],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "bun build.ts",
|
|
33
|
+
"typecheck": "bun tsc --noEmit",
|
|
34
|
+
"prepublishOnly": "bun run build"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@stacksjs/development": "0.68.2"
|
|
38
|
+
}
|
|
39
|
+
}
|