@woopsocial/typescript-sdk 0.0.8 → 0.1.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/FUNCTIONS.md +9 -3
- package/README.md +71 -22
- package/esm/funcs/posts-create-post.d.ts +23 -0
- package/esm/funcs/posts-create-post.d.ts.map +1 -0
- package/esm/funcs/posts-create-post.js +88 -0
- package/esm/funcs/posts-create-post.js.map +1 -0
- package/esm/funcs/posts-delete-post.d.ts +21 -0
- package/esm/funcs/posts-delete-post.d.ts.map +1 -0
- package/esm/funcs/posts-delete-post.js +91 -0
- package/esm/funcs/posts-delete-post.js.map +1 -0
- package/esm/funcs/posts-get-post.d.ts +19 -0
- package/esm/funcs/posts-get-post.d.ts.map +1 -0
- package/esm/funcs/posts-get-post.js +89 -0
- package/esm/funcs/posts-get-post.js.map +1 -0
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.d.ts +2 -1
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.d.ts.map +1 -1
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.js +2 -1
- package/esm/funcs/social-accounts-get-social-account-platform-inputs.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/create-post-error-code.d.ts +16 -0
- package/esm/models/create-post-error-code.d.ts.map +1 -0
- package/esm/models/create-post-error-code.js +17 -0
- package/esm/models/create-post-error-code.js.map +1 -0
- package/esm/models/create-post-request.d.ts +35 -0
- package/esm/models/create-post-request.d.ts.map +1 -0
- package/esm/models/create-post-request.js +17 -0
- package/esm/models/create-post-request.js.map +1 -0
- package/esm/models/delete-post-error-code.d.ts +11 -0
- package/esm/models/delete-post-error-code.d.ts.map +1 -0
- package/esm/models/delete-post-error-code.js +12 -0
- package/esm/models/delete-post-error-code.js.map +1 -0
- package/esm/models/delivery-status.d.ts +0 -2
- package/esm/models/delivery-status.d.ts.map +1 -1
- package/esm/models/delivery-status.js +0 -2
- package/esm/models/delivery-status.js.map +1 -1
- package/esm/models/draft-post-schedule.d.ts +17 -0
- package/esm/models/draft-post-schedule.d.ts.map +1 -0
- package/esm/models/draft-post-schedule.js +21 -0
- package/esm/models/draft-post-schedule.js.map +1 -0
- package/esm/models/errors/create-post-error-response.d.ts +46 -0
- package/esm/models/errors/create-post-error-response.d.ts.map +1 -0
- package/esm/models/errors/create-post-error-response.js +55 -0
- package/esm/models/errors/create-post-error-response.js.map +1 -0
- package/esm/models/errors/delete-post-error-response.d.ts +20 -0
- package/esm/models/errors/delete-post-error-response.d.ts.map +1 -0
- package/esm/models/errors/delete-post-error-response.js +34 -0
- package/esm/models/errors/delete-post-error-response.js.map +1 -0
- package/esm/models/errors/get-post-error-response.d.ts +20 -0
- package/esm/models/errors/get-post-error-response.d.ts.map +1 -0
- package/esm/models/errors/get-post-error-response.js +34 -0
- package/esm/models/errors/get-post-error-response.js.map +1 -0
- package/esm/models/errors/index.d.ts +3 -0
- package/esm/models/errors/index.d.ts.map +1 -1
- package/esm/models/errors/index.js +3 -0
- package/esm/models/errors/index.js.map +1 -1
- package/esm/models/facebook-input.d.ts +33 -0
- package/esm/models/facebook-input.d.ts.map +1 -0
- package/esm/models/facebook-input.js +18 -0
- package/esm/models/facebook-input.js.map +1 -0
- package/esm/models/facebook-post.d.ts +43 -0
- package/esm/models/facebook-post.d.ts.map +1 -0
- package/esm/models/facebook-post.js +26 -0
- package/esm/models/facebook-post.js.map +1 -0
- package/esm/models/get-post-error-code.d.ts +10 -0
- package/esm/models/get-post-error-code.d.ts.map +1 -0
- package/esm/models/get-post-error-code.js +11 -0
- package/esm/models/get-post-error-code.js.map +1 -0
- package/esm/models/health-response.d.ts +1 -1
- package/esm/models/health-response.d.ts.map +1 -1
- package/esm/models/health-response.js +1 -1
- package/esm/models/health-response.js.map +1 -1
- package/esm/models/index.d.ts +37 -34
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +37 -34
- package/esm/models/index.js.map +1 -1
- package/esm/models/instagram-input.d.ts +31 -0
- package/esm/models/instagram-input.d.ts.map +1 -0
- package/esm/models/instagram-input.js +17 -0
- package/esm/models/instagram-input.js.map +1 -0
- package/esm/models/instagram-post.d.ts +42 -0
- package/esm/models/instagram-post.d.ts.map +1 -0
- package/esm/models/instagram-post.js +25 -0
- package/esm/models/instagram-post.js.map +1 -0
- package/esm/models/linked-in-input.d.ts +28 -0
- package/esm/models/linked-in-input.d.ts.map +1 -0
- package/esm/models/linked-in-input.js +15 -0
- package/esm/models/linked-in-input.js.map +1 -0
- package/esm/models/linked-in-pages-input.d.ts +28 -0
- package/esm/models/linked-in-pages-input.d.ts.map +1 -0
- package/esm/models/linked-in-pages-input.js +15 -0
- package/esm/models/linked-in-pages-input.js.map +1 -0
- package/esm/models/linked-in-pages-post.d.ts +40 -0
- package/esm/models/linked-in-pages-post.d.ts.map +1 -0
- package/esm/models/linked-in-pages-post.js +23 -0
- package/esm/models/linked-in-pages-post.js.map +1 -0
- package/esm/models/linked-in-post.d.ts +40 -0
- package/esm/models/linked-in-post.d.ts.map +1 -0
- package/esm/models/linked-in-post.js +23 -0
- package/esm/models/linked-in-post.js.map +1 -0
- package/esm/models/media-library-post-content-media-input.d.ts +17 -0
- package/esm/models/media-library-post-content-media-input.d.ts.map +1 -0
- package/esm/models/media-library-post-content-media-input.js +13 -0
- package/esm/models/media-library-post-content-media-input.js.map +1 -0
- package/esm/models/media-library-post-content-media.d.ts +31 -0
- package/esm/models/media-library-post-content-media.d.ts.map +1 -0
- package/esm/models/media-library-post-content-media.js +25 -0
- package/esm/models/media-library-post-content-media.js.map +1 -0
- package/esm/models/operations/delete-post.d.ts +15 -0
- package/esm/models/operations/delete-post.d.ts.map +1 -0
- package/esm/models/operations/delete-post.js +12 -0
- package/esm/models/operations/delete-post.js.map +1 -0
- package/esm/models/operations/get-post.d.ts +15 -0
- package/esm/models/operations/get-post.d.ts.map +1 -0
- package/esm/models/operations/get-post.js +12 -0
- package/esm/models/operations/get-post.js.map +1 -0
- package/esm/models/operations/index.d.ts +2 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +2 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/pinterest-input.d.ts +30 -0
- package/esm/models/pinterest-input.d.ts.map +1 -0
- package/esm/models/pinterest-input.js +16 -0
- package/esm/models/pinterest-input.js.map +1 -0
- package/esm/models/pinterest-post.d.ts +41 -0
- package/esm/models/pinterest-post.d.ts.map +1 -0
- package/esm/models/pinterest-post.js +24 -0
- package/esm/models/pinterest-post.js.map +1 -0
- package/esm/models/pinterest-social-account-platform-specific-inputs.d.ts +10 -2
- package/esm/models/pinterest-social-account-platform-specific-inputs.d.ts.map +1 -1
- package/esm/models/pinterest-social-account-platform-specific-inputs.js +2 -2
- package/esm/models/pinterest-social-account-platform-specific-inputs.js.map +1 -1
- package/esm/models/post-content-item-input.d.ts +18 -0
- package/esm/models/post-content-item-input.d.ts.map +1 -0
- package/esm/models/post-content-item-input.js +14 -0
- package/esm/models/post-content-item-input.js.map +1 -0
- package/esm/models/post-content-item.d.ts +15 -0
- package/esm/models/post-content-item.d.ts.map +1 -0
- package/esm/models/post-content-item.js +16 -0
- package/esm/models/post-content-item.js.map +1 -0
- package/esm/models/post-content-media-input.d.ts +14 -0
- package/esm/models/post-content-media-input.d.ts.map +1 -0
- package/esm/models/post-content-media-input.js +10 -0
- package/esm/models/post-content-media-input.js.map +1 -0
- package/esm/models/post-content-media.d.ts +14 -0
- package/esm/models/post-content-media.d.ts.map +1 -0
- package/esm/models/post-content-media.js +11 -0
- package/esm/models/post-content-media.js.map +1 -0
- package/esm/models/post-schedule.d.ts +17 -0
- package/esm/models/post-schedule.d.ts.map +1 -0
- package/esm/models/post-schedule.js +28 -0
- package/esm/models/post-schedule.js.map +1 -0
- package/esm/models/post.d.ts +14 -44
- package/esm/models/post.d.ts.map +1 -1
- package/esm/models/post.js +8 -18
- package/esm/models/post.js.map +1 -1
- package/esm/models/publish-now-post-schedule.d.ts +17 -0
- package/esm/models/publish-now-post-schedule.d.ts.map +1 -0
- package/esm/models/publish-now-post-schedule.js +21 -0
- package/esm/models/publish-now-post-schedule.js.map +1 -0
- package/esm/models/schedule-for-later-post-schedule.d.ts +22 -0
- package/esm/models/schedule-for-later-post-schedule.d.ts.map +1 -0
- package/esm/models/schedule-for-later-post-schedule.js +23 -0
- package/esm/models/schedule-for-later-post-schedule.js.map +1 -0
- package/esm/models/social-account-platform-inputs.d.ts +0 -5
- package/esm/models/social-account-platform-inputs.d.ts.map +1 -1
- package/esm/models/social-account-platform-inputs.js +0 -2
- package/esm/models/social-account-platform-inputs.js.map +1 -1
- package/esm/models/social-account-post.d.ts +17 -0
- package/esm/models/social-account-post.d.ts.map +1 -0
- package/esm/models/social-account-post.js +28 -0
- package/esm/models/social-account-post.js.map +1 -0
- package/esm/models/social-account-target-input.d.ts +16 -0
- package/esm/models/social-account-target-input.d.ts.map +1 -0
- package/esm/models/social-account-target-input.js +27 -0
- package/esm/models/social-account-target-input.js.map +1 -0
- package/esm/models/tik-tok-input.d.ts +90 -0
- package/esm/models/tik-tok-input.d.ts.map +1 -0
- package/esm/models/tik-tok-input.js +26 -0
- package/esm/models/tik-tok-input.js.map +1 -0
- package/esm/models/tik-tok-post.d.ts +93 -0
- package/esm/models/tik-tok-post.d.ts.map +1 -0
- package/esm/models/tik-tok-post.js +35 -0
- package/esm/models/tik-tok-post.js.map +1 -0
- package/esm/models/tik-tok-social-account-platform-specific-inputs.d.ts +26 -2
- package/esm/models/tik-tok-social-account-platform-specific-inputs.d.ts.map +1 -1
- package/esm/models/tik-tok-social-account-platform-specific-inputs.js +6 -2
- package/esm/models/tik-tok-social-account-platform-specific-inputs.js.map +1 -1
- package/esm/models/upload-session-aborted-status.d.ts +14 -0
- package/esm/models/upload-session-aborted-status.d.ts.map +1 -0
- package/esm/models/upload-session-aborted-status.js +15 -0
- package/esm/models/upload-session-aborted-status.js.map +1 -0
- package/esm/models/upload-session-failed-status.d.ts +22 -0
- package/esm/models/upload-session-failed-status.d.ts.map +1 -0
- package/esm/models/upload-session-failed-status.js +17 -0
- package/esm/models/upload-session-failed-status.js.map +1 -0
- package/esm/models/upload-session-initiated-status.d.ts +14 -0
- package/esm/models/upload-session-initiated-status.d.ts.map +1 -0
- package/esm/models/upload-session-initiated-status.js +15 -0
- package/esm/models/upload-session-initiated-status.js.map +1 -0
- package/esm/models/upload-session-ready-status.d.ts +18 -0
- package/esm/models/upload-session-ready-status.d.ts.map +1 -0
- package/esm/models/upload-session-ready-status.js +16 -0
- package/esm/models/upload-session-ready-status.js.map +1 -0
- package/esm/models/upload-session-status.d.ts +7 -11
- package/esm/models/upload-session-status.d.ts.map +1 -1
- package/esm/models/upload-session-status.js +12 -9
- package/esm/models/upload-session-status.js.map +1 -1
- package/esm/models/upload-session-uploaded-status.d.ts +14 -0
- package/esm/models/upload-session-uploaded-status.d.ts.map +1 -0
- package/esm/models/upload-session-uploaded-status.js +15 -0
- package/esm/models/upload-session-uploaded-status.js.map +1 -0
- package/esm/models/validation-error.d.ts +4 -2
- package/esm/models/validation-error.d.ts.map +1 -1
- package/esm/models/validation-error.js +1 -2
- package/esm/models/validation-error.js.map +1 -1
- package/esm/models/x-input.d.ts +28 -0
- package/esm/models/x-input.d.ts.map +1 -0
- package/esm/models/x-input.js +16 -0
- package/esm/models/x-input.js.map +1 -0
- package/esm/models/x-post.d.ts +40 -0
- package/esm/models/x-post.d.ts.map +1 -0
- package/esm/models/x-post.js +23 -0
- package/esm/models/x-post.js.map +1 -0
- package/esm/models/you-tube-input.d.ts +37 -0
- package/esm/models/you-tube-input.d.ts.map +1 -0
- package/esm/models/you-tube-input.js +20 -0
- package/esm/models/you-tube-input.js.map +1 -0
- package/esm/models/you-tube-post.d.ts +45 -0
- package/esm/models/you-tube-post.d.ts.map +1 -0
- package/esm/models/you-tube-post.js +29 -0
- package/esm/models/you-tube-post.js.map +1 -0
- package/esm/sdk/posts.d.ts +15 -27
- package/esm/sdk/posts.d.ts.map +1 -1
- package/esm/sdk/posts.js +20 -36
- package/esm/sdk/posts.js.map +1 -1
- package/esm/sdk/social-accounts.d.ts +2 -1
- package/esm/sdk/social-accounts.d.ts.map +1 -1
- package/esm/sdk/social-accounts.js +2 -1
- package/esm/sdk/social-accounts.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +9 -1
- package/src/funcs/{posts-delete-posts.ts → posts-create-post.ts} +27 -16
- package/src/funcs/{posts-create-posts.ts → posts-delete-post.ts} +36 -24
- package/src/funcs/{posts-list-posts.ts → posts-get-post.ts} +34 -21
- package/src/funcs/social-accounts-get-social-account-platform-inputs.ts +2 -1
- package/src/lib/config.ts +2 -2
- package/src/models/{create-post-failure-code.ts → create-post-error-code.ts} +8 -7
- package/src/models/create-post-request.ts +67 -0
- package/src/models/{delete-post-failure-code.ts → delete-post-error-code.ts} +5 -5
- package/src/models/delivery-status.ts +0 -5
- package/src/models/draft-post-schedule.ts +50 -0
- package/src/models/errors/create-post-error-response.ts +89 -0
- package/src/models/errors/delete-post-error-response.ts +53 -0
- package/src/models/errors/get-post-error-response.ts +53 -0
- package/src/models/errors/index.ts +3 -0
- package/src/models/facebook-input.ts +58 -0
- package/src/models/facebook-post.ts +80 -0
- package/src/models/get-post-error-code.ts +19 -0
- package/src/models/health-response.ts +2 -2
- package/src/models/index.ts +37 -34
- package/src/models/instagram-input.ts +55 -0
- package/src/models/instagram-post.ts +80 -0
- package/src/models/linked-in-input.ts +48 -0
- package/src/models/linked-in-pages-input.ts +52 -0
- package/src/models/linked-in-pages-post.ts +74 -0
- package/src/models/linked-in-post.ts +72 -0
- package/src/models/media-library-post-content-media-input.ts +38 -0
- package/src/models/media-library-post-content-media.ts +60 -0
- package/src/models/operations/delete-post.ts +33 -0
- package/src/models/operations/get-post.ts +29 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/pinterest-input.ts +51 -0
- package/src/models/pinterest-post.ts +76 -0
- package/src/models/pinterest-social-account-platform-specific-inputs.ts +13 -5
- package/src/models/post-content-item-input.ts +41 -0
- package/src/models/post-content-item.ts +40 -0
- package/src/models/post-content-media-input.ts +35 -0
- package/src/models/post-content-media.ts +35 -0
- package/src/models/post-schedule.ts +70 -0
- package/src/models/post.ts +23 -65
- package/src/models/publish-now-post-schedule.ts +50 -0
- package/src/models/schedule-for-later-post-schedule.ts +59 -0
- package/src/models/social-account-platform-inputs.ts +0 -9
- package/src/models/social-account-post.ts +63 -0
- package/src/models/social-account-target-input.ts +85 -0
- package/src/models/tik-tok-input.ts +125 -0
- package/src/models/tik-tok-post.ts +140 -0
- package/src/models/tik-tok-social-account-platform-specific-inputs.ts +33 -5
- package/src/models/upload-session-aborted-status.ts +36 -0
- package/src/models/upload-session-failed-status.ts +46 -0
- package/src/models/upload-session-initiated-status.ts +36 -0
- package/src/models/upload-session-ready-status.ts +41 -0
- package/src/models/upload-session-status.ts +34 -20
- package/src/models/upload-session-uploaded-status.ts +36 -0
- package/src/models/validation-error.ts +5 -6
- package/src/models/x-input.ts +46 -0
- package/src/models/x-post.ts +71 -0
- package/src/models/you-tube-input.ts +64 -0
- package/src/models/you-tube-post.ts +84 -0
- package/src/sdk/posts.ts +27 -50
- package/src/sdk/social-accounts.ts +2 -1
- package/src/funcs/posts-update-posts.ts +0 -165
- package/src/models/create-post-failure-result.ts +0 -68
- package/src/models/create-post-item.ts +0 -73
- package/src/models/create-post-result.ts +0 -42
- package/src/models/create-post-success-result.ts +0 -50
- package/src/models/create-posts-response.ts +0 -37
- package/src/models/delete-post-failure-result.ts +0 -44
- package/src/models/delete-post-result.ts +0 -42
- package/src/models/delete-post-success-result.ts +0 -36
- package/src/models/delete-posts-response.ts +0 -37
- package/src/models/facebook-specifics.ts +0 -63
- package/src/models/instagram-specifics.ts +0 -59
- package/src/models/linked-in-pages-specifics.ts +0 -50
- package/src/models/linked-in-specifics.ts +0 -50
- package/src/models/list-posts-request.ts +0 -68
- package/src/models/list-posts-response.ts +0 -37
- package/src/models/pinterest-account-platform-inputs.ts +0 -42
- package/src/models/pinterest-specifics.ts +0 -54
- package/src/models/platform-specifics.ts +0 -129
- package/src/models/post-media.ts +0 -56
- package/src/models/tik-tok-account-platform-inputs.ts +0 -63
- package/src/models/tik-tok-specifics.ts +0 -94
- package/src/models/update-post-failure-code.ts +0 -23
- package/src/models/update-post-failure-result.ts +0 -68
- package/src/models/update-post-item.ts +0 -61
- package/src/models/update-post-result.ts +0 -42
- package/src/models/update-post-success-result.ts +0 -45
- package/src/models/update-posts-response.ts +0 -37
- package/src/models/upload-session-status-value.ts +0 -24
- package/src/models/validation-field.ts +0 -29
- package/src/models/validation-warning.ts +0 -37
- package/src/models/x-specifics.ts +0 -44
- package/src/models/you-tube-specifics.ts +0 -71
package/src/models/post.ts
CHANGED
|
@@ -6,20 +6,16 @@ import * as z from "zod/v4-mini";
|
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
8
|
import * as types from "../types/primitives.js";
|
|
9
|
-
import {
|
|
10
|
-
DeliveryStatus,
|
|
11
|
-
DeliveryStatus$inboundSchema,
|
|
12
|
-
} from "./delivery-status.js";
|
|
13
9
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
14
10
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from "./
|
|
18
|
-
import {
|
|
11
|
+
PostContentItem,
|
|
12
|
+
PostContentItem$inboundSchema,
|
|
13
|
+
} from "./post-content-item.js";
|
|
14
|
+
import { PostSchedule, PostSchedule$inboundSchema } from "./post-schedule.js";
|
|
19
15
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from "./social-
|
|
16
|
+
SocialAccountPost,
|
|
17
|
+
SocialAccountPost$inboundSchema,
|
|
18
|
+
} from "./social-account-post.js";
|
|
23
19
|
|
|
24
20
|
export type Post = {
|
|
25
21
|
/**
|
|
@@ -27,77 +23,39 @@ export type Post = {
|
|
|
27
23
|
*/
|
|
28
24
|
id: string;
|
|
29
25
|
/**
|
|
30
|
-
* Project identifier.
|
|
26
|
+
* Project identifier derived from the selected social accounts.
|
|
31
27
|
*/
|
|
32
28
|
projectId: string;
|
|
33
29
|
/**
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
socialAccountId: string;
|
|
37
|
-
/**
|
|
38
|
-
* Social platform supported by WoopSocial.
|
|
39
|
-
*/
|
|
40
|
-
platform: SocialPlatform;
|
|
41
|
-
/**
|
|
42
|
-
* Display name or username for the connected account.
|
|
43
|
-
*/
|
|
44
|
-
username: string;
|
|
45
|
-
/**
|
|
46
|
-
* Delivery lifecycle status for a post.
|
|
30
|
+
* Post content expressed as thread items.
|
|
47
31
|
*
|
|
48
32
|
* @remarks
|
|
49
33
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `SENT`: Delivery completed successfully.
|
|
53
|
-
* `FAILED`: Delivery completed unsuccessfully.
|
|
54
|
-
*/
|
|
55
|
-
deliveryStatus: DeliveryStatus;
|
|
56
|
-
/**
|
|
57
|
-
* Effective UTC time when the post is or was scheduled to publish.
|
|
58
|
-
*/
|
|
59
|
-
scheduledForUTC: Date;
|
|
60
|
-
/**
|
|
61
|
-
* UTC time when delivery completed successfully or failed.
|
|
62
|
-
*/
|
|
63
|
-
sentAt?: Date | undefined;
|
|
64
|
-
title?: string | undefined;
|
|
65
|
-
description?: string | undefined;
|
|
66
|
-
firstComment?: string | undefined;
|
|
67
|
-
media?: Array<PostMedia> | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Platform-specific publishing options. The `platform` value must match the publishing account's platform.
|
|
34
|
+
* The array exists for future thread support. Currently exactly one item
|
|
35
|
+
* is returned.
|
|
70
36
|
*/
|
|
71
|
-
|
|
37
|
+
content: Array<PostContentItem>;
|
|
38
|
+
schedule: PostSchedule;
|
|
39
|
+
socialAccounts: Array<SocialAccountPost>;
|
|
72
40
|
/**
|
|
73
|
-
*
|
|
41
|
+
* UTC time when the post was created.
|
|
74
42
|
*/
|
|
75
|
-
|
|
43
|
+
createdAt: Date;
|
|
76
44
|
/**
|
|
77
|
-
*
|
|
45
|
+
* UTC time when the post was last updated.
|
|
78
46
|
*/
|
|
79
|
-
|
|
80
|
-
errorMessage?: string | undefined;
|
|
47
|
+
updatedAt: Date;
|
|
81
48
|
};
|
|
82
49
|
|
|
83
50
|
/** @internal */
|
|
84
51
|
export const Post$inboundSchema: z.ZodMiniType<Post, unknown> = z.object({
|
|
85
52
|
id: types.string(),
|
|
86
53
|
projectId: types.string(),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
sentAt: types.optional(types.date()),
|
|
93
|
-
title: types.optional(types.string()),
|
|
94
|
-
description: types.optional(types.string()),
|
|
95
|
-
firstComment: types.optional(types.string()),
|
|
96
|
-
media: types.optional(z.array(PostMedia$inboundSchema)),
|
|
97
|
-
platformSpecifics: PlatformSpecifics$inboundSchema,
|
|
98
|
-
externalPostId: types.optional(types.string()),
|
|
99
|
-
externalPostUrl: types.optional(types.string()),
|
|
100
|
-
errorMessage: types.optional(types.string()),
|
|
54
|
+
content: z.array(PostContentItem$inboundSchema),
|
|
55
|
+
schedule: PostSchedule$inboundSchema,
|
|
56
|
+
socialAccounts: z.array(SocialAccountPost$inboundSchema),
|
|
57
|
+
createdAt: types.date(),
|
|
58
|
+
updatedAt: types.date(),
|
|
101
59
|
});
|
|
102
60
|
|
|
103
61
|
export function postFromJSON(
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type PublishNowPostSchedule = {
|
|
12
|
+
type: "PUBLISH_NOW";
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const PublishNowPostSchedule$inboundSchema: z.ZodMiniType<
|
|
17
|
+
PublishNowPostSchedule,
|
|
18
|
+
unknown
|
|
19
|
+
> = z.object({
|
|
20
|
+
type: types.literal("PUBLISH_NOW"),
|
|
21
|
+
});
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type PublishNowPostSchedule$Outbound = {
|
|
24
|
+
type: "PUBLISH_NOW";
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const PublishNowPostSchedule$outboundSchema: z.ZodMiniType<
|
|
29
|
+
PublishNowPostSchedule$Outbound,
|
|
30
|
+
PublishNowPostSchedule
|
|
31
|
+
> = z.object({
|
|
32
|
+
type: z.literal("PUBLISH_NOW"),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function publishNowPostScheduleToJSON(
|
|
36
|
+
publishNowPostSchedule: PublishNowPostSchedule,
|
|
37
|
+
): string {
|
|
38
|
+
return JSON.stringify(
|
|
39
|
+
PublishNowPostSchedule$outboundSchema.parse(publishNowPostSchedule),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
export function publishNowPostScheduleFromJSON(
|
|
43
|
+
jsonString: string,
|
|
44
|
+
): SafeParseResult<PublishNowPostSchedule, SDKValidationError> {
|
|
45
|
+
return safeParse(
|
|
46
|
+
jsonString,
|
|
47
|
+
(x) => PublishNowPostSchedule$inboundSchema.parse(JSON.parse(x)),
|
|
48
|
+
`Failed to parse 'PublishNowPostSchedule' from JSON`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
|
+
|
|
11
|
+
export type ScheduleForLaterPostSchedule = {
|
|
12
|
+
type: "SCHEDULE_FOR_LATER";
|
|
13
|
+
/**
|
|
14
|
+
* UTC time when the post should be published.
|
|
15
|
+
*/
|
|
16
|
+
scheduledForUTC: Date;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ScheduleForLaterPostSchedule$inboundSchema: z.ZodMiniType<
|
|
21
|
+
ScheduleForLaterPostSchedule,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
type: types.literal("SCHEDULE_FOR_LATER"),
|
|
25
|
+
scheduledForUTC: types.date(),
|
|
26
|
+
});
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type ScheduleForLaterPostSchedule$Outbound = {
|
|
29
|
+
type: "SCHEDULE_FOR_LATER";
|
|
30
|
+
scheduledForUTC: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const ScheduleForLaterPostSchedule$outboundSchema: z.ZodMiniType<
|
|
35
|
+
ScheduleForLaterPostSchedule$Outbound,
|
|
36
|
+
ScheduleForLaterPostSchedule
|
|
37
|
+
> = z.object({
|
|
38
|
+
type: z.literal("SCHEDULE_FOR_LATER"),
|
|
39
|
+
scheduledForUTC: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export function scheduleForLaterPostScheduleToJSON(
|
|
43
|
+
scheduleForLaterPostSchedule: ScheduleForLaterPostSchedule,
|
|
44
|
+
): string {
|
|
45
|
+
return JSON.stringify(
|
|
46
|
+
ScheduleForLaterPostSchedule$outboundSchema.parse(
|
|
47
|
+
scheduleForLaterPostSchedule,
|
|
48
|
+
),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export function scheduleForLaterPostScheduleFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<ScheduleForLaterPostSchedule, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => ScheduleForLaterPostSchedule$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'ScheduleForLaterPostSchedule' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -11,20 +11,12 @@ import {
|
|
|
11
11
|
SocialAccountPlatformSpecificInputs,
|
|
12
12
|
SocialAccountPlatformSpecificInputs$inboundSchema,
|
|
13
13
|
} from "./social-account-platform-specific-inputs.js";
|
|
14
|
-
import {
|
|
15
|
-
SocialPlatform,
|
|
16
|
-
SocialPlatform$inboundSchema,
|
|
17
|
-
} from "./social-platform.js";
|
|
18
14
|
|
|
19
15
|
export type SocialAccountPlatformInputs = {
|
|
20
16
|
/**
|
|
21
17
|
* Connected social account identifier.
|
|
22
18
|
*/
|
|
23
19
|
socialAccountId: string;
|
|
24
|
-
/**
|
|
25
|
-
* Social platform supported by WoopSocial.
|
|
26
|
-
*/
|
|
27
|
-
platform: SocialPlatform;
|
|
28
20
|
platformSpecificInputs: SocialAccountPlatformSpecificInputs;
|
|
29
21
|
};
|
|
30
22
|
|
|
@@ -34,7 +26,6 @@ export const SocialAccountPlatformInputs$inboundSchema: z.ZodMiniType<
|
|
|
34
26
|
unknown
|
|
35
27
|
> = z.object({
|
|
36
28
|
socialAccountId: types.string(),
|
|
37
|
-
platform: SocialPlatform$inboundSchema,
|
|
38
29
|
platformSpecificInputs: SocialAccountPlatformSpecificInputs$inboundSchema,
|
|
39
30
|
});
|
|
40
31
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import * as discriminatedUnionTypes from "../types/discriminated-union.js";
|
|
8
|
+
import { discriminatedUnion } from "../types/discriminated-union.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
11
|
+
import { FacebookPost, FacebookPost$inboundSchema } from "./facebook-post.js";
|
|
12
|
+
import {
|
|
13
|
+
InstagramPost,
|
|
14
|
+
InstagramPost$inboundSchema,
|
|
15
|
+
} from "./instagram-post.js";
|
|
16
|
+
import {
|
|
17
|
+
LinkedInPagesPost,
|
|
18
|
+
LinkedInPagesPost$inboundSchema,
|
|
19
|
+
} from "./linked-in-pages-post.js";
|
|
20
|
+
import { LinkedInPost, LinkedInPost$inboundSchema } from "./linked-in-post.js";
|
|
21
|
+
import {
|
|
22
|
+
PinterestPost,
|
|
23
|
+
PinterestPost$inboundSchema,
|
|
24
|
+
} from "./pinterest-post.js";
|
|
25
|
+
import { TikTokPost, TikTokPost$inboundSchema } from "./tik-tok-post.js";
|
|
26
|
+
import { XPost, XPost$inboundSchema } from "./x-post.js";
|
|
27
|
+
import { YouTubePost, YouTubePost$inboundSchema } from "./you-tube-post.js";
|
|
28
|
+
|
|
29
|
+
export type SocialAccountPost =
|
|
30
|
+
| PinterestPost
|
|
31
|
+
| InstagramPost
|
|
32
|
+
| FacebookPost
|
|
33
|
+
| TikTokPost
|
|
34
|
+
| YouTubePost
|
|
35
|
+
| XPost
|
|
36
|
+
| LinkedInPost
|
|
37
|
+
| LinkedInPagesPost
|
|
38
|
+
| discriminatedUnionTypes.Unknown<"platform">;
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const SocialAccountPost$inboundSchema: z.ZodMiniType<
|
|
42
|
+
SocialAccountPost,
|
|
43
|
+
unknown
|
|
44
|
+
> = discriminatedUnion("platform", {
|
|
45
|
+
PINTEREST: PinterestPost$inboundSchema,
|
|
46
|
+
INSTAGRAM: InstagramPost$inboundSchema,
|
|
47
|
+
FACEBOOK: FacebookPost$inboundSchema,
|
|
48
|
+
TIKTOK: TikTokPost$inboundSchema,
|
|
49
|
+
YOUTUBE: YouTubePost$inboundSchema,
|
|
50
|
+
X: XPost$inboundSchema,
|
|
51
|
+
LINKEDIN: LinkedInPost$inboundSchema,
|
|
52
|
+
LINKEDIN_PAGES: LinkedInPagesPost$inboundSchema,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export function socialAccountPostFromJSON(
|
|
56
|
+
jsonString: string,
|
|
57
|
+
): SafeParseResult<SocialAccountPost, SDKValidationError> {
|
|
58
|
+
return safeParse(
|
|
59
|
+
jsonString,
|
|
60
|
+
(x) => SocialAccountPost$inboundSchema.parse(JSON.parse(x)),
|
|
61
|
+
`Failed to parse 'SocialAccountPost' from JSON`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
FacebookInput,
|
|
8
|
+
FacebookInput$Outbound,
|
|
9
|
+
FacebookInput$outboundSchema,
|
|
10
|
+
} from "./facebook-input.js";
|
|
11
|
+
import {
|
|
12
|
+
InstagramInput,
|
|
13
|
+
InstagramInput$Outbound,
|
|
14
|
+
InstagramInput$outboundSchema,
|
|
15
|
+
} from "./instagram-input.js";
|
|
16
|
+
import {
|
|
17
|
+
LinkedInInput,
|
|
18
|
+
LinkedInInput$Outbound,
|
|
19
|
+
LinkedInInput$outboundSchema,
|
|
20
|
+
} from "./linked-in-input.js";
|
|
21
|
+
import {
|
|
22
|
+
LinkedInPagesInput,
|
|
23
|
+
LinkedInPagesInput$Outbound,
|
|
24
|
+
LinkedInPagesInput$outboundSchema,
|
|
25
|
+
} from "./linked-in-pages-input.js";
|
|
26
|
+
import {
|
|
27
|
+
PinterestInput,
|
|
28
|
+
PinterestInput$Outbound,
|
|
29
|
+
PinterestInput$outboundSchema,
|
|
30
|
+
} from "./pinterest-input.js";
|
|
31
|
+
import {
|
|
32
|
+
TikTokInput,
|
|
33
|
+
TikTokInput$Outbound,
|
|
34
|
+
TikTokInput$outboundSchema,
|
|
35
|
+
} from "./tik-tok-input.js";
|
|
36
|
+
import { XInput, XInput$Outbound, XInput$outboundSchema } from "./x-input.js";
|
|
37
|
+
import {
|
|
38
|
+
YouTubeInput,
|
|
39
|
+
YouTubeInput$Outbound,
|
|
40
|
+
YouTubeInput$outboundSchema,
|
|
41
|
+
} from "./you-tube-input.js";
|
|
42
|
+
|
|
43
|
+
export type SocialAccountTargetInput =
|
|
44
|
+
| PinterestInput
|
|
45
|
+
| InstagramInput
|
|
46
|
+
| FacebookInput
|
|
47
|
+
| TikTokInput
|
|
48
|
+
| YouTubeInput
|
|
49
|
+
| XInput
|
|
50
|
+
| LinkedInInput
|
|
51
|
+
| LinkedInPagesInput;
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type SocialAccountTargetInput$Outbound =
|
|
55
|
+
| PinterestInput$Outbound
|
|
56
|
+
| InstagramInput$Outbound
|
|
57
|
+
| FacebookInput$Outbound
|
|
58
|
+
| TikTokInput$Outbound
|
|
59
|
+
| YouTubeInput$Outbound
|
|
60
|
+
| XInput$Outbound
|
|
61
|
+
| LinkedInInput$Outbound
|
|
62
|
+
| LinkedInPagesInput$Outbound;
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const SocialAccountTargetInput$outboundSchema: z.ZodMiniType<
|
|
66
|
+
SocialAccountTargetInput$Outbound,
|
|
67
|
+
SocialAccountTargetInput
|
|
68
|
+
> = z.union([
|
|
69
|
+
PinterestInput$outboundSchema,
|
|
70
|
+
InstagramInput$outboundSchema,
|
|
71
|
+
FacebookInput$outboundSchema,
|
|
72
|
+
TikTokInput$outboundSchema,
|
|
73
|
+
YouTubeInput$outboundSchema,
|
|
74
|
+
XInput$outboundSchema,
|
|
75
|
+
LinkedInInput$outboundSchema,
|
|
76
|
+
LinkedInPagesInput$outboundSchema,
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
export function socialAccountTargetInputToJSON(
|
|
80
|
+
socialAccountTargetInput: SocialAccountTargetInput,
|
|
81
|
+
): string {
|
|
82
|
+
return JSON.stringify(
|
|
83
|
+
SocialAccountTargetInput$outboundSchema.parse(socialAccountTargetInput),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
PostContentItemInput,
|
|
8
|
+
PostContentItemInput$Outbound,
|
|
9
|
+
PostContentItemInput$outboundSchema,
|
|
10
|
+
} from "./post-content-item-input.js";
|
|
11
|
+
import {
|
|
12
|
+
TikTokPostType,
|
|
13
|
+
TikTokPostType$outboundSchema,
|
|
14
|
+
} from "./tik-tok-post-type.js";
|
|
15
|
+
import {
|
|
16
|
+
TikTokPrivacyLevel,
|
|
17
|
+
TikTokPrivacyLevel$outboundSchema,
|
|
18
|
+
} from "./tik-tok-privacy-level.js";
|
|
19
|
+
|
|
20
|
+
export type TikTokInput = {
|
|
21
|
+
platform: "TIKTOK";
|
|
22
|
+
/**
|
|
23
|
+
* Connected social account identifier.
|
|
24
|
+
*/
|
|
25
|
+
socialAccountId: string;
|
|
26
|
+
/**
|
|
27
|
+
* Post content expressed as thread items.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
*
|
|
31
|
+
* The array exists for future thread support. Currently exactly one item
|
|
32
|
+
* is supported.
|
|
33
|
+
*/
|
|
34
|
+
contentOverride?: Array<PostContentItemInput> | undefined;
|
|
35
|
+
postType: TikTokPostType;
|
|
36
|
+
privacyLevel: TikTokPrivacyLevel;
|
|
37
|
+
/**
|
|
38
|
+
* Whether comments should be allowed for this TikTok post.
|
|
39
|
+
*/
|
|
40
|
+
allowComment: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether duets should be allowed for this TikTok post.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
*
|
|
46
|
+
* This field applies to `postType=VIDEO`.
|
|
47
|
+
*
|
|
48
|
+
* When `postType=PHOTO`, this field is required by the API contract
|
|
49
|
+
* but is not used by TikTok.
|
|
50
|
+
*/
|
|
51
|
+
allowDuet: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether stitches should be allowed for this TikTok post.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
*
|
|
57
|
+
* This field applies to `postType=VIDEO`.
|
|
58
|
+
*
|
|
59
|
+
* When `postType=PHOTO`, this field is required by the API contract
|
|
60
|
+
* but is not used by TikTok.
|
|
61
|
+
*/
|
|
62
|
+
allowStitch: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether TikTok content disclosure should be enabled for this post.
|
|
65
|
+
*/
|
|
66
|
+
contentDisclosureEnabled: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the post should be disclosed as "Your brand" content on TikTok.
|
|
69
|
+
*/
|
|
70
|
+
isYourBrand: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether the post should be disclosed as branded content on TikTok.
|
|
73
|
+
*/
|
|
74
|
+
isBrandedContent: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether TikTok should automatically add music to this post.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
*
|
|
80
|
+
* This field applies to `postType=PHOTO`.
|
|
81
|
+
*
|
|
82
|
+
* When `postType=VIDEO`, this field is required by the API contract
|
|
83
|
+
* but is not used by TikTok.
|
|
84
|
+
*/
|
|
85
|
+
autoAddMusic: boolean;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export type TikTokInput$Outbound = {
|
|
90
|
+
platform: "TIKTOK";
|
|
91
|
+
socialAccountId: string;
|
|
92
|
+
contentOverride?: Array<PostContentItemInput$Outbound> | undefined;
|
|
93
|
+
postType: string;
|
|
94
|
+
privacyLevel: string;
|
|
95
|
+
allowComment: boolean;
|
|
96
|
+
allowDuet: boolean;
|
|
97
|
+
allowStitch: boolean;
|
|
98
|
+
contentDisclosureEnabled: boolean;
|
|
99
|
+
isYourBrand: boolean;
|
|
100
|
+
isBrandedContent: boolean;
|
|
101
|
+
autoAddMusic: boolean;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const TikTokInput$outboundSchema: z.ZodMiniType<
|
|
106
|
+
TikTokInput$Outbound,
|
|
107
|
+
TikTokInput
|
|
108
|
+
> = z.object({
|
|
109
|
+
platform: z.literal("TIKTOK"),
|
|
110
|
+
socialAccountId: z.string(),
|
|
111
|
+
contentOverride: z.optional(z.array(PostContentItemInput$outboundSchema)),
|
|
112
|
+
postType: TikTokPostType$outboundSchema,
|
|
113
|
+
privacyLevel: TikTokPrivacyLevel$outboundSchema,
|
|
114
|
+
allowComment: z.boolean(),
|
|
115
|
+
allowDuet: z.boolean(),
|
|
116
|
+
allowStitch: z.boolean(),
|
|
117
|
+
contentDisclosureEnabled: z.boolean(),
|
|
118
|
+
isYourBrand: z.boolean(),
|
|
119
|
+
isBrandedContent: z.boolean(),
|
|
120
|
+
autoAddMusic: z.boolean(),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export function tikTokInputToJSON(tikTokInput: TikTokInput): string {
|
|
124
|
+
return JSON.stringify(TikTokInput$outboundSchema.parse(tikTokInput));
|
|
125
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import * as types from "../types/primitives.js";
|
|
9
|
+
import {
|
|
10
|
+
DeliveryStatus,
|
|
11
|
+
DeliveryStatus$inboundSchema,
|
|
12
|
+
} from "./delivery-status.js";
|
|
13
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
14
|
+
import {
|
|
15
|
+
PostContentItem,
|
|
16
|
+
PostContentItem$inboundSchema,
|
|
17
|
+
} from "./post-content-item.js";
|
|
18
|
+
import {
|
|
19
|
+
TikTokPostType,
|
|
20
|
+
TikTokPostType$inboundSchema,
|
|
21
|
+
} from "./tik-tok-post-type.js";
|
|
22
|
+
import {
|
|
23
|
+
TikTokPrivacyLevel,
|
|
24
|
+
TikTokPrivacyLevel$inboundSchema,
|
|
25
|
+
} from "./tik-tok-privacy-level.js";
|
|
26
|
+
|
|
27
|
+
export type TikTokPost = {
|
|
28
|
+
platform: "TIKTOK";
|
|
29
|
+
/**
|
|
30
|
+
* Connected social account identifier.
|
|
31
|
+
*/
|
|
32
|
+
socialAccountId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Delivery lifecycle status for a post.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
*
|
|
38
|
+
* `NOT_STARTED`: The post exists and is scheduled, but delivery has not started yet.
|
|
39
|
+
* `SENDING`: Delivery is currently in progress.
|
|
40
|
+
* `SENT`: Delivery completed successfully.
|
|
41
|
+
* `FAILED`: Delivery completed unsuccessfully.
|
|
42
|
+
*/
|
|
43
|
+
deliveryStatus: DeliveryStatus;
|
|
44
|
+
/**
|
|
45
|
+
* Post content expressed as thread items.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
*
|
|
49
|
+
* The array exists for future thread support. Currently exactly one item
|
|
50
|
+
* is returned.
|
|
51
|
+
*/
|
|
52
|
+
contentOverride?: Array<PostContentItem> | undefined;
|
|
53
|
+
sentAt?: Date | undefined;
|
|
54
|
+
externalPostId?: string | undefined;
|
|
55
|
+
externalPostUrl?: string | undefined;
|
|
56
|
+
errorMessage?: string | undefined;
|
|
57
|
+
postType: TikTokPostType;
|
|
58
|
+
privacyLevel: TikTokPrivacyLevel;
|
|
59
|
+
/**
|
|
60
|
+
* Whether comments should be allowed for this TikTok post.
|
|
61
|
+
*/
|
|
62
|
+
allowComment: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether duets should be allowed for this TikTok post.
|
|
65
|
+
*
|
|
66
|
+
* @remarks
|
|
67
|
+
*
|
|
68
|
+
* This field applies to `postType=VIDEO`.
|
|
69
|
+
*
|
|
70
|
+
* When `postType=PHOTO`, this field is required by the API contract
|
|
71
|
+
* but is not used by TikTok.
|
|
72
|
+
*/
|
|
73
|
+
allowDuet: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether stitches should be allowed for this TikTok post.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
*
|
|
79
|
+
* This field applies to `postType=VIDEO`.
|
|
80
|
+
*
|
|
81
|
+
* When `postType=PHOTO`, this field is required by the API contract
|
|
82
|
+
* but is not used by TikTok.
|
|
83
|
+
*/
|
|
84
|
+
allowStitch: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether TikTok content disclosure should be enabled for this post.
|
|
87
|
+
*/
|
|
88
|
+
contentDisclosureEnabled: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Whether the post should be disclosed as "Your brand" content on TikTok.
|
|
91
|
+
*/
|
|
92
|
+
isYourBrand: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the post should be disclosed as branded content on TikTok.
|
|
95
|
+
*/
|
|
96
|
+
isBrandedContent: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether TikTok should automatically add music to this post.
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
*
|
|
102
|
+
* This field applies to `postType=PHOTO`.
|
|
103
|
+
*
|
|
104
|
+
* When `postType=VIDEO`, this field is required by the API contract
|
|
105
|
+
* but is not used by TikTok.
|
|
106
|
+
*/
|
|
107
|
+
autoAddMusic: boolean;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export const TikTokPost$inboundSchema: z.ZodMiniType<TikTokPost, unknown> = z
|
|
112
|
+
.object({
|
|
113
|
+
platform: types.literal("TIKTOK"),
|
|
114
|
+
socialAccountId: types.string(),
|
|
115
|
+
deliveryStatus: DeliveryStatus$inboundSchema,
|
|
116
|
+
contentOverride: types.optional(z.array(PostContentItem$inboundSchema)),
|
|
117
|
+
sentAt: types.optional(types.date()),
|
|
118
|
+
externalPostId: types.optional(types.string()),
|
|
119
|
+
externalPostUrl: types.optional(types.string()),
|
|
120
|
+
errorMessage: types.optional(types.string()),
|
|
121
|
+
postType: TikTokPostType$inboundSchema,
|
|
122
|
+
privacyLevel: TikTokPrivacyLevel$inboundSchema,
|
|
123
|
+
allowComment: types.boolean(),
|
|
124
|
+
allowDuet: types.boolean(),
|
|
125
|
+
allowStitch: types.boolean(),
|
|
126
|
+
contentDisclosureEnabled: types.boolean(),
|
|
127
|
+
isYourBrand: types.boolean(),
|
|
128
|
+
isBrandedContent: types.boolean(),
|
|
129
|
+
autoAddMusic: types.boolean(),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export function tikTokPostFromJSON(
|
|
133
|
+
jsonString: string,
|
|
134
|
+
): SafeParseResult<TikTokPost, SDKValidationError> {
|
|
135
|
+
return safeParse(
|
|
136
|
+
jsonString,
|
|
137
|
+
(x) => TikTokPost$inboundSchema.parse(JSON.parse(x)),
|
|
138
|
+
`Failed to parse 'TikTokPost' from JSON`,
|
|
139
|
+
);
|
|
140
|
+
}
|