@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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- [![bot-api](https://img.shields.io/badge/v9.3-000?style=flat&logo=telegram&logoColor=%2325A3E1&label=Bot%20API&labelColor=%23000&color=%2325A3E1)][bot-api]
2
- [![npm](https://img.shields.io/npm/v/%40grom.js%2Fbot-api-spec?style=flat&logo=npm&logoColor=%23BB443E&logoSize=auto&label=%C2%A0&labelColor=%23fff&color=%23BB443E)](https://www.npmjs.com/package/@grom.js/tgx)
3
- [![jsr](https://img.shields.io/jsr/v/%40grom/bot-api-spec?style=flat&logo=jsr&logoColor=%231B3646&logoSize=auto&label=%C2%A0&labelColor=%23F3E051&color=%231B3646)](https://jsr.io/@grom/tgx)
1
+ [![bot-api](https://img.shields.io/badge/v9.4-000?style=flat&logo=telegram&logoColor=%2325A3E1&label=Bot%20API&labelColor=%23000&color=%2325A3E1)][bot-api]
2
+ [![npm](https://img.shields.io/npm/v/%40grom.js%2Fbot-api-spec?style=flat&logo=npm&logoColor=%23BB443E&logoSize=auto&label=Latest&labelColor=%23fff&color=%23BB443E)](https://www.npmjs.com/package/@grom.js/bot-api-spec)
3
+ [![jsr](https://img.shields.io/jsr/v/%40grom/bot-api-spec?style=flat&logo=jsr&logoColor=%231B3646&logoSize=auto&label=Latest&labelColor=%23F3E051&color=%231B3646)](https://jsr.io/@grom/bot-api-spec)
4
4
 
5
5
  [Telegram Bot API][bot-api] specification as a collection of JavaScript objects in a [custom format](#format).
6
6
 
package/dist/format.d.ts CHANGED
@@ -1,9 +1,18 @@
1
+ /**
2
+ * This module exports types for representing Bot API methods and types
3
+ * in a structured format.
4
+ *
5
+ * @module
6
+ */
1
7
  import type { types } from './types.gen.ts';
2
8
  /**
3
9
  * Type defined in the API. It can either be an {@link ApiTypeObject object}
4
10
  * or a {@link ApiTypeOneOf union}.
5
11
  */
6
12
  export type ApiType = ApiTypeObject | ApiTypeOneOf;
13
+ /**
14
+ * Bot API type represented as an object with fields.
15
+ */
7
16
  export interface ApiTypeObject {
8
17
  /**
9
18
  * Name of the type.
@@ -19,6 +28,9 @@ export interface ApiTypeObject {
19
28
  fields: Array<FieldOrParam>;
20
29
  oneOf?: never;
21
30
  }
31
+ /**
32
+ * Bot API type represented as a union of other types.
33
+ */
22
34
  export interface ApiTypeOneOf {
23
35
  /**
24
36
  * Name of the type.
@@ -34,6 +46,9 @@ export interface ApiTypeOneOf {
34
46
  oneOf: Array<ValueTypeApiType>;
35
47
  fields?: never;
36
48
  }
49
+ /**
50
+ * Bot API method with parameters and return type.
51
+ */
37
52
  export interface ApiMethod {
38
53
  /**
39
54
  * Name of the method.
@@ -52,6 +67,9 @@ export interface ApiMethod {
52
67
  */
53
68
  returnType: ValueType;
54
69
  }
70
+ /**
71
+ * Field of a type or parameter of a method.
72
+ */
55
73
  export interface FieldOrParam {
56
74
  /**
57
75
  * Name of the field/parameter.
@@ -69,10 +87,6 @@ export interface FieldOrParam {
69
87
  * Description of the field/parameter.
70
88
  */
71
89
  description: Description;
72
- /**
73
- * Whether this field/parameter should be JSON-serialized.
74
- */
75
- jsonSerialized: boolean;
76
90
  }
77
91
  /**
78
92
  * Description of a type/method/field/parameter.
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;GAGG;AACH,MAAM,MAAM,OAAO,GACb,aAAa,GACb,YAAY,CAAA;AAElB,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,WAAW,EAAE,WAAW,CAAA;IAExB;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;IAE3B,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;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,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,MAAM,OAAO,KAAK,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,SAAS,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;CACxB"}
package/dist/format.js CHANGED
@@ -1,2 +1,8 @@
1
+ /**
2
+ * This module exports types for representing Bot API methods and types
3
+ * in a structured format.
4
+ *
5
+ * @module
6
+ */
1
7
  export {};
2
8
  //# sourceMappingURL=format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This module exports definitions of all Bot API methods and types.
3
+ *
4
+ * @module
5
+ */
1
6
  export { methods } from './methods.gen.ts';
2
7
  export { types } from './types.gen.ts';
3
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This module exports definitions of all Bot API methods and types.
3
+ *
4
+ * @module
5
+ */
1
6
  export { methods } from "./methods.gen.js";
2
7
  export { types } from "./types.gen.js";
3
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA"}
@@ -42,6 +42,7 @@ export declare const methods: {
42
42
  sendChatAction: ApiMethod;
43
43
  setMessageReaction: ApiMethod;
44
44
  getUserProfilePhotos: ApiMethod;
45
+ getUserProfileAudios: ApiMethod;
45
46
  setUserEmojiStatus: ApiMethod;
46
47
  getFile: ApiMethod;
47
48
  banChatMember: ApiMethod;
@@ -99,6 +100,8 @@ export declare const methods: {
99
100
  getMyDescription: ApiMethod;
100
101
  setMyShortDescription: ApiMethod;
101
102
  getMyShortDescription: ApiMethod;
103
+ setMyProfilePhoto: ApiMethod;
104
+ removeMyProfilePhoto: ApiMethod;
102
105
  setChatMenuButton: ApiMethod;
103
106
  getChatMenuButton: ApiMethod;
104
107
  setMyDefaultAdministratorRights: ApiMethod;
@@ -1 +1 @@
1
- {"version":3,"file":"methods.gen.d.ts","sourceRoot":"","sources":["../src/methods.gen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAklY5C;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmKnB,CAAA"}
1
+ {"version":3,"file":"methods.gen.d.ts","sourceRoot":"","sources":["../src/methods.gen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AA+0X5C;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKnB,CAAA"}