@sudobility/sudojo_types 1.0.0
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 +117 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.ts +172 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides context for AI assistants working on this codebase.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
`@sudobility/sudojo-types` is a TypeScript types package for the Sudojo API (a Sudoku learning platform). It contains:
|
|
8
|
+
- Entity types (database models)
|
|
9
|
+
- Request/response types for API endpoints
|
|
10
|
+
- Query parameter types
|
|
11
|
+
- Helper functions for creating responses
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run verify # Run all checks (typecheck, lint, test, build)
|
|
17
|
+
npm run typecheck # Type-check without emitting
|
|
18
|
+
npm run lint # Run ESLint
|
|
19
|
+
npm run lint:fix # Run ESLint with auto-fix
|
|
20
|
+
npm run format # Format code with Prettier
|
|
21
|
+
npm run format:check # Check formatting without changes
|
|
22
|
+
npm run build # Build ESM and CJS outputs to dist/
|
|
23
|
+
npm run clean # Remove dist/
|
|
24
|
+
npm run dev # Watch mode for development
|
|
25
|
+
npm test # Run tests once
|
|
26
|
+
npm run test:watch # Run tests in watch mode
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Code Conventions
|
|
30
|
+
|
|
31
|
+
### Optional Fields
|
|
32
|
+
|
|
33
|
+
Use `Optional<T>` from `@sudobility/types` for optional fields in request/query types:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
// Correct
|
|
37
|
+
interface UpdateRequest {
|
|
38
|
+
name: Optional<string>;
|
|
39
|
+
value: Optional<number>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Incorrect - do not use ?
|
|
43
|
+
interface UpdateRequest {
|
|
44
|
+
name?: string;
|
|
45
|
+
value?: number;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Nullable Database Fields
|
|
50
|
+
|
|
51
|
+
Entity types representing database models use `| null` for nullable columns:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
interface Entity {
|
|
55
|
+
uuid: string; // Required, non-null
|
|
56
|
+
text: string | null; // Nullable column
|
|
57
|
+
created_at: Date | null;
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Type Organization
|
|
62
|
+
|
|
63
|
+
Types in `src/index.ts` are organized into sections:
|
|
64
|
+
1. Re-exports from `@sudobility/types`
|
|
65
|
+
2. Entity Types (database models)
|
|
66
|
+
3. Request Body Types (Create/Update requests)
|
|
67
|
+
4. Query Parameter Types
|
|
68
|
+
5. Response Helper Types
|
|
69
|
+
|
|
70
|
+
### Code Style
|
|
71
|
+
|
|
72
|
+
- Single quotes, semicolons, trailing commas (es5)
|
|
73
|
+
- 80 character line width, 2 space indentation
|
|
74
|
+
- Run `npm run format` before committing
|
|
75
|
+
|
|
76
|
+
## Testing
|
|
77
|
+
|
|
78
|
+
Tests are in `src/index.test.ts` using Vitest. The test suite covers:
|
|
79
|
+
- **Helper functions**: `successResponse()` and `errorResponse()` runtime behavior
|
|
80
|
+
- **Type tests**: Compile-time validation using `expectTypeOf()` to ensure types have correct shapes
|
|
81
|
+
|
|
82
|
+
When adding new types, add corresponding type tests to verify the shape is correct.
|
|
83
|
+
|
|
84
|
+
## Dependencies
|
|
85
|
+
|
|
86
|
+
- `@sudobility/types`: Shared types library (peer dependency) - provides `Optional<T>`, `ApiResponse`, `BaseResponse`, etc.
|
|
87
|
+
- `typescript`: Build tooling
|
|
88
|
+
- `vitest`: Testing framework
|
|
89
|
+
- `eslint`: Linting
|
|
90
|
+
- `prettier`: Code formatting
|
|
91
|
+
- `rimraf`: Clean script
|
|
92
|
+
|
|
93
|
+
## File Structure
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
src/
|
|
97
|
+
index.ts # All types exported from single entry point
|
|
98
|
+
index.test.ts # Tests for types and helper functions
|
|
99
|
+
dist/
|
|
100
|
+
index.js # ESM build
|
|
101
|
+
index.cjs # CommonJS build
|
|
102
|
+
index.d.ts # Type declarations
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## CI/CD
|
|
106
|
+
|
|
107
|
+
GitHub Actions workflow (`.github/workflows/ci-cd.yml`) runs on push/PR to `main` and `develop`:
|
|
108
|
+
- Runs typecheck, lint, test, build
|
|
109
|
+
- Auto-publishes to npm on version bump (requires `NPM_TOKEN` secret)
|
|
110
|
+
|
|
111
|
+
## Publishing
|
|
112
|
+
|
|
113
|
+
Package is published to npm under `@sudobility` scope with public access.
|
|
114
|
+
|
|
115
|
+
**Manual**: Run `npm publish` (triggers `prepublishOnly` to verify and build)
|
|
116
|
+
|
|
117
|
+
**Automatic**: Bump version in `package.json` and push to `main` - CI/CD will publish automatically.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @sudobility/sudojo-types
|
|
4
|
+
* TypeScript types for Sudojo API - Sudoku learning platform
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.successResponse = successResponse;
|
|
8
|
+
exports.errorResponse = errorResponse;
|
|
9
|
+
/** Create a success response */
|
|
10
|
+
function successResponse(data) {
|
|
11
|
+
return {
|
|
12
|
+
success: true,
|
|
13
|
+
data,
|
|
14
|
+
timestamp: new Date().toISOString(),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Create an error response */
|
|
18
|
+
function errorResponse(error) {
|
|
19
|
+
return {
|
|
20
|
+
success: false,
|
|
21
|
+
error,
|
|
22
|
+
timestamp: new Date().toISOString(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @sudobility/sudojo-types
|
|
3
|
+
* TypeScript types for Sudojo API - Sudoku learning platform
|
|
4
|
+
*/
|
|
5
|
+
export type { ApiResponse, BaseResponse, Optional, PaginatedResponse, PaginationInfo, PaginationOptions, } from '@sudobility/types';
|
|
6
|
+
import type { Optional } from '@sudobility/types';
|
|
7
|
+
export interface Level {
|
|
8
|
+
uuid: string;
|
|
9
|
+
index: number;
|
|
10
|
+
title: string;
|
|
11
|
+
text: string | null;
|
|
12
|
+
requires_subscription: boolean | null;
|
|
13
|
+
created_at: Date | null;
|
|
14
|
+
updated_at: Date | null;
|
|
15
|
+
}
|
|
16
|
+
export interface Technique {
|
|
17
|
+
uuid: string;
|
|
18
|
+
level_uuid: string | null;
|
|
19
|
+
index: number;
|
|
20
|
+
title: string;
|
|
21
|
+
text: string | null;
|
|
22
|
+
created_at: Date | null;
|
|
23
|
+
updated_at: Date | null;
|
|
24
|
+
}
|
|
25
|
+
export interface Learning {
|
|
26
|
+
uuid: string;
|
|
27
|
+
technique_uuid: string | null;
|
|
28
|
+
index: number;
|
|
29
|
+
language_code: string;
|
|
30
|
+
text: string | null;
|
|
31
|
+
image_url: string | null;
|
|
32
|
+
created_at: Date | null;
|
|
33
|
+
updated_at: Date | null;
|
|
34
|
+
}
|
|
35
|
+
export interface Board {
|
|
36
|
+
uuid: string;
|
|
37
|
+
level_uuid: string | null;
|
|
38
|
+
symmetrical: boolean | null;
|
|
39
|
+
board: string;
|
|
40
|
+
solution: string;
|
|
41
|
+
techniques: number | null;
|
|
42
|
+
created_at: Date | null;
|
|
43
|
+
updated_at: Date | null;
|
|
44
|
+
}
|
|
45
|
+
export interface Daily {
|
|
46
|
+
uuid: string;
|
|
47
|
+
date: string;
|
|
48
|
+
board_uuid: string | null;
|
|
49
|
+
level_uuid: string | null;
|
|
50
|
+
techniques: number | null;
|
|
51
|
+
board: string;
|
|
52
|
+
solution: string;
|
|
53
|
+
created_at: Date | null;
|
|
54
|
+
updated_at: Date | null;
|
|
55
|
+
}
|
|
56
|
+
export interface Challenge {
|
|
57
|
+
uuid: string;
|
|
58
|
+
board_uuid: string | null;
|
|
59
|
+
level_uuid: string | null;
|
|
60
|
+
difficulty: number | null;
|
|
61
|
+
board: string;
|
|
62
|
+
solution: string;
|
|
63
|
+
created_at: Date | null;
|
|
64
|
+
updated_at: Date | null;
|
|
65
|
+
}
|
|
66
|
+
export interface LevelCreateRequest {
|
|
67
|
+
index: number;
|
|
68
|
+
title: string;
|
|
69
|
+
text: Optional<string>;
|
|
70
|
+
requires_subscription: Optional<boolean>;
|
|
71
|
+
}
|
|
72
|
+
export interface LevelUpdateRequest {
|
|
73
|
+
index: Optional<number>;
|
|
74
|
+
title: Optional<string>;
|
|
75
|
+
text: Optional<string>;
|
|
76
|
+
requires_subscription: Optional<boolean>;
|
|
77
|
+
}
|
|
78
|
+
export interface TechniqueCreateRequest {
|
|
79
|
+
level_uuid: string;
|
|
80
|
+
index: number;
|
|
81
|
+
title: string;
|
|
82
|
+
text: Optional<string>;
|
|
83
|
+
}
|
|
84
|
+
export interface TechniqueUpdateRequest {
|
|
85
|
+
level_uuid: Optional<string>;
|
|
86
|
+
index: Optional<number>;
|
|
87
|
+
title: Optional<string>;
|
|
88
|
+
text: Optional<string>;
|
|
89
|
+
}
|
|
90
|
+
export interface LearningCreateRequest {
|
|
91
|
+
technique_uuid: string;
|
|
92
|
+
index: number;
|
|
93
|
+
language_code: Optional<string>;
|
|
94
|
+
text: Optional<string>;
|
|
95
|
+
image_url: Optional<string | null>;
|
|
96
|
+
}
|
|
97
|
+
export interface LearningUpdateRequest {
|
|
98
|
+
technique_uuid: Optional<string>;
|
|
99
|
+
index: Optional<number>;
|
|
100
|
+
language_code: Optional<string>;
|
|
101
|
+
text: Optional<string>;
|
|
102
|
+
image_url: Optional<string | null>;
|
|
103
|
+
}
|
|
104
|
+
export interface BoardCreateRequest {
|
|
105
|
+
level_uuid: Optional<string | null>;
|
|
106
|
+
symmetrical: Optional<boolean>;
|
|
107
|
+
board: string;
|
|
108
|
+
solution: string;
|
|
109
|
+
techniques: Optional<number>;
|
|
110
|
+
}
|
|
111
|
+
export interface BoardUpdateRequest {
|
|
112
|
+
level_uuid: Optional<string | null>;
|
|
113
|
+
symmetrical: Optional<boolean>;
|
|
114
|
+
board: Optional<string>;
|
|
115
|
+
solution: Optional<string>;
|
|
116
|
+
techniques: Optional<number>;
|
|
117
|
+
}
|
|
118
|
+
export interface DailyCreateRequest {
|
|
119
|
+
date: string;
|
|
120
|
+
board_uuid: Optional<string | null>;
|
|
121
|
+
level_uuid: Optional<string | null>;
|
|
122
|
+
techniques: Optional<number>;
|
|
123
|
+
board: string;
|
|
124
|
+
solution: string;
|
|
125
|
+
}
|
|
126
|
+
export interface DailyUpdateRequest {
|
|
127
|
+
date: Optional<string>;
|
|
128
|
+
board_uuid: Optional<string | null>;
|
|
129
|
+
level_uuid: Optional<string | null>;
|
|
130
|
+
techniques: Optional<number>;
|
|
131
|
+
board: Optional<string>;
|
|
132
|
+
solution: Optional<string>;
|
|
133
|
+
}
|
|
134
|
+
export interface ChallengeCreateRequest {
|
|
135
|
+
board_uuid: Optional<string | null>;
|
|
136
|
+
level_uuid: Optional<string | null>;
|
|
137
|
+
difficulty: Optional<number>;
|
|
138
|
+
board: string;
|
|
139
|
+
solution: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ChallengeUpdateRequest {
|
|
142
|
+
board_uuid: Optional<string | null>;
|
|
143
|
+
level_uuid: Optional<string | null>;
|
|
144
|
+
difficulty: Optional<number>;
|
|
145
|
+
board: Optional<string>;
|
|
146
|
+
solution: Optional<string>;
|
|
147
|
+
}
|
|
148
|
+
export interface TechniqueQueryParams {
|
|
149
|
+
level_uuid: Optional<string>;
|
|
150
|
+
}
|
|
151
|
+
export interface LearningQueryParams {
|
|
152
|
+
technique_uuid: Optional<string>;
|
|
153
|
+
language_code: Optional<string>;
|
|
154
|
+
}
|
|
155
|
+
export interface BoardQueryParams {
|
|
156
|
+
level_uuid: Optional<string>;
|
|
157
|
+
}
|
|
158
|
+
export interface ChallengeQueryParams {
|
|
159
|
+
level_uuid: Optional<string>;
|
|
160
|
+
difficulty: Optional<string>;
|
|
161
|
+
}
|
|
162
|
+
import type { BaseResponse } from '@sudobility/types';
|
|
163
|
+
/** Create a success response */
|
|
164
|
+
export declare function successResponse<T>(data: T): BaseResponse<T>;
|
|
165
|
+
/** Create an error response */
|
|
166
|
+
export declare function errorResponse(error: string): BaseResponse<never>;
|
|
167
|
+
export interface HealthCheckData {
|
|
168
|
+
name: string;
|
|
169
|
+
version: string;
|
|
170
|
+
status: string;
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,cAAc,EACd,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAMlD,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,qBAAqB,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM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AW,gBAAgB;IAC/B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7B,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC9B;AAMD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,gCAAgC;AAChC,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAM3D;AAED,+BAA+B;AAC/B,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAMhE;AAMD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @sudobility/sudojo-types
|
|
4
|
+
* TypeScript types for Sudojo API - Sudoku learning platform
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.successResponse = successResponse;
|
|
8
|
+
exports.errorResponse = errorResponse;
|
|
9
|
+
/** Create a success response */
|
|
10
|
+
function successResponse(data) {
|
|
11
|
+
return {
|
|
12
|
+
success: true,
|
|
13
|
+
data,
|
|
14
|
+
timestamp: new Date().toISOString(),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/** Create an error response */
|
|
18
|
+
function errorResponse(error) {
|
|
19
|
+
return {
|
|
20
|
+
success: false,
|
|
21
|
+
error,
|
|
22
|
+
timestamp: new Date().toISOString(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAwNH,0CAMC;AAGD,sCAMC;AAhBD,gCAAgC;AAChC,SAAgB,eAAe,CAAI,IAAO;IACxC,OAAO;QACL,OAAO,EAAE,IAAI;QACb,IAAI;QACJ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC;AAED,+BAA+B;AAC/B,SAAgB,aAAa,CAAC,KAAa;IACzC,OAAO;QACL,OAAO,EAAE,KAAK;QACd,KAAK;QACL,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sudobility/sudojo_types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript types for Sudojo API - Sudoku learning platform",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "npm run build:esm && npm run build:cjs",
|
|
17
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
18
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && npm run build:cjs-rename",
|
|
19
|
+
"build:cjs-rename": "find dist -name '*.js' -not -name '*.cjs' -exec sh -c 'cp \"$1\" \"${1%.js}.cjs\"' _ {} \\;",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:coverage": "vitest --coverage",
|
|
25
|
+
"lint": "eslint src --ext .ts",
|
|
26
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
27
|
+
"format": "prettier --write \"src/**/*.{ts,js,json,md}\"",
|
|
28
|
+
"format:check": "prettier --check \"src/**/*.{ts,js,json,md}\"",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"verify": "npm run typecheck && npm run lint && npm run test && npm run build",
|
|
31
|
+
"prepublishOnly": "npm run clean && npm run verify"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist/**/*",
|
|
35
|
+
"CLAUDE.md"
|
|
36
|
+
],
|
|
37
|
+
"keywords": [
|
|
38
|
+
"typescript",
|
|
39
|
+
"types",
|
|
40
|
+
"sudoku",
|
|
41
|
+
"sudojo",
|
|
42
|
+
"api"
|
|
43
|
+
],
|
|
44
|
+
"author": "Sudobility",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@sudobility/types": "^1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/js": "^9.38.0",
|
|
51
|
+
"@sudobility/types": "^1.0.0",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
53
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
54
|
+
"eslint": "^9.38.0",
|
|
55
|
+
"globals": "^16.4.0",
|
|
56
|
+
"prettier": "^3.6.2",
|
|
57
|
+
"rimraf": "^6.0.1",
|
|
58
|
+
"typescript": "^5.9.3",
|
|
59
|
+
"vitest": "^4.0.15"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
}
|
|
64
|
+
}
|