@rolino/contracts 0.8.0 → 0.9.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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/index.ts
2
2
  import { z } from "zod";
3
3
  var API_VERSION = "v1";
4
- var CONTRACT_VERSION = "0.19.0";
4
+ var CONTRACT_VERSION = "0.20.0";
5
5
  var RequestMetadataSchema = z.object({
6
6
  requestId: z.string().min(1)
7
7
  });
@@ -1048,6 +1048,9 @@ var PostDestinationSchema = z.object({
1048
1048
  scheduledAt: z.string().datetime().nullable(),
1049
1049
  publishedAt: z.string().datetime().nullable(),
1050
1050
  remoteUrl: z.string().url().nullable(),
1051
+ remotePostId: z.string().nullable().optional(),
1052
+ remoteContainerId: z.string().nullable().optional(),
1053
+ studioUrl: z.string().url().nullable().optional(),
1051
1054
  attemptCount: z.number().int().nonnegative()
1052
1055
  });
1053
1056
  var TikTokPostSettingsSchema = z.object({
@@ -1990,6 +1993,61 @@ var BacklinkContactSchema = z.object({
1990
1993
  var BacklinkContactListDataSchema = z.object({ items: z.array(BacklinkContactSchema).max(50), page: z.object({ limit: z.number().int().min(1).max(50), nextCursor: SeoCursorSchema.nullable() }).strict() }).strict();
1991
1994
  var BacklinkContactListQuerySchema = z.object({ limit: z.coerce.number().int().min(1).max(50).default(20), cursor: SeoCursorSchema.optional() }).strict();
1992
1995
  var BacklinkContactListResponseSchema = successEnvelopeSchema(BacklinkContactListDataSchema);
1996
+ var PostDeliveryCheckInputSchema = z.object({ provider: PublishingProviderSchema }).strict();
1997
+ var PostDeliveryCheckResultSchema = z.object({
1998
+ postId: z.string().min(1),
1999
+ provider: PublishingProviderSchema,
2000
+ kind: z.enum(["PUBLISHED", "SCHEDULED", "PROCESSING", "ACTION_REQUIRED", "UNKNOWN", "BUSY"]),
2001
+ message: z.string(),
2002
+ version: z.number().int().positive(),
2003
+ remotePostId: z.string().nullable(),
2004
+ remoteContainerId: z.string().nullable(),
2005
+ studioUrl: z.string().url().nullable()
2006
+ });
2007
+ var PostDeliveryCheckResponseSchema = successEnvelopeSchema(PostDeliveryCheckResultSchema);
2008
+ var PostRecoveryInputSchema = z.object({
2009
+ provider: z.literal("YOUTUBE"),
2010
+ action: z.enum(["ATTACH", "RESUME"]),
2011
+ videoId: z.string().regex(/^[\w-]{11}$/),
2012
+ publishAt: z.string().datetime({ offset: true }).nullable().optional()
2013
+ }).strict().superRefine((input, context) => {
2014
+ if (input.action === "RESUME" && input.publishAt === void 0) {
2015
+ context.addIssue({ code: "custom", path: ["publishAt"], message: "RESUME requires a future time or explicit null to publish now." });
2016
+ }
2017
+ if (input.action === "ATTACH" && input.publishAt !== void 0) {
2018
+ context.addIssue({ code: "custom", path: ["publishAt"], message: "Attachment cannot change publication time." });
2019
+ }
2020
+ });
2021
+ var PostRecoveryExecuteInputSchema = PostRecoveryInputSchema.safeExtend({
2022
+ confirmationToken: z.string().trim().min(1).max(200)
2023
+ });
2024
+ var PostRecoveryPreviewSchema = z.object({
2025
+ operation: z.literal("posts.recovery.execute"),
2026
+ projectId: z.string().min(1),
2027
+ postId: z.string().min(1),
2028
+ provider: z.literal("YOUTUBE"),
2029
+ action: z.enum(["ATTACH", "RESUME"]),
2030
+ videoId: z.string(),
2031
+ publishAt: z.string().datetime({ offset: true }).nullable().optional(),
2032
+ version: z.number().int().positive(),
2033
+ title: z.string(),
2034
+ description: z.string(),
2035
+ channel: z.string().nullable(),
2036
+ accountId: z.string(),
2037
+ privacy: z.string(),
2038
+ consequence: z.string(),
2039
+ confirmation: z.object({ token: z.string().min(1), expiresAt: z.string().datetime() })
2040
+ });
2041
+ var PostRecoveryPreviewResponseSchema = successEnvelopeSchema(PostRecoveryPreviewSchema);
2042
+ var PostRecoveryResultSchema = z.object({
2043
+ postId: z.string().min(1),
2044
+ provider: z.literal("YOUTUBE"),
2045
+ action: z.enum(["ATTACH", "RESUME"]),
2046
+ videoId: z.string(),
2047
+ kind: z.enum(["ATTACHED", "QUEUED", "PUBLISHED"]),
2048
+ version: z.number().int().positive()
2049
+ });
2050
+ var PostRecoveryResponseSchema = successEnvelopeSchema(PostRecoveryResultSchema);
1993
2051
  export {
1994
2052
  AGENT_CAPABILITIES,
1995
2053
  API_VERSION,
@@ -2181,6 +2239,9 @@ export {
2181
2239
  NormalizedMediaCleanupSelectionSchema,
2182
2240
  PUBLISHING_PROVIDER_COUNT,
2183
2241
  PlatformPostStatusSchema,
2242
+ PostDeliveryCheckInputSchema,
2243
+ PostDeliveryCheckResponseSchema,
2244
+ PostDeliveryCheckResultSchema,
2184
2245
  PostDeliveryModeSchema,
2185
2246
  PostDestinationSchema,
2186
2247
  PostDestinationStageSchema,
@@ -2196,6 +2257,12 @@ export {
2196
2257
  PostReadinessCheckSchema,
2197
2258
  PostReadinessResponseSchema,
2198
2259
  PostReadinessSchema,
2260
+ PostRecoveryExecuteInputSchema,
2261
+ PostRecoveryInputSchema,
2262
+ PostRecoveryPreviewResponseSchema,
2263
+ PostRecoveryPreviewSchema,
2264
+ PostRecoveryResponseSchema,
2265
+ PostRecoveryResultSchema,
2199
2266
  PostResponseSchema,
2200
2267
  PostScheduleExecuteInputSchema,
2201
2268
  PostScheduleExecuteResponseSchema,