@postrun/js 2.10.0 → 2.12.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.cjs CHANGED
@@ -1,6 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var z = require('zod');
4
+ var axios = require('axios');
5
+ var pRetry = require('p-retry');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
4
8
 
5
9
  function _interopNamespace(e) {
6
10
  if (e && e.__esModule) return e;
@@ -21,6 +25,8 @@ function _interopNamespace(e) {
21
25
  }
22
26
 
23
27
  var z__namespace = /*#__PURE__*/_interopNamespace(z);
28
+ var axios__default = /*#__PURE__*/_interopDefault(axios);
29
+ var pRetry__default = /*#__PURE__*/_interopDefault(pRetry);
24
30
 
25
31
  // src/client/core/bodySerializer.gen.ts
26
32
  var jsonBodySerializer = {
@@ -1955,52 +1961,298 @@ z__namespace.object({
1955
1961
  z__namespace.number(),
1956
1962
  z__namespace.boolean()
1957
1963
  ])),
1958
- variants: z__namespace.array(z__namespace.object({
1959
- id: z__namespace.string(),
1960
- object: z__namespace.literal("post_variant"),
1961
- connection_id: z__namespace.string().nullable(),
1962
- platform: z__namespace.enum([
1963
- "x",
1964
- "linkedin",
1965
- "facebook_page",
1966
- "instagram",
1967
- "tiktok"
1968
- ]),
1969
- post_type: z__namespace.enum([
1970
- "text",
1971
- "single_image",
1972
- "multi_image",
1973
- "video",
1974
- "reel",
1975
- "carousel"
1976
- ]),
1977
- body: z__namespace.string().nullable(),
1978
- status: z__namespace.enum([
1979
- "draft",
1980
- "scheduled",
1981
- "publishing",
1982
- "published",
1983
- "failed"
1984
- ]),
1985
- settings: z__namespace.record(z__namespace.string(), z__namespace.unknown()),
1986
- schedule_at: z__namespace.string().nullable(),
1987
- result: z__namespace.object({
1988
- platform_post_id: z__namespace.string(),
1989
- permalink: z__namespace.string().nullable(),
1990
- published_at: z__namespace.string()
1991
- }).nullable(),
1992
- error: z__namespace.object({
1993
- code: z__namespace.string(),
1994
- message: z__namespace.string(),
1995
- display_error: z__namespace.string()
1996
- }).nullable(),
1997
- media: z__namespace.array(z__namespace.object({
1998
- media_id: z__namespace.string(),
1999
- position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2000
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2001
- alt_text_override: z__namespace.string().nullable()
2002
- }))
2003
- })),
1964
+ variants: z__namespace.array(z__namespace.union([
1965
+ z__namespace.object({
1966
+ platform: z__namespace.literal("x"),
1967
+ post_type: z__namespace.enum([
1968
+ "text",
1969
+ "single_image",
1970
+ "multi_image",
1971
+ "video"
1972
+ ]),
1973
+ settings: z__namespace.object({
1974
+ reply_settings: z__namespace.enum([
1975
+ "everyone",
1976
+ "following",
1977
+ "mentionedUsers",
1978
+ "subscribers",
1979
+ "verified"
1980
+ ]).optional(),
1981
+ quote_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
1982
+ poll: z__namespace.object({
1983
+ options: z__namespace.array(z__namespace.string().min(1).max(25)).min(2).max(4),
1984
+ duration_minutes: z__namespace.int().gte(5).lte(10080),
1985
+ reply_settings: z__namespace.enum([
1986
+ "following",
1987
+ "mentionedUsers",
1988
+ "subscribers",
1989
+ "verified"
1990
+ ]).optional()
1991
+ }).optional(),
1992
+ reply: z__namespace.object({
1993
+ in_reply_to_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/),
1994
+ exclude_reply_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).optional(),
1995
+ auto_populate_reply_metadata: z__namespace.boolean().optional()
1996
+ }).optional(),
1997
+ community_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
1998
+ for_super_followers_only: z__namespace.boolean().optional(),
1999
+ geo: z__namespace.object({
2000
+ place_id: z__namespace.string()
2001
+ }).optional(),
2002
+ card_uri: z__namespace.string().optional(),
2003
+ media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
2004
+ }),
2005
+ id: z__namespace.string(),
2006
+ object: z__namespace.literal("post_variant"),
2007
+ connection_id: z__namespace.string().nullable(),
2008
+ body: z__namespace.string().nullable(),
2009
+ status: z__namespace.enum([
2010
+ "draft",
2011
+ "scheduled",
2012
+ "publishing",
2013
+ "published",
2014
+ "failed"
2015
+ ]),
2016
+ schedule_at: z__namespace.string().nullable(),
2017
+ result: z__namespace.object({
2018
+ platform_post_id: z__namespace.string(),
2019
+ permalink: z__namespace.string().nullable(),
2020
+ published_at: z__namespace.string()
2021
+ }).nullable(),
2022
+ error: z__namespace.object({
2023
+ code: z__namespace.string(),
2024
+ message: z__namespace.string(),
2025
+ display_error: z__namespace.string()
2026
+ }).nullable(),
2027
+ media: z__namespace.array(z__namespace.object({
2028
+ media_id: z__namespace.string(),
2029
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2030
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2031
+ alt_text_override: z__namespace.string().nullable()
2032
+ }))
2033
+ }),
2034
+ z__namespace.object({
2035
+ platform: z__namespace.literal("linkedin"),
2036
+ post_type: z__namespace.enum([
2037
+ "text",
2038
+ "single_image",
2039
+ "multi_image",
2040
+ "video"
2041
+ ]),
2042
+ settings: z__namespace.object({
2043
+ visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
2044
+ content_kind: z__namespace.enum([
2045
+ "text",
2046
+ "single_image",
2047
+ "video",
2048
+ "multi_image",
2049
+ "document",
2050
+ "article",
2051
+ "poll"
2052
+ ]),
2053
+ article: z__namespace.object({
2054
+ source: z__namespace.url(),
2055
+ title: z__namespace.string().max(400).optional(),
2056
+ description: z__namespace.string().max(4086).optional(),
2057
+ thumbnail_media_id: z__namespace.string().optional()
2058
+ }).optional(),
2059
+ poll: z__namespace.object({
2060
+ question: z__namespace.string().min(1).max(140),
2061
+ options: z__namespace.array(z__namespace.string().min(1).max(30)).min(2).max(4),
2062
+ duration: z__namespace.enum([
2063
+ "ONE_DAY",
2064
+ "THREE_DAYS",
2065
+ "SEVEN_DAYS",
2066
+ "FOURTEEN_DAYS"
2067
+ ])
2068
+ }).optional(),
2069
+ document: z__namespace.object({
2070
+ title: z__namespace.string().min(1).max(400)
2071
+ }).optional(),
2072
+ disable_reshare: z__namespace.boolean().optional(),
2073
+ mentions: z__namespace.array(z__namespace.object({
2074
+ type: z__namespace.enum(["person", "organization"]),
2075
+ name: z__namespace.string().min(1),
2076
+ urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
2077
+ })).optional()
2078
+ }),
2079
+ id: z__namespace.string(),
2080
+ object: z__namespace.literal("post_variant"),
2081
+ connection_id: z__namespace.string().nullable(),
2082
+ body: z__namespace.string().nullable(),
2083
+ status: z__namespace.enum([
2084
+ "draft",
2085
+ "scheduled",
2086
+ "publishing",
2087
+ "published",
2088
+ "failed"
2089
+ ]),
2090
+ schedule_at: z__namespace.string().nullable(),
2091
+ result: z__namespace.object({
2092
+ platform_post_id: z__namespace.string(),
2093
+ permalink: z__namespace.string().nullable(),
2094
+ published_at: z__namespace.string()
2095
+ }).nullable(),
2096
+ error: z__namespace.object({
2097
+ code: z__namespace.string(),
2098
+ message: z__namespace.string(),
2099
+ display_error: z__namespace.string()
2100
+ }).nullable(),
2101
+ media: z__namespace.array(z__namespace.object({
2102
+ media_id: z__namespace.string(),
2103
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2104
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2105
+ alt_text_override: z__namespace.string().nullable()
2106
+ }))
2107
+ }),
2108
+ z__namespace.object({
2109
+ platform: z__namespace.literal("facebook_page"),
2110
+ post_type: z__namespace.enum([
2111
+ "text",
2112
+ "single_image",
2113
+ "multi_image",
2114
+ "reel"
2115
+ ]),
2116
+ settings: z__namespace.object({
2117
+ link: z__namespace.url().optional()
2118
+ }),
2119
+ id: z__namespace.string(),
2120
+ object: z__namespace.literal("post_variant"),
2121
+ connection_id: z__namespace.string().nullable(),
2122
+ body: z__namespace.string().nullable(),
2123
+ status: z__namespace.enum([
2124
+ "draft",
2125
+ "scheduled",
2126
+ "publishing",
2127
+ "published",
2128
+ "failed"
2129
+ ]),
2130
+ schedule_at: z__namespace.string().nullable(),
2131
+ result: z__namespace.object({
2132
+ platform_post_id: z__namespace.string(),
2133
+ permalink: z__namespace.string().nullable(),
2134
+ published_at: z__namespace.string()
2135
+ }).nullable(),
2136
+ error: z__namespace.object({
2137
+ code: z__namespace.string(),
2138
+ message: z__namespace.string(),
2139
+ display_error: z__namespace.string()
2140
+ }).nullable(),
2141
+ media: z__namespace.array(z__namespace.object({
2142
+ media_id: z__namespace.string(),
2143
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2144
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2145
+ alt_text_override: z__namespace.string().nullable()
2146
+ }))
2147
+ }),
2148
+ z__namespace.object({
2149
+ platform: z__namespace.literal("instagram"),
2150
+ post_type: z__namespace.enum([
2151
+ "single_image",
2152
+ "carousel",
2153
+ "reel"
2154
+ ]),
2155
+ settings: z__namespace.object({
2156
+ media_type: z__namespace.enum([
2157
+ "IMAGE",
2158
+ "CAROUSEL",
2159
+ "REELS"
2160
+ ]).optional(),
2161
+ location_id: z__namespace.string().optional(),
2162
+ user_tags: z__namespace.array(z__namespace.object({
2163
+ username: z__namespace.string().min(1),
2164
+ x: z__namespace.number().gte(0).lte(1),
2165
+ y: z__namespace.number().gte(0).lte(1)
2166
+ })).optional(),
2167
+ collaborators: z__namespace.array(z__namespace.string().min(1)).max(3).optional(),
2168
+ share_to_feed: z__namespace.boolean().optional(),
2169
+ thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2170
+ cover_url: z__namespace.url().optional(),
2171
+ audio_name: z__namespace.string().optional()
2172
+ }),
2173
+ id: z__namespace.string(),
2174
+ object: z__namespace.literal("post_variant"),
2175
+ connection_id: z__namespace.string().nullable(),
2176
+ body: z__namespace.string().nullable(),
2177
+ status: z__namespace.enum([
2178
+ "draft",
2179
+ "scheduled",
2180
+ "publishing",
2181
+ "published",
2182
+ "failed"
2183
+ ]),
2184
+ schedule_at: z__namespace.string().nullable(),
2185
+ result: z__namespace.object({
2186
+ platform_post_id: z__namespace.string(),
2187
+ permalink: z__namespace.string().nullable(),
2188
+ published_at: z__namespace.string()
2189
+ }).nullable(),
2190
+ error: z__namespace.object({
2191
+ code: z__namespace.string(),
2192
+ message: z__namespace.string(),
2193
+ display_error: z__namespace.string()
2194
+ }).nullable(),
2195
+ media: z__namespace.array(z__namespace.object({
2196
+ media_id: z__namespace.string(),
2197
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2198
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2199
+ alt_text_override: z__namespace.string().nullable()
2200
+ }))
2201
+ }),
2202
+ z__namespace.object({
2203
+ platform: z__namespace.literal("tiktok"),
2204
+ post_type: z__namespace.enum([
2205
+ "video",
2206
+ "single_image",
2207
+ "carousel"
2208
+ ]),
2209
+ settings: z__namespace.object({
2210
+ privacy_level: z__namespace.enum([
2211
+ "PUBLIC_TO_EVERYONE",
2212
+ "MUTUAL_FOLLOW_FRIENDS",
2213
+ "FOLLOWER_OF_CREATOR",
2214
+ "SELF_ONLY"
2215
+ ]).optional(),
2216
+ disable_comment: z__namespace.boolean().optional(),
2217
+ disable_duet: z__namespace.boolean().optional(),
2218
+ disable_stitch: z__namespace.boolean().optional(),
2219
+ video_cover_timestamp_ms: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2220
+ photo_cover_index: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2221
+ auto_add_music: z__namespace.boolean().optional(),
2222
+ brand_content_toggle: z__namespace.boolean().optional(),
2223
+ brand_organic_toggle: z__namespace.boolean().optional(),
2224
+ is_aigc: z__namespace.boolean().optional()
2225
+ }),
2226
+ id: z__namespace.string(),
2227
+ object: z__namespace.literal("post_variant"),
2228
+ connection_id: z__namespace.string().nullable(),
2229
+ body: z__namespace.string().nullable(),
2230
+ status: z__namespace.enum([
2231
+ "draft",
2232
+ "scheduled",
2233
+ "publishing",
2234
+ "published",
2235
+ "failed"
2236
+ ]),
2237
+ schedule_at: z__namespace.string().nullable(),
2238
+ result: z__namespace.object({
2239
+ platform_post_id: z__namespace.string(),
2240
+ permalink: z__namespace.string().nullable(),
2241
+ published_at: z__namespace.string()
2242
+ }).nullable(),
2243
+ error: z__namespace.object({
2244
+ code: z__namespace.string(),
2245
+ message: z__namespace.string(),
2246
+ display_error: z__namespace.string()
2247
+ }).nullable(),
2248
+ media: z__namespace.array(z__namespace.object({
2249
+ media_id: z__namespace.string(),
2250
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2251
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2252
+ alt_text_override: z__namespace.string().nullable()
2253
+ }))
2254
+ })
2255
+ ])),
2004
2256
  created_at: z__namespace.string(),
