@grom.js/bot-api-spec 0.6.1 → 0.7.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@grom.js/bot-api-spec",
3
3
  "type": "module",
4
- "version": "0.6.1",
4
+ "version": "0.7.0",
5
5
  "description": "Telegram Bot API specification as a collection of JavaScript objects in a custom format.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,26 +26,25 @@
26
26
  "node": ">=22.18"
27
27
  },
28
28
  "devDependencies": {
29
- "@antfu/eslint-config": "7.0.1",
30
- "@types/node": "22.19.7",
29
+ "@antfu/eslint-config": "7.3.0",
30
+ "@types/node": "22.19.10",
31
31
  "@types/turndown": "5.0.6",
32
- "bumpp": "10.4.0",
33
- "cheerio": "1.1.2",
32
+ "bumpp": "10.4.1",
33
+ "cheerio": "1.2.0",
34
34
  "domhandler": "5.0.3",
35
35
  "eslint": "9.39.2",
36
- "eslint-plugin-format": "1.3.1",
36
+ "eslint-plugin-format": "1.4.0",
37
37
  "taze": "19.9.2",
38
38
  "turndown": "7.2.2",
39
39
  "typescript": "5.9.3",
40
- "zod": "4.3.5"
40
+ "zod": "4.3.6"
41
41
  },
42
42
  "scripts": {
43
43
  "typecheck": "tsc --build --noEmit",
44
44
  "build": "tsc --build",
45
45
  "lint": "eslint .",
46
46
  "lint:fix": "eslint . --fix",
47
- "gen:spec": "node ./scripts/gen.ts",
48
- "gen:return-types": "node --env-file=./.env ./scripts/gen-return-types.ts",
47
+ "gen": "node ./scripts/generate.ts",
49
48
  "deps": "taze --write --interactive --include-locked minor",
50
49
  "release": "bumpp"
51
50
  }
package/src/format.ts CHANGED
@@ -1,3 +1,10 @@
1
+ /**
2
+ * This module exports types for representing Bot API methods and types
3
+ * in a structured format.
4
+ *
5
+ * @module
6
+ */
7
+
1
8
  import type { types } from './types.gen.ts'
2
9
 
3
10
  /**
@@ -8,6 +15,9 @@ export type ApiType
8
15
  = | ApiTypeObject
9
16
  | ApiTypeOneOf
10
17
 
18
+ /**
19
+ * Bot API type represented as an object with fields.
20
+ */
11
21
  export interface ApiTypeObject {
12
22
  /**
13
23
  * Name of the type.
@@ -27,6 +37,9 @@ export interface ApiTypeObject {
27
37
  oneOf?: never
28
38
  }
29
39
 
40
+ /**
41
+ * Bot API type represented as a union of other types.
42
+ */
30
43
  export interface ApiTypeOneOf {
31
44
  /**
32
45
  * Name of the type.
@@ -46,6 +59,9 @@ export interface ApiTypeOneOf {
46
59
  fields?: never
47
60
  }
48
61
 
62
+ /**
63
+ * Bot API method with parameters and return type.
64
+ */
49
65
  export interface ApiMethod {
50
66
  /**
51
67
  * Name of the method.
@@ -68,6 +84,9 @@ export interface ApiMethod {
68
84
  returnType: ValueType
69
85
  }
70
86
 
87
+ /**
88
+ * Field of a type or parameter of a method.
89
+ */
71
90
  export interface FieldOrParam {
72
91
  /**
73
92
  * Name of the field/parameter.
@@ -88,11 +107,6 @@ export interface FieldOrParam {
88
107
  * Description of the field/parameter.
89
108
  */
90
109
  description: Description
91
-
92
- /**
93
- * Whether this field/parameter should be JSON-serialized.
94
- */
95
- jsonSerialized: boolean
96
110
  }
97
111
 
98
112
  /**
package/src/index.ts CHANGED
@@ -1,2 +1,9 @@
1
+ /**
2
+ * This module exports definitions of all Bot API methods and types.
3
+ *
4
+ * @module
5
+ */
6
+
1
7
  export { methods } from './methods.gen.ts'
8
+
2
9
  export { types } from './types.gen.ts'