skedyul 0.1.39 → 0.1.41
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/.build-stamp +1 -1
- package/dist/config.d.ts +114 -0
- package/dist/schemas.d.ts +209 -4
- package/dist/schemas.js +100 -3
- package/package.json +1 -1
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1768542541896
|
package/dist/config.d.ts
CHANGED
|
@@ -242,6 +242,60 @@ export interface ModelDefinition {
|
|
|
242
242
|
/** Model-level dependencies - other models this model requires to be provisioned */
|
|
243
243
|
requires?: ResourceDependency[];
|
|
244
244
|
}
|
|
245
|
+
/** Relationship cardinality */
|
|
246
|
+
export type RelationshipCardinality = 'ONE_TO_ONE' | 'ONE_TO_MANY' | 'MANY_TO_ONE' | 'MANY_TO_MANY';
|
|
247
|
+
/** On-delete behavior for relationships */
|
|
248
|
+
export type OnDeleteBehavior = 'NONE' | 'CASCADE' | 'RESTRICT';
|
|
249
|
+
/** One side of a relationship */
|
|
250
|
+
export interface RelationshipLink {
|
|
251
|
+
/** Model handle for this side */
|
|
252
|
+
model: string;
|
|
253
|
+
/** Field handle on this model */
|
|
254
|
+
field: string;
|
|
255
|
+
/** Field label for display */
|
|
256
|
+
label: string;
|
|
257
|
+
/** Cardinality from this side */
|
|
258
|
+
cardinality: RelationshipCardinality;
|
|
259
|
+
/** On-delete behavior */
|
|
260
|
+
onDelete?: OnDeleteBehavior;
|
|
261
|
+
}
|
|
262
|
+
/** Bidirectional relationship definition between two models */
|
|
263
|
+
export interface RelationshipDefinition {
|
|
264
|
+
/** Source side of the relationship */
|
|
265
|
+
source: RelationshipLink;
|
|
266
|
+
/** Target side of the relationship */
|
|
267
|
+
target: RelationshipLink;
|
|
268
|
+
}
|
|
269
|
+
/** Page type: INSTANCE shows single record, LIST shows multiple records */
|
|
270
|
+
export type PageType = 'INSTANCE' | 'LIST';
|
|
271
|
+
/** Block types available for pages */
|
|
272
|
+
export type PageBlockType = 'form' | 'spreadsheet' | 'kanban' | 'calendar' | 'link';
|
|
273
|
+
/** Block definition within a page */
|
|
274
|
+
export interface PageBlockDefinition {
|
|
275
|
+
/** Block type determines the UI component */
|
|
276
|
+
type: PageBlockType;
|
|
277
|
+
/** Block title displayed in UI */
|
|
278
|
+
title?: string;
|
|
279
|
+
/** Field handles to include in this block */
|
|
280
|
+
fields?: string[];
|
|
281
|
+
/** Whether the block is read-only (no editing) */
|
|
282
|
+
readonly?: boolean;
|
|
283
|
+
}
|
|
284
|
+
/** Page definition for internal model display */
|
|
285
|
+
export interface PageDefinition {
|
|
286
|
+
/** Unique handle for the page */
|
|
287
|
+
handle: string;
|
|
288
|
+
/** Model handle this page displays */
|
|
289
|
+
model: string;
|
|
290
|
+
/** Page type: INSTANCE (single record) or LIST (multiple records) */
|
|
291
|
+
type: PageType;
|
|
292
|
+
/** Page title displayed in UI */
|
|
293
|
+
title: string;
|
|
294
|
+
/** Optional custom path for navigation */
|
|
295
|
+
path?: string;
|
|
296
|
+
/** Blocks that compose this page */
|
|
297
|
+
blocks: PageBlockDefinition[];
|
|
298
|
+
}
|
|
245
299
|
export type ChannelIdentifierType = 'DEDICATED_PHONE' | 'TEXT' | 'EMAIL';
|
|
246
300
|
export interface ChannelIdentifierValue {
|
|
247
301
|
/** Type of identifier */
|
|
@@ -450,6 +504,64 @@ export interface SkedyulConfig {
|
|
|
450
504
|
* ```
|
|
451
505
|
*/
|
|
452
506
|
models?: ModelDefinition[];
|
|
507
|
+
/**
|
|
508
|
+
* Relationships between models.
|
|
509
|
+
* Defines bidirectional links between INTERNAL models.
|
|
510
|
+
* Creates relationship fields on both sides automatically.
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* ```typescript
|
|
514
|
+
* relationships: [
|
|
515
|
+
* {
|
|
516
|
+
* source: {
|
|
517
|
+
* model: 'phone_number',
|
|
518
|
+
* field: 'compliance_record',
|
|
519
|
+
* label: 'Compliance Record',
|
|
520
|
+
* cardinality: 'MANY_TO_ONE',
|
|
521
|
+
* onDelete: 'RESTRICT',
|
|
522
|
+
* },
|
|
523
|
+
* target: {
|
|
524
|
+
* model: 'compliance_record',
|
|
525
|
+
* field: 'phone_numbers',
|
|
526
|
+
* label: 'Phone Numbers',
|
|
527
|
+
* cardinality: 'ONE_TO_MANY',
|
|
528
|
+
* onDelete: 'NONE',
|
|
529
|
+
* },
|
|
530
|
+
* },
|
|
531
|
+
* ]
|
|
532
|
+
* ```
|
|
533
|
+
*/
|
|
534
|
+
relationships?: RelationshipDefinition[];
|
|
535
|
+
/**
|
|
536
|
+
* Pages for internal models.
|
|
537
|
+
* Defines how internal models are displayed in the post-install UI.
|
|
538
|
+
* Each page references a model by handle and can have multiple pages per model.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```typescript
|
|
542
|
+
* pages: [
|
|
543
|
+
* {
|
|
544
|
+
* handle: 'compliance_submission',
|
|
545
|
+
* model: 'compliance_record',
|
|
546
|
+
* type: 'INSTANCE',
|
|
547
|
+
* title: 'Submit Compliance Record',
|
|
548
|
+
* blocks: [
|
|
549
|
+
* { type: 'form', title: 'Business Registration', fields: ['file'] },
|
|
550
|
+
* ],
|
|
551
|
+
* },
|
|
552
|
+
* {
|
|
553
|
+
* handle: 'phone_numbers_list',
|
|
554
|
+
* model: 'phone_number',
|
|
555
|
+
* type: 'LIST',
|
|
556
|
+
* title: 'Phone Numbers',
|
|
557
|
+
* blocks: [
|
|
558
|
+
* { type: 'spreadsheet', fields: ['phone', 'forwarding_phone_number'] },
|
|
559
|
+
* ],
|
|
560
|
+
* },
|
|
561
|
+
* ]
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
pages?: PageDefinition[];
|
|
453
565
|
/**
|
|
454
566
|
* Communication channels this app provides (new syntax).
|
|
455
567
|
* Uses typed `requires` for dependencies.
|
|
@@ -504,6 +616,8 @@ export interface SerializableSkedyulConfig {
|
|
|
504
616
|
postInstall?: PostInstallConfig;
|
|
505
617
|
/** Unified model definitions (INTERNAL + SHARED) */
|
|
506
618
|
models?: ModelDefinition[];
|
|
619
|
+
/** Pages for internal model display */
|
|
620
|
+
pages?: PageDefinition[];
|
|
507
621
|
/** Communication channels (new syntax) */
|
|
508
622
|
channels?: ChannelDefinition[];
|
|
509
623
|
/** Communication channels (legacy) @deprecated */
|
package/dist/schemas.d.ts
CHANGED
|
@@ -361,6 +361,143 @@ export declare const FieldOptionSchema: z.ZodObject<{
|
|
|
361
361
|
value: z.ZodString;
|
|
362
362
|
color: z.ZodOptional<z.ZodString>;
|
|
363
363
|
}, z.core.$strip>;
|
|
364
|
+
/**
|
|
365
|
+
* Schema for relationship cardinality.
|
|
366
|
+
* Defines how many records can be linked on each side.
|
|
367
|
+
*/
|
|
368
|
+
export declare const RelationshipCardinalitySchema: z.ZodEnum<{
|
|
369
|
+
ONE_TO_ONE: "ONE_TO_ONE";
|
|
370
|
+
ONE_TO_MANY: "ONE_TO_MANY";
|
|
371
|
+
MANY_TO_ONE: "MANY_TO_ONE";
|
|
372
|
+
MANY_TO_MANY: "MANY_TO_MANY";
|
|
373
|
+
}>;
|
|
374
|
+
/**
|
|
375
|
+
* Schema for on-delete behavior in relationships.
|
|
376
|
+
*/
|
|
377
|
+
export declare const OnDeleteBehaviorSchema: z.ZodEnum<{
|
|
378
|
+
NONE: "NONE";
|
|
379
|
+
CASCADE: "CASCADE";
|
|
380
|
+
RESTRICT: "RESTRICT";
|
|
381
|
+
}>;
|
|
382
|
+
/**
|
|
383
|
+
* Schema for a relationship link (one side of a relationship).
|
|
384
|
+
*/
|
|
385
|
+
export declare const RelationshipLinkSchema: z.ZodObject<{
|
|
386
|
+
model: z.ZodString;
|
|
387
|
+
field: z.ZodString;
|
|
388
|
+
label: z.ZodString;
|
|
389
|
+
cardinality: z.ZodEnum<{
|
|
390
|
+
ONE_TO_ONE: "ONE_TO_ONE";
|
|
391
|
+
ONE_TO_MANY: "ONE_TO_MANY";
|
|
392
|
+
MANY_TO_ONE: "MANY_TO_ONE";
|
|
393
|
+
MANY_TO_MANY: "MANY_TO_MANY";
|
|
394
|
+
}>;
|
|
395
|
+
onDelete: z.ZodDefault<z.ZodEnum<{
|
|
396
|
+
NONE: "NONE";
|
|
397
|
+
CASCADE: "CASCADE";
|
|
398
|
+
RESTRICT: "RESTRICT";
|
|
399
|
+
}>>;
|
|
400
|
+
}, z.core.$strip>;
|
|
401
|
+
/**
|
|
402
|
+
* Schema for a relationship definition.
|
|
403
|
+
* Relationships are bidirectional - they define links from both sides.
|
|
404
|
+
*/
|
|
405
|
+
export declare const RelationshipDefinitionSchema: z.ZodObject<{
|
|
406
|
+
source: z.ZodObject<{
|
|
407
|
+
model: z.ZodString;
|
|
408
|
+
field: z.ZodString;
|
|
409
|
+
label: z.ZodString;
|
|
410
|
+
cardinality: z.ZodEnum<{
|
|
411
|
+
ONE_TO_ONE: "ONE_TO_ONE";
|
|
412
|
+
ONE_TO_MANY: "ONE_TO_MANY";
|
|
413
|
+
MANY_TO_ONE: "MANY_TO_ONE";
|
|
414
|
+
MANY_TO_MANY: "MANY_TO_MANY";
|
|
415
|
+
}>;
|
|
416
|
+
onDelete: z.ZodDefault<z.ZodEnum<{
|
|
417
|
+
NONE: "NONE";
|
|
418
|
+
CASCADE: "CASCADE";
|
|
419
|
+
RESTRICT: "RESTRICT";
|
|
420
|
+
}>>;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
target: z.ZodObject<{
|
|
423
|
+
model: z.ZodString;
|
|
424
|
+
field: z.ZodString;
|
|
425
|
+
label: z.ZodString;
|
|
426
|
+
cardinality: z.ZodEnum<{
|
|
427
|
+
ONE_TO_ONE: "ONE_TO_ONE";
|
|
428
|
+
ONE_TO_MANY: "ONE_TO_MANY";
|
|
429
|
+
MANY_TO_ONE: "MANY_TO_ONE";
|
|
430
|
+
MANY_TO_MANY: "MANY_TO_MANY";
|
|
431
|
+
}>;
|
|
432
|
+
onDelete: z.ZodDefault<z.ZodEnum<{
|
|
433
|
+
NONE: "NONE";
|
|
434
|
+
CASCADE: "CASCADE";
|
|
435
|
+
RESTRICT: "RESTRICT";
|
|
436
|
+
}>>;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
/**
|
|
440
|
+
* Schema for page type.
|
|
441
|
+
* INSTANCE: Shows a single record (form-like)
|
|
442
|
+
* LIST: Shows multiple records (spreadsheet/table)
|
|
443
|
+
*/
|
|
444
|
+
export declare const PageTypeSchema: z.ZodEnum<{
|
|
445
|
+
INSTANCE: "INSTANCE";
|
|
446
|
+
LIST: "LIST";
|
|
447
|
+
}>;
|
|
448
|
+
/**
|
|
449
|
+
* Schema for block type in a page.
|
|
450
|
+
* Matches existing block types in the system.
|
|
451
|
+
*/
|
|
452
|
+
export declare const PageBlockTypeSchema: z.ZodEnum<{
|
|
453
|
+
form: "form";
|
|
454
|
+
spreadsheet: "spreadsheet";
|
|
455
|
+
kanban: "kanban";
|
|
456
|
+
calendar: "calendar";
|
|
457
|
+
link: "link";
|
|
458
|
+
}>;
|
|
459
|
+
/**
|
|
460
|
+
* Schema for a block definition within a page.
|
|
461
|
+
* Blocks define the UI components that render model data.
|
|
462
|
+
*/
|
|
463
|
+
export declare const PageBlockDefinitionSchema: z.ZodObject<{
|
|
464
|
+
type: z.ZodEnum<{
|
|
465
|
+
form: "form";
|
|
466
|
+
spreadsheet: "spreadsheet";
|
|
467
|
+
kanban: "kanban";
|
|
468
|
+
calendar: "calendar";
|
|
469
|
+
link: "link";
|
|
470
|
+
}>;
|
|
471
|
+
title: z.ZodOptional<z.ZodString>;
|
|
472
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
473
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
474
|
+
}, z.core.$strip>;
|
|
475
|
+
/**
|
|
476
|
+
* Schema for a page definition.
|
|
477
|
+
* Pages define how internal models are displayed in the post-install UI.
|
|
478
|
+
*/
|
|
479
|
+
export declare const PageDefinitionSchema: z.ZodObject<{
|
|
480
|
+
handle: z.ZodString;
|
|
481
|
+
model: z.ZodString;
|
|
482
|
+
type: z.ZodEnum<{
|
|
483
|
+
INSTANCE: "INSTANCE";
|
|
484
|
+
LIST: "LIST";
|
|
485
|
+
}>;
|
|
486
|
+
title: z.ZodString;
|
|
487
|
+
path: z.ZodOptional<z.ZodString>;
|
|
488
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
489
|
+
type: z.ZodEnum<{
|
|
490
|
+
form: "form";
|
|
491
|
+
spreadsheet: "spreadsheet";
|
|
492
|
+
kanban: "kanban";
|
|
493
|
+
calendar: "calendar";
|
|
494
|
+
link: "link";
|
|
495
|
+
}>;
|
|
496
|
+
title: z.ZodOptional<z.ZodString>;
|
|
497
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
498
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
499
|
+
}, z.core.$strip>>;
|
|
500
|
+
}, z.core.$strip>;
|
|
364
501
|
/**
|
|
365
502
|
* Schema for inline field definition (constraints, options, etc.)
|
|
366
503
|
* This allows defining field behavior without referencing a metafield definition.
|
|
@@ -376,7 +513,6 @@ export declare const InlineFieldDefinitionSchema: z.ZodObject<{
|
|
|
376
513
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
377
514
|
min: z.ZodOptional<z.ZodNumber>;
|
|
378
515
|
max: z.ZodOptional<z.ZodNumber>;
|
|
379
|
-
relatedModel: z.ZodOptional<z.ZodString>;
|
|
380
516
|
pattern: z.ZodOptional<z.ZodString>;
|
|
381
517
|
}, z.core.$strip>;
|
|
382
518
|
/**
|
|
@@ -411,7 +547,6 @@ export declare const ModelFieldDefinitionSchema: z.ZodObject<{
|
|
|
411
547
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
412
548
|
min: z.ZodOptional<z.ZodNumber>;
|
|
413
549
|
max: z.ZodOptional<z.ZodNumber>;
|
|
414
|
-
relatedModel: z.ZodOptional<z.ZodString>;
|
|
415
550
|
pattern: z.ZodOptional<z.ZodString>;
|
|
416
551
|
}, z.core.$strip>>;
|
|
417
552
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -475,7 +610,6 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
|
|
|
475
610
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
476
611
|
min: z.ZodOptional<z.ZodNumber>;
|
|
477
612
|
max: z.ZodOptional<z.ZodNumber>;
|
|
478
|
-
relatedModel: z.ZodOptional<z.ZodString>;
|
|
479
613
|
pattern: z.ZodOptional<z.ZodString>;
|
|
480
614
|
}, z.core.$strip>>;
|
|
481
615
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -700,7 +834,6 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
|
|
|
700
834
|
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
701
835
|
min: z.ZodOptional<z.ZodNumber>;
|
|
702
836
|
max: z.ZodOptional<z.ZodNumber>;
|
|
703
|
-
relatedModel: z.ZodOptional<z.ZodString>;
|
|
704
837
|
pattern: z.ZodOptional<z.ZodString>;
|
|
705
838
|
}, z.core.$strip>>;
|
|
706
839
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -732,6 +865,62 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
|
|
|
732
865
|
workflow: z.ZodString;
|
|
733
866
|
}, z.core.$strip>]>>>;
|
|
734
867
|
}, z.core.$strip>>>;
|
|
868
|
+
relationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
869
|
+
source: z.ZodObject<{
|
|
870
|
+
model: z.ZodString;
|
|
871
|
+
field: z.ZodString;
|
|
872
|
+
label: z.ZodString;
|
|
873
|
+
cardinality: z.ZodEnum<{
|
|
874
|
+
ONE_TO_ONE: "ONE_TO_ONE";
|
|
875
|
+
ONE_TO_MANY: "ONE_TO_MANY";
|
|
876
|
+
MANY_TO_ONE: "MANY_TO_ONE";
|
|
877
|
+
MANY_TO_MANY: "MANY_TO_MANY";
|
|
878
|
+
}>;
|
|
879
|
+
onDelete: z.ZodDefault<z.ZodEnum<{
|
|
880
|
+
NONE: "NONE";
|
|
881
|
+
CASCADE: "CASCADE";
|
|
882
|
+
RESTRICT: "RESTRICT";
|
|
883
|
+
}>>;
|
|
884
|
+
}, z.core.$strip>;
|
|
885
|
+
target: z.ZodObject<{
|
|
886
|
+
model: z.ZodString;
|
|
887
|
+
field: z.ZodString;
|
|
888
|
+
label: z.ZodString;
|
|
889
|
+
cardinality: z.ZodEnum<{
|
|
890
|
+
ONE_TO_ONE: "ONE_TO_ONE";
|
|
891
|
+
ONE_TO_MANY: "ONE_TO_MANY";
|
|
892
|
+
MANY_TO_ONE: "MANY_TO_ONE";
|
|
893
|
+
MANY_TO_MANY: "MANY_TO_MANY";
|
|
894
|
+
}>;
|
|
895
|
+
onDelete: z.ZodDefault<z.ZodEnum<{
|
|
896
|
+
NONE: "NONE";
|
|
897
|
+
CASCADE: "CASCADE";
|
|
898
|
+
RESTRICT: "RESTRICT";
|
|
899
|
+
}>>;
|
|
900
|
+
}, z.core.$strip>;
|
|
901
|
+
}, z.core.$strip>>>;
|
|
902
|
+
pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
903
|
+
handle: z.ZodString;
|
|
904
|
+
model: z.ZodString;
|
|
905
|
+
type: z.ZodEnum<{
|
|
906
|
+
INSTANCE: "INSTANCE";
|
|
907
|
+
LIST: "LIST";
|
|
908
|
+
}>;
|
|
909
|
+
title: z.ZodString;
|
|
910
|
+
path: z.ZodOptional<z.ZodString>;
|
|
911
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
912
|
+
type: z.ZodEnum<{
|
|
913
|
+
form: "form";
|
|
914
|
+
spreadsheet: "spreadsheet";
|
|
915
|
+
kanban: "kanban";
|
|
916
|
+
calendar: "calendar";
|
|
917
|
+
link: "link";
|
|
918
|
+
}>;
|
|
919
|
+
title: z.ZodOptional<z.ZodString>;
|
|
920
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
921
|
+
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
922
|
+
}, z.core.$strip>>;
|
|
923
|
+
}, z.core.$strip>>>;
|
|
735
924
|
channels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
736
925
|
handle: z.ZodString;
|
|
737
926
|
name: z.ZodString;
|
|
@@ -900,6 +1089,22 @@ export type StructuredFilter = z.infer<typeof StructuredFilterSchema>;
|
|
|
900
1089
|
export type FieldOption = z.infer<typeof FieldOptionSchema>;
|
|
901
1090
|
/** Inline field definition (constraints, options, etc.) */
|
|
902
1091
|
export type InlineFieldDefinition = z.infer<typeof InlineFieldDefinitionSchema>;
|
|
1092
|
+
/** Relationship cardinality type */
|
|
1093
|
+
export type RelationshipCardinality = z.infer<typeof RelationshipCardinalitySchema>;
|
|
1094
|
+
/** On-delete behavior type */
|
|
1095
|
+
export type OnDeleteBehavior = z.infer<typeof OnDeleteBehaviorSchema>;
|
|
1096
|
+
/** Relationship link (one side of a relationship) */
|
|
1097
|
+
export type RelationshipLink = z.infer<typeof RelationshipLinkSchema>;
|
|
1098
|
+
/** Relationship definition */
|
|
1099
|
+
export type RelationshipDefinition = z.infer<typeof RelationshipDefinitionSchema>;
|
|
1100
|
+
/** Page type */
|
|
1101
|
+
export type PageType = z.infer<typeof PageTypeSchema>;
|
|
1102
|
+
/** Page block type */
|
|
1103
|
+
export type PageBlockType = z.infer<typeof PageBlockTypeSchema>;
|
|
1104
|
+
/** Page block definition */
|
|
1105
|
+
export type PageBlockDefinition = z.infer<typeof PageBlockDefinitionSchema>;
|
|
1106
|
+
/** Page definition */
|
|
1107
|
+
export type PageDefinition = z.infer<typeof PageDefinitionSchema>;
|
|
903
1108
|
/** Model dependency reference */
|
|
904
1109
|
export type ModelDependency = z.infer<typeof ModelDependencySchema>;
|
|
905
1110
|
/** Channel dependency reference */
|
package/dist/schemas.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SkedyulConfigSchema = exports.InternalModelDefinitionSchema = exports.InternalFieldDefinitionSchema = exports.InternalFieldDataTypeSchema = exports.ModelDefinitionSchema = exports.ModelFieldDefinitionSchema = exports.InlineFieldDefinitionSchema = exports.FieldOptionSchema = exports.FieldDataTypeSchema = exports.ComputeLayerTypeSchema = exports.WorkflowDefinitionSchema = exports.WorkflowActionSchema = exports.WorkflowActionInputSchema = exports.ChannelDefinitionSchema = exports.CommunicationChannelDefinitionSchema = exports.ResourceDependencySchema = exports.WorkflowDependencySchema = exports.ChannelDependencySchema = exports.ModelDependencySchema = exports.StructuredFilterSchema = exports.FieldOwnerSchema = exports.ResourceScopeSchema = exports.ChannelIdentifierValueSchema = exports.ChannelIdentifierTypeSchema = exports.ChannelToolBindingsSchema = exports.AppFieldDefinitionSchema = exports.AppFieldVisibilitySchema = exports.InstallConfigSchema = exports.AppModelDefinitionSchema = exports.EnvSchemaSchema = exports.EnvVariableDefinitionSchema = exports.EnvVisibilitySchema = void 0;
|
|
3
|
+
exports.SkedyulConfigSchema = exports.InternalModelDefinitionSchema = exports.InternalFieldDefinitionSchema = exports.InternalFieldDataTypeSchema = exports.ModelDefinitionSchema = exports.ModelFieldDefinitionSchema = exports.InlineFieldDefinitionSchema = exports.PageDefinitionSchema = exports.PageBlockDefinitionSchema = exports.PageBlockTypeSchema = exports.PageTypeSchema = exports.RelationshipDefinitionSchema = exports.RelationshipLinkSchema = exports.OnDeleteBehaviorSchema = exports.RelationshipCardinalitySchema = exports.FieldOptionSchema = exports.FieldDataTypeSchema = exports.ComputeLayerTypeSchema = exports.WorkflowDefinitionSchema = exports.WorkflowActionSchema = exports.WorkflowActionInputSchema = exports.ChannelDefinitionSchema = exports.CommunicationChannelDefinitionSchema = exports.ResourceDependencySchema = exports.WorkflowDependencySchema = exports.ChannelDependencySchema = exports.ModelDependencySchema = exports.StructuredFilterSchema = exports.FieldOwnerSchema = exports.ResourceScopeSchema = exports.ChannelIdentifierValueSchema = exports.ChannelIdentifierTypeSchema = exports.ChannelToolBindingsSchema = exports.AppFieldDefinitionSchema = exports.AppFieldVisibilitySchema = exports.InstallConfigSchema = exports.AppModelDefinitionSchema = exports.EnvSchemaSchema = exports.EnvVariableDefinitionSchema = exports.EnvVisibilitySchema = void 0;
|
|
4
4
|
exports.safeParseConfig = safeParseConfig;
|
|
5
5
|
exports.isModelDependency = isModelDependency;
|
|
6
6
|
exports.isChannelDependency = isChannelDependency;
|
|
@@ -245,6 +245,101 @@ exports.FieldOptionSchema = zod_1.z.object({
|
|
|
245
245
|
/** Optional color for UI display */
|
|
246
246
|
color: zod_1.z.string().optional(),
|
|
247
247
|
});
|
|
248
|
+
/**
|
|
249
|
+
* Schema for relationship cardinality.
|
|
250
|
+
* Defines how many records can be linked on each side.
|
|
251
|
+
*/
|
|
252
|
+
exports.RelationshipCardinalitySchema = zod_1.z.enum([
|
|
253
|
+
'ONE_TO_ONE',
|
|
254
|
+
'ONE_TO_MANY',
|
|
255
|
+
'MANY_TO_ONE',
|
|
256
|
+
'MANY_TO_MANY',
|
|
257
|
+
]);
|
|
258
|
+
/**
|
|
259
|
+
* Schema for on-delete behavior in relationships.
|
|
260
|
+
*/
|
|
261
|
+
exports.OnDeleteBehaviorSchema = zod_1.z.enum([
|
|
262
|
+
'NONE', // No action
|
|
263
|
+
'CASCADE', // Delete related records
|
|
264
|
+
'RESTRICT', // Prevent deletion
|
|
265
|
+
]);
|
|
266
|
+
/**
|
|
267
|
+
* Schema for a relationship link (one side of a relationship).
|
|
268
|
+
*/
|
|
269
|
+
exports.RelationshipLinkSchema = zod_1.z.object({
|
|
270
|
+
/** Model handle for this side of the relationship */
|
|
271
|
+
model: zod_1.z.string(),
|
|
272
|
+
/** Field handle on this model */
|
|
273
|
+
field: zod_1.z.string(),
|
|
274
|
+
/** Field label for display */
|
|
275
|
+
label: zod_1.z.string(),
|
|
276
|
+
/** Cardinality from this side */
|
|
277
|
+
cardinality: exports.RelationshipCardinalitySchema,
|
|
278
|
+
/** On-delete behavior */
|
|
279
|
+
onDelete: exports.OnDeleteBehaviorSchema.default('NONE'),
|
|
280
|
+
});
|
|
281
|
+
/**
|
|
282
|
+
* Schema for a relationship definition.
|
|
283
|
+
* Relationships are bidirectional - they define links from both sides.
|
|
284
|
+
*/
|
|
285
|
+
exports.RelationshipDefinitionSchema = zod_1.z.object({
|
|
286
|
+
/** Source side of the relationship */
|
|
287
|
+
source: exports.RelationshipLinkSchema,
|
|
288
|
+
/** Target side of the relationship */
|
|
289
|
+
target: exports.RelationshipLinkSchema,
|
|
290
|
+
});
|
|
291
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
292
|
+
// Page and Block Schemas
|
|
293
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
294
|
+
/**
|
|
295
|
+
* Schema for page type.
|
|
296
|
+
* INSTANCE: Shows a single record (form-like)
|
|
297
|
+
* LIST: Shows multiple records (spreadsheet/table)
|
|
298
|
+
*/
|
|
299
|
+
exports.PageTypeSchema = zod_1.z.enum(['INSTANCE', 'LIST']);
|
|
300
|
+
/**
|
|
301
|
+
* Schema for block type in a page.
|
|
302
|
+
* Matches existing block types in the system.
|
|
303
|
+
*/
|
|
304
|
+
exports.PageBlockTypeSchema = zod_1.z.enum([
|
|
305
|
+
'form',
|
|
306
|
+
'spreadsheet',
|
|
307
|
+
'kanban',
|
|
308
|
+
'calendar',
|
|
309
|
+
'link',
|
|
310
|
+
]);
|
|
311
|
+
/**
|
|
312
|
+
* Schema for a block definition within a page.
|
|
313
|
+
* Blocks define the UI components that render model data.
|
|
314
|
+
*/
|
|
315
|
+
exports.PageBlockDefinitionSchema = zod_1.z.object({
|
|
316
|
+
/** Block type determines the UI component */
|
|
317
|
+
type: exports.PageBlockTypeSchema,
|
|
318
|
+
/** Block title displayed in UI */
|
|
319
|
+
title: zod_1.z.string().optional(),
|
|
320
|
+
/** Field handles to include in this block */
|
|
321
|
+
fields: zod_1.z.array(zod_1.z.string()).optional(),
|
|
322
|
+
/** Whether the block is read-only (no editing) */
|
|
323
|
+
readonly: zod_1.z.boolean().optional(),
|
|
324
|
+
});
|
|
325
|
+
/**
|
|
326
|
+
* Schema for a page definition.
|
|
327
|
+
* Pages define how internal models are displayed in the post-install UI.
|
|
328
|
+
*/
|
|
329
|
+
exports.PageDefinitionSchema = zod_1.z.object({
|
|
330
|
+
/** Unique handle for the page */
|
|
331
|
+
handle: zod_1.z.string(),
|
|
332
|
+
/** Model handle this page displays */
|
|
333
|
+
model: zod_1.z.string(),
|
|
334
|
+
/** Page type: INSTANCE (single record) or LIST (multiple records) */
|
|
335
|
+
type: exports.PageTypeSchema,
|
|
336
|
+
/** Page title displayed in UI */
|
|
337
|
+
title: zod_1.z.string(),
|
|
338
|
+
/** Optional custom path for navigation */
|
|
339
|
+
path: zod_1.z.string().optional(),
|
|
340
|
+
/** Blocks that compose this page */
|
|
341
|
+
blocks: zod_1.z.array(exports.PageBlockDefinitionSchema),
|
|
342
|
+
});
|
|
248
343
|
/**
|
|
249
344
|
* Schema for inline field definition (constraints, options, etc.)
|
|
250
345
|
* This allows defining field behavior without referencing a metafield definition.
|
|
@@ -262,8 +357,6 @@ exports.InlineFieldDefinitionSchema = zod_1.z.object({
|
|
|
262
357
|
min: zod_1.z.number().optional(),
|
|
263
358
|
/** For number fields: max value */
|
|
264
359
|
max: zod_1.z.number().optional(),
|
|
265
|
-
/** For relation fields: target model handle */
|
|
266
|
-
relatedModel: zod_1.z.string().optional(),
|
|
267
360
|
/** Validation regex pattern */
|
|
268
361
|
pattern: zod_1.z.string().optional(),
|
|
269
362
|
});
|
|
@@ -385,6 +478,10 @@ exports.SkedyulConfigSchema = zod_1.z.object({
|
|
|
385
478
|
.optional(),
|
|
386
479
|
// New unified model definitions (INTERNAL + SHARED)
|
|
387
480
|
models: zod_1.z.array(exports.ModelDefinitionSchema).optional(),
|
|
481
|
+
// Relationships between models
|
|
482
|
+
relationships: zod_1.z.array(exports.RelationshipDefinitionSchema).optional(),
|
|
483
|
+
// Pages for internal models (displayed in post-install UI)
|
|
484
|
+
pages: zod_1.z.array(exports.PageDefinitionSchema).optional(),
|
|
388
485
|
// New channel syntax (alias for communicationChannels)
|
|
389
486
|
channels: zod_1.z.array(exports.ChannelDefinitionSchema).optional(),
|
|
390
487
|
// Legacy: communication channels (deprecated - use channels)
|