2005
2257
  updated_at: z__namespace.string()
2006
2258
  })),
@@ -2035,13 +2287,6 @@ z__namespace.object({
2035
2287
  "multi_image",
2036
2288
  "video"
2037
2289
  ]),
2038
- connection_id: z__namespace.string(),
2039
- body: z__namespace.string().optional(),
2040
- media: z__namespace.array(z__namespace.object({
2041
- media_id: z__namespace.string(),
2042
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2043
- alt_text_override: z__namespace.string().nullish()
2044
- })).optional().default([]),
2045
2290
  settings: z__namespace.object({
2046
2291
  reply_settings: z__namespace.enum([
2047
2292
  "everyone",
@@ -2073,7 +2318,14 @@ z__namespace.object({
2073
2318
  }).optional(),
2074
2319
  card_uri: z__namespace.string().optional(),
2075
2320
  media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
2076
- }).optional().default({})
2321
+ }).optional().default({}),
2322
+ connection_id: z__namespace.string(),
2323
+ body: z__namespace.string().optional(),
2324
+ media: z__namespace.array(z__namespace.object({
2325
+ media_id: z__namespace.string(),
2326
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2327
+ alt_text_override: z__namespace.string().nullish()
2328
+ })).optional().default([])
2077
2329
  }),
2078
2330
  z__namespace.object({
2079
2331
  platform: z__namespace.literal("linkedin"),
@@ -2083,13 +2335,6 @@ z__namespace.object({
2083
2335
  "multi_image",
2084
2336
  "video"
2085
2337
  ]),
2086
- connection_id: z__namespace.string(),
2087
- body: z__namespace.string().optional(),
2088
- media: z__namespace.array(z__namespace.object({
2089
- media_id: z__namespace.string(),
2090
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2091
- alt_text_override: z__namespace.string().nullish()
2092
- })).optional().default([]),
2093
2338
  settings: z__namespace.object({
2094
2339
  visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
2095
2340
  content_kind: z__namespace.enum([
@@ -2126,7 +2371,14 @@ z__namespace.object({
2126
2371
  name: z__namespace.string().min(1),
2127
2372
  urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
2128
2373
  })).optional()
2129
- })
2374
+ }),
2375
+ connection_id: z__namespace.string(),
2376
+ body: z__namespace.string().optional(),
2377
+ media: z__namespace.array(z__namespace.object({
2378
+ media_id: z__namespace.string(),
2379
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2380
+ alt_text_override: z__namespace.string().nullish()
2381
+ })).optional().default([])
2130
2382
  }),
2131
2383
  z__namespace.object({
2132
2384
  platform: z__namespace.literal("instagram"),
@@ -2135,13 +2387,6 @@ z__namespace.object({
2135
2387
  "carousel",
2136
2388
  "reel"
2137
2389
  ]),
2138
- connection_id: z__namespace.string(),
2139
- body: z__namespace.string().optional(),
2140
- media: z__namespace.array(z__namespace.object({
2141
- media_id: z__namespace.string(),
2142
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2143
- alt_text_override: z__namespace.string().nullish()
2144
- })).optional().default([]),
2145
2390
  settings: z__namespace.object({
2146
2391
  media_type: z__namespace.enum([
2147
2392
  "IMAGE",
@@ -2159,7 +2404,14 @@ z__namespace.object({
2159
2404
  thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2160
2405
  cover_url: z__namespace.url().optional(),
2161
2406
  audio_name: z__namespace.string().optional()
2162
- })
2407
+ }),
2408
+ connection_id: z__namespace.string(),
2409
+ body: z__namespace.string().optional(),
2410
+ media: z__namespace.array(z__namespace.object({
2411
+ media_id: z__namespace.string(),
2412
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2413
+ alt_text_override: z__namespace.string().nullish()
2414
+ })).optional().default([])
2163
2415
  }),
2164
2416
  z__namespace.object({
2165
2417
  platform: z__namespace.literal("facebook_page"),
@@ -2169,16 +2421,16 @@ z__namespace.object({
2169
2421
  "multi_image",
2170
2422
  "reel"
2171
2423
  ]),
2424
+ settings: z__namespace.object({
2425
+ link: z__namespace.url().optional()
2426
+ }).optional().default({}),
2172
2427
  connection_id: z__namespace.string(),
2173
2428
  body: z__namespace.string().optional(),
2174
2429
  media: z__namespace.array(z__namespace.object({
2175
2430
  media_id: z__namespace.string(),
2176
2431
  crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2177
2432
  alt_text_override: z__namespace.string().nullish()
2178
- })).optional().default([]),
2179
- settings: z__namespace.object({
2180
- link: z__namespace.url().optional()
2181
- }).optional().default({})
2433
+ })).optional().default([])
2182
2434
  }),
2183
2435
  z__namespace.object({
2184
2436
  platform: z__namespace.literal("tiktok"),
@@ -2187,13 +2439,6 @@ z__namespace.object({
2187
2439
  "single_image",
2188
2440
  "carousel"
2189
2441
  ]),
2190
- connection_id: z__namespace.string(),
2191
- body: z__namespace.string().optional(),
2192
- media: z__namespace.array(z__namespace.object({
2193
- media_id: z__namespace.string(),
2194
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2195
- alt_text_override: z__namespace.string().nullish()
2196
- })).optional().default([]),
2197
2442
  settings: z__namespace.object({
2198
2443
  privacy_level: z__namespace.enum([
2199
2444
  "PUBLIC_TO_EVERYONE",
@@ -2210,7 +2455,14 @@ z__namespace.object({
2210
2455
  brand_content_toggle: z__namespace.boolean().optional(),
2211
2456
  brand_organic_toggle: z__namespace.boolean().optional(),
2212
2457
  is_aigc: z__namespace.boolean().optional()
2213
- }).optional().default({})
2458
+ }).optional().default({}),
2459
+ connection_id: z__namespace.string(),
2460
+ body: z__namespace.string().optional(),
2461
+ media: z__namespace.array(z__namespace.object({
2462
+ media_id: z__namespace.string(),
2463
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2464
+ alt_text_override: z__namespace.string().nullish()
2465
+ })).optional().default([])
2214
2466
  })
2215
2467
  ])).min(1)
2216
2468
  });
@@ -2235,154 +2487,858 @@ z__namespace.object({
2235
2487
  z__namespace.number(),
2236
2488
  z__namespace.boolean()
2237
2489
  ])),
