@posty5/social-publisher-post 2.0.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/index.mjs ADDED
@@ -0,0 +1,442 @@
1
+ import { uploadToR2 } from '@posty5/core';
2
+
3
+ // src/social-publisher-post.client.ts
4
+ var SocialPublisherPostClient = class {
5
+ constructor(http) {
6
+ this.basePath = "/api/social-publisher-post";
7
+ this.http = http;
8
+ this.maxVideoUploadSizeBytes = 2147483648;
9
+ this.maxImageUploadSizeBytes = 1073741824;
10
+ }
11
+ /**
12
+ * Search posts
13
+ * @param params - Search parameters (optional)
14
+ * @param pagination - Pagination parameters
15
+ */
16
+ async list(params, pagination) {
17
+ const response = await this.http.get(this.basePath, {
18
+ params: {
19
+ ...params,
20
+ ...pagination
21
+ }
22
+ });
23
+ return response.result;
24
+ }
25
+ /**
26
+ * Get default settings
27
+ */
28
+ async getDefaultSettings() {
29
+ const response = await this.http.get(`${this.basePath}/default-settings`);
30
+ return response.result;
31
+ }
32
+ /**
33
+ * Get post status
34
+ * @param id - Post ID
35
+ */
36
+ async getStatus(id) {
37
+ const response = await this.http.get(`${this.basePath}/${id}/status`);
38
+ return response.result;
39
+ }
40
+ /**
41
+ * Generate upload signed URLs for video and thumbnail
42
+ * @param data - File information
43
+ */
44
+ async generateUploadUrls(data) {
45
+ const response = await this.http.post(`${this.basePath}/generate-upload-urls`, data);
46
+ return response.result;
47
+ }
48
+ /**
49
+ * Get next and previous post IDs
50
+ * @param id - Current Post ID
51
+ */
52
+ async getNextAndPrevious(id) {
53
+ const response = await this.http.get(`${this.basePath}/${id}/next-previous`);
54
+ return response.result;
55
+ }
56
+ /**
57
+ * Create a new post (publish video)
58
+ * @param data - Post creation data
59
+ * @param id - Optional ID for updating/retrying? (Based on route :id?)
60
+ */
61
+ async createToWorkspaceByFile(data, id) {
62
+ const url = id ? `${this.basePath}/short-video/workspace/by-file/${id}` : `${this.basePath}/short-video/workspace/by-file`;
63
+ const response = await this.http.post(url, {
64
+ ...data,
65
+ createdFrom: "npmPackage"
66
+ });
67
+ return response.result?._id;
68
+ }
69
+ /**
70
+ * Create a new post (publish video)
71
+ * @param data - Post creation data
72
+ * @param id - Optional ID for updating/retrying? (Based on route :id?)
73
+ */
74
+ async createToWorkspaceByURL(data, id) {
75
+ const url = id ? `${this.basePath}/short-video/workspace/by-url/${id}` : `${this.basePath}/short-video/workspace/by-url`;
76
+ const response = await this.http.post(url, {
77
+ ...data,
78
+ createdFrom: "npmPackage"
79
+ });
80
+ return response.result?._id;
81
+ }
82
+ /**
83
+ * Create a new post (publish video to account)
84
+ * @param data - Post creation data
85
+ * @param id - Optional ID for updating/retrying?
86
+ */
87
+ async createToAccountByFile(data, id) {
88
+ const url = id ? `${this.basePath}/short-video/account/by-file/${id}` : `${this.basePath}/short-video/account/by-file`;
89
+ const response = await this.http.post(url, {
90
+ ...data,
91
+ createdFrom: "npmPackage"
92
+ });
93
+ return response.result?._id;
94
+ }
95
+ /**
96
+ * Create a new post (publish video to account)
97
+ * @param data - Post creation data
98
+ * @param id - Optional ID for updating/retrying?
99
+ */
100
+ async createToAccountByURL(data, id) {
101
+ const url = id ? `${this.basePath}/short-video/account/by-url/${id}` : `${this.basePath}/short-video/account/by-url`;
102
+ const response = await this.http.post(url, {
103
+ ...data,
104
+ createdFrom: "npmPackage"
105
+ });
106
+ return response.result?._id;
107
+ }
108
+ /**
109
+ * Handle thumbnail upload - accepts either File or URL string
110
+ * @param thumb - Thumbnail as File (will be uploaded) or URL string (will be passed directly)
111
+ * @returns Thumbnail URL or undefined
112
+ */
113
+ async handleThumbnailUpload(thumb, uploadUrlsResponse) {
114
+ if (!thumb) {
115
+ return void 0;
116
+ }
117
+ if (typeof thumb === "string") {
118
+ const urlPattern = /(http:\/\/)..*|(https:\/\/)..*/gi;
119
+ if (!urlPattern.test(thumb)) {
120
+ throw new Error("Invalid thumbnail URL format");
121
+ }
122
+ return { thumbFileURL: thumb, postId: void 0 };
123
+ }
124
+ if (thumb instanceof File) {
125
+ if (thumb.size > this.maxImageUploadSizeBytes) {
126
+ throw new Error(`Thumbnail file size (${thumb.size} bytes) exceeds maximum allowed size (${this.maxImageUploadSizeBytes} bytes)`);
127
+ }
128
+ if (!uploadUrlsResponse) {
129
+ uploadUrlsResponse = await this.generateUploadUrls({
130
+ thumbFileType: thumb.type
131
+ });
132
+ }
133
+ if (uploadUrlsResponse.thumb.uploadFileURL) {
134
+ await uploadToR2(uploadUrlsResponse.thumb.uploadFileURL, thumb, {
135
+ contentType: thumb.type
136
+ });
137
+ return { thumbFileURL: uploadUrlsResponse.thumb.fileURL, postId: uploadUrlsResponse.postId };
138
+ }
139
+ }
140
+ return void 0;
141
+ }
142
+ /**
143
+ * Publish a short video by uploading a video file and optional thumbnail
144
+ * @param settings - Post creation settings
145
+ * @param video - Video file to upload (.mp4, .mov, .avi, .mkv, .webm)
146
+ * @param thumb - Optional thumbnail image file or URL string
147
+ * @returns Created post response
148
+ */
149
+ async publishShortVideoToWorkspaceByFile(settings, video, thumb) {
150
+ if (video.size > this.maxVideoUploadSizeBytes) {
151
+ throw new Error(`Video file size (${video.size} bytes) exceeds maximum allowed size (${this.maxVideoUploadSizeBytes} bytes)`);
152
+ }
153
+ const allowedVideoTypes = [".mp4", ".mov", ".avi", ".mkv", ".webm"];
154
+ const videoExtension = "." + video.name.split(".").pop()?.toLowerCase();
155
+ if (!allowedVideoTypes.includes(videoExtension)) {
156
+ throw new Error(`Invalid video file type. Allowed types: ${allowedVideoTypes.join(", ")}`);
157
+ }
158
+ const uploadUrlsResponse = await this.generateUploadUrls({
159
+ videoFileType: video.type,
160
+ thumbFileType: thumb instanceof File ? thumb.type : void 0
161
+ });
162
+ await uploadToR2(uploadUrlsResponse.video.uploadFileURL, video, {
163
+ contentType: video.type
164
+ });
165
+ const uploadThumb = await this.handleThumbnailUpload(thumb, uploadUrlsResponse);
166
+ const postSettings = {
167
+ ...settings,
168
+ videoURL: uploadUrlsResponse.video.fileURL,
169
+ thumbURL: uploadThumb?.thumbFileURL
170
+ };
171
+ return await this.createToWorkspaceByFile(postSettings, uploadUrlsResponse.postId);
172
+ }
173
+ /**
174
+ * Publish a short video by providing a video URL and optional thumbnail
175
+ * @param settings - Post creation settings
176
+ * @param videoURL - Video URL (.mp4, .mov, .avi, .mkv, .webm)
177
+ * @param thumb - Optional thumbnail image file or URL string
178
+ * @returns Created post response
179
+ */
180
+ async publishShortVideoToWorkspaceByURL(settings, videoURL, thumb) {
181
+ const uploadThumb = await this.handleThumbnailUpload(thumb);
182
+ const postSettings = {
183
+ ...settings,
184
+ videoURL,
185
+ thumbURL: uploadThumb?.thumbFileURL
186
+ };
187
+ return await this.createToWorkspaceByURL(postSettings, uploadThumb?.postId);
188
+ }
189
+ /**
190
+ * Publish a repost video from TikTok
191
+ * @param settings - Post creation settings
192
+ * @param videoURL - TikTok video URL (tiktok.com, vm.tiktok.com)
193
+ * @param thumb - Optional thumbnail image file or URL string
194
+ * @returns Created post response
195
+ */
196
+ async publishRepostVideoToWorkspace(settings, videoURL, thumb) {
197
+ const uploadThumb = await this.handleThumbnailUpload(thumb);
198
+ const postSettings = {
199
+ ...settings,
200
+ postURL: videoURL,
201
+ thumbURL: uploadThumb?.thumbFileURL
202
+ };
203
+ return await this.createToWorkspaceByURL(postSettings, uploadThumb?.postId);
204
+ }
205
+ /**
206
+ * Publish a short video to account by uploading a video file
207
+ */
208
+ async publishShortVideoToAccountByFile(settings, video, thumb) {
209
+ if (video.size > this.maxVideoUploadSizeBytes) {
210
+ throw new Error(`Video file size (${video.size} bytes) exceeds maximum allowed size (${this.maxVideoUploadSizeBytes} bytes)`);
211
+ }
212
+ const allowedVideoTypes = [".mp4", ".mov", ".avi", ".mkv", ".webm"];
213
+ const videoExtension = "." + video.name.split(".").pop()?.toLowerCase();
214
+ if (!allowedVideoTypes.includes(videoExtension)) {
215
+ throw new Error(`Invalid video file type. Allowed types: ${allowedVideoTypes.join(", ")}`);
216
+ }
217
+ const uploadUrlsResponse = await this.generateUploadUrls({
218
+ videoFileType: video.type,
219
+ thumbFileType: thumb instanceof File ? thumb.type : void 0
220
+ });
221
+ await uploadToR2(uploadUrlsResponse.video.uploadFileURL, video, {
222
+ contentType: video.type
223
+ });
224
+ const uploadThumb = await this.handleThumbnailUpload(thumb, uploadUrlsResponse);
225
+ const postSettings = {
226
+ ...settings,
227
+ videoURL: uploadUrlsResponse.video.fileURL,
228
+ thumbURL: uploadThumb?.thumbFileURL
229
+ };
230
+ return await this.createToAccountByFile(postSettings, uploadUrlsResponse.postId);
231
+ }
232
+ /**
233
+ * Publish a short video to account by URL
234
+ */
235
+ async publishShortVideoToAccountByURL(settings, videoURL, thumb) {
236
+ const uploadThumb = await this.handleThumbnailUpload(thumb);
237
+ const postSettings = {
238
+ ...settings,
239
+ videoURL,
240
+ thumbURL: uploadThumb?.thumbFileURL
241
+ };
242
+ return await this.createToAccountByURL(postSettings, uploadThumb?.postId);
243
+ }
244
+ /**
245
+ * Publish a repost video to account
246
+ */
247
+ async publishRepostVideoToAccount(settings, videoURL, thumb) {
248
+ const uploadThumb = await this.handleThumbnailUpload(thumb);
249
+ const postSettings = {
250
+ ...settings,
251
+ postURL: videoURL,
252
+ thumbURL: uploadThumb?.thumbFileURL
253
+ };
254
+ return await this.createToAccountByURL(postSettings, uploadThumb?.postId);
255
+ }
256
+ /**
257
+ * Publish a video to multiple social media platforms with auto-detection
258
+ * This is the recommended method for most use cases.
259
+ *
260
+ * @param options - Simplified publishing options
261
+ * @returns Created post response
262
+ *
263
+ * @example
264
+ * ```typescript
265
+ * // Publish video file to YouTube
266
+ * await client.publish({
267
+ * workspaceId: 'workspace-123',
268
+ * video: videoFile,
269
+ * thumbnail: thumbFile,
270
+ * platforms: ['youtube'],
271
+ * youtube: {
272
+ * title: 'My Video',
273
+ * description: 'Description',
274
+ * tags: ['tag1', 'tag2']
275
+ * }
276
+ * });
277
+ *
278
+ * // Publish to multiple platforms
279
+ * await client.publish({
280
+ * workspaceId: 'workspace-123',
281
+ * video: 'https://example.com/video.mp4',
282
+ * thumbnail: 'https://example.com/thumb.jpg',
283
+ * platforms: ['youtube', 'tiktok'],
284
+ * youtube: { title: 'Video', description: 'Desc', tags: [] },
285
+ * tiktok: { caption: 'Caption', privacy_level: 'public', disable_duet: false, disable_stitch: false, disable_comment: false }
286
+ * });
287
+ *
288
+ * // Repost from Facebook (auto-detected)
289
+ * await client.publish({
290
+ * workspaceId: 'workspace-123',
291
+ * video: 'https://facebook.com/video/12345',
292
+ * platforms: ['youtube'],
293
+ * youtube: { title: 'Reposted', description: 'From FB', tags: [] }
294
+ * });
295
+ * ```
296
+ */
297
+ async publishShortVideoToWorkspace(options) {
298
+ if (!options.workspaceId) {
299
+ throw new Error("workspaceId is required");
300
+ }
301
+ if (!options.video) {
302
+ throw new Error("video is required");
303
+ }
304
+ if (!options.platforms || options.platforms.length === 0) {
305
+ throw new Error("At least one platform must be specified");
306
+ }
307
+ if (options.platforms.includes("youtube") && !options.youtube) {
308
+ throw new Error("YouTube configuration is required when publishing to YouTube");
309
+ }
310
+ if (options.platforms.includes("tiktok") && !options.tiktok) {
311
+ throw new Error("TikTok configuration is required when publishing to TikTok");
312
+ }
313
+ if (options.platforms.includes("facebook") && !options.facebook) {
314
+ throw new Error("Facebook configuration is required when publishing to Facebook");
315
+ }
316
+ if (options.platforms.includes("instagram") && !options.instagram) {
317
+ throw new Error("Instagram configuration is required when publishing to Instagram");
318
+ }
319
+ const settings = {
320
+ workspaceId: options.workspaceId,
321
+ isAllowYouTube: options.platforms.includes("youtube"),
322
+ isAllowTiktok: options.platforms.includes("tiktok"),
323
+ isAllowFacebookPage: options.platforms.includes("facebook"),
324
+ isAllowInstagram: options.platforms.includes("instagram"),
325
+ youtube: options.youtube,
326
+ tiktok: options.tiktok,
327
+ facebook: options.facebook,
328
+ instagram: options.instagram,
329
+ schedule: options.schedule ? {
330
+ type: options.schedule === "now" ? "now" : "schedule",
331
+ scheduledAt: options.schedule instanceof Date ? options.schedule : void 0
332
+ } : void 0,
333
+ source: "video-file"
334
+ };
335
+ const source = this.detectVideoSource(options.video);
336
+ switch (source) {
337
+ case "file": {
338
+ return this.publishShortVideoToWorkspaceByFile(settings, options.video, options.thumbnail);
339
+ }
340
+ case "url": {
341
+ return this.publishShortVideoToWorkspaceByURL(settings, options.video, options.thumbnail);
342
+ }
343
+ case "repost": {
344
+ return this.publishRepostVideoToWorkspace(settings, options.video, options.thumbnail);
345
+ }
346
+ default:
347
+ throw new Error(`Unknown video source type: ${source}`);
348
+ }
349
+ }
350
+ /**
351
+ * Publish a video to multiple social media platforms with auto-detection (Account)
352
+ *
353
+ * @param options - Simplified publishing options for account
354
+ * @returns Created post response
355
+ */
356
+ async publishShortVideoToAccount(options) {
357
+ if (!options.accountId) {
358
+ throw new Error("accountId is required");
359
+ }
360
+ if (!options.video) {
361
+ throw new Error("video is required");
362
+ }
363
+ if (!options.platforms || options.platforms.length === 0) {
364
+ throw new Error("At least one platform must be specified");
365
+ }
366
+ if (options.platforms.includes("youtube") && !options.youtube) {
367
+ throw new Error("YouTube configuration is required when publishing to YouTube");
368
+ }
369
+ if (options.platforms.includes("tiktok") && !options.tiktok) {
370
+ throw new Error("TikTok configuration is required when publishing to TikTok");
371
+ }
372
+ if (options.platforms.includes("facebook") && !options.facebook) {
373
+ throw new Error("Facebook configuration is required when publishing to Facebook");
374
+ }
375
+ if (options.platforms.includes("instagram") && !options.instagram) {
376
+ throw new Error("Instagram configuration is required when publishing to Instagram");
377
+ }
378
+ const source = this.detectVideoSource(options.video);
379
+ const settings = {
380
+ accountId: options.accountId,
381
+ isAllowYouTube: options.platforms.includes("youtube"),
382
+ isAllowTiktok: options.platforms.includes("tiktok"),
383
+ isAllowFacebookPage: options.platforms.includes("facebook"),
384
+ isAllowInstagram: options.platforms.includes("instagram"),
385
+ youtube: options.youtube,
386
+ tiktok: options.tiktok,
387
+ facebook: options.facebook,
388
+ instagram: options.instagram,
389
+ schedule: options.schedule ? {
390
+ type: options.schedule === "now" ? "now" : "schedule",
391
+ scheduledAt: options.schedule instanceof Date ? options.schedule : void 0
392
+ } : void 0,
393
+ source: "video-file"
394
+ };
395
+ switch (source) {
396
+ case "file": {
397
+ return this.publishShortVideoToAccountByFile(settings, options.video, options.thumbnail);
398
+ }
399
+ case "url": {
400
+ return this.publishShortVideoToAccountByURL(settings, options.video, options.thumbnail);
401
+ }
402
+ case "repost": {
403
+ return this.publishRepostVideoToAccount(settings, options.video, options.thumbnail);
404
+ }
405
+ default:
406
+ throw new Error(`Unknown video source type: ${source}`);
407
+ }
408
+ }
409
+ /**
410
+ * @deprecated Use publishShortVideoToWorkspace instead
411
+ */
412
+ async publishShortVideo(options) {
413
+ return this.publishShortVideoToWorkspace(options);
414
+ }
415
+ /**
416
+ * Auto-detect video source type
417
+ * @param video - File or URL string
418
+ * @returns Detected source type and video
419
+ */
420
+ detectVideoSource(video) {
421
+ if (video instanceof File) {
422
+ return "file";
423
+ }
424
+ if (typeof video === "string") {
425
+ if (/^https?:\/\/(www\.)?(facebook\.com|fb\.watch)\/(reel|watch|.*\/videos)\/.*/i.test(video)) {
426
+ return "repost";
427
+ }
428
+ if (/^https?:\/\/(www\.)?(tiktok\.com\/@[^\/]+\/video\/\d+|vm\.tiktok\.com\/\w+|vt\.tiktok\.com\/\w+)/i.test(video)) {
429
+ return "repost";
430
+ }
431
+ if (/^https?:\/\/(www\.)?(youtube\.com\/shorts\/|youtu\.be\/)[A-Za-z0-9_-]+/i.test(video)) {
432
+ return "repost";
433
+ }
434
+ return "url";
435
+ }
436
+ throw new Error("Invalid video type. Must be File or string URL");
437
+ }
438
+ };
439
+
440
+ export { SocialPublisherPostClient };
441
+ //# sourceMappingURL=index.mjs.map
442
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/social-publisher-post.client.ts"],"names":[],"mappings":";;;AAoBO,IAAM,4BAAN,MAAgC;AAAA,EAMrC,YAAY,IAAA,EAAkB;AAJ9B,IAAA,IAA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,KAAA,EAAiB,QAAQ,SAAS,CAAA;AAAA,MAClG;AAAA,MACA,KAAK,QAAA,EAAU;AACb,QAAA,OAAO,KAAK,2BAAA,CAA4B,QAAA,EAAU,OAAA,CAAQ,KAAA,EAAiB,QAAQ,SAAS,CAAA;AAAA,MAC9F;AAAA,MACA;AACE,QAAA,MAAM,IAAI,KAAA,CAAM,CAAA,2BAAA,EAA8B,MAAM,CAAA,CAAE,CAAA;AAAA;AAC1D,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB,OAAA,EAA2C;AACjE,IAAA,OAAO,IAAA,CAAK,6BAA6B,OAAO,CAAA;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOQ,kBAAkB,KAAA,EAAiD;AAEzE,IAAA,IAAI,iBAAiB,IAAA,EAAM;AACzB,MAAA,OAAO,MAAA;AAAA,IACT;AAGA,IAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAE7B,MAAA,IAAI,6EAAA,CAA8E,IAAA,CAAK,KAAK,CAAA,EAAG;AAC7F,QAAA,OAAO,QAAA;AAAA,MACT;AAGA,MAAA,IAAI,mGAAA,CAAoG,IAAA,CAAK,KAAK,CAAA,EAAG;AACnH,QAAA,OAAO,QAAA;AAAA,MACT;AAGA,MAAA,IAAI,yEAAA,CAA0E,IAAA,CAAK,KAAK,CAAA,EAAG;AACzF,QAAA,OAAO,QAAA;AAAA,MACT;AAGA,MAAA,OAAO,KAAA;AAAA,IACT;AAEA,IAAA,MAAM,IAAI,MAAM,gDAAgD,CAAA;AAAA,EAClE;AACF","file":"index.mjs","sourcesContent":["import { HttpClient, IPaginationParams, uploadToR2 } from \"@posty5/core\";\r\nimport {\r\n ICreateSocialPublisherPostRequest,\r\n IGenerateUploadUrlsRequest,\r\n IGenerateUploadUrlsResponse,\r\n ISearchSocialPublisherPostResponse,\r\n ISocialPublisherPostNextPreviousResponse,\r\n ISocialPublisherPostStatusResponse,\r\n IDefaultSettingsResponse,\r\n IPostSetting,\r\n IPublishOptions,\r\n IListParams,\r\n ICreateSocialPublisherAccountPostRequest,\r\n IAccountPostSetting,\r\n IPublishToAccountOptions,\r\n} from \"./interfaces\";\r\n\r\n/**\r\n * Social Publisher Post Client\r\n */\r\nexport class SocialPublisherPostClient {\r\n private http: HttpClient;\r\n private basePath = \"/api/social-publisher-post\";\r\n public readonly maxVideoUploadSizeBytes: number;\r\n public readonly maxImageUploadSizeBytes: number;\r\n\r\n constructor(http: HttpClient) {\r\n this.http = http;\r\n this.maxVideoUploadSizeBytes = 2147483648; //2GB default\r\n this.maxImageUploadSizeBytes = 1073741824; // 1GB default\r\n }\r\n\r\n /**\r\n * Search posts\r\n * @param params - Search parameters (optional)\r\n * @param pagination - Pagination parameters\r\n */\r\n async list(params?: IListParams, pagination?: IPaginationParams): Promise<ISearchSocialPublisherPostResponse> {\r\n const response = await this.http.get<ISearchSocialPublisherPostResponse>(this.basePath, {\r\n params: {\r\n ...params,\r\n ...pagination,\r\n },\r\n });\r\n return response.result!;\r\n }\r\n\r\n /**\r\n * Get default settings\r\n */\r\n async getDefaultSettings(): Promise<IDefaultSettingsResponse> {\r\n const response = await this.http.get<IDefaultSettingsResponse>(`${this.basePath}/default-settings`);\r\n return response.result!;\r\n }\r\n\r\n /**\r\n * Get post status\r\n * @param id - Post ID\r\n */\r\n async getStatus(id: string): Promise<ISocialPublisherPostStatusResponse> {\r\n const response = await this.http.get<ISocialPublisherPostStatusResponse>(`${this.basePath}/${id}/status`);\r\n return response.result!;\r\n }\r\n\r\n /**\r\n * Generate upload signed URLs for video and thumbnail\r\n * @param data - File information\r\n */\r\n private async generateUploadUrls(data: IGenerateUploadUrlsRequest): Promise<IGenerateUploadUrlsResponse> {\r\n const response = await this.http.post<IGenerateUploadUrlsResponse>(`${this.basePath}/generate-upload-urls`, data);\r\n return response.result!;\r\n }\r\n\r\n /**\r\n * Get next and previous post IDs\r\n * @param id - Current Post ID\r\n */\r\n async getNextAndPrevious(id: string): Promise<ISocialPublisherPostNextPreviousResponse> {\r\n const response = await this.http.get<ISocialPublisherPostNextPreviousResponse>(`${this.basePath}/${id}/next-previous`);\r\n return response.result!;\r\n }\r\n\r\n /**\r\n * Create a new post (publish video)\r\n * @param data - Post creation data\r\n * @param id - Optional ID for updating/retrying? (Based on route :id?)\r\n */\r\n private async createToWorkspaceByFile(data: ICreateSocialPublisherPostRequest, id?: string): Promise<string> {\r\n const url = id ? `${this.basePath}/short-video/workspace/by-file/${id}` : `${this.basePath}/short-video/workspace/by-file`;\r\n const response = await this.http.post<{ _id: string }>(url, {\r\n ...data,\r\n createdFrom: \"npmPackage\",\r\n });\r\n return response.result?._id!;\r\n }\r\n\r\n /**\r\n * Create a new post (publish video)\r\n * @param data - Post creation data\r\n * @param id - Optional ID for updating/retrying? (Based on route :id?)\r\n */\r\n private async createToWorkspaceByURL(data: ICreateSocialPublisherPostRequest, id?: string): Promise<string> {\r\n const url = id ? `${this.basePath}/short-video/workspace/by-url/${id}` : `${this.basePath}/short-video/workspace/by-url`;\r\n const response = await this.http.post<{ _id: string }>(url, {\r\n ...data,\r\n createdFrom: \"npmPackage\",\r\n });\r\n return response.result?._id!;\r\n }\r\n\r\n /**\r\n * Create a new post (publish video to account)\r\n * @param data - Post creation data\r\n * @param id - Optional ID for updating/retrying?\r\n */\r\n private async createToAccountByFile(data: ICreateSocialPublisherAccountPostRequest, id?: string): Promise<string> {\r\n const url = id ? `${this.basePath}/short-video/account/by-file/${id}` : `${this.basePath}/short-video/account/by-file`;\r\n const response = await this.http.post<{ _id: string }>(url, {\r\n ...data,\r\n createdFrom: \"npmPackage\",\r\n });\r\n return response.result?._id!;\r\n }\r\n\r\n /**\r\n * Create a new post (publish video to account)\r\n * @param data - Post creation data\r\n * @param id - Optional ID for updating/retrying?\r\n */\r\n private async createToAccountByURL(data: ICreateSocialPublisherAccountPostRequest, id?: string): Promise<string> {\r\n const url = id ? `${this.basePath}/short-video/account/by-url/${id}` : `${this.basePath}/short-video/account/by-url`;\r\n const response = await this.http.post<{ _id: string }>(url, {\r\n ...data,\r\n createdFrom: \"npmPackage\",\r\n });\r\n return response.result?._id!;\r\n }\r\n\r\n /**\r\n * Handle thumbnail upload - accepts either File or URL string\r\n * @param thumb - Thumbnail as File (will be uploaded) or URL string (will be passed directly)\r\n * @returns Thumbnail URL or undefined\r\n */\r\n private async handleThumbnailUpload(thumb?: File | string, uploadUrlsResponse?: IGenerateUploadUrlsResponse) {\r\n if (!thumb) {\r\n return undefined;\r\n }\r\n\r\n // If thumb is a string (URL), validate and return it directly\r\n if (typeof thumb === \"string\") {\r\n const urlPattern = /(http:\\/\\/)..*|(https:\\/\\/)..*/gi;\r\n if (!urlPattern.test(thumb)) {\r\n throw new Error(\"Invalid thumbnail URL format\");\r\n }\r\n return { thumbFileURL: thumb, postId: undefined };\r\n }\r\n\r\n // If thumb is a File, upload it\r\n if (thumb instanceof File) {\r\n // Validate thumbnail file size\r\n if (thumb.size > this.maxImageUploadSizeBytes) {\r\n throw new Error(`Thumbnail file size (${thumb.size} bytes) exceeds maximum allowed size (${this.maxImageUploadSizeBytes} bytes)`);\r\n }\r\n\r\n // Generate upload URL\r\n if (!uploadUrlsResponse) {\r\n uploadUrlsResponse = await this.generateUploadUrls({\r\n thumbFileType: thumb.type,\r\n });\r\n }\r\n\r\n if (uploadUrlsResponse.thumb.uploadFileURL) {\r\n // Upload to R2 using uploadToR2 utility\r\n await uploadToR2(uploadUrlsResponse.thumb.uploadFileURL, thumb, {\r\n contentType: thumb.type,\r\n });\r\n\r\n return { thumbFileURL: uploadUrlsResponse.thumb.fileURL, postId: uploadUrlsResponse.postId };\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Publish a short video by uploading a video file and optional thumbnail\r\n * @param settings - Post creation settings\r\n * @param video - Video file to upload (.mp4, .mov, .avi, .mkv, .webm)\r\n * @param thumb - Optional thumbnail image file or URL string\r\n * @returns Created post response\r\n */\r\n private async publishShortVideoToWorkspaceByFile(settings: IPostSetting, video: File, thumb?: File | string): Promise<string> {\r\n // Validate video size\r\n if (video.size > this.maxVideoUploadSizeBytes) {\r\n throw new Error(`Video file size (${video.size} bytes) exceeds maximum allowed size (${this.maxVideoUploadSizeBytes} bytes)`);\r\n }\r\n\r\n // Validate video file type\r\n const allowedVideoTypes = [\".mp4\", \".mov\", \".avi\", \".mkv\", \".webm\"];\r\n const videoExtension = \".\" + video.name.split(\".\").pop()?.toLowerCase();\r\n if (!allowedVideoTypes.includes(videoExtension)) {\r\n throw new Error(`Invalid video file type. Allowed types: ${allowedVideoTypes.join(\", \")}`);\r\n }\r\n\r\n // Step 1: Generate upload URLs for video\r\n const uploadUrlsResponse = await this.generateUploadUrls({\r\n videoFileType: video.type,\r\n thumbFileType: thumb instanceof File ? thumb.type : undefined,\r\n });\r\n\r\n // Step 2: Upload video using uploadToR2 utility\r\n await uploadToR2(uploadUrlsResponse.video.uploadFileURL!, video, {\r\n contentType: video.type,\r\n });\r\n\r\n // Step 3: Handle thumbnail upload (File or URL)\r\n const uploadThumb = await this.handleThumbnailUpload(thumb, uploadUrlsResponse);\r\n\r\n // Step 4: Create post with uploaded file URLs\r\n const postSettings: ICreateSocialPublisherPostRequest = {\r\n ...settings,\r\n videoURL: uploadUrlsResponse.video.fileURL,\r\n thumbURL: uploadThumb?.thumbFileURL,\r\n };\r\n\r\n return await this.createToWorkspaceByFile(postSettings, uploadUrlsResponse.postId);\r\n }\r\n\r\n /**\r\n * Publish a short video by providing a video URL and optional thumbnail\r\n * @param settings - Post creation settings\r\n * @param videoURL - Video URL (.mp4, .mov, .avi, .mkv, .webm)\r\n * @param thumb - Optional thumbnail image file or URL string\r\n * @returns Created post response\r\n */\r\n private async publishShortVideoToWorkspaceByURL(settings: IPostSetting, videoURL: string, thumb?: File | string): Promise<string> {\r\n // Handle thumbnail upload (File or URL)\r\n const uploadThumb = await this.handleThumbnailUpload(thumb);\r\n\r\n // Create post with video URL\r\n const postSettings: ICreateSocialPublisherPostRequest = {\r\n ...settings,\r\n videoURL,\r\n thumbURL: uploadThumb?.thumbFileURL,\r\n };\r\n\r\n return await this.createToWorkspaceByURL(postSettings, uploadThumb?.postId);\r\n }\r\n\r\n /**\r\n * Publish a repost video from TikTok\r\n * @param settings - Post creation settings\r\n * @param videoURL - TikTok video URL (tiktok.com, vm.tiktok.com)\r\n * @param thumb - Optional thumbnail image file or URL string\r\n * @returns Created post response\r\n */\r\n private async publishRepostVideoToWorkspace(settings: IPostSetting, videoURL: string, thumb?: File | string): Promise<string> {\r\n // Handle thumbnail upload (File or URL)\r\n const uploadThumb = await this.handleThumbnailUpload(thumb);\r\n\r\n // Create post with TikTok video URL\r\n const postSettings: ICreateSocialPublisherPostRequest = {\r\n ...settings,\r\n postURL: videoURL,\r\n thumbURL: uploadThumb?.thumbFileURL,\r\n };\r\n\r\n return await this.createToWorkspaceByURL(postSettings, uploadThumb?.postId);\r\n }\r\n\r\n /**\r\n * Publish a short video to account by uploading a video file\r\n */\r\n private async publishShortVideoToAccountByFile(settings: IAccountPostSetting, video: File, thumb?: File | string): Promise<string> {\r\n // Validate video size\r\n if (video.size > this.maxVideoUploadSizeBytes) {\r\n throw new Error(`Video file size (${video.size} bytes) exceeds maximum allowed size (${this.maxVideoUploadSizeBytes} bytes)`);\r\n }\r\n\r\n // Validate video file type\r\n const allowedVideoTypes = [\".mp4\", \".mov\", \".avi\", \".mkv\", \".webm\"];\r\n const videoExtension = \".\" + video.name.split(\".\").pop()?.toLowerCase();\r\n if (!allowedVideoTypes.includes(videoExtension)) {\r\n throw new Error(`Invalid video file type. Allowed types: ${allowedVideoTypes.join(\", \")}`);\r\n }\r\n\r\n // Step 1: Generate upload URLs for video\r\n const uploadUrlsResponse = await this.generateUploadUrls({\r\n videoFileType: video.type,\r\n thumbFileType: thumb instanceof File ? thumb.type : undefined,\r\n });\r\n\r\n // Step 2: Upload video using uploadToR2 utility\r\n await uploadToR2(uploadUrlsResponse.video.uploadFileURL!, video, {\r\n contentType: video.type,\r\n });\r\n\r\n // Step 3: Handle thumbnail upload (File or URL)\r\n const uploadThumb = await this.handleThumbnailUpload(thumb, uploadUrlsResponse);\r\n\r\n // Step 4: Create post with uploaded file URLs\r\n const postSettings: ICreateSocialPublisherAccountPostRequest = {\r\n ...settings,\r\n videoURL: uploadUrlsResponse.video.fileURL,\r\n thumbURL: uploadThumb?.thumbFileURL,\r\n };\r\n\r\n return await this.createToAccountByFile(postSettings, uploadUrlsResponse.postId);\r\n }\r\n\r\n /**\r\n * Publish a short video to account by URL\r\n */\r\n private async publishShortVideoToAccountByURL(settings: IAccountPostSetting, videoURL: string, thumb?: File | string): Promise<string> {\r\n // Handle thumbnail upload (File or URL)\r\n const uploadThumb = await this.handleThumbnailUpload(thumb);\r\n\r\n // Create post with video URL\r\n const postSettings: ICreateSocialPublisherAccountPostRequest = {\r\n ...settings,\r\n videoURL,\r\n thumbURL: uploadThumb?.thumbFileURL,\r\n };\r\n\r\n return await this.createToAccountByURL(postSettings, uploadThumb?.postId);\r\n }\r\n\r\n /**\r\n * Publish a repost video to account\r\n */\r\n private async publishRepostVideoToAccount(settings: IAccountPostSetting, videoURL: string, thumb?: File | string): Promise<string> {\r\n // Handle thumbnail upload (File or URL)\r\n const uploadThumb = await this.handleThumbnailUpload(thumb);\r\n\r\n // Create post with TikTok video URL\r\n const postSettings: ICreateSocialPublisherAccountPostRequest = {\r\n ...settings,\r\n postURL: videoURL,\r\n thumbURL: uploadThumb?.thumbFileURL,\r\n };\r\n\r\n return await this.createToAccountByURL(postSettings, uploadThumb?.postId);\r\n }\r\n\r\n /**\r\n * Publish a video to multiple social media platforms with auto-detection\r\n * This is the recommended method for most use cases.\r\n *\r\n * @param options - Simplified publishing options\r\n * @returns Created post response\r\n *\r\n * @example\r\n * ```typescript\r\n * // Publish video file to YouTube\r\n * await client.publish({\r\n * workspaceId: 'workspace-123',\r\n * video: videoFile,\r\n * thumbnail: thumbFile,\r\n * platforms: ['youtube'],\r\n * youtube: {\r\n * title: 'My Video',\r\n * description: 'Description',\r\n * tags: ['tag1', 'tag2']\r\n * }\r\n * });\r\n *\r\n * // Publish to multiple platforms\r\n * await client.publish({\r\n * workspaceId: 'workspace-123',\r\n * video: 'https://example.com/video.mp4',\r\n * thumbnail: 'https://example.com/thumb.jpg',\r\n * platforms: ['youtube', 'tiktok'],\r\n * youtube: { title: 'Video', description: 'Desc', tags: [] },\r\n * tiktok: { caption: 'Caption', privacy_level: 'public', disable_duet: false, disable_stitch: false, disable_comment: false }\r\n * });\r\n *\r\n * // Repost from Facebook (auto-detected)\r\n * await client.publish({\r\n * workspaceId: 'workspace-123',\r\n * video: 'https://facebook.com/video/12345',\r\n * platforms: ['youtube'],\r\n * youtube: { title: 'Reposted', description: 'From FB', tags: [] }\r\n * });\r\n * ```\r\n */\r\n async publishShortVideoToWorkspace(options: IPublishOptions): Promise<string> {\r\n // Validate required fields\r\n if (!options.workspaceId) {\r\n throw new Error(\"workspaceId is required\");\r\n }\r\n if (!options.video) {\r\n throw new Error(\"video is required\");\r\n }\r\n if (!options.platforms || options.platforms.length === 0) {\r\n throw new Error(\"At least one platform must be specified\");\r\n }\r\n\r\n // Validate platform configurations\r\n if (options.platforms.includes(\"youtube\") && !options.youtube) {\r\n throw new Error(\"YouTube configuration is required when publishing to YouTube\");\r\n }\r\n if (options.platforms.includes(\"tiktok\") && !options.tiktok) {\r\n throw new Error(\"TikTok configuration is required when publishing to TikTok\");\r\n }\r\n if (options.platforms.includes(\"facebook\") && !options.facebook) {\r\n throw new Error(\"Facebook configuration is required when publishing to Facebook\");\r\n }\r\n if (options.platforms.includes(\"instagram\") && !options.instagram) {\r\n throw new Error(\"Instagram configuration is required when publishing to Instagram\");\r\n }\r\n\r\n // Build IPostSetting from simplified options\r\n const settings: IPostSetting = {\r\n workspaceId: options.workspaceId,\r\n isAllowYouTube: options.platforms.includes(\"youtube\"),\r\n isAllowTiktok: options.platforms.includes(\"tiktok\"),\r\n isAllowFacebookPage: options.platforms.includes(\"facebook\"),\r\n isAllowInstagram: options.platforms.includes(\"instagram\"),\r\n youtube: options.youtube,\r\n tiktok: options.tiktok,\r\n facebook: options.facebook,\r\n instagram: options.instagram,\r\n schedule: options.schedule\r\n ? {\r\n type: options.schedule === \"now\" ? \"now\" : \"schedule\",\r\n scheduledAt: options.schedule instanceof Date ? options.schedule : undefined,\r\n }\r\n : undefined,\r\n source: \"video-file\",\r\n };\r\n\r\n // Auto-detect video source type\r\n const source = this.detectVideoSource(options.video);\r\n\r\n // Route to appropriate method based on detected source\r\n switch (source) {\r\n case \"file\": {\r\n return this.publishShortVideoToWorkspaceByFile(settings, options.video as File, options.thumbnail);\r\n }\r\n\r\n case \"url\": {\r\n return this.publishShortVideoToWorkspaceByURL(settings, options.video as string, options.thumbnail);\r\n }\r\n case \"repost\": {\r\n return this.publishRepostVideoToWorkspace(settings, options.video as string, options.thumbnail);\r\n }\r\n default:\r\n throw new Error(`Unknown video source type: ${source}`);\r\n }\r\n }\r\n\r\n /**\r\n * Publish a video to multiple social media platforms with auto-detection (Account)\r\n *\r\n * @param options - Simplified publishing options for account\r\n * @returns Created post response\r\n */\r\n async publishShortVideoToAccount(options: IPublishToAccountOptions): Promise<string> {\r\n // Validate required fields\r\n if (!options.accountId) {\r\n throw new Error(\"accountId is required\");\r\n }\r\n if (!options.video) {\r\n throw new Error(\"video is required\");\r\n }\r\n if (!options.platforms || options.platforms.length === 0) {\r\n throw new Error(\"At least one platform must be specified\");\r\n }\r\n\r\n // Validate platform configurations\r\n if (options.platforms.includes(\"youtube\") && !options.youtube) {\r\n throw new Error(\"YouTube configuration is required when publishing to YouTube\");\r\n }\r\n if (options.platforms.includes(\"tiktok\") && !options.tiktok) {\r\n throw new Error(\"TikTok configuration is required when publishing to TikTok\");\r\n }\r\n if (options.platforms.includes(\"facebook\") && !options.facebook) {\r\n throw new Error(\"Facebook configuration is required when publishing to Facebook\");\r\n }\r\n if (options.platforms.includes(\"instagram\") && !options.instagram) {\r\n throw new Error(\"Instagram configuration is required when publishing to Instagram\");\r\n }\r\n\r\n // Auto-detect video source type\r\n const source = this.detectVideoSource(options.video);\r\n\r\n // Build IAccountPostSetting from simplified options\r\n const settings: IAccountPostSetting = {\r\n accountId: options.accountId,\r\n isAllowYouTube: options.platforms.includes(\"youtube\"),\r\n isAllowTiktok: options.platforms.includes(\"tiktok\"),\r\n isAllowFacebookPage: options.platforms.includes(\"facebook\"),\r\n isAllowInstagram: options.platforms.includes(\"instagram\"),\r\n youtube: options.youtube,\r\n tiktok: options.tiktok,\r\n facebook: options.facebook,\r\n instagram: options.instagram,\r\n schedule: options.schedule\r\n ? {\r\n type: options.schedule === \"now\" ? \"now\" : \"schedule\",\r\n scheduledAt: options.schedule instanceof Date ? options.schedule : undefined,\r\n }\r\n : undefined,\r\n source: \"video-file\",\r\n };\r\n\r\n // Route to appropriate method based on detected source\r\n switch (source) {\r\n case \"file\": {\r\n return this.publishShortVideoToAccountByFile(settings, options.video as File, options.thumbnail);\r\n }\r\n\r\n case \"url\": {\r\n return this.publishShortVideoToAccountByURL(settings, options.video as string, options.thumbnail);\r\n }\r\n case \"repost\": {\r\n return this.publishRepostVideoToAccount(settings, options.video as string, options.thumbnail);\r\n }\r\n default:\r\n throw new Error(`Unknown video source type: ${source}`);\r\n }\r\n }\r\n\r\n /**\r\n * @deprecated Use publishShortVideoToWorkspace instead\r\n */\r\n async publishShortVideo(options: IPublishOptions): Promise<string> {\r\n return this.publishShortVideoToWorkspace(options);\r\n }\r\n\r\n /**\r\n * Auto-detect video source type\r\n * @param video - File or URL string\r\n * @returns Detected source type and video\r\n */\r\n private detectVideoSource(video: File | string): \"file\" | \"url\" | \"repost\" {\r\n // Check if it's a File object\r\n if (video instanceof File) {\r\n return \"file\";\r\n }\r\n\r\n // Check for platform-specific URLs\r\n if (typeof video === \"string\") {\r\n // Facebook video URL\r\n if (/^https?:\\/\\/(www\\.)?(facebook\\.com|fb\\.watch)\\/(reel|watch|.*\\/videos)\\/.*/i.test(video)) {\r\n return \"repost\";\r\n }\r\n\r\n // TikTok video URL\r\n if (/^https?:\\/\\/(www\\.)?(tiktok\\.com\\/@[^\\/]+\\/video\\/\\d+|vm\\.tiktok\\.com\\/\\w+|vt\\.tiktok\\.com\\/\\w+)/i.test(video)) {\r\n return \"repost\";\r\n }\r\n\r\n // YouTube Shorts URL\r\n if (/^https?:\\/\\/(www\\.)?(youtube\\.com\\/shorts\\/|youtu\\.be\\/)[A-Za-z0-9_-]+/i.test(video)) {\r\n return \"repost\";\r\n }\r\n\r\n // Generic video URL\r\n return \"url\";\r\n }\r\n\r\n throw new Error(\"Invalid video type. Must be File or string URL\");\r\n }\r\n}\r\n"]}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@posty5/social-publisher-post",
3
+ "version": "2.0.0",
4
+ "description": "Social Publisher Post management SDK for Posty5 API",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Posty5/npm-sdk/tree/main/posty5-social-publisher-post"
11
+ },
12
+ "homepage": "https://github.com/Posty5/npm-sdk#readme",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.mjs",
20
+ "require": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "scripts": {
29
+ "build": "tsup",
30
+ "dev": "tsup --watch",
31
+ "test": "jest",
32
+ "test:watch": "jest --watch",
33
+ "typecheck": "tsc --noEmit",
34
+ "lint": "eslint src --ext .ts",
35
+ "prepublishOnly": "npm run build"
36
+ },
37
+ "keywords": [
38
+ "posty5",
39
+ "social-publisher",
40
+ "post",
41
+ "sdk",
42
+ "api",
43
+ "typescript"
44
+ ],
45
+ "author": "Posty5",
46
+ "license": "MIT",
47
+ "peerDependencies": {
48
+ "@posty5/core": "^2.0.0"
49
+ },
50
+ "devDependencies": {
51
+ "@posty5/core": "file:../posty5-core",
52
+ "@types/node": "^20.0.0",
53
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
54
+ "@typescript-eslint/parser": "^6.0.0",
55
+ "eslint": "^8.0.0",
56
+ "typescript": "^5.3.0",
57
+ "tsup": "^8.0.0"
58
+ },
59
+ "engines": {
60
+ "node": ">=16.0.0"
61
+ }
62
+ }