@sudobility/tapayoka_types 0.0.6 → 0.0.8

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.
Files changed (3) hide show
  1. package/README.md +47 -0
  2. package/package.json +6 -10
  3. 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,18 @@
1
1
  {
2
2
  "name": "@sudobility/tapayoka_types",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "TypeScript types for Tapayoka - QR-to-device cashless payment system",
5
- "main": "./dist/index.cjs",
6
- "module": "./dist/index.js",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": "./dist/index.js",
11
- "require": "./dist/index.cjs",
12
11
  "types": "./dist/index.d.ts"
13
12
  }
14
13
  },
15
14
  "scripts": {
16
- "build": "bun run build:esm && bun run build:cjs",
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\")\"' _ {} \\;",
15
+ "build": "tsc -p tsconfig.esm.json",
20
16
  "clean": "rm -rf dist",
21
17
  "dev": "bunx tsc --watch",
22
18
  "typecheck": "bunx tsc --noEmit",
@@ -44,11 +40,11 @@
44
40
  "author": "Sudobility",
45
41
  "license": "BUSL-1.1",
46
42
  "peerDependencies": {
47
- "@sudobility/types": "^1.9.55"
43
+ "@sudobility/types": "^1.9.57"
48
44
  },
49
45
  "devDependencies": {
50
46
  "@eslint/js": "^9.39.2",
51
- "@sudobility/types": "^1.9.55",
47
+ "@sudobility/types": "^1.9.57",
52
48
  "@typescript-eslint/eslint-plugin": "^8.50.0",
53
49
  "@typescript-eslint/parser": "^8.50.0",
54
50
  "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