2238
- variants: z__namespace.array(z__namespace.object({
2239
- id: z__namespace.string(),
2240
- object: z__namespace.literal("post_variant"),
2241
- connection_id: z__namespace.string().nullable(),
2242
- platform: z__namespace.enum([
2243
- "x",
2244
- "linkedin",
2245
- "facebook_page",
2246
- "instagram",
2247
- "tiktok"
2248
- ]),
2249
- post_type: z__namespace.enum([
2250
- "text",
2251
- "single_image",
2252
- "multi_image",
2253
- "video",
2254
- "reel",
2255
- "carousel"
2256
- ]),
2257
- body: z__namespace.string().nullable(),
2258
- status: z__namespace.enum([
2259
- "draft",
2260
- "scheduled",
2261
- "publishing",
2262
- "published",
2263
- "failed"
2264
- ]),
2265
- settings: z__namespace.record(z__namespace.string(), z__namespace.unknown()),
2266
- schedule_at: z__namespace.string().nullable(),
2267
- result: z__namespace.object({
2268
- platform_post_id: z__namespace.string(),
2269
- permalink: z__namespace.string().nullable(),
2270
- published_at: z__namespace.string()
2271
- }).nullable(),
2272
- error: z__namespace.object({
2273
- code: z__namespace.string(),
2274
- message: z__namespace.string(),
2275
- display_error: z__namespace.string()
2276
- }).nullable(),
2277
- media: z__namespace.array(z__namespace.object({
2278
- media_id: z__namespace.string(),
2279
- position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2280
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2281
- alt_text_override: z__namespace.string().nullable()
2282
- }))
2283
- })),
2284
- created_at: z__namespace.string(),
2285
- updated_at: z__namespace.string(),
2286
- dry_run: z__namespace.boolean(),
2287
- executed: z__namespace.boolean()
2288
- });
2289
- z__namespace.object({
2290
- id: z__namespace.string()
2291
- });
2292
- z__namespace.object({
2293
- id: z__namespace.string(),
2294
- object: z__namespace.literal("post"),
2295
- deleted: z__namespace.literal(true)
2296
- });
2297
- z__namespace.object({
2298
- id: z__namespace.string()
2299
- });
2300
- z__namespace.object({
2301
- id: z__namespace.string(),
2302
- object: z__namespace.literal("post"),
2303
- profile_id: z__namespace.string(),
2304
- external_id: z__namespace.string().nullable(),
2305
- status: z__namespace.enum([
2306
- "draft",
2307
- "scheduled",
2308
- "publishing",
2309
- "partially_published",
2310
- "published",
2311
- "failed"
2312
- ]),
2313
- schedule_at: z__namespace.string().nullable(),
2314
- tags: z__namespace.array(z__namespace.string()),
2315
- notes: z__namespace.string().nullable(),
2316
- metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
2317
- z__namespace.string().max(500),
2318
- z__namespace.number(),
2319
- z__namespace.boolean()
2320
- ])),
2321
- variants: z__namespace.array(z__namespace.object({
2322
- id: z__namespace.string(),
2323
- object: z__namespace.literal("post_variant"),
2324
- connection_id: z__namespace.string().nullable(),
2325
- platform: z__namespace.enum([
2326
- "x",
2327
- "linkedin",
2328
- "facebook_page",
2329
- "instagram",
2330
- "tiktok"
2331
- ]),
2332
- post_type: z__namespace.enum([
2333
- "text",
2334
- "single_image",
2335
- "multi_image",
2336
- "video",
2337
- "reel",
2338
- "carousel"
2339
- ]),
2340
- body: z__namespace.string().nullable(),
2341
- status: z__namespace.enum([
2342
- "draft",
2343
- "scheduled",
2344
- "publishing",
2345
- "published",
2346
- "failed"
2347
- ]),
2348
- settings: z__namespace.record(z__namespace.string(), z__namespace.unknown()),
2349
- schedule_at: z__namespace.string().nullable(),
2350
- result: z__namespace.object({
2351
- platform_post_id: z__namespace.string(),
2352
- permalink: z__namespace.string().nullable(),
2353
- published_at: z__namespace.string()
2354
- }).nullable(),
2355
- error: z__namespace.object({
2356
- code: z__namespace.string(),
2357
- message: z__namespace.string(),
2358
- display_error: z__namespace.string()
2359
- }).nullable(),
2360
- media: z__namespace.array(z__namespace.object({
2361
- media_id: z__namespace.string(),
2362
- position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2363
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2364
- alt_text_override: z__namespace.string().nullable()
2365
- }))
2366
- })),
2490
+ variants: z__namespace.array(z__namespace.union([
2491
+ z__namespace.object({
2492
+ platform: z__namespace.literal("x"),
2493
+ post_type: z__namespace.enum([
2494
+ "text",
2495
+ "single_image",
2496
+ "multi_image",
2497
+ "video"
2498
+ ]),
2499
+ settings: z__namespace.object({
2500
+ reply_settings: z__namespace.enum([
2501
+ "everyone",
2502
+ "following",
2503
+ "mentionedUsers",
2504
+ "subscribers",
2505
+ "verified"
2506
+ ]).optional(),
2507
+ quote_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
2508
+ poll: z__namespace.object({
2509
+ options: z__namespace.array(z__namespace.string().min(1).max(25)).min(2).max(4),
2510
+ duration_minutes: z__namespace.int().gte(5).lte(10080),
2511
+ reply_settings: z__namespace.enum([
2512
+ "following",
2513
+ "mentionedUsers",
2514
+ "subscribers",
2515
+ "verified"
2516
+ ]).optional()
2517
+ }).optional(),
2518
+ reply: z__namespace.object({
2519
+ in_reply_to_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/),
2520
+ exclude_reply_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).optional(),
2521
+ auto_populate_reply_metadata: z__namespace.boolean().optional()
2522
+ }).optional(),
2523
+ community_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
2524
+ for_super_followers_only: z__namespace.boolean().optional(),
2525
+ geo: z__namespace.object({
2526
+ place_id: z__namespace.string()
2527
+ }).optional(),
2528
+ card_uri: z__namespace.string().optional(),
2529
+ media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
2530
+ }),
2531
+ id: z__namespace.string(),
2532
+ object: z__namespace.literal("post_variant"),
2533
+ connection_id: z__namespace.string().nullable(),
2534
+ body: z__namespace.string().nullable(),
2535
+ status: z__namespace.enum([
2536
+ "draft",
2537
+ "scheduled",
2538
+ "publishing",
2539
+ "published",
2540
+ "failed"
2541
+ ]),
2542
+ schedule_at: z__namespace.string().nullable(),
2543
+ result: z__namespace.object({
2544
+ platform_post_id: z__namespace.string(),
2545
+ permalink: z__namespace.string().nullable(),
2546
+ published_at: z__namespace.string()
2547
+ }).nullable(),
2548
+ error: z__namespace.object({
2549
+ code: z__namespace.string(),
2550
+ message: z__namespace.string(),
2551
+ display_error: z__namespace.string()
2552
+ }).nullable(),
2553
+ media: z__namespace.array(z__namespace.object({
2554
+ media_id: z__namespace.string(),
2555
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2556
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2557
+ alt_text_override: z__namespace.string().nullable()
2558
+ }))
2559
+ }),
2560
+ z__namespace.object({
2561
+ platform: z__namespace.literal("linkedin"),
2562
+ post_type: z__namespace.enum([
2563
+ "text",
2564
+ "single_image",
2565
+ "multi_image",
2566
+ "video"
2567
+ ]),
2568
+ settings: z__namespace.object({
2569
+ visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
2570
+ content_kind: z__namespace.enum([
2571
+ "text",
2572
+ "single_image",
2573
+ "video",
2574
+ "multi_image",
2575
+ "document",
2576
+ "article",
2577
+ "poll"
2578
+ ]),
2579
+ article: z__namespace.object({
2580
+ source: z__namespace.url(),
2581
+ title: z__namespace.string().max(400).optional(),
2582
+ description: z__namespace.string().max(4086).optional(),
2583
+ thumbnail_media_id: z__namespace.string().optional()
2584
+ }).optional(),
2585
+ poll: z__namespace.object({
2586
+ question: z__namespace.string().min(1).max(140),
2587
+ options: z__namespace.array(z__namespace.string().min(1).max(30)).min(2).max(4),
2588
+ duration: z__namespace.enum([
2589
+ "ONE_DAY",
2590
+ "THREE_DAYS",
2591
+ "SEVEN_DAYS",
2592
+ "FOURTEEN_DAYS"
2593
+ ])
2594
+ }).optional(),
2595
+ document: z__namespace.object({
2596
+ title: z__namespace.string().min(1).max(400)
2597
+ }).optional(),
2598
+ disable_reshare: z__namespace.boolean().optional(),
2599
+ mentions: z__namespace.array(z__namespace.object({
2600
+ type: z__namespace.enum(["person", "organization"]),
2601
+ name: z__namespace.string().min(1),
2602
+ urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
2603
+ })).optional()
2604
+ }),
2605
+ id: z__namespace.string(),
2606
+ object: z__namespace.literal("post_variant"),
2607
+ connection_id: z__namespace.string().nullable(),
2608
+ body: z__namespace.string().nullable(),
2609
+ status: z__namespace.enum([
2610
+ "draft",
2611
+ "scheduled",
2612
+ "publishing",
2613
+ "published",
2614
+ "failed"
2615
+ ]),
2616
+ schedule_at: z__namespace.string().nullable(),
2617
+ result: z__namespace.object({
2618
+ platform_post_id: z__namespace.string(),
2619
+ permalink: z__namespace.string().nullable(),
2620
+ published_at: z__namespace.string()
2621
+ }).nullable(),
2622
+ error: z__namespace.object({
2623
+ code: z__namespace.string(),
2624
+ message: z__namespace.string(),
2625
+ display_error: z__namespace.string()
2626
+ }).nullable(),
2627
+ media: z__namespace.array(z__namespace.object({
2628
+ media_id: z__namespace.string(),
2629
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2630
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2631
+ alt_text_override: z__namespace.string().nullable()
2632
+ }))
2633
+ }),
2634
+ z__namespace.object({
2635
+ platform: z__namespace.literal("facebook_page"),
2636
+ post_type: z__namespace.enum([
2637
+ "text",
2638
+ "single_image",
2639
+ "multi_image",
2640
+ "reel"
2641
+ ]),
2642
+ settings: z__namespace.object({
2643
+ link: z__namespace.url().optional()
2644
+ }),
2645
+ id: z__namespace.string(),
2646
+ object: z__namespace.literal("post_variant"),
2647
+ connection_id: z__namespace.string().nullable(),
2648
+ body: z__namespace.string().nullable(),
2649
+ status: z__namespace.enum([
2650
+ "draft",
2651
+ "scheduled",
2652
+ "publishing",
2653
+ "published",
2654
+ "failed"
2655
+ ]),
2656
+ schedule_at: z__namespace.string().nullable(),
2657
+ result: z__namespace.object({
2658
+ platform_post_id: z__namespace.string(),
2659
+ permalink: z__namespace.string().nullable(),
2660
+ published_at: z__namespace.string()
2661
+ }).nullable(),
2662
+ error: z__namespace.object({
2663
+ code: z__namespace.string(),
2664
+ message: z__namespace.string(),
2665
+ display_error: z__namespace.string()
2666
+ }).nullable(),
2667
+ media: z__namespace.array(z__namespace.object({
2668
+ media_id: z__namespace.string(),
2669
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2670
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2671
+ alt_text_override: z__namespace.string().nullable()
2672
+ }))
2673
+ }),
2674
+ z__namespace.object({
2675
+ platform: z__namespace.literal("instagram"),
2676
+ post_type: z__namespace.enum([
2677
+ "single_image",
2678
+ "carousel",
2679
+ "reel"
2680
+ ]),
2681
+ settings: z__namespace.object({
2682
+ media_type: z__namespace.enum([
2683
+ "IMAGE",
2684
+ "CAROUSEL",
2685
+ "REELS"
2686
+ ]).optional(),
2687
+ location_id: z__namespace.string().optional(),
2688
+ user_tags: z__namespace.array(z__namespace.object({
2689
+ username: z__namespace.string().min(1),
2690
+ x: z__namespace.number().gte(0).lte(1),
2691
+ y: z__namespace.number().gte(0).lte(1)
2692
+ })).optional(),
2693
+ collaborators: z__namespace.array(z__namespace.string().min(1)).max(3).optional(),
2694
+ share_to_feed: z__namespace.boolean().optional(),
2695
+ thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2696
+ cover_url: z__namespace.url().optional(),
2697
+ audio_name: z__namespace.string().optional()
2698
+ }),
2699
+ id: z__namespace.string(),
2700
+ object: z__namespace.literal("post_variant"),
2701
+ connection_id: z__namespace.string().nullable(),
2702
+ body: z__namespace.string().nullable(),
2703
+ status: z__namespace.enum([
2704
+ "draft",
2705
+ "scheduled",
2706
+ "publishing",
2707
+ "published",
2708
+ "failed"
2709
+ ]),
2710
+ schedule_at: z__namespace.string().nullable(),
2711
+ result: z__namespace.object({
2712
+ platform_post_id: z__namespace.string(),
2713
+ permalink: z__namespace.string().nullable(),
2714
+ published_at: z__namespace.string()
2715
+ }).nullable(),
2716
+ error: z__namespace.object({
2717
+ code: z__namespace.string(),
2718
+ message: z__namespace.string(),
2719
+ display_error: z__namespace.string()
2720
+ }).nullable(),
2721
+ media: z__namespace.array(z__namespace.object({
2722
+ media_id: z__namespace.string(),
2723
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2724
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2725
+ alt_text_override: z__namespace.string().nullable()
2726
+ }))
2727
+ }),
2728
+ z__namespace.object({
2729
+ platform: z__namespace.literal("tiktok"),
2730
+ post_type: z__namespace.enum([
2731
+ "video",
2732
+ "single_image",
2733
+ "carousel"
2734
+ ]),
2735
+ settings: z__namespace.object({
2736
+ privacy_level: z__namespace.enum([
2737
+ "PUBLIC_TO_EVERYONE",
2738
+ "MUTUAL_FOLLOW_FRIENDS",
2739
+ "FOLLOWER_OF_CREATOR",
2740
+ "SELF_ONLY"
2741
+ ]).optional(),
2742
+ disable_comment: z__namespace.boolean().optional(),
2743
+ disable_duet: z__namespace.boolean().optional(),
2744
+ disable_stitch: z__namespace.boolean().optional(),
2745
+ video_cover_timestamp_ms: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2746
+ photo_cover_index: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2747
+ auto_add_music: z__namespace.boolean().optional(),
2748
+ brand_content_toggle: z__namespace.boolean().optional(),
2749
+ brand_organic_toggle: z__namespace.boolean().optional(),
2750
+ is_aigc: z__namespace.boolean().optional()
2751
+ }),
2752
+ id: z__namespace.string(),
2753
+ object: z__namespace.literal("post_variant"),
2754
+ connection_id: z__namespace.string().nullable(),
2755
+ body: z__namespace.string().nullable(),
2756
+ status: z__namespace.enum([
2757
+ "draft",
2758
+ "scheduled",
2759
+ "publishing",
2760
+ "published",
2761
+ "failed"
2762
+ ]),
2763
+ schedule_at: z__namespace.string().nullable(),
2764
+ result: z__namespace.object({
2765
+ platform_post_id: z__namespace.string(),
2766
+ permalink: z__namespace.string().nullable(),
2767
+ published_at: z__namespace.string()
2768
+ }).nullable(),
2769
+ error: z__namespace.object({
2770
+ code: z__namespace.string(),
2771
+ message: z__namespace.string(),
2772
+ display_error: z__namespace.string()
2773
+ }).nullable(),
2774
+ media: z__namespace.array(z__namespace.object({
2775
+ media_id: z__namespace.string(),
2776
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2777
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2778
+ alt_text_override: z__namespace.string().nullable()
2779
+ }))
2780
+ })
2781
+ ])),
2782
+ created_at: z__namespace.string(),
2783
+ updated_at: z__namespace.string(),
2784
+ dry_run: z__namespace.boolean(),
2785
+ executed: z__namespace.boolean()
2786
+ });
2787
+ z__namespace.object({
2788
+ id: z__namespace.string()
2789
+ });
2790
+ z__namespace.object({
2791
+ id: z__namespace.string(),
2792
+ object: z__namespace.literal("post"),
2793
+ deleted: z__namespace.literal(true)
2794
+ });
2795
+ z__namespace.object({
2796
+ id: z__namespace.string()
2797
+ });
2798
+ z__namespace.object({
2799
+ id: z__namespace.string(),
2800
+ object: z__namespace.literal("post"),
2801
+ profile_id: z__namespace.string(),
2802
+ external_id: z__namespace.string().nullable(),
2803
+ status: z__namespace.enum([
2804
+ "draft",
2805
+ "scheduled",
2806
+ "publishing",
2807
+ "partially_published",
2808
+ "published",
2809
+ "failed"
2810
+ ]),
2811
+ schedule_at: z__namespace.string().nullable(),
2812
+ tags: z__namespace.array(z__namespace.string()),
2813
+ notes: z__namespace.string().nullable(),
2814
+ metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
2815
+ z__namespace.string().max(500),
2816
+ z__namespace.number(),
2817
+ z__namespace.boolean()
2818
+ ])),
2819
+ variants: z__namespace.array(z__namespace.union([
2820
+ z__namespace.object({
2821
+ platform: z__namespace.literal("x"),
2822
+ post_type: z__namespace.enum([
2823
+ "text",
2824
+ "single_image",
2825
+ "multi_image",
2826
+ "video"
2827
+ ]),
2828
+ settings: z__namespace.object({
2829
+ reply_settings: z__namespace.enum([
2830
+ "everyone",
2831
+ "following",
2832
+ "mentionedUsers",
2833
+ "subscribers",
2834
+ "verified"
2835
+ ]).optional(),
2836
+ quote_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
2837
+ poll: z__namespace.object({
2838
+ options: z__namespace.array(z__namespace.string().min(1).max(25)).min(2).max(4),
2839
+ duration_minutes: z__namespace.int().gte(5).lte(10080),
2840
+ reply_settings: z__namespace.enum([
2841
+ "following",
2842
+ "mentionedUsers",
2843
+ "subscribers",
2844
+ "verified"
2845
+ ]).optional()
2846
+ }).optional(),
2847
+ reply: z__namespace.object({
2848
+ in_reply_to_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/),
2849
+ exclude_reply_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).optional(),
2850
+ auto_populate_reply_metadata: z__namespace.boolean().optional()
2851
+ }).optional(),
2852
+ community_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
2853
+ for_super_followers_only: z__namespace.boolean().optional(),
2854
+ geo: z__namespace.object({
2855
+ place_id: z__namespace.string()
2856
+ }).optional(),
2857
+ card_uri: z__namespace.string().optional(),
2858
+ media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
2859
+ }),
2860
+ id: z__namespace.string(),
2861
+ object: z__namespace.literal("post_variant"),
2862
+ connection_id: z__namespace.string().nullable(),
2863
+ body: z__namespace.string().nullable(),
2864
+ status: z__namespace.enum([
2865
+ "draft",
2866
+ "scheduled",
2867
+ "publishing",
2868
+ "published",
2869
+ "failed"
2870
+ ]),
2871
+ schedule_at: z__namespace.string().nullable(),
2872
+ result: z__namespace.object({
2873
+ platform_post_id: z__namespace.string(),
2874
+ permalink: z__namespace.string().nullable(),
2875
+ published_at: z__namespace.string()
2876
+ }).nullable(),
2877
+ error: z__namespace.object({
2878
+ code: z__namespace.string(),
2879
+ message: z__namespace.string(),
2880
+ display_error: z__namespace.string()
2881
+ }).nullable(),
2882
+ media: z__namespace.array(z__namespace.object({
2883
+ media_id: z__namespace.string(),
2884
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2885
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2886
+ alt_text_override: z__namespace.string().nullable()
2887
+ }))
2888
+ }),
2889
+ z__namespace.object({
2890
+ platform: z__namespace.literal("linkedin"),
2891
+ post_type: z__namespace.enum([
2892
+ "text",
2893
+ "single_image",
2894
+ "multi_image",
2895
+ "video"
2896
+ ]),
2897
+ settings: z__namespace.object({
2898
+ visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
2899
+ content_kind: z__namespace.enum([
2900
+ "text",
2901
+ "single_image",
2902
+ "video",
2903
+ "multi_image",
2904
+ "document",
2905
+ "article",
2906
+ "poll"
2907
+ ]),
2908
+ article: z__namespace.object({
2909
+ source: z__namespace.url(),
2910
+ title: z__namespace.string().max(400).optional(),
2911
+ description: z__namespace.string().max(4086).optional(),
2912
+ thumbnail_media_id: z__namespace.string().optional()
2913
+ }).optional(),
2914
+ poll: z__namespace.object({
2915
+ question: z__namespace.string().min(1).max(140),
2916
+ options: z__namespace.array(z__namespace.string().min(1).max(30)).min(2).max(4),
2917
+ duration: z__namespace.enum([
2918
+ "ONE_DAY",
2919
+ "THREE_DAYS",
2920
+ "SEVEN_DAYS",
2921
+ "FOURTEEN_DAYS"
2922
+ ])
2923
+ }).optional(),
2924
+ document: z__namespace.object({
2925
+ title: z__namespace.string().min(1).max(400)
2926
+ }).optional(),
2927
+ disable_reshare: z__namespace.boolean().optional(),
2928
+ mentions: z__namespace.array(z__namespace.object({
2929
+ type: z__namespace.enum(["person", "organization"]),
2930
+ name: z__namespace.string().min(1),
2931
+ urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
2932
+ })).optional()
2933
+ }),
2934
+ id: z__namespace.string(),
2935
+ object: z__namespace.literal("post_variant"),
2936
+ connection_id: z__namespace.string().nullable(),
2937
+ body: z__namespace.string().nullable(),
2938
+ status: z__namespace.enum([
2939
+ "draft",
2940
+ "scheduled",
2941
+ "publishing",
2942
+ "published",
2943
+ "failed"
2944
+ ]),
2945
+ schedule_at: z__namespace.string().nullable(),
2946
+ result: z__namespace.object({
2947
+ platform_post_id: z__namespace.string(),
2948
+ permalink: z__namespace.string().nullable(),
2949
+ published_at: z__namespace.string()
2950
+ }).nullable(),
2951
+ error: z__namespace.object({
2952
+ code: z__namespace.string(),
2953
+ message: z__namespace.string(),
2954
+ display_error: z__namespace.string()
2955
+ }).nullable(),
2956
+ media: z__namespace.array(z__namespace.object({
2957
+ media_id: z__namespace.string(),
2958
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2959
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2960
+ alt_text_override: z__namespace.string().nullable()
2961
+ }))
2962
+ }),
2963
+ z__namespace.object({
2964
+ platform: z__namespace.literal("facebook_page"),
2965
+ post_type: z__namespace.enum([
2966
+ "text",
2967
+ "single_image",
2968
+ "multi_image",
2969
+ "reel"
2970
+ ]),
2971
+ settings: z__namespace.object({
2972
+ link: z__namespace.url().optional()
2973
+ }),
2974
+ id: z__namespace.string(),
2975
+ object: z__namespace.literal("post_variant"),
2976
+ connection_id: z__namespace.string().nullable(),
2977
+ body: z__namespace.string().nullable(),
2978
+ status: z__namespace.enum([
2979
+ "draft",
2980
+ "scheduled",
2981
+ "publishing",
2982
+ "published",
2983
+ "failed"
2984
+ ]),
2985
+ schedule_at: z__namespace.string().nullable(),
2986
+ result: z__namespace.object({
2987
+ platform_post_id: z__namespace.string(),
2988
+ permalink: z__namespace.string().nullable(),
2989
+ published_at: z__namespace.string()
2990
+ }).nullable(),
2991
+ error: z__namespace.object({
2992
+ code: z__namespace.string(),
2993
+ message: z__namespace.string(),
2994
+ display_error: z__namespace.string()
2995
+ }).nullable(),
2996
+ media: z__namespace.array(z__namespace.object({
2997
+ media_id: z__namespace.string(),
2998
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2999
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3000
+ alt_text_override: z__namespace.string().nullable()
3001
+ }))
3002
+ }),
3003
+ z__namespace.object({
3004
+ platform: z__namespace.literal("instagram"),
3005
+ post_type: z__namespace.enum([
3006
+ "single_image",
3007
+ "carousel",
3008
+ "reel"
3009
+ ]),
3010
+ settings: z__namespace.object({
3011
+ media_type: z__namespace.enum([
3012
+ "IMAGE",
3013
+ "CAROUSEL",
3014
+ "REELS"
3015
+ ]).optional(),
3016
+ location_id: z__namespace.string().optional(),
3017
+ user_tags: z__namespace.array(z__namespace.object({
3018
+ username: z__namespace.string().min(1),
3019
+ x: z__namespace.number().gte(0).lte(1),
3020
+ y: z__namespace.number().gte(0).lte(1)
3021
+ })).optional(),
3022
+ collaborators: z__namespace.array(z__namespace.string().min(1)).max(3).optional(),
3023
+ share_to_feed: z__namespace.boolean().optional(),
3024
+ thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
3025
+ cover_url: z__namespace.url().optional(),
3026
+ audio_name: z__namespace.string().optional()
3027
+ }),
3028
+ id: z__namespace.string(),
3029
+ object: z__namespace.literal("post_variant"),
3030
+ connection_id: z__namespace.string().nullable(),
3031
+ body: z__namespace.string().nullable(),
3032
+ status: z__namespace.enum([
3033
+ "draft",
3034
+ "scheduled",
3035
+ "publishing",
3036
+ "published",
3037
+ "failed"
3038
+ ]),
3039
+ schedule_at: z__namespace.string().nullable(),
3040
+ result: z__namespace.object({
3041
+ platform_post_id: z__namespace.string(),
3042
+ permalink: z__namespace.string().nullable(),
3043
+ published_at: z__namespace.string()
3044
+ }).nullable(),
3045
+ error: z__namespace.object({
3046
+ code: z__namespace.string(),
3047
+ message: z__namespace.string(),
3048
+ display_error: z__namespace.string()
3049
+ }).nullable(),
3050
+ media: z__namespace.array(z__namespace.object({
3051
+ media_id: z__namespace.string(),
3052
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3053
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3054
+ alt_text_override: z__namespace.string().nullable()
3055
+ }))
3056
+ }),
3057
+ z__namespace.object({
3058
+ platform: z__namespace.literal("tiktok"),
3059
+ post_type: z__namespace.enum([
3060
+ "video",
3061
+ "single_image",
3062
+ "carousel"
3063
+ ]),
3064
+ settings: z__namespace.object({
3065
+ privacy_level: z__namespace.enum([
3066
+ "PUBLIC_TO_EVERYONE",
3067
+ "MUTUAL_FOLLOW_FRIENDS",
3068
+ "FOLLOWER_OF_CREATOR",
3069
+ "SELF_ONLY"
3070
+ ]).optional(),
3071
+ disable_comment: z__namespace.boolean().optional(),
3072
+ disable_duet: z__namespace.boolean().optional(),
3073
+ disable_stitch: z__namespace.boolean().optional(),
3074
+ video_cover_timestamp_ms: z__namespace.int().gte(0).lte(9007199254740991).optional(),
3075
+ photo_cover_index: z__namespace.int().gte(0).lte(9007199254740991).optional(),
3076
+ auto_add_music: z__namespace.boolean().optional(),
3077
+ brand_content_toggle: z__namespace.boolean().optional(),
3078
+ brand_organic_toggle: z__namespace.boolean().optional(),
3079
+ is_aigc: z__namespace.boolean().optional()
3080
+ }),
3081
+ id: z__namespace.string(),
3082
+ object: z__namespace.literal("post_variant"),
3083
+ connection_id: z__namespace.string().nullable(),
3084
+ body: z__namespace.string().nullable(),
3085
+ status: z__namespace.enum([
3086
+ "draft",
3087
+ "scheduled",
3088
+ "publishing",
3089
+ "published",
3090
+ "failed"
3091
+ ]),
3092
+ schedule_at: z__namespace.string().nullable(),
3093
+ result: z__namespace.object({
3094
+ platform_post_id: z__namespace.string(),
3095
+ permalink: z__namespace.string().nullable(),
3096
+ published_at: z__namespace.string()
3097
+ }).nullable(),
3098
+ error: z__namespace.object({
3099
+ code: z__namespace.string(),
3100
+ message: z__namespace.string(),
3101
+ display_error: z__namespace.string()
3102
+ }).nullable(),
3103
+ media: z__namespace.array(z__namespace.object({
3104
+ media_id: z__namespace.string(),
3105
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3106
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3107
+ alt_text_override: z__namespace.string().nullable()
3108
+ }))
3109
+ })
3110
+ ])),
2367
3111
  created_at: z__namespace.string(),
