telegram-jobs-contract 1.0.13 → 1.0.14
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/dist/contracts/channels.contract.d.ts +191 -307
- package/dist/contracts/channels.contract.d.ts.map +1 -1
- package/dist/contracts/channels.contract.js +26 -10
- package/dist/contracts/stats.contract.d.ts +4 -4
- package/dist/index.d.ts +195 -311
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/channels.contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channels.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/channels.contract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiI3B,CAAC"}
|
|
@@ -6,12 +6,20 @@ const channels_1 = require("../schemas/channels");
|
|
|
6
6
|
const errors_1 = require("../schemas/errors");
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
const c = (0, core_1.initContract)();
|
|
9
|
+
// Channel info for explore view (simplified)
|
|
10
|
+
const ChannelInfoSchema = zod_1.z.object({
|
|
11
|
+
username: zod_1.z.string(),
|
|
12
|
+
title: zod_1.z.string(),
|
|
13
|
+
description: zod_1.z.string().optional(),
|
|
14
|
+
memberCount: zod_1.z.number().optional(),
|
|
15
|
+
isJoined: zod_1.z.boolean(),
|
|
16
|
+
});
|
|
9
17
|
exports.channelsContract = c.router({
|
|
10
18
|
getAvailableChannels: {
|
|
11
19
|
method: 'GET',
|
|
12
20
|
path: '/api/channels/available',
|
|
13
21
|
responses: {
|
|
14
|
-
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.
|
|
22
|
+
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.array(channels_1.ChannelSchema)),
|
|
15
23
|
401: errors_1.ErrorResponseSchema,
|
|
16
24
|
500: errors_1.ErrorResponseSchema,
|
|
17
25
|
},
|
|
@@ -21,7 +29,7 @@ exports.channelsContract = c.router({
|
|
|
21
29
|
method: 'GET',
|
|
22
30
|
path: '/api/channels/user-channels',
|
|
23
31
|
responses: {
|
|
24
|
-
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.
|
|
32
|
+
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.array(channels_1.ChannelSchema)),
|
|
25
33
|
401: errors_1.ErrorResponseSchema,
|
|
26
34
|
500: errors_1.ErrorResponseSchema,
|
|
27
35
|
},
|
|
@@ -48,8 +56,15 @@ exports.channelsContract = c.router({
|
|
|
48
56
|
exploreChannels: {
|
|
49
57
|
method: 'GET',
|
|
50
58
|
path: '/api/channels/explore',
|
|
59
|
+
query: zod_1.z.object({
|
|
60
|
+
searchQuery: zod_1.z.string().optional(),
|
|
61
|
+
categories: zod_1.z.array(zod_1.z.string()).optional(),
|
|
62
|
+
}),
|
|
51
63
|
responses: {
|
|
52
|
-
200: (0, errors_1.SuccessResponseSchema)(
|
|
64
|
+
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.object({
|
|
65
|
+
channels: zod_1.z.array(ChannelInfoSchema),
|
|
66
|
+
missedJobsCount: zod_1.z.number(),
|
|
67
|
+
})),
|
|
53
68
|
401: errors_1.ErrorResponseSchema,
|
|
54
69
|
500: errors_1.ErrorResponseSchema,
|
|
55
70
|
},
|
|
@@ -69,10 +84,10 @@ exports.channelsContract = c.router({
|
|
|
69
84
|
subscribeToChannels: {
|
|
70
85
|
method: 'POST',
|
|
71
86
|
path: '/api/channels/subscribe',
|
|
72
|
-
body: zod_1.z.object({
|
|
87
|
+
body: zod_1.z.object({ channels: zod_1.z.array(zod_1.z.string()) }),
|
|
73
88
|
responses: {
|
|
74
89
|
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.object({
|
|
75
|
-
|
|
90
|
+
success: zod_1.z.boolean(),
|
|
76
91
|
message: zod_1.z.string(),
|
|
77
92
|
})),
|
|
78
93
|
400: errors_1.ErrorResponseSchema,
|
|
@@ -84,10 +99,10 @@ exports.channelsContract = c.router({
|
|
|
84
99
|
addChannels: {
|
|
85
100
|
method: 'POST',
|
|
86
101
|
path: '/api/channels/add',
|
|
87
|
-
body: zod_1.z.object({
|
|
102
|
+
body: zod_1.z.object({ channels: zod_1.z.array(zod_1.z.string()) }),
|
|
88
103
|
responses: {
|
|
89
104
|
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.object({
|
|
90
|
-
|
|
105
|
+
success: zod_1.z.boolean(),
|
|
91
106
|
message: zod_1.z.string(),
|
|
92
107
|
})),
|
|
93
108
|
400: errors_1.ErrorResponseSchema,
|
|
@@ -99,11 +114,12 @@ exports.channelsContract = c.router({
|
|
|
99
114
|
unsubscribeFromChannel: {
|
|
100
115
|
method: 'POST',
|
|
101
116
|
path: '/api/channels/unsubscribe',
|
|
102
|
-
body: zod_1.z.object({
|
|
117
|
+
body: zod_1.z.object({ channel: zod_1.z.string() }),
|
|
103
118
|
responses: {
|
|
104
119
|
200: (0, errors_1.SuccessResponseSchema)(zod_1.z.object({
|
|
105
|
-
|
|
106
|
-
|
|
120
|
+
success: zod_1.z.boolean(),
|
|
121
|
+
totalChannels: zod_1.z.number(),
|
|
122
|
+
swapsRemaining: zod_1.z.number().optional(),
|
|
107
123
|
})),
|
|
108
124
|
400: errors_1.ErrorResponseSchema,
|
|
109
125
|
401: errors_1.ErrorResponseSchema,
|
|
@@ -15,14 +15,14 @@ export declare const statsContract: {
|
|
|
15
15
|
activeUsers: z.ZodNumber;
|
|
16
16
|
jobsLast24h: z.ZodNumber;
|
|
17
17
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
totalJobs: number;
|
|
19
18
|
totalChannels: number;
|
|
19
|
+
totalJobs: number;
|
|
20
20
|
totalUsers: number;
|
|
21
21
|
activeUsers: number;
|
|
22
22
|
jobsLast24h: number;
|
|
23
23
|
}, {
|
|
24
|
-
totalJobs: number;
|
|
25
24
|
totalChannels: number;
|
|
25
|
+
totalJobs: number;
|
|
26
26
|
totalUsers: number;
|
|
27
27
|
activeUsers: number;
|
|
28
28
|
jobsLast24h: number;
|
|
@@ -31,8 +31,8 @@ export declare const statsContract: {
|
|
|
31
31
|
message: string;
|
|
32
32
|
success: true;
|
|
33
33
|
data: {
|
|
34
|
-
totalJobs: number;
|
|
35
34
|
totalChannels: number;
|
|
35
|
+
totalJobs: number;
|
|
36
36
|
totalUsers: number;
|
|
37
37
|
activeUsers: number;
|
|
38
38
|
jobsLast24h: number;
|
|
@@ -41,8 +41,8 @@ export declare const statsContract: {
|
|
|
41
41
|
message: string;
|
|
42
42
|
success: true;
|
|
43
43
|
data: {
|
|
44
|
-
totalJobs: number;
|
|
45
44
|
totalChannels: number;
|
|
45
|
+
totalJobs: number;
|
|
46
46
|
totalUsers: number;
|
|
47
47
|
activeUsers: number;
|
|
48
48
|
jobsLast24h: number;
|