@sudobility/tapayoka_types 0.0.5 → 0.0.7
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 +47 -0
- package/package.json +5 -10
- package/dist/index.cjs +0 -37
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @sudobility/tapayoka_types
|
|
2
|
+
|
|
3
|
+
Shared TypeScript type definitions for the Tapayoka QR-to-device cashless payment system.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @sudobility/tapayoka_types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type {
|
|
15
|
+
Device, Service, Order, Authorization,
|
|
16
|
+
ServiceType, OrderStatus, DeviceStatus,
|
|
17
|
+
BleDeviceChallenge, AuthorizationPayload,
|
|
18
|
+
} from '@sudobility/tapayoka_types';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Types
|
|
22
|
+
|
|
23
|
+
- **Enums**: `ServiceType` (TRIGGER/FIXED/VARIABLE), `OrderStatus`, `DeviceStatus`, `UserRole`, `LogDirection`
|
|
24
|
+
- **Domain Models**: `Device` (keyed by ETH wallet address), `Service`, `Order`, `Authorization`
|
|
25
|
+
- **BLE Protocol**: `BleDeviceChallenge`, `AuthorizationPayload`, `BleCommand`, `BleDeviceResponse`, UUID constants
|
|
26
|
+
- **Request/Response**: Buyer (verify, order, pay, authorize) and Vendor (device/service CRUD, QR, dashboard stats) types
|
|
27
|
+
|
|
28
|
+
## Development
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun run build # ESM + CJS dual build
|
|
32
|
+
bun run test # Run Vitest
|
|
33
|
+
bun run typecheck # TypeScript check
|
|
34
|
+
bun run lint # ESLint
|
|
35
|
+
bun run verify # Typecheck + lint + build
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Related Packages
|
|
39
|
+
|
|
40
|
+
- `@sudobility/tapayoka_client` -- React hooks for Tapayoka API
|
|
41
|
+
- `@sudobility/tapayoka_lib` -- Business logic with Zustand stores
|
|
42
|
+
- `tapayoka_api` -- Backend API server
|
|
43
|
+
- `tapayoka_buyer_app_rn` / `tapayoka_vendor_app` -- Consumer apps
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
BUSL-1.1
|
package/package.json
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/tapayoka_types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "TypeScript types for Tapayoka - QR-to-device cashless payment system",
|
|
5
|
-
"main": "./dist/index.
|
|
6
|
-
"module": "./dist/index.js",
|
|
5
|
+
"main": "./dist/index.js",
|
|
7
6
|
"types": "./dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
9
|
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/index.cjs",
|
|
12
10
|
"types": "./dist/index.d.ts"
|
|
13
11
|
}
|
|
14
12
|
},
|
|
15
13
|
"scripts": {
|
|
16
|
-
"build": "
|
|
17
|
-
"build:esm": "bunx tsc -p tsconfig.esm.json",
|
|
18
|
-
"build:cjs": "bunx tsc -p tsconfig.cjs.json && bun run build:cjs-rename && rm -rf dist-cjs",
|
|
19
|
-
"build:cjs-rename": "find dist-cjs -name '*.js' -exec sh -c 'cp \"$1\" \"dist/$(basename \"${1%.js}.cjs\")\"' _ {} \\;",
|
|
14
|
+
"build": "tsc -p tsconfig.esm.json",
|
|
20
15
|
"clean": "rm -rf dist",
|
|
21
16
|
"dev": "bunx tsc --watch",
|
|
22
17
|
"typecheck": "bunx tsc --noEmit",
|
|
@@ -44,11 +39,11 @@
|
|
|
44
39
|
"author": "Sudobility",
|
|
45
40
|
"license": "BUSL-1.1",
|
|
46
41
|
"peerDependencies": {
|
|
47
|
-
"@sudobility/types": "^1.9.
|
|
42
|
+
"@sudobility/types": "^1.9.56"
|
|
48
43
|
},
|
|
49
44
|
"devDependencies": {
|
|
50
45
|
"@eslint/js": "^9.39.2",
|
|
51
|
-
"@sudobility/types": "^1.9.
|
|
46
|
+
"@sudobility/types": "^1.9.56",
|
|
52
47
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
53
48
|
"@typescript-eslint/parser": "^8.50.0",
|
|
54
49
|
"eslint": "^9.39.2",
|
package/dist/index.cjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @sudobility/tapayoka_types
|
|
4
|
-
* TypeScript types for Tapayoka - QR-to-device cashless payment system
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.BLE_DEVICE_NAME_PREFIX = exports.BLE_CHAR_RESPONSE_UUID = exports.BLE_CHAR_COMMAND_UUID = exports.BLE_CHAR_DEVICE_INFO_UUID = exports.BLE_SERVICE_UUID = void 0;
|
|
8
|
-
exports.successResponse = successResponse;
|
|
9
|
-
exports.errorResponse = errorResponse;
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// BLE Service UUIDs
|
|
12
|
-
// =============================================================================
|
|
13
|
-
exports.BLE_SERVICE_UUID = '000088F4-0000-1000-8000-00805f9b34fb';
|
|
14
|
-
exports.BLE_CHAR_DEVICE_INFO_UUID = '00000E32-0000-1000-8000-00805f9b34fb';
|
|
15
|
-
exports.BLE_CHAR_COMMAND_UUID = '00000E33-0000-1000-8000-00805f9b34fb';
|
|
16
|
-
exports.BLE_CHAR_RESPONSE_UUID = '00000E34-0000-1000-8000-00805f9b34fb';
|
|
17
|
-
exports.BLE_DEVICE_NAME_PREFIX = 'tapayoka-';
|
|
18
|
-
// =============================================================================
|
|
19
|
-
// Response Helper Functions
|
|
20
|
-
// =============================================================================
|
|
21
|
-
/** Create a success response */
|
|
22
|
-
function successResponse(data) {
|
|
23
|
-
return {
|
|
24
|
-
success: true,
|
|
25
|
-
data,
|
|
26
|
-
timestamp: new Date().toISOString(),
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/** Create an error response */
|
|
30
|
-
function errorResponse(error) {
|
|
31
|
-
return {
|
|
32
|
-
success: false,
|
|
33
|
-
error,
|
|
34
|
-
timestamp: new Date().toISOString(),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=index.js.map
|