@sudobility/whisperly_types 1.0.26 → 1.0.27

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 ADDED
@@ -0,0 +1,57 @@
1
+ # @sudobility/whisperly_types
2
+
3
+ Shared TypeScript type definitions for the Whisperly localization SaaS platform.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add @sudobility/whisperly_types
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import {
15
+ Project,
16
+ TranslationRequest,
17
+ TranslationResponse,
18
+ successResponse,
19
+ errorResponse,
20
+ } from "@sudobility/whisperly_types";
21
+
22
+ const response = successResponse({ translations: { es: ["Hola"] } });
23
+ ```
24
+
25
+ ## Types
26
+
27
+ ### Entity Types
28
+ `User`, `UserSettings`, `Project`, `Dictionary`, `DictionaryEntry`, `UsageRecord`
29
+
30
+ ### Request Types
31
+ `ProjectCreateRequest`, `ProjectUpdateRequest`, `DictionaryCreateRequest`, `TranslationRequest`
32
+
33
+ ### Response Types
34
+ `ProjectResponse`, `ProjectListResponse`, `TranslationApiResponse`, `AnalyticsApiResponse`, `DictionarySearchApiResponse`
35
+
36
+ ### Response Helpers
37
+ - `successResponse<T>(data)` -- wrap data in `BaseResponse<T>`
38
+ - `errorResponse(error)` -- create error response
39
+
40
+ ## Development
41
+
42
+ ```bash
43
+ bun run build # Dual CJS + ESM build
44
+ bun run test:run # Run tests once
45
+ bun run verify # All checks + build
46
+ ```
47
+
48
+ ## Related Packages
49
+
50
+ - `whisperly_client` -- API client SDK
51
+ - `whisperly_lib` -- Business logic with Zustand stores
52
+ - `whisperly_api` -- Backend API server
53
+ - `whisperly_app` -- Web application
54
+
55
+ ## License
56
+
57
+ BUSL-1.1
package/dist/index.js CHANGED
@@ -1,11 +1,7 @@
1
- "use strict";
2
1
  /**
3
2
  * @sudobility/whisperly_types
4
3
  * TypeScript types for Whisperly API - Localization SaaS platform
5
4
  */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.successResponse = successResponse;
8
- exports.errorResponse = errorResponse;
9
5
  // =============================================================================
10
6
  // Response Helper Functions
11
7
  // =============================================================================
@@ -16,7 +12,7 @@ exports.errorResponse = errorResponse;
16
12
  * @param data - The response payload
17
13
  * @returns A {@link BaseResponse} with `success: true` and an ISO 8601 timestamp
18
14
  */
19
- function successResponse(data) {
15
+ export function successResponse(data) {
20
16
  return {
21
17
  success: true,
22
18
  data,
@@ -29,7 +25,7 @@ function successResponse(data) {
29
25
  * @param error - A human-readable error message describing what went wrong
30
26
  * @returns A {@link BaseResponse} with `success: false` and an ISO 8601 timestamp
31
27
  */
32
- function errorResponse(error) {
28
+ export function errorResponse(error) {
33
29
  return {
34
30
  success: false,
35
31
  error,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAwmBH,0CAMC;AAQD,sCAMC;AA/BD,gFAAgF;AAChF,4BAA4B;AAC5B,gFAAgF;AAEhF;;;;;;GAMG;AACH,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;;;;;GAKG;AACH,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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6lBH,gFAAgF;AAChF,4BAA4B;AAC5B,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,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;;;;;GAKG;AACH,MAAM,UAAU,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 CHANGED
@@ -1,23 +1,18 @@
1
1
  {
2
2
  "name": "@sudobility/whisperly_types",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "type": "module",
5
5
  "description": "TypeScript types for Whisperly API - Localization SaaS platform",
6
- "main": "./dist/index.cjs",
7
- "module": "./dist/index.js",
6
+ "main": "./dist/index.js",
8
7
  "types": "./dist/index.d.ts",
9
8
  "exports": {
10
9
  ".": {
11
10
  "import": "./dist/index.js",
12
- "require": "./dist/index.cjs",
13
11
  "types": "./dist/index.d.ts"
14
12
  }
15
13
  },
16
14
  "scripts": {
17
- "build": "bun run build:esm && bun run build:cjs",
18
- "build:esm": "bunx tsc -p tsconfig.esm.json",
19
- "build:cjs": "bunx tsc -p tsconfig.cjs.json && bun run build:cjs-rename",
20
- "build:cjs-rename": "find dist -name '*.js' -not -name '*.cjs' -exec sh -c 'cp \"$1\" \"${1%.js}.cjs\"' _ {} \\;",
15
+ "build": "tsc -p tsconfig.esm.json",
21
16
  "clean": "rm -rf dist",
22
17
  "dev": "bunx tsc --watch",
23
18
  "typecheck": "bunx tsc --noEmit",
@@ -45,11 +40,11 @@
45
40
  "author": "Sudobility",
46
41
  "license": "BUSL-1.1",
47
42
  "peerDependencies": {
48
- "@sudobility/types": "^1.9.55"
43
+ "@sudobility/types": "^1.9.57"
49
44
  },
50
45
  "devDependencies": {
51
46
  "@eslint/js": "^9.39.2",
52
- "@sudobility/types": "^1.9.55",
47
+ "@sudobility/types": "^1.9.57",
53
48
  "@typescript-eslint/eslint-plugin": "^8.50.0",
54
49
  "@typescript-eslint/parser": "^8.50.0",
55
50
  "eslint": "^9.39.2",
package/dist/index.cjs DELETED
@@ -1,39 +0,0 @@
1
- "use strict";
2
- /**
3
- * @sudobility/whisperly_types
4
- * TypeScript types for Whisperly API - Localization SaaS platform
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.successResponse = successResponse;
8
- exports.errorResponse = errorResponse;
9
- // =============================================================================
10
- // Response Helper Functions
11
- // =============================================================================
12
- /**
13
- * Create a standardized success response wrapping the given data.
14
- *
15
- * @template T - The type of the response data
16
- * @param data - The response payload
17
- * @returns A {@link BaseResponse} with `success: true` and an ISO 8601 timestamp
18
- */
19
- function successResponse(data) {
20
- return {
21
- success: true,
22
- data,
23
- timestamp: new Date().toISOString(),
24
- };
25
- }
26
- /**
27
- * Create a standardized error response with the given error message.
28
- *
29
- * @param error - A human-readable error message describing what went wrong
30
- * @returns A {@link BaseResponse} with `success: false` and an ISO 8601 timestamp
31
- */
32
- function errorResponse(error) {
33
- return {
34
- success: false,
35
- error,
36
- timestamp: new Date().toISOString(),
37
- };
38
- }
39
- //# sourceMappingURL=index.js.map