telegram-jobs-contract 1.0.13 → 1.0.15

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.
@@ -1 +1 @@
1
- {"version":3,"file":"channels.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/channels.contract.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkI3B,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.object({ channels: zod_1.z.array(channels_1.ChannelSchema) })),
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.object({ channels: zod_1.z.array(channels_1.ChannelSchema) })),
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
  },
@@ -40,7 +48,7 @@ exports.channelsContract = c.router({
40
48
  method: 'GET',
41
49
  path: '/api/channels/categories',
42
50
  responses: {
43
- 200: (0, errors_1.SuccessResponseSchema)(zod_1.z.array(channels_1.CategorySchema)),
51
+ 200: (0, errors_1.SuccessResponseSchema)(zod_1.z.array(zod_1.z.string())),
44
52
  500: errors_1.ErrorResponseSchema,
45
53
  },
46
54
  summary: 'Get all channel categories',
@@ -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)(channels_1.ExploreChannelsResponseSchema),
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
  },
@@ -60,7 +75,7 @@ exports.channelsContract = c.router({
60
75
  path: '/api/channels/search',
61
76
  body: zod_1.z.object({ query: zod_1.z.string() }),
62
77
  responses: {
63
- 200: (0, errors_1.SuccessResponseSchema)(zod_1.z.array(channels_1.ChannelSchema)),
78
+ 200: (0, errors_1.SuccessResponseSchema)(zod_1.z.array(ChannelInfoSchema)),
64
79
  400: errors_1.ErrorResponseSchema,
65
80
  500: errors_1.ErrorResponseSchema,
66
81
  },
@@ -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({ channelUsernames: zod_1.z.array(zod_1.z.string()) }),
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
- subscribedChannels: zod_1.z.array(zod_1.z.string()),
90
+ success: zod_1.z.boolean(),
76
91
  message: zod_1.z.string(),
77
92
  })),
78
93
  400: errors_1.ErrorResponseSchema,
@@ -84,11 +99,12 @@ exports.channelsContract = c.router({
84
99
  addChannels: {
85
100
  method: 'POST',
86
101
  path: '/api/channels/add',
87
- body: zod_1.z.object({ channelUsernames: zod_1.z.array(zod_1.z.string()) }),
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
- subscribedChannels: zod_1.z.array(zod_1.z.string()),
91
- message: zod_1.z.string(),
105
+ success: zod_1.z.boolean(),
106
+ totalChannels: zod_1.z.number(),
107
+ swapsRemaining: zod_1.z.number().optional(),
92
108
  })),
93
109
  400: errors_1.ErrorResponseSchema,
94
110
  401: errors_1.ErrorResponseSchema,
@@ -99,11 +115,12 @@ exports.channelsContract = c.router({
99
115
  unsubscribeFromChannel: {
100
116
  method: 'POST',
101
117
  path: '/api/channels/unsubscribe',
102
- body: zod_1.z.object({ channelUsername: zod_1.z.string() }),
118
+ body: zod_1.z.object({ channel: zod_1.z.string() }),
103
119
  responses: {
104
120
  200: (0, errors_1.SuccessResponseSchema)(zod_1.z.object({
105
- subscribedChannels: zod_1.z.array(zod_1.z.string()),
106
- message: zod_1.z.string(),
121
+ success: zod_1.z.boolean(),
122
+ totalChannels: zod_1.z.number(),
123
+ swapsRemaining: zod_1.z.number().optional(),
107
124
  })),
108
125
  400: errors_1.ErrorResponseSchema,
109
126
  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;