postproxy-mcp 1.0.2 → 1.2.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/dist/api/client.d.ts +27 -1
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +99 -0
- package/dist/api/client.js.map +1 -1
- package/dist/server.d.ts +192 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +197 -6
- package/dist/server.js.map +1 -1
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -2
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/post.d.ts +6 -0
- package/dist/tools/post.d.ts.map +1 -1
- package/dist/tools/post.js +22 -8
- package/dist/tools/post.js.map +1 -1
- package/dist/tools/queue.d.ts +73 -0
- package/dist/tools/queue.d.ts.map +1 -0
- package/dist/tools/queue.js +167 -0
- package/dist/tools/queue.js.map +1 -0
- package/dist/types/index.d.ts +91 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +63 -2
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +12 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +1 -1
- package/src/api/client.ts +112 -0
- package/src/server.ts +204 -6
- package/src/tools/history.ts +5 -2
- package/src/tools/post.ts +29 -14
- package/src/tools/queue.ts +230 -0
- package/src/types/index.ts +84 -11
- package/src/utils/validation.ts +13 -0
- package/worker/index.ts +366 -19
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Queue tools: queues.list, queues.get, queues.create, queues.update, queues.delete, queues.next_slot
|
|
3
|
+
*/
|
|
4
|
+
import { createError, ErrorCodes } from "../utils/errors.js";
|
|
5
|
+
import { logError } from "../utils/logger.js";
|
|
6
|
+
const DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
7
|
+
function formatTimeslots(timeslots) {
|
|
8
|
+
return timeslots.map((ts) => `${DAY_NAMES[ts.day]} at ${ts.time} (id: ${ts.id})`);
|
|
9
|
+
}
|
|
10
|
+
export async function handleQueuesList(client, args) {
|
|
11
|
+
try {
|
|
12
|
+
const queues = await client.listQueues(args.profile_group_id);
|
|
13
|
+
return {
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: "text",
|
|
17
|
+
text: JSON.stringify({
|
|
18
|
+
queues: queues.map((q) => ({
|
|
19
|
+
id: q.id,
|
|
20
|
+
name: q.name,
|
|
21
|
+
description: q.description,
|
|
22
|
+
timezone: q.timezone,
|
|
23
|
+
enabled: q.enabled,
|
|
24
|
+
jitter: q.jitter,
|
|
25
|
+
profile_group_id: q.profile_group_id,
|
|
26
|
+
timeslots: formatTimeslots(q.timeslots),
|
|
27
|
+
posts_count: q.posts_count,
|
|
28
|
+
})),
|
|
29
|
+
}, null, 2),
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
logError(error, "queues.list");
|
|
36
|
+
throw createError(ErrorCodes.API_ERROR, `Failed to list queues: ${error.message}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export async function handleQueuesGet(client, args) {
|
|
40
|
+
if (!args.queue_id) {
|
|
41
|
+
throw createError(ErrorCodes.VALIDATION_ERROR, "queue_id is required");
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const queue = await client.getQueue(args.queue_id);
|
|
45
|
+
return {
|
|
46
|
+
content: [
|
|
47
|
+
{
|
|
48
|
+
type: "text",
|
|
49
|
+
text: JSON.stringify({
|
|
50
|
+
...queue,
|
|
51
|
+
timeslots_formatted: formatTimeslots(queue.timeslots),
|
|
52
|
+
}, null, 2),
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
logError(error, "queues.get");
|
|
59
|
+
throw createError(ErrorCodes.API_ERROR, `Failed to get queue: ${error.message}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export async function handleQueuesCreate(client, args) {
|
|
63
|
+
if (!args.profile_group_id) {
|
|
64
|
+
throw createError(ErrorCodes.VALIDATION_ERROR, "profile_group_id is required");
|
|
65
|
+
}
|
|
66
|
+
if (!args.name) {
|
|
67
|
+
throw createError(ErrorCodes.VALIDATION_ERROR, "name is required");
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const queue = await client.createQueue({
|
|
71
|
+
profile_group_id: args.profile_group_id,
|
|
72
|
+
name: args.name,
|
|
73
|
+
description: args.description,
|
|
74
|
+
timezone: args.timezone,
|
|
75
|
+
jitter: args.jitter,
|
|
76
|
+
timeslots: args.timeslots,
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
content: [
|
|
80
|
+
{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: JSON.stringify({
|
|
83
|
+
...queue,
|
|
84
|
+
timeslots_formatted: formatTimeslots(queue.timeslots),
|
|
85
|
+
message: "Queue created successfully",
|
|
86
|
+
}, null, 2),
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
logError(error, "queues.create");
|
|
93
|
+
throw createError(ErrorCodes.API_ERROR, `Failed to create queue: ${error.message}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export async function handleQueuesUpdate(client, args) {
|
|
97
|
+
if (!args.queue_id) {
|
|
98
|
+
throw createError(ErrorCodes.VALIDATION_ERROR, "queue_id is required");
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const queue = await client.updateQueue(args.queue_id, {
|
|
102
|
+
name: args.name,
|
|
103
|
+
description: args.description,
|
|
104
|
+
timezone: args.timezone,
|
|
105
|
+
enabled: args.enabled,
|
|
106
|
+
jitter: args.jitter,
|
|
107
|
+
timeslots: args.timeslots,
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
content: [
|
|
111
|
+
{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: JSON.stringify({
|
|
114
|
+
...queue,
|
|
115
|
+
timeslots_formatted: formatTimeslots(queue.timeslots),
|
|
116
|
+
message: "Queue updated successfully",
|
|
117
|
+
}, null, 2),
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
logError(error, "queues.update");
|
|
124
|
+
throw createError(ErrorCodes.API_ERROR, `Failed to update queue: ${error.message}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export async function handleQueuesDelete(client, args) {
|
|
128
|
+
if (!args.queue_id) {
|
|
129
|
+
throw createError(ErrorCodes.VALIDATION_ERROR, "queue_id is required");
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
await client.deleteQueue(args.queue_id);
|
|
133
|
+
return {
|
|
134
|
+
content: [
|
|
135
|
+
{
|
|
136
|
+
type: "text",
|
|
137
|
+
text: JSON.stringify({ queue_id: args.queue_id, deleted: true }, null, 2),
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
logError(error, "queues.delete");
|
|
144
|
+
throw createError(ErrorCodes.API_ERROR, `Failed to delete queue: ${error.message}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export async function handleQueuesNextSlot(client, args) {
|
|
148
|
+
if (!args.queue_id) {
|
|
149
|
+
throw createError(ErrorCodes.VALIDATION_ERROR, "queue_id is required");
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
const result = await client.getQueueNextSlot(args.queue_id);
|
|
153
|
+
return {
|
|
154
|
+
content: [
|
|
155
|
+
{
|
|
156
|
+
type: "text",
|
|
157
|
+
text: JSON.stringify(result, null, 2),
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
logError(error, "queues.next_slot");
|
|
164
|
+
throw createError(ErrorCodes.API_ERROR, `Failed to get next slot: ${error.message}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/tools/queue.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEjG,SAAS,eAAe,CAAC,SAA2D;IAClF,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAuB,EACvB,IAAmC;IAEnC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAE9D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;wBACE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;4BACzB,EAAE,EAAE,CAAC,CAAC,EAAE;4BACR,IAAI,EAAE,CAAC,CAAC,IAAI;4BACZ,WAAW,EAAE,CAAC,CAAC,WAAW;4BAC1B,QAAQ,EAAE,CAAC,CAAC,QAAQ;4BACpB,OAAO,E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AC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC1E;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,KAAc,EAAE,eAAe,CAAC,CAAC;QAC1C,MAAM,WAAW,CAAC,UAAU,CAAC,SAAS,EAAE,2BAA4B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAuB,EACvB,IAA0B;IAE1B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,MAAM,WAAW,CAAC,UAAU,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE5D,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBACtC;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,KAAc,EAAE,kBAAkB,CAAC,CAAC;QAC7C,MAAM,WAAW,CAAC,UAAU,CAAC,SAAS,EAAE,4BAA6B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;AACH,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -18,6 +18,18 @@ export interface Profile {
|
|
|
18
18
|
username?: string;
|
|
19
19
|
avatar_url?: string;
|
|
20
20
|
}
|
|
21
|
+
export interface ThreadChild {
|
|
22
|
+
body: string;
|
|
23
|
+
media?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface MediaAttachment {
|
|
26
|
+
id: string;
|
|
27
|
+
status: "pending" | "processed" | "failed";
|
|
28
|
+
error_message: string | null;
|
|
29
|
+
content_type: string;
|
|
30
|
+
source_url: string | null;
|
|
31
|
+
url: string | null;
|
|
32
|
+
}
|
|
21
33
|
export interface CreatePostParams {
|
|
22
34
|
content: string;
|
|
23
35
|
profile_group_id?: number;
|
|
@@ -27,16 +39,25 @@ export interface CreatePostParams {
|
|
|
27
39
|
idempotency_key?: string;
|
|
28
40
|
draft?: boolean;
|
|
29
41
|
platforms?: PlatformParams;
|
|
42
|
+
thread?: ThreadChild[];
|
|
43
|
+
queue_id?: string;
|
|
44
|
+
queue_priority?: "high" | "medium" | "low";
|
|
30
45
|
}
|
|
31
46
|
export interface CreatePostResponse {
|
|
32
47
|
id: string;
|
|
33
48
|
body?: string;
|
|
34
49
|
content?: string;
|
|
35
|
-
status: "draft" | "pending" | "processing" | "processed" | "scheduled";
|
|
50
|
+
status: "draft" | "pending" | "processing" | "processed" | "scheduled" | "media_processing_failed";
|
|
36
51
|
draft: boolean;
|
|
37
52
|
scheduled_at: string | null;
|
|
38
53
|
created_at: string;
|
|
54
|
+
media?: MediaAttachment[];
|
|
39
55
|
platforms: PlatformOutcome[];
|
|
56
|
+
thread?: Array<{
|
|
57
|
+
id: string;
|
|
58
|
+
body: string;
|
|
59
|
+
media?: MediaAttachment[];
|
|
60
|
+
}>;
|
|
40
61
|
}
|
|
41
62
|
export interface PlatformOutcome {
|
|
42
63
|
platform: string;
|
|
@@ -56,23 +77,35 @@ export interface PostDetails {
|
|
|
56
77
|
id: string;
|
|
57
78
|
body?: string;
|
|
58
79
|
content?: string;
|
|
59
|
-
status: "draft" | "pending" | "processing" | "processed" | "scheduled";
|
|
80
|
+
status: "draft" | "pending" | "processing" | "processed" | "scheduled" | "media_processing_failed";
|
|
60
81
|
draft: boolean;
|
|
61
82
|
scheduled_at: string | null;
|
|
62
83
|
created_at: string;
|
|
63
84
|
updated_at?: string;
|
|
85
|
+
media?: MediaAttachment[];
|
|
64
86
|
platforms: PlatformOutcome[];
|
|
87
|
+
thread?: Array<{
|
|
88
|
+
id: string;
|
|
89
|
+
body: string;
|
|
90
|
+
media?: MediaAttachment[];
|
|
91
|
+
}>;
|
|
65
92
|
}
|
|
66
93
|
export interface Post {
|
|
67
94
|
id: string;
|
|
68
95
|
body?: string;
|
|
69
96
|
content?: string;
|
|
70
|
-
status: "draft" | "pending" | "processing" | "processed" | "scheduled";
|
|
97
|
+
status: "draft" | "pending" | "processing" | "processed" | "scheduled" | "media_processing_failed";
|
|
71
98
|
draft: boolean;
|
|
72
99
|
scheduled_at: string | null;
|
|
73
100
|
created_at: string;
|
|
74
101
|
updated_at?: string;
|
|
102
|
+
media?: MediaAttachment[];
|
|
75
103
|
platforms: PlatformOutcome[];
|
|
104
|
+
thread?: Array<{
|
|
105
|
+
id: string;
|
|
106
|
+
body: string;
|
|
107
|
+
media?: MediaAttachment[];
|
|
108
|
+
}>;
|
|
76
109
|
}
|
|
77
110
|
/**
|
|
78
111
|
* Platform-specific parameters for Instagram
|
|
@@ -93,11 +126,13 @@ export interface YouTubeParams {
|
|
|
93
126
|
title?: string;
|
|
94
127
|
privacy_status?: "public" | "unlisted" | "private";
|
|
95
128
|
cover_url?: string;
|
|
129
|
+
made_for_kids?: boolean;
|
|
96
130
|
}
|
|
97
131
|
/**
|
|
98
132
|
* Platform-specific parameters for TikTok
|
|
99
133
|
*/
|
|
100
134
|
export interface TikTokParams {
|
|
135
|
+
format?: "video" | "image";
|
|
101
136
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
|
|
102
137
|
photo_cover_index?: number;
|
|
103
138
|
auto_add_music?: boolean;
|
|
@@ -178,4 +213,57 @@ export interface PostStats {
|
|
|
178
213
|
export interface StatsResponse {
|
|
179
214
|
data: Record<string, PostStats>;
|
|
180
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Queue timeslot definition
|
|
218
|
+
*/
|
|
219
|
+
export interface QueueTimeslot {
|
|
220
|
+
id: number;
|
|
221
|
+
day: number;
|
|
222
|
+
time: string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Post queue
|
|
226
|
+
*/
|
|
227
|
+
export interface PostQueue {
|
|
228
|
+
id: string;
|
|
229
|
+
name: string;
|
|
230
|
+
description: string | null;
|
|
231
|
+
timezone: string;
|
|
232
|
+
enabled: boolean;
|
|
233
|
+
jitter: number;
|
|
234
|
+
profile_group_id: string;
|
|
235
|
+
timeslots: QueueTimeslot[];
|
|
236
|
+
posts_count: number;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Parameters for creating a queue
|
|
240
|
+
*/
|
|
241
|
+
export interface CreateQueueParams {
|
|
242
|
+
profile_group_id: string;
|
|
243
|
+
name: string;
|
|
244
|
+
description?: string;
|
|
245
|
+
timezone?: string;
|
|
246
|
+
jitter?: number;
|
|
247
|
+
timeslots?: Array<{
|
|
248
|
+
day: number;
|
|
249
|
+
time: string;
|
|
250
|
+
}>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Parameters for updating a queue
|
|
254
|
+
*/
|
|
255
|
+
export interface UpdateQueueParams {
|
|
256
|
+
name?: string;
|
|
257
|
+
description?: string;
|
|
258
|
+
timezone?: string;
|
|
259
|
+
enabled?: boolean;
|
|
260
|
+
jitter?: number;
|
|
261
|
+
timeslots?: Array<{
|
|
262
|
+
day: number;
|
|
263
|
+
time: string;
|
|
264
|
+
} | {
|
|
265
|
+
id: number;
|
|
266
|
+
_destroy: true;
|
|
267
|
+
}>;
|
|
268
|
+
}
|
|
181
269
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IAC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AClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;CACnF"}
|
|
@@ -50,16 +50,20 @@ export declare const YouTubeParamsSchema: z.ZodObject<{
|
|
|
50
50
|
title: z.ZodOptional<z.ZodString>;
|
|
51
51
|
privacy_status: z.ZodOptional<z.ZodEnum<["public", "unlisted", "private"]>>;
|
|
52
52
|
cover_url: z.ZodOptional<z.ZodString>;
|
|
53
|
+
made_for_kids: z.ZodOptional<z.ZodBoolean>;
|
|
53
54
|
}, "strict", z.ZodTypeAny, {
|
|
54
55
|
cover_url?: string | undefined;
|
|
55
56
|
title?: string | undefined;
|
|
56
57
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
58
|
+
made_for_kids?: boolean | undefined;
|
|
57
59
|
}, {
|
|
58
60
|
cover_url?: string | undefined;
|
|
59
61
|
title?: string | undefined;
|
|
60
62
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
63
|
+
made_for_kids?: boolean | undefined;
|
|
61
64
|
}>;
|
|
62
65
|
export declare const TikTokParamsSchema: z.ZodObject<{
|
|
66
|
+
format: z.ZodOptional<z.ZodEnum<["video", "image"]>>;
|
|
63
67
|
privacy_status: z.ZodOptional<z.ZodEnum<["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "FOLLOWER_OF_CREATOR", "SELF_ONLY"]>>;
|
|
64
68
|
photo_cover_index: z.ZodOptional<z.ZodNumber>;
|
|
65
69
|
auto_add_music: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -70,6 +74,7 @@ export declare const TikTokParamsSchema: z.ZodObject<{
|
|
|
70
74
|
brand_content_toggle: z.ZodOptional<z.ZodBoolean>;
|
|
71
75
|
brand_organic_toggle: z.ZodOptional<z.ZodBoolean>;
|
|
72
76
|
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
format?: "video" | "image" | undefined;
|
|
73
78
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
74
79
|
photo_cover_index?: number | undefined;
|
|
75
80
|
auto_add_music?: boolean | undefined;
|
|
@@ -80,6 +85,7 @@ export declare const TikTokParamsSchema: z.ZodObject<{
|
|
|
80
85
|
brand_content_toggle?: boolean | undefined;
|
|
81
86
|
brand_organic_toggle?: boolean | undefined;
|
|
82
87
|
}, {
|
|
88
|
+
format?: "video" | "image" | undefined;
|
|
83
89
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
84
90
|
photo_cover_index?: number | undefined;
|
|
85
91
|
auto_add_music?: boolean | undefined;
|
|
@@ -142,16 +148,20 @@ export declare const PlatformParamsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
142
148
|
title: z.ZodOptional<z.ZodString>;
|
|
143
149
|
privacy_status: z.ZodOptional<z.ZodEnum<["public", "unlisted", "private"]>>;
|
|
144
150
|
cover_url: z.ZodOptional<z.ZodString>;
|
|
151
|
+
made_for_kids: z.ZodOptional<z.ZodBoolean>;
|
|
145
152
|
}, "strict", z.ZodTypeAny, {
|
|
146
153
|
cover_url?: string | undefined;
|
|
147
154
|
title?: string | undefined;
|
|
148
155
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
156
|
+
made_for_kids?: boolean | undefined;
|
|
149
157
|
}, {
|
|
150
158
|
cover_url?: string | undefined;
|
|
151
159
|
title?: string | undefined;
|
|
152
160
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
161
|
+
made_for_kids?: boolean | undefined;
|
|
153
162
|
}>>;
|
|
154
163
|
tiktok: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
format: z.ZodOptional<z.ZodEnum<["video", "image"]>>;
|
|
155
165
|
privacy_status: z.ZodOptional<z.ZodEnum<["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "FOLLOWER_OF_CREATOR", "SELF_ONLY"]>>;
|
|
156
166
|
photo_cover_index: z.ZodOptional<z.ZodNumber>;
|
|
157
167
|
auto_add_music: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -162,6 +172,7 @@ export declare const PlatformParamsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
162
172
|
brand_content_toggle: z.ZodOptional<z.ZodBoolean>;
|
|
163
173
|
brand_organic_toggle: z.ZodOptional<z.ZodBoolean>;
|
|
164
174
|
}, "strict", z.ZodTypeAny, {
|
|
175
|
+
format?: "video" | "image" | undefined;
|
|
165
176
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
166
177
|
photo_cover_index?: number | undefined;
|
|
167
178
|
auto_add_music?: boolean | undefined;
|
|
@@ -172,6 +183,7 @@ export declare const PlatformParamsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
172
183
|
brand_content_toggle?: boolean | undefined;
|
|
173
184
|
brand_organic_toggle?: boolean | undefined;
|
|
174
185
|
}, {
|
|
186
|
+
format?: "video" | "image" | undefined;
|
|
175
187
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
176
188
|
photo_cover_index?: number | undefined;
|
|
177
189
|
auto_add_music?: boolean | undefined;
|
|
@@ -218,8 +230,10 @@ export declare const PlatformParamsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
218
230
|
cover_url?: string | undefined;
|
|
219
231
|
title?: string | undefined;
|
|
220
232
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
233
|
+
made_for_kids?: boolean | undefined;
|
|
221
234
|
} | undefined;
|
|
222
235
|
tiktok?: {
|
|
236
|
+
format?: "video" | "image" | undefined;
|
|
223
237
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
224
238
|
photo_cover_index?: number | undefined;
|
|
225
239
|
auto_add_music?: boolean | undefined;
|
|
@@ -254,8 +268,10 @@ export declare const PlatformParamsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
254
268
|
cover_url?: string | undefined;
|
|
255
269
|
title?: string | undefined;
|
|
256
270
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
271
|
+
made_for_kids?: boolean | undefined;
|
|
257
272
|
} | undefined;
|
|
258
273
|
tiktok?: {
|
|
274
|
+
format?: "video" | "image" | undefined;
|
|
259
275
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
260
276
|
photo_cover_index?: number | undefined;
|
|
261
277
|
auto_add_music?: boolean | undefined;
|
|
@@ -277,6 +293,19 @@ export declare const PlatformParamsSchema: z.ZodOptional<z.ZodObject<{
|
|
|
277
293
|
twitter?: {} | undefined;
|
|
278
294
|
threads?: {} | undefined;
|
|
279
295
|
}>>;
|
|
296
|
+
/**
|
|
297
|
+
* Schema for thread child posts
|
|
298
|
+
*/
|
|
299
|
+
export declare const ThreadChildSchema: z.ZodObject<{
|
|
300
|
+
body: z.ZodString;
|
|
301
|
+
media: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
302
|
+
}, "strip", z.ZodTypeAny, {
|
|
303
|
+
body: string;
|
|
304
|
+
media?: string[] | undefined;
|
|
305
|
+
}, {
|
|
306
|
+
body: string;
|
|
307
|
+
media?: string[] | undefined;
|
|
308
|
+
}>;
|
|
280
309
|
/**
|
|
281
310
|
* Schema for post.publish parameters
|
|
282
311
|
*/
|
|
@@ -318,16 +347,20 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
318
347
|
title: z.ZodOptional<z.ZodString>;
|
|
319
348
|
privacy_status: z.ZodOptional<z.ZodEnum<["public", "unlisted", "private"]>>;
|
|
320
349
|
cover_url: z.ZodOptional<z.ZodString>;
|
|
350
|
+
made_for_kids: z.ZodOptional<z.ZodBoolean>;
|
|
321
351
|
}, "strict", z.ZodTypeAny, {
|
|
322
352
|
cover_url?: string | undefined;
|
|
323
353
|
title?: string | undefined;
|
|
324
354
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
355
|
+
made_for_kids?: boolean | undefined;
|
|
325
356
|
}, {
|
|
326
357
|
cover_url?: string | undefined;
|
|
327
358
|
title?: string | undefined;
|
|
328
359
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
360
|
+
made_for_kids?: boolean | undefined;
|
|
329
361
|
}>>;
|
|
330
362
|
tiktok: z.ZodOptional<z.ZodObject<{
|
|
363
|
+
format: z.ZodOptional<z.ZodEnum<["video", "image"]>>;
|
|
331
364
|
privacy_status: z.ZodOptional<z.ZodEnum<["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "FOLLOWER_OF_CREATOR", "SELF_ONLY"]>>;
|
|
332
365
|
photo_cover_index: z.ZodOptional<z.ZodNumber>;
|
|
333
366
|
auto_add_music: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -338,6 +371,7 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
338
371
|
brand_content_toggle: z.ZodOptional<z.ZodBoolean>;
|
|
339
372
|
brand_organic_toggle: z.ZodOptional<z.ZodBoolean>;
|
|
340
373
|
}, "strict", z.ZodTypeAny, {
|
|
374
|
+
format?: "video" | "image" | undefined;
|
|
341
375
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
342
376
|
photo_cover_index?: number | undefined;
|
|
343
377
|
auto_add_music?: boolean | undefined;
|
|
@@ -348,6 +382,7 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
348
382
|
brand_content_toggle?: boolean | undefined;
|
|
349
383
|
brand_organic_toggle?: boolean | undefined;
|
|
350
384
|
}, {
|
|
385
|
+
format?: "video" | "image" | undefined;
|
|
351
386
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
352
387
|
photo_cover_index?: number | undefined;
|
|
353
388
|
auto_add_music?: boolean | undefined;
|
|
@@ -394,8 +429,10 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
394
429
|
cover_url?: string | undefined;
|
|
395
430
|
title?: string | undefined;
|
|
396
431
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
432
|
+
made_for_kids?: boolean | undefined;
|
|
397
433
|
} | undefined;
|
|
398
434
|
tiktok?: {
|
|
435
|
+
format?: "video" | "image" | undefined;
|
|
399
436
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
400
437
|
photo_cover_index?: number | undefined;
|
|
401
438
|
auto_add_music?: boolean | undefined;
|
|
@@ -430,8 +467,10 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
430
467
|
cover_url?: string | undefined;
|
|
431
468
|
title?: string | undefined;
|
|
432
469
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
470
|
+
made_for_kids?: boolean | undefined;
|
|
433
471
|
} | undefined;
|
|
434
472
|
tiktok?: {
|
|
473
|
+
format?: "video" | "image" | undefined;
|
|
435
474
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
436
475
|
photo_cover_index?: number | undefined;
|
|
437
476
|
auto_add_music?: boolean | undefined;
|
|
@@ -453,12 +492,22 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
453
492
|
twitter?: {} | undefined;
|
|
454
493
|
threads?: {} | undefined;
|
|
455
494
|
}>>;
|
|
495
|
+
thread: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
496
|
+
body: z.ZodString;
|
|
497
|
+
media: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
|
|
498
|
+
}, "strip", z.ZodTypeAny, {
|
|
499
|
+
body: string;
|
|
500
|
+
media?: string[] | undefined;
|
|
501
|
+
}, {
|
|
502
|
+
body: string;
|
|
503
|
+
media?: string[] | undefined;
|
|
504
|
+
}>, "many">>;
|
|
456
505
|
}, "strip", z.ZodTypeAny, {
|
|
457
506
|
content: string;
|
|
458
507
|
profiles: string[];
|
|
459
508
|
draft?: boolean | undefined;
|
|
460
|
-
schedule?: string | undefined;
|
|
461
509
|
media?: string[] | undefined;
|
|
510
|
+
schedule?: string | undefined;
|
|
462
511
|
idempotency_key?: string | undefined;
|
|
463
512
|
require_confirmation?: boolean | undefined;
|
|
464
513
|
platforms?: {
|
|
@@ -475,8 +524,10 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
475
524
|
cover_url?: string | undefined;
|
|
476
525
|
title?: string | undefined;
|
|
477
526
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
527
|
+
made_for_kids?: boolean | undefined;
|
|
478
528
|
} | undefined;
|
|
479
529
|
tiktok?: {
|
|
530
|
+
format?: "video" | "image" | undefined;
|
|
480
531
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
481
532
|
photo_cover_index?: number | undefined;
|
|
482
533
|
auto_add_music?: boolean | undefined;
|
|
@@ -498,12 +549,16 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
498
549
|
twitter?: {} | undefined;
|
|
499
550
|
threads?: {} | undefined;
|
|
500
551
|
} | undefined;
|
|
552
|
+
thread?: {
|
|
553
|
+
body: string;
|
|
554
|
+
media?: string[] | undefined;
|
|
555
|
+
}[] | undefined;
|
|
501
556
|
}, {
|
|
502
557
|
content: string;
|
|
503
558
|
profiles: string[];
|
|
504
559
|
draft?: boolean | undefined;
|
|
505
|
-
schedule?: string | undefined;
|
|
506
560
|
media?: string[] | undefined;
|
|
561
|
+
schedule?: string | undefined;
|
|
507
562
|
idempotency_key?: string | undefined;
|
|
508
563
|
require_confirmation?: boolean | undefined;
|
|
509
564
|
platforms?: {
|
|
@@ -520,8 +575,10 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
520
575
|
cover_url?: string | undefined;
|
|
521
576
|
title?: string | undefined;
|
|
522
577
|
privacy_status?: "public" | "unlisted" | "private" | undefined;
|
|
578
|
+
made_for_kids?: boolean | undefined;
|
|
523
579
|
} | undefined;
|
|
524
580
|
tiktok?: {
|
|
581
|
+
format?: "video" | "image" | undefined;
|
|
525
582
|
privacy_status?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY" | undefined;
|
|
526
583
|
photo_cover_index?: number | undefined;
|
|
527
584
|
auto_add_music?: boolean | undefined;
|
|
@@ -543,6 +600,10 @@ export declare const PostPublishSchema: z.ZodObject<{
|
|
|
543
600
|
twitter?: {} | undefined;
|
|
544
601
|
threads?: {} | undefined;
|
|
545
602
|
} | undefined;
|
|
603
|
+
thread?: {
|
|
604
|
+
body: string;
|
|
605
|
+
media?: string[] | undefined;
|
|
606
|
+
}[] | undefined;
|
|
546
607
|
}>;
|
|
547
608
|
/**
|
|
548
609
|
* Validate that a schedule date is in the future
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,iBAAiB,2CAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,aAEpB,CAAC;AAEH;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAUjD;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,2CAiB3B,CAAC;AAEF;;GAEG;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC;AAGZ,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,iBAAiB,2CAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,aAEpB,CAAC;AAEH;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAUjD;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,2CAiB3B,CAAC;AAEF;;GAEG;AAGH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAcvB,CAAC;AAGZ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAOrB,CAAC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|
74
74
|
errorMap: () => ({ message: "YouTube privacy_status must be 'public', 'unlisted', or 'private'" }),
|
|
75
75
|
}).optional(),
|
|
76
76
|
cover_url: URLSchema.optional(),
|
|
77
|
+
made_for_kids: z.boolean().optional(),
|
|
77
78
|
}).strict();
|
|
78
79
|
// TikTok parameters validation
|
|
79
80
|
export const TikTokParamsSchema = z.object({
|
|
81
|
+
format: z.enum(["video", "image"], {
|
|
82
|
+
errorMap: () => ({ message: "TikTok format must be 'video' or 'image'" }),
|
|
83
|
+
}).optional(),
|
|
80
84
|
privacy_status: z.enum([
|
|
81
85
|
"PUBLIC_TO_EVERYONE",
|
|
82
86
|
"MUTUAL_FOLLOW_FRIENDS",
|
|
@@ -121,6 +125,13 @@ export const PlatformParamsSchema = z.object({
|
|
|
121
125
|
twitter: TwitterParamsSchema.optional(),
|
|
122
126
|
threads: ThreadsParamsSchema.optional(),
|
|
123
127
|
}).strict().optional();
|
|
128
|
+
/**
|
|
129
|
+
* Schema for thread child posts
|
|
130
|
+
*/
|
|
131
|
+
export const ThreadChildSchema = z.object({
|
|
132
|
+
body: z.string().min(1, "Thread child body cannot be empty"),
|
|
133
|
+
media: z.array(MediaItemSchema).optional(),
|
|
134
|
+
});
|
|
124
135
|
/**
|
|
125
136
|
* Schema for post.publish parameters
|
|
126
137
|
*/
|
|
@@ -133,6 +144,7 @@ export const PostPublishSchema = z.object({
|
|
|
133
144
|
require_confirmation: z.boolean().optional(),
|
|
134
145
|
draft: z.boolean().optional(),
|
|
135
146
|
platforms: PlatformParamsSchema,
|
|
147
|
+
thread: z.array(ThreadChildSchema).optional(),
|
|
136
148
|
});
|
|
137
149
|
/**
|
|
138
150
|
* Validate that a schedule date is in the future
|