2368
3112
  updated_at: z__namespace.string()
2369
3113
  });
2370
3114
  z__namespace.object({
2371
- publish: z__namespace.enum([
2372
- "now",
2373
- "schedule",
2374
- "draft"
2375
- ]).optional(),
2376
- schedule_at: z__namespace.iso.datetime().nullish(),
2377
- external_id: z__namespace.string().min(1).max(255).nullish(),
3115
+ publish: z__namespace.enum([
3116
+ "now",
3117
+ "schedule",
3118
+ "draft"
3119
+ ]).optional(),
3120
+ schedule_at: z__namespace.iso.datetime().nullish(),
3121
+ external_id: z__namespace.string().min(1).max(255).nullish(),
3122
+ metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
3123
+ z__namespace.string().max(500),
3124
+ z__namespace.number(),
3125
+ z__namespace.boolean()
3126
+ ])).optional(),
3127
+ tags: z__namespace.array(z__namespace.string()).optional(),
3128
+ notes: z__namespace.string().nullish(),
3129
+ dry_run: z__namespace.boolean().optional().default(false),
3130
+ variants: z__namespace.array(z__namespace.union([
3131
+ z__namespace.object({
3132
+ platform: z__namespace.literal("x"),
3133
+ post_type: z__namespace.enum([
3134
+ "text",
3135
+ "single_image",
3136
+ "multi_image",
3137
+ "video"
3138
+ ]),
3139
+ settings: z__namespace.object({
3140
+ reply_settings: z__namespace.enum([
3141
+ "everyone",
3142
+ "following",
3143
+ "mentionedUsers",
3144
+ "subscribers",
3145
+ "verified"
3146
+ ]).optional(),
3147
+ quote_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
3148
+ poll: z__namespace.object({
3149
+ options: z__namespace.array(z__namespace.string().min(1).max(25)).min(2).max(4),
3150
+ duration_minutes: z__namespace.int().gte(5).lte(10080),
3151
+ reply_settings: z__namespace.enum([
3152
+ "following",
3153
+ "mentionedUsers",
3154
+ "subscribers",
3155
+ "verified"
3156
+ ]).optional()
3157
+ }).optional(),
3158
+ reply: z__namespace.object({
3159
+ in_reply_to_tweet_id: z__namespace.string().regex(/^[0-9]{1,19}$/),
3160
+ exclude_reply_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).optional(),
3161
+ auto_populate_reply_metadata: z__namespace.boolean().optional()
3162
+ }).optional(),
3163
+ community_id: z__namespace.string().regex(/^[0-9]{1,19}$/).optional(),
3164
+ for_super_followers_only: z__namespace.boolean().optional(),
3165
+ geo: z__namespace.object({
3166
+ place_id: z__namespace.string()
3167
+ }).optional(),
3168
+ card_uri: z__namespace.string().optional(),
3169
+ media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
3170
+ }).optional().default({}),
3171
+ connection_id: z__namespace.string(),
3172
+ body: z__namespace.string().optional(),
3173
+ media: z__namespace.array(z__namespace.object({
3174
+ media_id: z__namespace.string(),
3175
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3176
+ alt_text_override: z__namespace.string().nullish()
3177
+ })).optional().default([])
3178
+ }),
3179
+ z__namespace.object({
3180
+ platform: z__namespace.literal("linkedin"),
3181
+ post_type: z__namespace.enum([
3182
+ "text",
3183
+ "single_image",
3184
+ "multi_image",
3185
+ "video"
3186
+ ]),
3187
+ settings: z__namespace.object({
3188
+ visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
3189
+ content_kind: z__namespace.enum([
3190
+ "text",
3191
+ "single_image",
3192
+ "video",
3193
+ "multi_image",
3194
+ "document",
3195
+ "article",
3196
+ "poll"
3197
+ ]),
3198
+ article: z__namespace.object({
3199
+ source: z__namespace.url(),
3200
+ title: z__namespace.string().max(400).optional(),
3201
+ description: z__namespace.string().max(4086).optional(),
3202
+ thumbnail_media_id: z__namespace.string().optional()
3203
+ }).optional(),
3204
+ poll: z__namespace.object({
3205
+ question: z__namespace.string().min(1).max(140),
3206
+ options: z__namespace.array(z__namespace.string().min(1).max(30)).min(2).max(4),
3207
+ duration: z__namespace.enum([
3208
+ "ONE_DAY",
3209
+ "THREE_DAYS",
3210
+ "SEVEN_DAYS",
3211
+ "FOURTEEN_DAYS"
3212
+ ])
3213
+ }).optional(),
3214
+ document: z__namespace.object({
3215
+ title: z__namespace.string().min(1).max(400)
3216
+ }).optional(),
3217
+ disable_reshare: z__namespace.boolean().optional(),
3218
+ mentions: z__namespace.array(z__namespace.object({
3219
+ type: z__namespace.enum(["person", "organization"]),
3220
+ name: z__namespace.string().min(1),
3221
+ urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
3222
+ })).optional()
3223
+ }),
3224
+ connection_id: z__namespace.string(),
3225
+ body: z__namespace.string().optional(),
3226
+ media: z__namespace.array(z__namespace.object({
3227
+ media_id: z__namespace.string(),
3228
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3229
+ alt_text_override: z__namespace.string().nullish()
3230
+ })).optional().default([])
3231
+ }),
3232
+ z__namespace.object({
3233
+ platform: z__namespace.literal("instagram"),
3234
+ post_type: z__namespace.enum([
3235
+ "single_image",
3236
+ "carousel",
3237
+ "reel"
3238
+ ]),
3239
+ settings: z__namespace.object({
3240
+ media_type: z__namespace.enum([
3241
+ "IMAGE",
3242
+ "CAROUSEL",
3243
+ "REELS"
3244
+ ]).optional(),
3245
+ location_id: z__namespace.string().optional(),
3246
+ user_tags: z__namespace.array(z__namespace.object({
3247
+ username: z__namespace.string().min(1),
3248
+ x: z__namespace.number().gte(0).lte(1),
3249
+ y: z__namespace.number().gte(0).lte(1)
3250
+ })).optional(),
3251
+ collaborators: z__namespace.array(z__namespace.string().min(1)).max(3).optional(),
3252
+ share_to_feed: z__namespace.boolean().optional(),
3253
+ thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
3254
+ cover_url: z__namespace.url().optional(),
3255
+ audio_name: z__namespace.string().optional()
3256
+ }),
3257
+ connection_id: z__namespace.string(),
3258
+ body: z__namespace.string().optional(),
3259
+ media: z__namespace.array(z__namespace.object({
3260
+ media_id: z__namespace.string(),
3261
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3262
+ alt_text_override: z__namespace.string().nullish()
3263
+ })).optional().default([])
3264
+ }),
3265
+ z__namespace.object({
3266
+ platform: z__namespace.literal("facebook_page"),
3267
+ post_type: z__namespace.enum([
3268
+ "text",
3269
+ "single_image",
3270
+ "multi_image",
3271
+ "reel"
3272
+ ]),
3273
+ settings: z__namespace.object({
3274
+ link: z__namespace.url().optional()
3275
+ }).optional().default({}),
3276
+ connection_id: z__namespace.string(),
3277
+ body: z__namespace.string().optional(),
3278
+ media: z__namespace.array(z__namespace.object({
3279
+ media_id: z__namespace.string(),
3280
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3281
+ alt_text_override: z__namespace.string().nullish()
3282
+ })).optional().default([])
3283
+ }),
3284
+ z__namespace.object({
3285
+ platform: z__namespace.literal("tiktok"),
3286
+ post_type: z__namespace.enum([
3287
+ "video",
3288
+ "single_image",
3289
+ "carousel"
3290
+ ]),
3291
+ settings: z__namespace.object({
3292
+ privacy_level: z__namespace.enum([
3293
+ "PUBLIC_TO_EVERYONE",
3294
+ "MUTUAL_FOLLOW_FRIENDS",
3295
+ "FOLLOWER_OF_CREATOR",
3296
+ "SELF_ONLY"
3297
+ ]).optional(),
3298
+ disable_comment: z__namespace.boolean().optional(),
3299
+ disable_duet: z__namespace.boolean().optional(),
3300
+ disable_stitch: z__namespace.boolean().optional(),
3301
+ video_cover_timestamp_ms: z__namespace.int().gte(0).lte(9007199254740991).optional(),
3302
+ photo_cover_index: z__namespace.int().gte(0).lte(9007199254740991).optional(),
3303
+ auto_add_music: z__namespace.boolean().optional(),
3304
+ brand_content_toggle: z__namespace.boolean().optional(),
3305
+ brand_organic_toggle: z__namespace.boolean().optional(),
3306
+ is_aigc: z__namespace.boolean().optional()
3307
+ }).optional().default({}),
3308
+ connection_id: z__namespace.string(),
3309
+ body: z__namespace.string().optional(),
3310
+ media: z__namespace.array(z__namespace.object({
3311
+ media_id: z__namespace.string(),
3312
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3313
+ alt_text_override: z__namespace.string().nullish()
3314
+ })).optional().default([])
3315
+ })
3316
+ ])).min(1).optional()
3317
+ });
3318
+ z__namespace.object({
3319
+ id: z__namespace.string()
3320
+ });
3321
+ z__namespace.object({
3322
+ id: z__namespace.string(),
3323
+ object: z__namespace.literal("post"),
3324
+ profile_id: z__namespace.string(),
3325
+ external_id: z__namespace.string().nullable(),
3326
+ status: z__namespace.enum([
3327
+ "draft",
3328
+ "scheduled",
3329
+ "publishing",
3330
+ "partially_published",
3331
+ "published",
3332
+ "failed"
3333
+ ]),
3334
+ schedule_at: z__namespace.string().nullable(),
3335
+ tags: z__namespace.array(z__namespace.string()),
3336
+ notes: z__namespace.string().nullable(),
2378
3337
  metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
2379
3338
  z__namespace.string().max(500),
2380
3339
  z__namespace.number(),
2381
3340
  z__namespace.boolean()
2382
- ])).optional(),
2383
- tags: z__namespace.array(z__namespace.string()).optional(),
2384
- notes: z__namespace.string().nullish(),
2385
- dry_run: z__namespace.boolean().optional().default(false),
3341
+ ])),
2386
3342
  variants: z__namespace.array(z__namespace.union([
2387
3343
  z__namespace.object({
2388
3344
  platform: z__namespace.literal("x"),
@@ -2392,13 +3348,6 @@ z__namespace.object({
2392
3348
  "multi_image",
2393
3349
  "video"
2394
3350
  ]),
2395
- connection_id: z__namespace.string(),
2396
- body: z__namespace.string().optional(),
2397
- media: z__namespace.array(z__namespace.object({
2398
- media_id: z__namespace.string(),
2399
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2400
- alt_text_override: z__namespace.string().nullish()
2401
- })).optional().default([]),
2402
3351
  settings: z__namespace.object({
2403
3352
  reply_settings: z__namespace.enum([
2404
3353
  "everyone",
@@ -2430,7 +3379,35 @@ z__namespace.object({
2430
3379
  }).optional(),
2431
3380
  card_uri: z__namespace.string().optional(),
2432
3381
  media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
2433
- }).optional().default({})
3382
+ }),
3383
+ id: z__namespace.string(),
3384
+ object: z__namespace.literal("post_variant"),
3385
+ connection_id: z__namespace.string().nullable(),
3386
+ body: z__namespace.string().nullable(),
3387
+ status: z__namespace.enum([
3388
+ "draft",
3389
+ "scheduled",
3390
+ "publishing",
3391
+ "published",
3392
+ "failed"
3393
+ ]),
3394
+ schedule_at: z__namespace.string().nullable(),
3395
+ result: z__namespace.object({
3396
+ platform_post_id: z__namespace.string(),
3397
+ permalink: z__namespace.string().nullable(),
3398
+ published_at: z__namespace.string()
3399
+ }).nullable(),
3400
+ error: z__namespace.object({
3401
+ code: z__namespace.string(),
3402
+ message: z__namespace.string(),
3403
+ display_error: z__namespace.string()
3404
+ }).nullable(),
3405
+ media: z__namespace.array(z__namespace.object({
3406
+ media_id: z__namespace.string(),
3407
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3408
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3409
+ alt_text_override: z__namespace.string().nullable()
3410
+ }))
2434
3411
  }),
2435
3412
  z__namespace.object({
2436
3413
  platform: z__namespace.literal("linkedin"),
@@ -2440,50 +3417,111 @@ z__namespace.object({
2440
3417
  "multi_image",
2441
3418
  "video"
2442
3419
  ]),
2443
- connection_id: z__namespace.string(),
2444
- body: z__namespace.string().optional(),
3420
+ settings: z__namespace.object({
3421
+ visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
3422
+ content_kind: z__namespace.enum([
3423
+ "text",
3424
+ "single_image",
3425
+ "video",
3426
+ "multi_image",
3427
+ "document",
3428
+ "article",
3429
+ "poll"
3430
+ ]),
3431
+ article: z__namespace.object({
3432
+ source: z__namespace.url(),
3433
+ title: z__namespace.string().max(400).optional(),
3434
+ description: z__namespace.string().max(4086).optional(),
3435
+ thumbnail_media_id: z__namespace.string().optional()
3436
+ }).optional(),
3437
+ poll: z__namespace.object({
3438
+ question: z__namespace.string().min(1).max(140),
3439
+ options: z__namespace.array(z__namespace.string().min(1).max(30)).min(2).max(4),
3440
+ duration: z__namespace.enum([
3441
+ "ONE_DAY",
3442
+ "THREE_DAYS",
3443
+ "SEVEN_DAYS",
3444
+ "FOURTEEN_DAYS"
3445
+ ])
3446
+ }).optional(),
3447
+ document: z__namespace.object({
3448
+ title: z__namespace.string().min(1).max(400)
3449
+ }).optional(),
3450
+ disable_reshare: z__namespace.boolean().optional(),
3451
+ mentions: z__namespace.array(z__namespace.object({
3452
+ type: z__namespace.enum(["person", "organization"]),
3453
+ name: z__namespace.string().min(1),
3454
+ urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
3455
+ })).optional()
3456
+ }),
3457
+ id: z__namespace.string(),
3458
+ object: z__namespace.literal("post_variant"),
3459
+ connection_id: z__namespace.string().nullable(),
3460
+ body: z__namespace.string().nullable(),
3461
+ status: z__namespace.enum([
3462
+ "draft",
3463
+ "scheduled",
3464
+ "publishing",
3465
+ "published",
3466
+ "failed"
3467
+ ]),
3468
+ schedule_at: z__namespace.string().nullable(),
3469
+ result: z__namespace.object({
3470
+ platform_post_id: z__namespace.string(),
3471
+ permalink: z__namespace.string().nullable(),
3472
+ published_at: z__namespace.string()
3473
+ }).nullable(),
3474
+ error: z__namespace.object({
3475
+ code: z__namespace.string(),
3476
+ message: z__namespace.string(),
3477
+ display_error: z__namespace.string()
3478
+ }).nullable(),
3479
+ media: z__namespace.array(z__namespace.object({
3480
+ media_id: z__namespace.string(),
3481
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3482
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3483
+ alt_text_override: z__namespace.string().nullable()
3484
+ }))
3485
+ }),
3486
+ z__namespace.object({
3487
+ platform: z__namespace.literal("facebook_page"),
3488
+ post_type: z__namespace.enum([
3489
+ "text",
3490
+ "single_image",
3491
+ "multi_image",
3492
+ "reel"
3493
+ ]),
3494
+ settings: z__namespace.object({
3495
+ link: z__namespace.url().optional()
3496
+ }),
3497
+ id: z__namespace.string(),
3498
+ object: z__namespace.literal("post_variant"),
3499
+ connection_id: z__namespace.string().nullable(),
3500
+ body: z__namespace.string().nullable(),
3501
+ status: z__namespace.enum([
3502
+ "draft",
3503
+ "scheduled",
3504
+ "publishing",
3505
+ "published",
3506
+ "failed"
3507
+ ]),
3508
+ schedule_at: z__namespace.string().nullable(),
3509
+ result: z__namespace.object({
3510
+ platform_post_id: z__namespace.string(),
3511
+ permalink: z__namespace.string().nullable(),
3512
+ published_at: z__namespace.string()
3513
+ }).nullable(),
3514
+ error: z__namespace.object({
3515
+ code: z__namespace.string(),
3516
+ message: z__namespace.string(),
3517
+ display_error: z__namespace.string()
3518
+ }).nullable(),
2445
3519
  media: z__namespace.array(z__namespace.object({
2446
3520
  media_id: z__namespace.string(),
2447
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2448
- alt_text_override: z__namespace.string().nullish()
2449
- })).optional().default([]),
2450
- settings: z__namespace.object({
2451
- visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
2452
- content_kind: z__namespace.enum([
2453
- "text",
2454
- "single_image",
2455
- "video",
2456
- "multi_image",
2457
- "document",
2458
- "article",
2459
- "poll"
2460
- ]),
2461
- article: z__namespace.object({
2462
- source: z__namespace.url(),
2463
- title: z__namespace.string().max(400).optional(),
2464
- description: z__namespace.string().max(4086).optional(),
2465
- thumbnail_media_id: z__namespace.string().optional()
2466
- }).optional(),
2467
- poll: z__namespace.object({
2468
- question: z__namespace.string().min(1).max(140),
2469
- options: z__namespace.array(z__namespace.string().min(1).max(30)).min(2).max(4),
2470
- duration: z__namespace.enum([
2471
- "ONE_DAY",
2472
- "THREE_DAYS",
2473
- "SEVEN_DAYS",
2474
- "FOURTEEN_DAYS"
2475
- ])
2476
- }).optional(),
2477
- document: z__namespace.object({
2478
- title: z__namespace.string().min(1).max(400)
2479
- }).optional(),
2480
- disable_reshare: z__namespace.boolean().optional(),
2481
- mentions: z__namespace.array(z__namespace.object({
2482
- type: z__namespace.enum(["person", "organization"]),
2483
- name: z__namespace.string().min(1),
2484
- urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
2485
- })).optional()
2486
- })
3521
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3522
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3523
+ alt_text_override: z__namespace.string().nullable()
3524
+ }))
2487
3525
  }),
