@skravets/eapi 0.0.16 → 0.0.18
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/LICENSE +21 -21
- package/README.md +9 -3
- package/dist/api-types.d.cts +50 -1
- package/dist/api-types.d.ts +50 -1
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +19 -0
- package/package.json +2 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Kravets
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Kravets
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
package/dist/api-types.d.cts
CHANGED
|
@@ -11,6 +11,10 @@ interface paths {
|
|
|
11
11
|
/** Get Hello World! */
|
|
12
12
|
get: operations["app.getHello"];
|
|
13
13
|
};
|
|
14
|
+
"/messages/search": {
|
|
15
|
+
/** Search messages by phrases and time interval */
|
|
16
|
+
post: operations["messages.searchMessages"];
|
|
17
|
+
};
|
|
14
18
|
"/chats": {
|
|
15
19
|
/** Get Hello World! */
|
|
16
20
|
get: operations["channels.getHello"];
|
|
@@ -59,13 +63,35 @@ interface paths {
|
|
|
59
63
|
*/
|
|
60
64
|
interface components {
|
|
61
65
|
schemas: {
|
|
66
|
+
SearchMessagesDto: {
|
|
67
|
+
/**
|
|
68
|
+
* @description Search phrases (comma-separated)
|
|
69
|
+
* @example phrase1,phrase2
|
|
70
|
+
*/
|
|
71
|
+
phrases: string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Number of days to search back (default: 30)
|
|
74
|
+
* @example 60
|
|
75
|
+
*/
|
|
76
|
+
days?: number;
|
|
77
|
+
/**
|
|
78
|
+
* @description Start date for search (YYYY-MM-DD format)
|
|
79
|
+
* @example 2024-01-01
|
|
80
|
+
*/
|
|
81
|
+
fromDate?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description End date for search (YYYY-MM-DD format)
|
|
84
|
+
* @example 2024-12-31
|
|
85
|
+
*/
|
|
86
|
+
toDate?: string;
|
|
87
|
+
};
|
|
62
88
|
/** @description Message schema */
|
|
63
89
|
Message: {
|
|
64
90
|
/** @example 123 */
|
|
65
91
|
channel_id: number;
|
|
66
92
|
/**
|
|
67
93
|
* Format: date-time
|
|
68
|
-
* @example 2025-
|
|
94
|
+
* @example 2025-10-06T12:23:20.662Z
|
|
69
95
|
*/
|
|
70
96
|
message_created_at: string;
|
|
71
97
|
/** @example 123 */
|
|
@@ -323,6 +349,29 @@ interface operations {
|
|
|
323
349
|
};
|
|
324
350
|
};
|
|
325
351
|
};
|
|
352
|
+
"messages.searchMessages": {
|
|
353
|
+
parameters: {
|
|
354
|
+
header: {
|
|
355
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
356
|
+
Authorization: string;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
requestBody: {
|
|
360
|
+
content: {
|
|
361
|
+
"application/json": components["schemas"]["SearchMessagesDto"];
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
responses: {
|
|
365
|
+
201: {
|
|
366
|
+
headers: {
|
|
367
|
+
[name: string]: unknown;
|
|
368
|
+
};
|
|
369
|
+
content: {
|
|
370
|
+
"application/json": Record<string, never>[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
326
375
|
"channels.getHello": {
|
|
327
376
|
parameters: {
|
|
328
377
|
header: {
|
package/dist/api-types.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ interface paths {
|
|
|
11
11
|
/** Get Hello World! */
|
|
12
12
|
get: operations["app.getHello"];
|
|
13
13
|
};
|
|
14
|
+
"/messages/search": {
|
|
15
|
+
/** Search messages by phrases and time interval */
|
|
16
|
+
post: operations["messages.searchMessages"];
|
|
17
|
+
};
|
|
14
18
|
"/chats": {
|
|
15
19
|
/** Get Hello World! */
|
|
16
20
|
get: operations["channels.getHello"];
|
|
@@ -59,13 +63,35 @@ interface paths {
|
|
|
59
63
|
*/
|
|
60
64
|
interface components {
|
|
61
65
|
schemas: {
|
|
66
|
+
SearchMessagesDto: {
|
|
67
|
+
/**
|
|
68
|
+
* @description Search phrases (comma-separated)
|
|
69
|
+
* @example phrase1,phrase2
|
|
70
|
+
*/
|
|
71
|
+
phrases: string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Number of days to search back (default: 30)
|
|
74
|
+
* @example 60
|
|
75
|
+
*/
|
|
76
|
+
days?: number;
|
|
77
|
+
/**
|
|
78
|
+
* @description Start date for search (YYYY-MM-DD format)
|
|
79
|
+
* @example 2024-01-01
|
|
80
|
+
*/
|
|
81
|
+
fromDate?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description End date for search (YYYY-MM-DD format)
|
|
84
|
+
* @example 2024-12-31
|
|
85
|
+
*/
|
|
86
|
+
toDate?: string;
|
|
87
|
+
};
|
|
62
88
|
/** @description Message schema */
|
|
63
89
|
Message: {
|
|
64
90
|
/** @example 123 */
|
|
65
91
|
channel_id: number;
|
|
66
92
|
/**
|
|
67
93
|
* Format: date-time
|
|
68
|
-
* @example 2025-
|
|
94
|
+
* @example 2025-10-06T12:23:20.662Z
|
|
69
95
|
*/
|
|
70
96
|
message_created_at: string;
|
|
71
97
|
/** @example 123 */
|
|
@@ -323,6 +349,29 @@ interface operations {
|
|
|
323
349
|
};
|
|
324
350
|
};
|
|
325
351
|
};
|
|
352
|
+
"messages.searchMessages": {
|
|
353
|
+
parameters: {
|
|
354
|
+
header: {
|
|
355
|
+
/** @description `Basic token`, where token is `id:secret` base64 encoded */
|
|
356
|
+
Authorization: string;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
requestBody: {
|
|
360
|
+
content: {
|
|
361
|
+
"application/json": components["schemas"]["SearchMessagesDto"];
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
responses: {
|
|
365
|
+
201: {
|
|
366
|
+
headers: {
|
|
367
|
+
[name: string]: unknown;
|
|
368
|
+
};
|
|
369
|
+
content: {
|
|
370
|
+
"application/json": Record<string, never>[];
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
326
375
|
"channels.getHello": {
|
|
327
376
|
parameters: {
|
|
328
377
|
header: {
|
package/dist/index.cjs
CHANGED
|
@@ -108,6 +108,25 @@ class EApi {
|
|
|
108
108
|
return this.request("/", void 0, { method: "GET", ...options });
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
+
/**
|
|
112
|
+
* @tags messages
|
|
113
|
+
*/
|
|
114
|
+
messages = {
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* @tags messages
|
|
119
|
+
* @summary Search messages by phrases and time interval
|
|
120
|
+
*
|
|
121
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
122
|
+
*/
|
|
123
|
+
searchMessages: (body, options) => {
|
|
124
|
+
return this.request("/messages/search", body, {
|
|
125
|
+
method: "POST",
|
|
126
|
+
...options
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
111
130
|
/**
|
|
112
131
|
* @tags chats
|
|
113
132
|
*/
|
package/dist/index.d.cts
CHANGED
|
@@ -247,6 +247,20 @@ declare class EApi {
|
|
|
247
247
|
*/
|
|
248
248
|
getHello: (options?: RequestOptions) => Promise<GetResponse<"/", "get">>;
|
|
249
249
|
};
|
|
250
|
+
/**
|
|
251
|
+
* @tags messages
|
|
252
|
+
*/
|
|
253
|
+
messages: {
|
|
254
|
+
/**
|
|
255
|
+
*
|
|
256
|
+
*
|
|
257
|
+
* @tags messages
|
|
258
|
+
* @summary Search messages by phrases and time interval
|
|
259
|
+
*
|
|
260
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
261
|
+
*/
|
|
262
|
+
searchMessages: (body: GetRequestBody<"/messages/search", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/search", "post">>;
|
|
263
|
+
};
|
|
250
264
|
/**
|
|
251
265
|
* @tags chats
|
|
252
266
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -247,6 +247,20 @@ declare class EApi {
|
|
|
247
247
|
*/
|
|
248
248
|
getHello: (options?: RequestOptions) => Promise<GetResponse<"/", "get">>;
|
|
249
249
|
};
|
|
250
|
+
/**
|
|
251
|
+
* @tags messages
|
|
252
|
+
*/
|
|
253
|
+
messages: {
|
|
254
|
+
/**
|
|
255
|
+
*
|
|
256
|
+
*
|
|
257
|
+
* @tags messages
|
|
258
|
+
* @summary Search messages by phrases and time interval
|
|
259
|
+
*
|
|
260
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
261
|
+
*/
|
|
262
|
+
searchMessages: (body: GetRequestBody<"/messages/search", "post">, options?: RequestOptions) => Promise<GetResponse<"/messages/search", "post">>;
|
|
263
|
+
};
|
|
250
264
|
/**
|
|
251
265
|
* @tags chats
|
|
252
266
|
*/
|
package/dist/index.js
CHANGED
|
@@ -106,6 +106,25 @@ class EApi {
|
|
|
106
106
|
return this.request("/", void 0, { method: "GET", ...options });
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* @tags messages
|
|
111
|
+
*/
|
|
112
|
+
messages = {
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* @tags messages
|
|
117
|
+
* @summary Search messages by phrases and time interval
|
|
118
|
+
*
|
|
119
|
+
* [Documentation](.../messages/operation/messages.searchMessages)
|
|
120
|
+
*/
|
|
121
|
+
searchMessages: (body, options) => {
|
|
122
|
+
return this.request("/messages/search", body, {
|
|
123
|
+
method: "POST",
|
|
124
|
+
...options
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
109
128
|
/**
|
|
110
129
|
* @tags chats
|
|
111
130
|
*/
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skravets/eapi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"module": "./dist/index.js",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
+
"generate": "bun scripts/generate.ts",
|
|
8
9
|
"build": "bunx pkgroll",
|
|
9
10
|
"prepublishOnly": "bunx pkgroll"
|
|
10
11
|
},
|