@rolino/contracts 0.5.0-beta.0 → 0.5.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
@@ -94,6 +94,7 @@ var CapabilityIdSchema = z.enum([
94
94
  "blog:read",
95
95
  "blog:write",
96
96
  "blog:manage",
97
+ "blog:approve",
97
98
  "blog:publish"
98
99
  ]);
99
100
  var AgentBlogPlanSchema = z.object({
@@ -116,6 +117,21 @@ var AgentBlogArticleSchema = z.object({
116
117
  scheduledPublishAt: z.string().datetime().nullable(),
117
118
  updatedAt: z.string().datetime()
118
119
  });
120
+ var AgentBlogImageSchema = z.object({
121
+ id: z.string().min(1),
122
+ revisionId: z.string().nullable(),
123
+ version: z.number().int().positive(),
124
+ purpose: z.enum(["FEATURED", "SECTION", "SOCIAL_PREVIEW"]),
125
+ source: z.enum(["GENERATED", "AGENT_UPLOAD"]),
126
+ state: z.enum(["QUEUED", "GENERATING", "READY_FOR_REVIEW", "APPROVED", "REJECTED", "FAILED"]),
127
+ publicUrl: z.string().url().nullable(),
128
+ mimeType: z.enum(["image/jpeg", "image/png", "image/webp"]).nullable(),
129
+ width: z.number().int().positive().nullable(),
130
+ height: z.number().int().positive().nullable(),
131
+ altText: z.string().nullable(),
132
+ caption: z.string().nullable(),
133
+ createdAt: z.string().datetime()
134
+ }).strict();
119
135
  var AgentBlogArticleDetailSchema = AgentBlogArticleSchema.extend({
120
136
  draft: z.object({
121
137
  id: z.string().min(1),
@@ -132,7 +148,8 @@ var AgentBlogArticleDetailSchema = AgentBlogArticleSchema.extend({
132
148
  callToAction: z.unknown().nullable(),
133
149
  internalLinks: z.unknown()
134
150
  }).nullable(),
135
- revisions: z.array(z.object({ id: z.string().min(1), revisionNumber: z.number().int().positive(), contentHash: z.string().min(1), approvedAt: z.string().datetime().nullable(), createdAt: z.string().datetime() }))
151
+ revisions: z.array(z.object({ id: z.string().min(1), revisionNumber: z.number().int().positive(), contentHash: z.string().min(1), approvedAt: z.string().datetime().nullable(), createdAt: z.string().datetime() })),
152
+ images: z.array(AgentBlogImageSchema)
136
153
  });
137
154
  var AgentBlogJobSchema = z.object({
138
155
  id: z.string().min(1),
@@ -161,13 +178,126 @@ var AgentBlogDraftUpdateSchema = z.object({
161
178
  scheduledPublishAt: z.string().datetime().nullable().optional()
162
179
  });
163
180
  var AgentBlogGenerateRequestSchema = z.object({ idempotencyKey: z.string().trim().min(8).max(200) });
181
+ var AgentBlogImageGenerateRequestSchema = z.object({
182
+ revisionId: z.string().min(1),
183
+ idempotencyKey: z.string().trim().min(8).max(200),
184
+ editorialBrief: z.string().trim().max(500).optional()
185
+ }).strict();
186
+ var AgentBlogImageUploadPrepareRequestSchema = z.object({
187
+ revisionId: z.string().min(1),
188
+ fileName: z.string().trim().min(1).max(255),
189
+ contentType: z.enum(["image/jpeg", "image/png", "image/webp"]),
190
+ fileSize: z.number().int().positive().max(25 * 1024 * 1024)
191
+ }).strict();
192
+ var AgentBlogImageUploadCompleteRequestSchema = AgentBlogImageUploadPrepareRequestSchema.extend({
193
+ storageKey: z.string().min(1).max(1024),
194
+ altText: z.string().trim().min(1).max(300)
195
+ }).strict();
196
+ var AgentBlogImageReviewRequestSchema = z.object({
197
+ expectedVersion: z.number().int().positive(),
198
+ decision: z.enum(["APPROVED", "REJECTED"]),
199
+ altText: z.string().max(300),
200
+ idempotencyKey: z.string().trim().min(8).max(200)
201
+ }).strict();
202
+ var AgentBlogApprovalPreviewRequestSchema = z.object({ revisionId: z.string().min(1) }).strict();
203
+ var AgentBlogApprovalExecuteRequestSchema = AgentBlogApprovalPreviewRequestSchema.extend({
204
+ confirmationToken: z.string().min(1),
205
+ idempotencyKey: z.string().trim().min(8).max(200)
206
+ }).strict();
207
+ var AgentBlogApprovalImageSummarySchema = z.object({
208
+ id: z.string(),
209
+ purpose: z.enum(["FEATURED", "SECTION", "SOCIAL_PREVIEW"]),
210
+ contentPosition: z.string().nullable(),
211
+ width: z.number().int().positive(),
212
+ height: z.number().int().positive(),
213
+ mimeType: z.enum(["image/jpeg", "image/png", "image/webp"]),
214
+ altText: z.string().min(1),
215
+ caption: z.string().nullable(),
216
+ version: z.number().int().positive()
217
+ }).strict();
218
+ var AgentBlogApprovalLinkSummarySchema = z.object({
219
+ pageId: z.string(),
220
+ liveState: z.enum(["LIVE", "REDIRECT"])
221
+ }).strict();
222
+ var AgentBlogApprovalPreviewSchema = z.object({
223
+ articleId: z.string(),
224
+ revisionId: z.string(),
225
+ title: z.string(),
226
+ slug: z.string(),
227
+ revisionNumber: z.number().int().positive(),
228
+ contentHash: z.string(),
229
+ images: z.array(AgentBlogApprovalImageSummarySchema),
230
+ links: z.array(AgentBlogApprovalLinkSummarySchema),
231
+ warnings: z.array(z.string()),
232
+ bundleHash: z.string().regex(/^[a-f0-9]{64}$/),
233
+ confirmation: z.object({ token: z.string(), expiresAt: z.string().datetime() }).strict()
234
+ }).strict();
235
+ var AgentBlogApprovalExecuteSchema = AgentBlogApprovalPreviewSchema.omit({ confirmation: true }).extend({
236
+ approvalSource: z.literal("AGENT"),
237
+ approvedAt: z.string().datetime()
238
+ }).strict();
164
239
  var AgentBlogDestinationSelectionSchema = z.array(z.string().min(1)).min(1).max(20);
240
+ var AgentBlogIanaTimeZoneSchema = z.string().trim().min(1).max(100).refine((timeZone) => {
241
+ try {
242
+ new Intl.DateTimeFormat("en", { timeZone }).format();
243
+ return true;
244
+ } catch {
245
+ return false;
246
+ }
247
+ }, "timezone must be a valid IANA timezone");
248
+ var AgentBlogSchedulePreviewRequestSchema = z.object({
249
+ revisionId: z.string().min(1),
250
+ destinationIds: AgentBlogDestinationSelectionSchema.optional(),
251
+ scheduledAt: z.string().datetime({ offset: true }),
252
+ timezone: AgentBlogIanaTimeZoneSchema
253
+ }).strict();
254
+ var AgentBlogScheduleExecuteRequestSchema = AgentBlogSchedulePreviewRequestSchema.extend({
255
+ confirmationToken: z.string().min(1),
256
+ idempotencyKey: z.string().trim().min(8).max(200)
257
+ }).strict();
258
+ var AgentBlogScheduleCancelPreviewRequestSchema = z.object({}).strict();
259
+ var AgentBlogScheduleCancelExecuteRequestSchema = z.object({
260
+ confirmationToken: z.string().min(1),
261
+ idempotencyKey: z.string().trim().min(8).max(200)
262
+ }).strict();
263
+ var AgentBlogSchedulePreviewSchema = z.object({
264
+ articleId: z.string(),
265
+ revisionId: z.string(),
266
+ contentHash: z.string(),
267
+ approvalBundleHash: z.string().regex(/^[a-f0-9]{64}$/),
268
+ approvalSource: z.enum(["USER", "AGENT"]).nullable(),
269
+ destinationIds: AgentBlogDestinationSelectionSchema,
270
+ scheduledAt: z.string().datetime(),
271
+ timezone: AgentBlogIanaTimeZoneSchema,
272
+ currentScheduleVersion: z.string().datetime(),
273
+ previousScheduledAt: z.string().datetime().nullable(),
274
+ confirmation: z.object({ token: z.string(), expiresAt: z.string().datetime() }).strict()
275
+ }).strict();
276
+ var AgentBlogScheduleExecuteSchema = AgentBlogSchedulePreviewSchema.omit({ confirmation: true }).extend({
277
+ jobId: z.string(),
278
+ scheduleVersion: z.string().datetime(),
279
+ state: z.literal("SCHEDULED")
280
+ }).strict();
281
+ var AgentBlogScheduleCancelPreviewSchema = z.object({
282
+ articleId: z.string(),
283
+ revisionId: z.string(),
284
+ approvalBundleHash: z.string().regex(/^[a-f0-9]{64}$/),
285
+ destinationIds: AgentBlogDestinationSelectionSchema,
286
+ scheduledAt: z.string().datetime(),
287
+ timezone: AgentBlogIanaTimeZoneSchema,
288
+ scheduleVersion: z.string().datetime(),
289
+ confirmation: z.object({ token: z.string(), expiresAt: z.string().datetime() }).strict()
290
+ }).strict();
291
+ var AgentBlogScheduleCancelExecuteSchema = AgentBlogScheduleCancelPreviewSchema.omit({ confirmation: true }).extend({
292
+ state: z.literal("APPROVED"),
293
+ canceledAt: z.string().datetime()
294
+ }).strict();
165
295
  var AgentBlogPublishPreviewRequestSchema = z.object({ revisionId: z.string().min(1), destinationIds: AgentBlogDestinationSelectionSchema.optional() });
166
296
  var AgentBlogPublishExecuteRequestSchema = z.object({ revisionId: z.string().min(1), destinationIds: AgentBlogDestinationSelectionSchema.optional(), confirmationToken: z.string().min(1), idempotencyKey: z.string().trim().min(8).max(200) });
167
297
  var AgentBlogPublishingProviderSchema = z.object({ key: z.string(), name: z.string(), description: z.string(), mode: z.string(), rollout: z.enum(["PREVIEW", "VISIBLE"]), capabilities: z.array(z.string()), authorizationStrategy: z.string(), requiresResourceDiscovery: z.boolean(), requiresFieldMapping: z.boolean(), officialDocumentationUrl: z.string().url() }).strict();
168
298
  var AgentBlogPublishingDestinationSchema = z.object({ id: z.string(), name: z.string(), providerKey: z.string(), mode: z.string(), status: z.string(), isPrimary: z.boolean(), enabled: z.boolean(), externalSiteName: z.string().nullable(), externalSiteUrl: z.string().url().nullable(), lastTestedAt: z.string().datetime().nullable(), lastSucceededAt: z.string().datetime().nullable(), lastErrorCode: z.string().nullable() }).strict();
169
299
  var AgentBlogDeliveryAttemptSchema = z.object({ id: z.string(), articleId: z.string().nullable(), revisionId: z.string().nullable(), destinationId: z.string().nullable(), destinationName: z.string().nullable(), operation: z.string().nullable(), state: z.string(), attemptCount: z.number().int().nonnegative(), errorCode: z.string().nullable(), retryAt: z.string().datetime().nullable(), remoteUrl: z.string().url().nullable(), createdAt: z.string().datetime(), deliveredAt: z.string().datetime().nullable() }).strict();
170
- var AgentBlogPublishPreviewSchema = z.object({ articleId: z.string(), revisionId: z.string(), contentHash: z.string(), title: z.string(), slug: z.string(), publicUrl: z.string().url(), destinations: z.array(AgentBlogPublishingDestinationSchema), confirmation: z.object({ token: z.string(), expiresAt: z.string().datetime() }) });
300
+ var AgentBlogPublishPreviewSchema = z.object({ articleId: z.string(), revisionId: z.string(), contentHash: z.string(), approvalBundleHash: z.string().regex(/^[a-f0-9]{64}$/), approvalSource: z.enum(["USER", "AGENT"]).nullable(), title: z.string(), slug: z.string(), publicUrl: z.string().url(), destinations: z.array(AgentBlogPublishingDestinationSchema), confirmation: z.object({ token: z.string(), expiresAt: z.string().datetime() }) });
171
301
  var AgentBlogReadinessSchema = z.enum([
172
302
  "MISSING",
173
303
  "NOT_STARTED",
@@ -308,8 +438,23 @@ var AgentBlogPlanListResponseSchema = successEnvelopeSchema(z.object({ plans: z.
308
438
  var AgentBlogArticleListResponseSchema = successEnvelopeSchema(z.object({ articles: z.array(AgentBlogArticleSchema) }));
309
439
  var AgentBlogArticleResponseSchema = successEnvelopeSchema(AgentBlogArticleDetailSchema);
310
440
  var AgentBlogJobResponseSchema = successEnvelopeSchema(AgentBlogJobSchema);
441
+ var AgentBlogImageGenerationResponseSchema = successEnvelopeSchema(z.object({ image: AgentBlogImageSchema, job: AgentBlogJobSchema }).strict());
442
+ var AgentBlogImageUploadPreparationResponseSchema = successEnvelopeSchema(z.object({
443
+ uploadUrl: z.string().url(),
444
+ storageKey: z.string(),
445
+ expiresAt: z.string().datetime(),
446
+ headers: z.object({ "Content-Type": z.enum(["image/jpeg", "image/png", "image/webp"]) }).strict(),
447
+ maxFileSize: z.number().int().positive()
448
+ }).strict());
449
+ var AgentBlogImageResponseSchema = successEnvelopeSchema(AgentBlogImageSchema);
450
+ var AgentBlogApprovalPreviewResponseSchema = successEnvelopeSchema(AgentBlogApprovalPreviewSchema);
451
+ var AgentBlogApprovalExecuteResponseSchema = successEnvelopeSchema(AgentBlogApprovalExecuteSchema);
452
+ var AgentBlogSchedulePreviewResponseSchema = successEnvelopeSchema(AgentBlogSchedulePreviewSchema);
453
+ var AgentBlogScheduleExecuteResponseSchema = successEnvelopeSchema(AgentBlogScheduleExecuteSchema);
454
+ var AgentBlogScheduleCancelPreviewResponseSchema = successEnvelopeSchema(AgentBlogScheduleCancelPreviewSchema);
455
+ var AgentBlogScheduleCancelExecuteResponseSchema = successEnvelopeSchema(AgentBlogScheduleCancelExecuteSchema);
311
456
  var AgentBlogPublishPreviewResponseSchema = successEnvelopeSchema(AgentBlogPublishPreviewSchema);
312
- var AgentBlogPublishExecuteResponseSchema = successEnvelopeSchema(z.object({ publicationId: z.string(), articleId: z.string(), revisionId: z.string(), publicUrl: z.string().url(), publishedAt: z.string().datetime() }));
457
+ var AgentBlogPublishExecuteResponseSchema = successEnvelopeSchema(z.object({ publicationId: z.string(), articleId: z.string(), revisionId: z.string(), approvalBundleHash: z.string().regex(/^[a-f0-9]{64}$/), approvalSource: z.enum(["USER", "AGENT"]).nullable(), publicUrl: z.string().url(), publishedAt: z.string().datetime() }));
313
458
  var AgentBlogPublishingProviderListResponseSchema = successEnvelopeSchema(z.object({ providers: z.array(AgentBlogPublishingProviderSchema) }).strict());
314
459
  var AgentBlogPublishingDestinationListResponseSchema = successEnvelopeSchema(z.object({ destinations: z.array(AgentBlogPublishingDestinationSchema) }).strict());
315
460
  var AgentBlogDeliveryAttemptListResponseSchema = successEnvelopeSchema(z.object({ deliveries: z.array(AgentBlogDeliveryAttemptSchema) }).strict());
@@ -1417,6 +1562,14 @@ var SeoReportResponseSchema = successEnvelopeSchema(SeoReportSchema);
1417
1562
  export {
1418
1563
  API_VERSION,
1419
1564
  ActorSchema,
1565
+ AgentBlogApprovalExecuteRequestSchema,
1566
+ AgentBlogApprovalExecuteResponseSchema,
1567
+ AgentBlogApprovalExecuteSchema,
1568
+ AgentBlogApprovalImageSummarySchema,
1569
+ AgentBlogApprovalLinkSummarySchema,
1570
+ AgentBlogApprovalPreviewRequestSchema,
1571
+ AgentBlogApprovalPreviewResponseSchema,
1572
+ AgentBlogApprovalPreviewSchema,
1420
1573
  AgentBlogArticleCreateRequestSchema,
1421
1574
  AgentBlogArticleDetailSchema,
1422
1575
  AgentBlogArticleListResponseSchema,
@@ -1439,6 +1592,14 @@ export {
1439
1592
  AgentBlogDraftUpdateSchema,
1440
1593
  AgentBlogGenerateRequestSchema,
1441
1594
  AgentBlogIdempotentRequestSchema,
1595
+ AgentBlogImageGenerateRequestSchema,
1596
+ AgentBlogImageGenerationResponseSchema,
1597
+ AgentBlogImageResponseSchema,
1598
+ AgentBlogImageReviewRequestSchema,
1599
+ AgentBlogImageSchema,
1600
+ AgentBlogImageUploadCompleteRequestSchema,
1601
+ AgentBlogImageUploadPreparationResponseSchema,
1602
+ AgentBlogImageUploadPrepareRequestSchema,
1442
1603
  AgentBlogJobResponseSchema,
1443
1604
  AgentBlogJobSchema,
1444
1605
  AgentBlogPlanCreateRequestSchema,
@@ -1462,6 +1623,18 @@ export {
1462
1623
  AgentBlogRevalidationTestRequestSchema,
1463
1624
  AgentBlogRevalidationTestResponseSchema,
1464
1625
  AgentBlogRevalidationTestSchema,
1626
+ AgentBlogScheduleCancelExecuteRequestSchema,
1627
+ AgentBlogScheduleCancelExecuteResponseSchema,
1628
+ AgentBlogScheduleCancelExecuteSchema,
1629
+ AgentBlogScheduleCancelPreviewRequestSchema,
1630
+ AgentBlogScheduleCancelPreviewResponseSchema,
1631
+ AgentBlogScheduleCancelPreviewSchema,
1632
+ AgentBlogScheduleExecuteRequestSchema,
1633
+ AgentBlogScheduleExecuteResponseSchema,
1634
+ AgentBlogScheduleExecuteSchema,
1635
+ AgentBlogSchedulePreviewRequestSchema,
1636
+ AgentBlogSchedulePreviewResponseSchema,
1637
+ AgentBlogSchedulePreviewSchema,
1465
1638
  AgentBlogSetupStatusResponseSchema,
1466
1639
  AgentBlogSetupStatusSchema,
1467
1640
  ApiErrorCodeSchema,