2488
3526
  z__namespace.object({
2489
3527
  platform: z__namespace.literal("instagram"),
@@ -2492,13 +3530,6 @@ z__namespace.object({
2492
3530
  "carousel",
2493
3531
  "reel"
2494
3532
  ]),
2495
- connection_id: z__namespace.string(),
2496
- body: z__namespace.string().optional(),
2497
- media: z__namespace.array(z__namespace.object({
2498
- media_id: z__namespace.string(),
2499
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2500
- alt_text_override: z__namespace.string().nullish()
2501
- })).optional().default([]),
2502
3533
  settings: z__namespace.object({
2503
3534
  media_type: z__namespace.enum([
2504
3535
  "IMAGE",
@@ -2516,26 +3547,35 @@ z__namespace.object({
2516
3547
  thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2517
3548
  cover_url: z__namespace.url().optional(),
2518
3549
  audio_name: z__namespace.string().optional()
2519
- })
2520
- }),
2521
- z__namespace.object({
2522
- platform: z__namespace.literal("facebook_page"),
2523
- post_type: z__namespace.enum([
2524
- "text",
2525
- "single_image",
2526
- "multi_image",
2527
- "reel"
3550
+ }),
3551
+ id: z__namespace.string(),
3552
+ object: z__namespace.literal("post_variant"),
3553
+ connection_id: z__namespace.string().nullable(),
3554
+ body: z__namespace.string().nullable(),
3555
+ status: z__namespace.enum([
3556
+ "draft",
3557
+ "scheduled",
3558
+ "publishing",
3559
+ "published",
3560
+ "failed"
2528
3561
  ]),
2529
- connection_id: z__namespace.string(),
2530
- body: z__namespace.string().optional(),
3562
+ schedule_at: z__namespace.string().nullable(),
3563
+ result: z__namespace.object({
3564
+ platform_post_id: z__namespace.string(),
3565
+ permalink: z__namespace.string().nullable(),
3566
+ published_at: z__namespace.string()
3567
+ }).nullable(),
3568
+ error: z__namespace.object({
3569
+ code: z__namespace.string(),
3570
+ message: z__namespace.string(),
3571
+ display_error: z__namespace.string()
3572
+ }).nullable(),
2531
3573
  media: z__namespace.array(z__namespace.object({
2532
3574
  media_id: z__namespace.string(),
2533
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2534
- alt_text_override: z__namespace.string().nullish()
2535
- })).optional().default([]),
2536
- settings: z__namespace.object({
2537
- link: z__namespace.url().optional()
2538
- }).optional().default({})
3575
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3576
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3577
+ alt_text_override: z__namespace.string().nullable()
3578
+ }))
2539
3579
  }),
2540
3580
  z__namespace.object({
2541
3581
  platform: z__namespace.literal("tiktok"),
@@ -2544,13 +3584,6 @@ z__namespace.object({
2544
3584
  "single_image",
2545
3585
  "carousel"
2546
3586
  ]),
2547
- connection_id: z__namespace.string(),
2548
- body: z__namespace.string().optional(),
2549
- media: z__namespace.array(z__namespace.object({
2550
- media_id: z__namespace.string(),
2551
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2552
- alt_text_override: z__namespace.string().nullish()
2553
- })).optional().default([]),
2554
3587
  settings: z__namespace.object({
2555
3588
  privacy_level: z__namespace.enum([
2556
3589
  "PUBLIC_TO_EVERYONE",
@@ -2567,80 +3600,37 @@ z__namespace.object({
2567
3600
  brand_content_toggle: z__namespace.boolean().optional(),
2568
3601
  brand_organic_toggle: z__namespace.boolean().optional(),
2569
3602
  is_aigc: z__namespace.boolean().optional()
2570
- }).optional().default({})
3603
+ }),
3604
+ id: z__namespace.string(),
3605
+ object: z__namespace.literal("post_variant"),
3606
+ connection_id: z__namespace.string().nullable(),
3607
+ body: z__namespace.string().nullable(),
3608
+ status: z__namespace.enum([
3609
+ "draft",
3610
+ "scheduled",
3611
+ "publishing",
3612
+ "published",
3613
+ "failed"
3614
+ ]),
3615
+ schedule_at: z__namespace.string().nullable(),
3616
+ result: z__namespace.object({
3617
+ platform_post_id: z__namespace.string(),
3618
+ permalink: z__namespace.string().nullable(),
3619
+ published_at: z__namespace.string()
3620
+ }).nullable(),
3621
+ error: z__namespace.object({
3622
+ code: z__namespace.string(),
3623
+ message: z__namespace.string(),
3624
+ display_error: z__namespace.string()
3625
+ }).nullable(),
3626
+ media: z__namespace.array(z__namespace.object({
3627
+ media_id: z__namespace.string(),
3628
+ position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
3629
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
3630
+ alt_text_override: z__namespace.string().nullable()
3631
+ }))
2571
3632
  })
2572
- ])).min(1).optional()
2573
- });
2574
- z__namespace.object({
2575
- id: z__namespace.string()
2576
- });
2577
- z__namespace.object({
2578
- id: z__namespace.string(),
2579
- object: z__namespace.literal("post"),
2580
- profile_id: z__namespace.string(),
2581
- external_id: z__namespace.string().nullable(),
2582
- status: z__namespace.enum([
2583
- "draft",
2584
- "scheduled",
2585
- "publishing",
2586
- "partially_published",
2587
- "published",
2588
- "failed"
2589
- ]),
2590
- schedule_at: z__namespace.string().nullable(),
2591
- tags: z__namespace.array(z__namespace.string()),
2592
- notes: z__namespace.string().nullable(),
2593
- metadata: z__namespace.record(z__namespace.string(), z__namespace.union([
2594
- z__namespace.string().max(500),
2595
- z__namespace.number(),
2596
- z__namespace.boolean()
2597
3633
  ])),
2598
- variants: z__namespace.array(z__namespace.object({
2599
- id: z__namespace.string(),
2600
- object: z__namespace.literal("post_variant"),
2601
- connection_id: z__namespace.string().nullable(),
2602
- platform: z__namespace.enum([
2603
- "x",
2604
- "linkedin",
2605
- "facebook_page",
2606
- "instagram",
2607
- "tiktok"
2608
- ]),
2609
- post_type: z__namespace.enum([
2610
- "text",
2611
- "single_image",
2612
- "multi_image",
2613
- "video",
2614
- "reel",
2615
- "carousel"
2616
- ]),
2617
- body: z__namespace.string().nullable(),
2618
- status: z__namespace.enum([
2619
- "draft",
2620
- "scheduled",
2621
- "publishing",
2622
- "published",
2623
- "failed"
2624
- ]),
2625
- settings: z__namespace.record(z__namespace.string(), z__namespace.unknown()),
2626
- schedule_at: z__namespace.string().nullable(),
2627
- result: z__namespace.object({
2628
- platform_post_id: z__namespace.string(),
2629
- permalink: z__namespace.string().nullable(),
2630
- published_at: z__namespace.string()
2631
- }).nullable(),
2632
- error: z__namespace.object({
2633
- code: z__namespace.string(),
2634
- message: z__namespace.string(),
2635
- display_error: z__namespace.string()
2636
- }).nullable(),
2637
- media: z__namespace.array(z__namespace.object({
2638
- media_id: z__namespace.string(),
2639
- position: z__namespace.int().gte(-9007199254740991).lte(9007199254740991),
2640
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullable(),
2641
- alt_text_override: z__namespace.string().nullable()
2642
- }))
2643
- })),
2644
3634
  created_at: z__namespace.string(),
2645
3635
  updated_at: z__namespace.string(),
2646
3636
  dry_run: z__namespace.boolean(),
@@ -2657,13 +3647,6 @@ z__namespace.object({
2657
3647
  "multi_image",
2658
3648
  "video"
2659
3649
  ]),
2660
- connection_id: z__namespace.string(),
2661
- body: z__namespace.string().optional(),
2662
- media: z__namespace.array(z__namespace.object({
2663
- media_id: z__namespace.string(),
2664
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2665
- alt_text_override: z__namespace.string().nullish()
2666
- })).optional().default([]),
2667
3650
  settings: z__namespace.object({
2668
3651
  reply_settings: z__namespace.enum([
2669
3652
  "everyone",
@@ -2695,7 +3678,14 @@ z__namespace.object({
2695
3678
  }).optional(),
2696
3679
  card_uri: z__namespace.string().optional(),
2697
3680
  media_tagged_user_ids: z__namespace.array(z__namespace.string().regex(/^[0-9]{1,19}$/)).max(10).optional()
2698
- }).optional().default({})
3681
+ }).optional().default({}),
3682
+ connection_id: z__namespace.string(),
3683
+ body: z__namespace.string().optional(),
3684
+ media: z__namespace.array(z__namespace.object({
3685
+ media_id: z__namespace.string(),
3686
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3687
+ alt_text_override: z__namespace.string().nullish()
3688
+ })).optional().default([])
2699
3689
  }),
