@woopsocial/typescript-sdk 0.0.9 → 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 +1 -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
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
|
|
19
|
+
export type LinkedInPost = {
|
|
20
|
+
platform: "LINKEDIN";
|
|
21
|
+
/**
|
|
22
|
+
* Connected social account identifier.
|
|
23
|
+
*/
|
|
24
|
+
socialAccountId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Delivery lifecycle status for a post.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
*
|
|
30
|
+
* `NOT_STARTED`: The post exists and is scheduled, but delivery has not started yet.
|
|
31
|
+
* `SENDING`: Delivery is currently in progress.
|
|
32
|
+
* `SENT`: Delivery completed successfully.
|
|
33
|
+
* `FAILED`: Delivery completed unsuccessfully.
|
|
34
|
+
*/
|
|
35
|
+
deliveryStatus: DeliveryStatus;
|
|
36
|
+
/**
|
|
37
|
+
* Post content expressed as thread items.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
*
|
|
41
|
+
* The array exists for future thread support. Currently exactly one item
|
|
42
|
+
* is returned.
|
|
43
|
+
*/
|
|
44
|
+
contentOverride?: Array<PostContentItem> | undefined;
|
|
45
|
+
sentAt?: Date | undefined;
|
|
46
|
+
externalPostId?: string | undefined;
|
|
47
|
+
externalPostUrl?: string | undefined;
|
|
48
|
+
errorMessage?: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const LinkedInPost$inboundSchema: z.ZodMiniType<LinkedInPost, unknown> =
|
|
53
|
+
z.object({
|
|
54
|
+
platform: types.literal("LINKEDIN"),
|
|
55
|
+
socialAccountId: types.string(),
|
|
56
|
+
deliveryStatus: DeliveryStatus$inboundSchema,
|
|
57
|
+
contentOverride: types.optional(z.array(PostContentItem$inboundSchema)),
|
|
58
|
+
sentAt: types.optional(types.date()),
|
|
59
|
+
externalPostId: types.optional(types.string()),
|
|
60
|
+
externalPostUrl: types.optional(types.string()),
|
|
61
|
+
errorMessage: types.optional(types.string()),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export function linkedInPostFromJSON(
|
|
65
|
+
jsonString: string,
|
|
66
|
+
): SafeParseResult<LinkedInPost, SDKValidationError> {
|
|
67
|
+
return safeParse(
|
|
68
|
+
jsonString,
|
|
69
|
+
(x) => LinkedInPost$inboundSchema.parse(JSON.parse(x)),
|
|
70
|
+
`Failed to parse 'LinkedInPost' from JSON`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type MediaLibraryPostContentMediaInput = {
|
|
8
|
+
type: "MEDIA_LIBRARY";
|
|
9
|
+
/**
|
|
10
|
+
* Media identifier from the media library.
|
|
11
|
+
*/
|
|
12
|
+
mediaId: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type MediaLibraryPostContentMediaInput$Outbound = {
|
|
17
|
+
type: "MEDIA_LIBRARY";
|
|
18
|
+
mediaId: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const MediaLibraryPostContentMediaInput$outboundSchema: z.ZodMiniType<
|
|
23
|
+
MediaLibraryPostContentMediaInput$Outbound,
|
|
24
|
+
MediaLibraryPostContentMediaInput
|
|
25
|
+
> = z.object({
|
|
26
|
+
type: z.literal("MEDIA_LIBRARY"),
|
|
27
|
+
mediaId: z.string(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function mediaLibraryPostContentMediaInputToJSON(
|
|
31
|
+
mediaLibraryPostContentMediaInput: MediaLibraryPostContentMediaInput,
|
|
32
|
+
): string {
|
|
33
|
+
return JSON.stringify(
|
|
34
|
+
MediaLibraryPostContentMediaInput$outboundSchema.parse(
|
|
35
|
+
mediaLibraryPostContentMediaInput,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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 openEnums from "../types/enums.js";
|
|
8
|
+
import { OpenEnum } from "../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
|
+
import * as types from "../types/primitives.js";
|
|
11
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
12
|
+
|
|
13
|
+
export const MediaType = {
|
|
14
|
+
Image: "IMAGE",
|
|
15
|
+
Video: "VIDEO",
|
|
16
|
+
} as const;
|
|
17
|
+
export type MediaType = OpenEnum<typeof MediaType>;
|
|
18
|
+
|
|
19
|
+
export type MediaLibraryPostContentMedia = {
|
|
20
|
+
type: "MEDIA_LIBRARY";
|
|
21
|
+
/**
|
|
22
|
+
* Media identifier from the media library.
|
|
23
|
+
*/
|
|
24
|
+
mediaId: string;
|
|
25
|
+
mediaType: MediaType;
|
|
26
|
+
/**
|
|
27
|
+
* Canonical media URL.
|
|
28
|
+
*/
|
|
29
|
+
url: string;
|
|
30
|
+
/**
|
|
31
|
+
* Thumbnail or preview URL for the media item.
|
|
32
|
+
*/
|
|
33
|
+
thumbnailUrl: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const MediaType$inboundSchema: z.ZodMiniType<MediaType, unknown> =
|
|
38
|
+
openEnums.inboundSchema(MediaType);
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const MediaLibraryPostContentMedia$inboundSchema: z.ZodMiniType<
|
|
42
|
+
MediaLibraryPostContentMedia,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.object({
|
|
45
|
+
type: types.literal("MEDIA_LIBRARY"),
|
|
46
|
+
mediaId: types.string(),
|
|
47
|
+
mediaType: MediaType$inboundSchema,
|
|
48
|
+
url: types.string(),
|
|
49
|
+
thumbnailUrl: types.string(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export function mediaLibraryPostContentMediaFromJSON(
|
|
53
|
+
jsonString: string,
|
|
54
|
+
): SafeParseResult<MediaLibraryPostContentMedia, SDKValidationError> {
|
|
55
|
+
return safeParse(
|
|
56
|
+
jsonString,
|
|
57
|
+
(x) => MediaLibraryPostContentMedia$inboundSchema.parse(JSON.parse(x)),
|
|
58
|
+
`Failed to parse 'MediaLibraryPostContentMedia' from JSON`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type DeletePostRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* Post identifier.
|
|
10
|
+
*/
|
|
11
|
+
postId: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type DeletePostRequest$Outbound = {
|
|
16
|
+
postId: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const DeletePostRequest$outboundSchema: z.ZodMiniType<
|
|
21
|
+
DeletePostRequest$Outbound,
|
|
22
|
+
DeletePostRequest
|
|
23
|
+
> = z.object({
|
|
24
|
+
postId: z.string(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function deletePostRequestToJSON(
|
|
28
|
+
deletePostRequest: DeletePostRequest,
|
|
29
|
+
): string {
|
|
30
|
+
return JSON.stringify(
|
|
31
|
+
DeletePostRequest$outboundSchema.parse(deletePostRequest),
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
|
|
7
|
+
export type GetPostRequest = {
|
|
8
|
+
/**
|
|
9
|
+
* Post identifier.
|
|
10
|
+
*/
|
|
11
|
+
postId: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type GetPostRequest$Outbound = {
|
|
16
|
+
postId: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const GetPostRequest$outboundSchema: z.ZodMiniType<
|
|
21
|
+
GetPostRequest$Outbound,
|
|
22
|
+
GetPostRequest
|
|
23
|
+
> = z.object({
|
|
24
|
+
postId: z.string(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function getPostRequestToJSON(getPostRequest: GetPostRequest): string {
|
|
28
|
+
return JSON.stringify(GetPostRequest$outboundSchema.parse(getPostRequest));
|
|
29
|
+
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
export * from "./complete-upload-session.js";
|
|
6
6
|
export * from "./create-media.js";
|
|
7
|
+
export * from "./delete-post.js";
|
|
8
|
+
export * from "./get-post.js";
|
|
7
9
|
export * from "./get-social-account-platform-inputs.js";
|
|
8
10
|
export * from "./get-upload-session.js";
|
|
9
11
|
export * from "./list-social-accounts.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
|
|
12
|
+
export type PinterestInput = {
|
|
13
|
+
platform: "PINTEREST";
|
|
14
|
+
/**
|
|
15
|
+
* Connected social account identifier.
|
|
16
|
+
*/
|
|
17
|
+
socialAccountId: string;
|
|
18
|
+
/**
|
|
19
|
+
* Post content expressed as thread items.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
*
|
|
23
|
+
* The array exists for future thread support. Currently exactly one item
|
|
24
|
+
* is supported.
|
|
25
|
+
*/
|
|
26
|
+
contentOverride?: Array<PostContentItemInput> | undefined;
|
|
27
|
+
pinterestBoardId: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type PinterestInput$Outbound = {
|
|
32
|
+
platform: "PINTEREST";
|
|
33
|
+
socialAccountId: string;
|
|
34
|
+
contentOverride?: Array<PostContentItemInput$Outbound> | undefined;
|
|
35
|
+
pinterestBoardId: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const PinterestInput$outboundSchema: z.ZodMiniType<
|
|
40
|
+
PinterestInput$Outbound,
|
|
41
|
+
PinterestInput
|
|
42
|
+
> = z.object({
|
|
43
|
+
platform: z.literal("PINTEREST"),
|
|
44
|
+
socialAccountId: z.string(),
|
|
45
|
+
contentOverride: z.optional(z.array(PostContentItemInput$outboundSchema)),
|
|
46
|
+
pinterestBoardId: z.string(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export function pinterestInputToJSON(pinterestInput: PinterestInput): string {
|
|
50
|
+
return JSON.stringify(PinterestInput$outboundSchema.parse(pinterestInput));
|
|
51
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
|
|
19
|
+
export type PinterestPost = {
|
|
20
|
+
platform: "PINTEREST";
|
|
21
|
+
/**
|
|
22
|
+
* Connected social account identifier.
|
|
23
|
+
*/
|
|
24
|
+
socialAccountId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Delivery lifecycle status for a post.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
*
|
|
30
|
+
* `NOT_STARTED`: The post exists and is scheduled, but delivery has not started yet.
|
|
31
|
+
* `SENDING`: Delivery is currently in progress.
|
|
32
|
+
* `SENT`: Delivery completed successfully.
|
|
33
|
+
* `FAILED`: Delivery completed unsuccessfully.
|
|
34
|
+
*/
|
|
35
|
+
deliveryStatus: DeliveryStatus;
|
|
36
|
+
/**
|
|
37
|
+
* Post content expressed as thread items.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
*
|
|
41
|
+
* The array exists for future thread support. Currently exactly one item
|
|
42
|
+
* is returned.
|
|
43
|
+
*/
|
|
44
|
+
contentOverride?: Array<PostContentItem> | undefined;
|
|
45
|
+
sentAt?: Date | undefined;
|
|
46
|
+
externalPostId?: string | undefined;
|
|
47
|
+
externalPostUrl?: string | undefined;
|
|
48
|
+
errorMessage?: string | undefined;
|
|
49
|
+
pinterestBoardId: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const PinterestPost$inboundSchema: z.ZodMiniType<
|
|
54
|
+
PinterestPost,
|
|
55
|
+
unknown
|
|
56
|
+
> = z.object({
|
|
57
|
+
platform: types.literal("PINTEREST"),
|
|
58
|
+
socialAccountId: types.string(),
|
|
59
|
+
deliveryStatus: DeliveryStatus$inboundSchema,
|
|
60
|
+
contentOverride: types.optional(z.array(PostContentItem$inboundSchema)),
|
|
61
|
+
sentAt: types.optional(types.date()),
|
|
62
|
+
externalPostId: types.optional(types.string()),
|
|
63
|
+
externalPostUrl: types.optional(types.string()),
|
|
64
|
+
errorMessage: types.optional(types.string()),
|
|
65
|
+
pinterestBoardId: types.string(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export function pinterestPostFromJSON(
|
|
69
|
+
jsonString: string,
|
|
70
|
+
): SafeParseResult<PinterestPost, SDKValidationError> {
|
|
71
|
+
return safeParse(
|
|
72
|
+
jsonString,
|
|
73
|
+
(x) => PinterestPost$inboundSchema.parse(JSON.parse(x)),
|
|
74
|
+
`Failed to parse 'PinterestPost' from JSON`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -8,13 +8,21 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
8
8
|
import * as types from "../types/primitives.js";
|
|
9
9
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./pinterest-
|
|
11
|
+
PinterestBoardOption,
|
|
12
|
+
PinterestBoardOption$inboundSchema,
|
|
13
|
+
} from "./pinterest-board-option.js";
|
|
14
14
|
|
|
15
15
|
export type PinterestSocialAccountPlatformSpecificInputs = {
|
|
16
16
|
platform: "PINTEREST";
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Available Pinterest boards for this account.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*
|
|
22
|
+
* Each `id` value can be sent as `pinterestBoardId` when creating a
|
|
23
|
+
* post for a Pinterest social-account target.
|
|
24
|
+
*/
|
|
25
|
+
boards: Array<PinterestBoardOption>;
|
|
18
26
|
};
|
|
19
27
|
|
|
20
28
|
/** @internal */
|
|
@@ -22,7 +30,7 @@ export const PinterestSocialAccountPlatformSpecificInputs$inboundSchema:
|
|
|
22
30
|
z.ZodMiniType<PinterestSocialAccountPlatformSpecificInputs, unknown> = z
|
|
23
31
|
.object({
|
|
24
32
|
platform: types.literal("PINTEREST"),
|
|
25
|
-
|
|
33
|
+
boards: z.array(PinterestBoardOption$inboundSchema),
|
|
26
34
|
});
|
|
27
35
|
|
|
28
36
|
export function pinterestSocialAccountPlatformSpecificInputsFromJSON(
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
PostContentMediaInput,
|
|
8
|
+
PostContentMediaInput$Outbound,
|
|
9
|
+
PostContentMediaInput$outboundSchema,
|
|
10
|
+
} from "./post-content-media-input.js";
|
|
11
|
+
|
|
12
|
+
export type PostContentItemInput = {
|
|
13
|
+
/**
|
|
14
|
+
* Text content for this thread item.
|
|
15
|
+
*/
|
|
16
|
+
text?: string | undefined;
|
|
17
|
+
media?: Array<PostContentMediaInput> | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type PostContentItemInput$Outbound = {
|
|
22
|
+
text?: string | undefined;
|
|
23
|
+
media?: Array<PostContentMediaInput$Outbound> | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const PostContentItemInput$outboundSchema: z.ZodMiniType<
|
|
28
|
+
PostContentItemInput$Outbound,
|
|
29
|
+
PostContentItemInput
|
|
30
|
+
> = z.object({
|
|
31
|
+
text: z.optional(z.string()),
|
|
32
|
+
media: z.optional(z.array(PostContentMediaInput$outboundSchema)),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function postContentItemInputToJSON(
|
|
36
|
+
postContentItemInput: PostContentItemInput,
|
|
37
|
+
): string {
|
|
38
|
+
return JSON.stringify(
|
|
39
|
+
PostContentItemInput$outboundSchema.parse(postContentItemInput),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
import {
|
|
11
|
+
PostContentMedia,
|
|
12
|
+
PostContentMedia$inboundSchema,
|
|
13
|
+
} from "./post-content-media.js";
|
|
14
|
+
|
|
15
|
+
export type PostContentItem = {
|
|
16
|
+
/**
|
|
17
|
+
* Text content for this thread item.
|
|
18
|
+
*/
|
|
19
|
+
text?: string | undefined;
|
|
20
|
+
media?: Array<PostContentMedia> | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const PostContentItem$inboundSchema: z.ZodMiniType<
|
|
25
|
+
PostContentItem,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
text: types.optional(types.string()),
|
|
29
|
+
media: types.optional(z.array(PostContentMedia$inboundSchema)),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function postContentItemFromJSON(
|
|
33
|
+
jsonString: string,
|
|
34
|
+
): SafeParseResult<PostContentItem, SDKValidationError> {
|
|
35
|
+
return safeParse(
|
|
36
|
+
jsonString,
|
|
37
|
+
(x) => PostContentItem$inboundSchema.parse(JSON.parse(x)),
|
|
38
|
+
`Failed to parse 'PostContentItem' from JSON`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
MediaLibraryPostContentMediaInput,
|
|
8
|
+
MediaLibraryPostContentMediaInput$Outbound,
|
|
9
|
+
MediaLibraryPostContentMediaInput$outboundSchema,
|
|
10
|
+
} from "./media-library-post-content-media-input.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Content media reference.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
*/
|
|
17
|
+
export type PostContentMediaInput = MediaLibraryPostContentMediaInput;
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export type PostContentMediaInput$Outbound =
|
|
21
|
+
MediaLibraryPostContentMediaInput$Outbound;
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const PostContentMediaInput$outboundSchema: z.ZodMiniType<
|
|
25
|
+
PostContentMediaInput$Outbound,
|
|
26
|
+
PostContentMediaInput
|
|
27
|
+
> = MediaLibraryPostContentMediaInput$outboundSchema;
|
|
28
|
+
|
|
29
|
+
export function postContentMediaInputToJSON(
|
|
30
|
+
postContentMediaInput: PostContentMediaInput,
|
|
31
|
+
): string {
|
|
32
|
+
return JSON.stringify(
|
|
33
|
+
PostContentMediaInput$outboundSchema.parse(postContentMediaInput),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
9
|
+
import {
|
|
10
|
+
MediaLibraryPostContentMedia,
|
|
11
|
+
MediaLibraryPostContentMedia$inboundSchema,
|
|
12
|
+
} from "./media-library-post-content-media.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Resolved content media.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
*/
|
|
19
|
+
export type PostContentMedia = MediaLibraryPostContentMedia;
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const PostContentMedia$inboundSchema: z.ZodMiniType<
|
|
23
|
+
PostContentMedia,
|
|
24
|
+
unknown
|
|
25
|
+
> = MediaLibraryPostContentMedia$inboundSchema;
|
|
26
|
+
|
|
27
|
+
export function postContentMediaFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<PostContentMedia, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => PostContentMedia$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'PostContentMedia' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 {
|
|
11
|
+
DraftPostSchedule,
|
|
12
|
+
DraftPostSchedule$inboundSchema,
|
|
13
|
+
DraftPostSchedule$Outbound,
|
|
14
|
+
DraftPostSchedule$outboundSchema,
|
|
15
|
+
} from "./draft-post-schedule.js";
|
|
16
|
+
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
17
|
+
import {
|
|
18
|
+
PublishNowPostSchedule,
|
|
19
|
+
PublishNowPostSchedule$inboundSchema,
|
|
20
|
+
PublishNowPostSchedule$Outbound,
|
|
21
|
+
PublishNowPostSchedule$outboundSchema,
|
|
22
|
+
} from "./publish-now-post-schedule.js";
|
|
23
|
+
import {
|
|
24
|
+
ScheduleForLaterPostSchedule,
|
|
25
|
+
ScheduleForLaterPostSchedule$inboundSchema,
|
|
26
|
+
ScheduleForLaterPostSchedule$Outbound,
|
|
27
|
+
ScheduleForLaterPostSchedule$outboundSchema,
|
|
28
|
+
} from "./schedule-for-later-post-schedule.js";
|
|
29
|
+
|
|
30
|
+
export type PostSchedule =
|
|
31
|
+
| DraftPostSchedule
|
|
32
|
+
| PublishNowPostSchedule
|
|
33
|
+
| ScheduleForLaterPostSchedule
|
|
34
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const PostSchedule$inboundSchema: z.ZodMiniType<PostSchedule, unknown> =
|
|
38
|
+
discriminatedUnion("type", {
|
|
39
|
+
DRAFT: DraftPostSchedule$inboundSchema,
|
|
40
|
+
PUBLISH_NOW: PublishNowPostSchedule$inboundSchema,
|
|
41
|
+
SCHEDULE_FOR_LATER: ScheduleForLaterPostSchedule$inboundSchema,
|
|
42
|
+
});
|
|
43
|
+
/** @internal */
|
|
44
|
+
export type PostSchedule$Outbound =
|
|
45
|
+
| DraftPostSchedule$Outbound
|
|
46
|
+
| PublishNowPostSchedule$Outbound
|
|
47
|
+
| ScheduleForLaterPostSchedule$Outbound;
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const PostSchedule$outboundSchema: z.ZodMiniType<
|
|
51
|
+
PostSchedule$Outbound,
|
|
52
|
+
PostSchedule
|
|
53
|
+
> = z.union([
|
|
54
|
+
DraftPostSchedule$outboundSchema,
|
|
55
|
+
PublishNowPostSchedule$outboundSchema,
|
|
56
|
+
ScheduleForLaterPostSchedule$outboundSchema,
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
export function postScheduleToJSON(postSchedule: PostSchedule): string {
|
|
60
|
+
return JSON.stringify(PostSchedule$outboundSchema.parse(postSchedule));
|
|
61
|
+
}
|
|
62
|
+
export function postScheduleFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<PostSchedule, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => PostSchedule$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'PostSchedule' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|