@pixerate/schemas 1.2.0 → 1.3.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
@@ -267,6 +267,215 @@ var QueueJobSchema = z.object({
267
267
  createdAt: z.any().optional(),
268
268
  updatedAt: z.any().optional()
269
269
  });
270
+ var ConditionOperatorSchema = z.enum([
271
+ "equals",
272
+ "notEquals",
273
+ "not_equals",
274
+ "includes",
275
+ "contains",
276
+ "greaterThan",
277
+ "greater_than",
278
+ "lessThan",
279
+ "less_than",
280
+ "exists"
281
+ ]);
282
+ var ConditionSchema = z.object({
283
+ field: z.string().optional(),
284
+ fieldId: z.string().optional(),
285
+ operator: ConditionOperatorSchema,
286
+ value: z.union([z.string(), z.number(), z.boolean()]).optional()
287
+ });
288
+ var ControlValidationSchema = z.object({
289
+ min: z.number().optional(),
290
+ max: z.number().optional(),
291
+ minLength: z.number().optional(),
292
+ maxLength: z.number().optional(),
293
+ pattern: z.string().optional(),
294
+ message: z.string().optional(),
295
+ unit: z.string().optional()
296
+ });
297
+ var FormOptionSchema = z.object({
298
+ label: z.string(),
299
+ value: z.string()
300
+ });
301
+ var ReferenceDataSourceSchema = z.enum(["companies", "users"]);
302
+ var FormControlTypeSchema = z.enum([
303
+ "text",
304
+ "textarea",
305
+ "number",
306
+ "select",
307
+ "multiselect",
308
+ "radio",
309
+ "checkbox",
310
+ "date",
311
+ "file",
312
+ "company",
313
+ "user",
314
+ "slider",
315
+ "computed",
316
+ "repeater"
317
+ ]);
318
+ var FormControlSchema = z.lazy(
319
+ () => z.object({
320
+ id: z.string(),
321
+ type: FormControlTypeSchema,
322
+ label: z.string(),
323
+ description: z.string().optional(),
324
+ helperText: z.string().optional(),
325
+ placeholder: z.string().optional(),
326
+ required: z.boolean().optional(),
327
+ defaultValue: z.any().optional(),
328
+ options: z.array(FormOptionSchema).optional(),
329
+ dataSource: ReferenceDataSourceSchema.optional(),
330
+ validation: ControlValidationSchema.optional(),
331
+ pattern: z.string().optional(),
332
+ min: z.number().optional(),
333
+ max: z.number().optional(),
334
+ step: z.number().optional(),
335
+ minItems: z.number().optional(),
336
+ maxItems: z.number().optional(),
337
+ formula: z.string().optional(),
338
+ computed: z.object({ formula: z.string().optional() }).optional(),
339
+ visibleWhen: ConditionSchema.optional(),
340
+ condition: ConditionSchema.optional(),
341
+ itemControls: z.array(FormControlSchema).optional(),
342
+ controls: z.array(FormControlSchema).optional()
343
+ })
344
+ );
345
+ var FormSectionSchema = z.object({
346
+ id: z.string(),
347
+ title: z.string(),
348
+ description: z.string().optional(),
349
+ controls: z.array(FormControlSchema),
350
+ visibleWhen: ConditionSchema.optional(),
351
+ condition: ConditionSchema.optional()
352
+ });
353
+ var FormStageSchema = z.object({
354
+ id: z.string(),
355
+ title: z.string(),
356
+ description: z.string().optional(),
357
+ sections: z.array(FormSectionSchema),
358
+ gate: z.string().optional()
359
+ });
360
+ var DecisionGateKindSchema = z.enum(["approval", "review", "decision"]);
361
+ var DecisionGateSchema = z.object({
362
+ id: z.string(),
363
+ title: z.string(),
364
+ description: z.string().optional(),
365
+ stageId: z.string(),
366
+ kind: DecisionGateKindSchema.optional(),
367
+ trigger: z.string().optional(),
368
+ requiredAction: z.string().optional(),
369
+ consequence: z.string().optional(),
370
+ condition: z.union([ConditionSchema, z.string()]).optional(),
371
+ blocking: z.boolean(),
372
+ reviewerRole: z.string().optional()
373
+ });
374
+ var ScoringRuleSchema = z.object({
375
+ field: z.string(),
376
+ optionPoints: z.record(z.number()).optional(),
377
+ ranges: z.array(
378
+ z.object({
379
+ min: z.number().optional(),
380
+ max: z.number().optional(),
381
+ points: z.number()
382
+ })
383
+ ).optional(),
384
+ multiplier: z.number().optional(),
385
+ truePoints: z.number().optional(),
386
+ falsePoints: z.number().optional()
387
+ });
388
+ var ScoringDimensionSchema = z.object({
389
+ id: z.string(),
390
+ label: z.string(),
391
+ description: z.string().optional(),
392
+ weight: z.number().optional(),
393
+ rules: z.array(ScoringRuleSchema)
394
+ });
395
+ var ScoreBandSchema = z.object({
396
+ id: z.string(),
397
+ label: z.string(),
398
+ min: z.number(),
399
+ max: z.number().optional()
400
+ });
401
+ var ScoringConfigSchema = z.object({
402
+ description: z.string().optional(),
403
+ dimensions: z.array(ScoringDimensionSchema),
404
+ bands: z.array(ScoreBandSchema).optional()
405
+ });
406
+ var DimensionScoreSchema = z.object({
407
+ dimensionId: z.string(),
408
+ label: z.string(),
409
+ points: z.number(),
410
+ weight: z.number(),
411
+ weighted: z.number()
412
+ });
413
+ var SubmissionScoreSchema = z.object({
414
+ total: z.number(),
415
+ dimensions: z.array(DimensionScoreSchema),
416
+ band: z.object({ id: z.string(), label: z.string() }).optional(),
417
+ calculatedAt: z.string(),
418
+ schemaVersion: z.union([z.string(), z.number()])
419
+ });
420
+ var FormValidatorSchema = z.object({
421
+ id: z.string(),
422
+ description: z.string().optional(),
423
+ fields: z.array(z.string()).optional(),
424
+ severity: z.union([z.enum(["error", "warning"]), z.string()]).optional(),
425
+ type: z.string().optional(),
426
+ config: z.any().optional()
427
+ });
428
+ var FormHandoffActionSchema = z.object({
429
+ id: z.string().optional(),
430
+ label: z.string().optional(),
431
+ destination: z.string().optional(),
432
+ condition: z.union([ConditionSchema, z.string()]).optional(),
433
+ payloadFields: z.array(z.string()).optional(),
434
+ type: z.string().optional(),
435
+ config: z.any().optional()
436
+ });
437
+ var FormReviewMetaSchema = z.object({
438
+ humanReviewRequired: z.boolean(),
439
+ reviewAreas: z.array(z.string())
440
+ });
441
+ var TechnicalFormSchema = z.object({
442
+ id: z.string().optional(),
443
+ title: z.string().optional(),
444
+ description: z.string().optional(),
445
+ version: z.union([z.string(), z.number()]),
446
+ stages: z.array(FormStageSchema),
447
+ decisionGates: z.array(DecisionGateSchema).optional(),
448
+ validators: z.array(FormValidatorSchema).optional(),
449
+ handoffActions: z.array(FormHandoffActionSchema).optional(),
450
+ review: FormReviewMetaSchema.optional(),
451
+ reviewMetadata: z.object({
452
+ approvers: z.array(z.string()),
453
+ requirements: z.array(z.string())
454
+ }).optional(),
455
+ scoring: ScoringConfigSchema.optional()
456
+ });
457
+ var SemanticReviewStatusSchema = z.enum(["pass", "flagged", "unavailable"]);
458
+ var SemanticReviewIssueSchema = z.object({
459
+ id: z.string(),
460
+ severity: z.enum(["warning", "error"]),
461
+ message: z.string(),
462
+ fieldId: z.string().optional(),
463
+ fieldLabel: z.string().optional(),
464
+ suggestion: z.string().optional()
465
+ });
466
+ var SemanticReviewResultSchema = z.object({
467
+ status: SemanticReviewStatusSchema,
468
+ summary: z.string().optional(),
469
+ issues: z.array(SemanticReviewIssueSchema)
470
+ });
471
+ var FormSubmissionPayloadSchema = z.object({
472
+ id: z.string().optional(),
473
+ answers: z.record(z.any()),
474
+ stageReviews: z.array(z.any()).optional(),
475
+ gateDecisions: z.array(z.any()).optional(),
476
+ submittedAt: z.string().optional(),
477
+ score: SubmissionScoreSchema.optional()
478
+ });
270
479
  export {
271
480
  AgentConfigSchema,
272
481
  AgentDocumentAttachmentSchema,
@@ -282,8 +491,23 @@ export {
282
491
  CodeGenerationSchema,
283
492
  ComponentPropDefinitionSchema,
284
493
  ComponentSynthesisSchema,
494
+ ConditionOperatorSchema,
495
+ ConditionSchema,
496
+ ControlValidationSchema,
497
+ DecisionGateKindSchema,
498
+ DecisionGateSchema,
499
+ DimensionScoreSchema,
285
500
  DropShadowSchema,
286
501
  FidelitySchema,
502
+ FormControlSchema,
503
+ FormControlTypeSchema,
504
+ FormHandoffActionSchema,
505
+ FormOptionSchema,
506
+ FormReviewMetaSchema,
507
+ FormSectionSchema,
508
+ FormStageSchema,
509
+ FormSubmissionPayloadSchema,
510
+ FormValidatorSchema,
287
511
  ImageCompositingSchema,
288
512
  ImageGenerationSchema,
289
513
  ImageTextOverlaySchema,
@@ -293,8 +517,18 @@ export {
293
517
  QueueJobSchema,
294
518
  QueueJobStatusSchema,
295
519
  QueueJobTypeSchema,
520
+ ReferenceDataSourceSchema,
521
+ ScoreBandSchema,
522
+ ScoringConfigSchema,
523
+ ScoringDimensionSchema,
524
+ ScoringRuleSchema,
525
+ SemanticReviewIssueSchema,
526
+ SemanticReviewResultSchema,
527
+ SemanticReviewStatusSchema,
296
528
  ServiceClientSchema,
297
529
  SocialVideoGenerationSchema,
530
+ SubmissionScoreSchema,
531
+ TechnicalFormSchema,
298
532
  TextAlignmentSchema,
299
533
  TextOverlayPositionSchema,
300
534
  VideoAnalysisCategorySchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/schemas",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",