2700
3690
  z__namespace.object({
2701
3691
  platform: z__namespace.literal("linkedin"),
@@ -2705,13 +3695,6 @@ z__namespace.object({
2705
3695
  "multi_image",
2706
3696
  "video"
2707
3697
  ]),
2708
- connection_id: z__namespace.string(),
2709
- body: z__namespace.string().optional(),
2710
- media: z__namespace.array(z__namespace.object({
2711
- media_id: z__namespace.string(),
2712
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2713
- alt_text_override: z__namespace.string().nullish()
2714
- })).optional().default([]),
2715
3698
  settings: z__namespace.object({
2716
3699
  visibility: z__namespace.enum(["PUBLIC", "CONNECTIONS"]),
2717
3700
  content_kind: z__namespace.enum([
@@ -2748,7 +3731,14 @@ z__namespace.object({
2748
3731
  name: z__namespace.string().min(1),
2749
3732
  urn: z__namespace.string().regex(/^urn:li:(person|organization):/)
2750
3733
  })).optional()
2751
- })
3734
+ }),
3735
+ connection_id: z__namespace.string(),
3736
+ body: z__namespace.string().optional(),
3737
+ media: z__namespace.array(z__namespace.object({
3738
+ media_id: z__namespace.string(),
3739
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3740
+ alt_text_override: z__namespace.string().nullish()
3741
+ })).optional().default([])
2752
3742
  }),
2753
3743
  z__namespace.object({
2754
3744
  platform: z__namespace.literal("instagram"),
@@ -2757,13 +3747,6 @@ z__namespace.object({
2757
3747
  "carousel",
2758
3748
  "reel"
2759
3749
  ]),
2760
- connection_id: z__namespace.string(),
2761
- body: z__namespace.string().optional(),
2762
- media: z__namespace.array(z__namespace.object({
2763
- media_id: z__namespace.string(),
2764
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2765
- alt_text_override: z__namespace.string().nullish()
2766
- })).optional().default([]),
2767
3750
  settings: z__namespace.object({
2768
3751
  media_type: z__namespace.enum([
2769
3752
  "IMAGE",
@@ -2781,7 +3764,14 @@ z__namespace.object({
2781
3764
  thumb_offset: z__namespace.int().gte(0).lte(9007199254740991).optional(),
2782
3765
  cover_url: z__namespace.url().optional(),
2783
3766
  audio_name: z__namespace.string().optional()
2784
- })
3767
+ }),
3768
+ connection_id: z__namespace.string(),
3769
+ body: z__namespace.string().optional(),
3770
+ media: z__namespace.array(z__namespace.object({
3771
+ media_id: z__namespace.string(),
3772
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3773
+ alt_text_override: z__namespace.string().nullish()
3774
+ })).optional().default([])
2785
3775
  }),
2786
3776
  z__namespace.object({
2787
3777
  platform: z__namespace.literal("facebook_page"),
@@ -2791,16 +3781,16 @@ z__namespace.object({
2791
3781
  "multi_image",
2792
3782
  "reel"
2793
3783
  ]),
3784
+ settings: z__namespace.object({
3785
+ link: z__namespace.url().optional()
3786
+ }).optional().default({}),
2794
3787
  connection_id: z__namespace.string(),
2795
3788
  body: z__namespace.string().optional(),
2796
3789
  media: z__namespace.array(z__namespace.object({
2797
3790
  media_id: z__namespace.string(),
2798
3791
  crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2799
3792
  alt_text_override: z__namespace.string().nullish()
2800
- })).optional().default([]),
2801
- settings: z__namespace.object({
2802
- link: z__namespace.url().optional()
2803
- }).optional().default({})
3793
+ })).optional().default([])
2804
3794
  }),
2805
3795
  z__namespace.object({
2806
3796
  platform: z__namespace.literal("tiktok"),
@@ -2809,13 +3799,6 @@ z__namespace.object({
2809
3799
  "single_image",
2810
3800
  "carousel"
2811
3801
  ]),
2812
- connection_id: z__namespace.string(),
2813
- body: z__namespace.string().optional(),
2814
- media: z__namespace.array(z__namespace.object({
2815
- media_id: z__namespace.string(),
2816
- crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
2817
- alt_text_override: z__namespace.string().nullish()
2818
- })).optional().default([]),
2819
3802
  settings: z__namespace.object({
2820
3803
  privacy_level: z__namespace.enum([
2821
3804
  "PUBLIC_TO_EVERYONE",
@@ -2832,7 +3815,14 @@ z__namespace.object({
2832
3815
  brand_content_toggle: z__namespace.boolean().optional(),
2833
3816
  brand_organic_toggle: z__namespace.boolean().optional(),
2834
3817
  is_aigc: z__namespace.boolean().optional()
2835
- }).optional().default({})
3818
+ }).optional().default({}),
3819
+ connection_id: z__namespace.string(),
3820
+ body: z__namespace.string().optional(),
3821
+ media: z__namespace.array(z__namespace.object({
3822
+ media_id: z__namespace.string(),
3823
+ crop_box: z__namespace.record(z__namespace.string(), z__namespace.unknown()).nullish(),
3824
+ alt_text_override: z__namespace.string().nullish()
3825
+ })).optional().default([])
2836
3826
  })
2837
3827
  ])).min(1)
2838
3828
  });
@@ -6049,6 +7039,62 @@ var tokensMint = (options) => (options.client ?? client).post({
6049
7039
  // src/resources.ts
6050
7040
  var isPublished = (post) => post.status === "published";
6051
7041
  var failedVariants = (post) => post.variants.filter((variant) => variant.status === "failed");
7042
+ var UploadError = class extends Error {
7043
+ status;
7044
+ constructor(status, message) {
7045
+ super(message);
7046
+ this.name = "UploadError";
7047
+ this.status = status;
7048
+ }
7049
+ };
7050
+ function isTerminal(status) {
7051
+ return status >= 400 && status < 500 && status !== 429;
7052
+ }
7053
+ async function uploadToTarget(file, target, opts = {}) {
7054
+ const { onProgress, signal } = opts;
7055
+ async function putOnce() {
7056
+ try {
7057
+ await axios__default.default.request({
7058
+ method: target.method,
7059
+ url: target.url,
7060
+ data: file,
7061
+ headers: target.headers,
7062
+ signal,
7063
+ onUploadProgress: (event) => {
7064
+ if (event.total) {
7065
+ onProgress?.(event.loaded / event.total);
7066
+ }
7067
+ }
7068
+ });
7069
+ onProgress?.(1);
7070
+ } catch (error) {
7071
+ if (signal?.aborted) {
7072
+ throw error;
7073
+ }
7074
+ if (axios.isAxiosError(error)) {
7075
+ const status = error.response?.status ?? 0;
7076
+ throw new UploadError(
7077
+ status,
7078
+ status ? `Upload failed (HTTP ${status}).` : "Upload failed: network error."
7079
+ );
7080
+ }
7081
+ throw error;
7082
+ }
7083
+ }
7084
+ await pRetry__default.default(
7085
+ async () => {
7086
+ try {
7087
+ await putOnce();
7088
+ } catch (error) {
7089
+ if (error instanceof UploadError && isTerminal(error.status)) {
7090
+ throw new pRetry.AbortError(error);
7091
+ }
7092
+ throw error;
7093
+ }
7094
+ },
7095
+ { retries: opts.retries ?? 3, signal }
7096
+ );
7097
+ }
6052
7098
 
6053
7099
  // src/tiktok.ts
6054
7100
  function tiktokPrivacyLabel(value) {
@@ -6410,6 +7456,7 @@ exports.TIKTOK_CAPTION_MAX = TIKTOK_CAPTION_MAX;
6410
7456
  exports.TIKTOK_DISCLOSURE_REQUIRED_HINT = TIKTOK_DISCLOSURE_REQUIRED_HINT;
6411
7457
  exports.TIKTOK_MUSIC_CONFIRMATION_URL = TIKTOK_MUSIC_CONFIRMATION_URL;
6412
7458
  exports.TIKTOK_PROCESSING_NOTICE = TIKTOK_PROCESSING_NOTICE;
7459
+ exports.UploadError = UploadError;
6413
7460
  exports.audiencePrivacyOptions = audiencePrivacyOptions;
6414
7461
  exports.audienceUnselected = audienceUnselected;
6415
7462
  exports.brandedContentDeclared = brandedContentDeclared;
@@ -6511,6 +7558,7 @@ exports.tiktokPrivacyLabel = tiktokPrivacyLabel;
6511
7558
  exports.tiktokSettings = tiktokSettings;
6512
7559
  exports.toggleInteraction = toggleInteraction;
6513
7560
  exports.tokensMint = tokensMint;
7561
+ exports.uploadToTarget = uploadToTarget;
6514
7562
  exports.webhooksCreateEndpoint = webhooksCreateEndpoint;
6515
7563
  exports.webhooksCreatePortal = webhooksCreatePortal;
6516
7564
  exports.webhooksDeleteEndpoint = webhooksDeleteEndpoint;