@onlineapps/cookbook-core 2.0.0 → 2.1.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/README.md CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/cookbook-core",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Core cookbook parsing and validation - lightweight foundation for workflow definitions",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://onlineapps.com/schemas/cookbook/v2.0.0/cookbook.schema.json",
4
- "title": "Cookbook Workflow Schema v2.0",
3
+ "$id": "https://onlineapps.com/schemas/cookbook/v2.1.0/cookbook.schema.json",
4
+ "title": "Cookbook Workflow Schema v2.1",
5
5
  "description": "Schema for defining workflow orchestration with snake_case convention",
6
6
  "type": "object",
7
7
  "required": ["version", "steps"],
@@ -36,6 +36,10 @@
36
36
  "$ref": "#/definitions/Step"
37
37
  },
38
38
  "description": "Array of workflow steps"
39
+ },
40
+ "delivery": {
41
+ "$ref": "#/definitions/DeliveryConfig",
42
+ "description": "Delivery strategy and destinations for workflow output"
39
43
  }
40
44
  },
41
45
  "definitions": {
@@ -514,6 +518,211 @@
514
518
  "additionalProperties": true
515
519
  }
516
520
  }
521
+ },
522
+ "DeliveryConfig": {
523
+ "type": "object",
524
+ "required": ["handler"],
525
+ "additionalProperties": false,
526
+ "properties": {
527
+ "handler": {
528
+ "enum": ["dispatcher", "service_step", "none"],
529
+ "description": "Delivery handler selection"
530
+ },
531
+ "allow_skip": {
532
+ "type": "boolean",
533
+ "default": false,
534
+ "description": "Allow dispatcher to skip delivery without failing workflow"
535
+ },
536
+ "delivery_step": {
537
+ "type": "string",
538
+ "pattern": "^[a-zA-Z0-9_]+$",
539
+ "description": "Step ID that performs delivery when handler=service_step"
540
+ },
541
+ "destinations": {
542
+ "type": "array",
543
+ "items": {
544
+ "$ref": "#/definitions/DeliveryDestination"
545
+ },
546
+ "default": []
547
+ },
548
+ "output": {
549
+ "$ref": "#/definitions/DeliveryOutput"
550
+ }
551
+ },
552
+ "allOf": [
553
+ {
554
+ "if": {
555
+ "properties": {
556
+ "handler": { "const": "dispatcher" }
557
+ }
558
+ },
559
+ "then": {
560
+ "required": ["destinations", "output"],
561
+ "properties": {
562
+ "destinations": {
563
+ "minItems": 1
564
+ }
565
+ }
566
+ }
567
+ },
568
+ {
569
+ "if": {
570
+ "properties": {
571
+ "handler": { "const": "service_step" }
572
+ }
573
+ },
574
+ "then": {
575
+ "required": ["delivery_step", "output"]
576
+ }
577
+ }
578
+ ]
579
+ },
580
+ "DeliveryDestination": {
581
+ "type": "object",
582
+ "required": ["type"],
583
+ "properties": {
584
+ "type": {
585
+ "enum": ["webhook", "websocket", "public_url"],
586
+ "description": "Delivery channel type"
587
+ },
588
+ "name": {
589
+ "type": "string",
590
+ "pattern": "^[a-zA-Z0-9._-]+$",
591
+ "description": "Optional identifier for monitoring"
592
+ },
593
+ "enabled": {
594
+ "type": "boolean",
595
+ "default": true
596
+ },
597
+ "retry": {
598
+ "$ref": "#/definitions/RetryConfig"
599
+ }
600
+ },
601
+ "allOf": [
602
+ {
603
+ "if": {
604
+ "properties": {
605
+ "type": { "const": "webhook" }
606
+ }
607
+ },
608
+ "then": {
609
+ "$ref": "#/definitions/DeliveryWebhookOptions"
610
+ }
611
+ },
612
+ {
613
+ "if": {
614
+ "properties": {
615
+ "type": { "const": "websocket" }
616
+ }
617
+ },
618
+ "then": {
619
+ "$ref": "#/definitions/DeliveryWebsocketOptions"
620
+ }
621
+ },
622
+ {
623
+ "if": {
624
+ "properties": {
625
+ "type": { "const": "public_url" }
626
+ }
627
+ },
628
+ "then": {
629
+ "$ref": "#/definitions/DeliveryPublicUrlOptions"
630
+ }
631
+ }
632
+ ]
633
+ },
634
+ "DeliveryWebhookOptions": {
635
+ "type": "object",
636
+ "required": ["url", "method"],
637
+ "properties": {
638
+ "url": {
639
+ "type": "string",
640
+ "format": "uri",
641
+ "description": "Target webhook URL"
642
+ },
643
+ "method": {
644
+ "type": "string",
645
+ "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]
646
+ },
647
+ "headers": {
648
+ "type": "object",
649
+ "additionalProperties": {
650
+ "type": "string"
651
+ }
652
+ },
653
+ "body_template": {
654
+ "type": ["object", "array"],
655
+ "description": "Optional custom payload template"
656
+ },
657
+ "timeout_ms": {
658
+ "type": "integer",
659
+ "minimum": 100,
660
+ "description": "Request timeout"
661
+ }
662
+ }
663
+ },
664
+ "DeliveryWebsocketOptions": {
665
+ "type": "object",
666
+ "properties": {
667
+ "client_id": {
668
+ "type": "string",
669
+ "description": "Client session identifier"
670
+ },
671
+ "tenant_id": {
672
+ "type": "string",
673
+ "description": "Tenant/topic identifier"
674
+ },
675
+ "events": {
676
+ "type": "array",
677
+ "items": {
678
+ "type": "string"
679
+ }
680
+ }
681
+ },
682
+ "anyOf": [
683
+ { "required": ["client_id"] },
684
+ { "required": ["tenant_id"] }
685
+ ]
686
+ },
687
+ "DeliveryPublicUrlOptions": {
688
+ "type": "object",
689
+ "required": ["path"],
690
+ "properties": {
691
+ "path": {
692
+ "type": "string",
693
+ "pattern": "^[a-zA-Z0-9._\\-/\\${}]+$",
694
+ "description": "Storage key / relative path"
695
+ },
696
+ "ttl_seconds": {
697
+ "type": "integer",
698
+ "minimum": 60,
699
+ "description": "Time to live for generated URL"
700
+ },
701
+ "access": {
702
+ "type": "string",
703
+ "enum": ["public", "signed"],
704
+ "default": "signed"
705
+ },
706
+ "max_downloads": {
707
+ "type": "integer",
708
+ "minimum": 1
709
+ }
710
+ }
711
+ },
712
+ "DeliveryOutput": {
713
+ "type": "object",
714
+ "propertyNames": {
715
+ "pattern": "^[a-zA-Z0-9_]+$"
716
+ },
717
+ "additionalProperties": {
718
+ "type": [
719
+ "string",
720
+ "number",
721
+ "boolean",
722
+ "object",
723
+ "array"
724
+ ]
725
+ }
517
726
  }
518
727
  }
519
728
  }
package/src/index.js CHANGED
@@ -60,5 +60,5 @@ module.exports = {
60
60
 
61
61
  // Utility exports
62
62
  VERSION: '2.0.0',
63
- SCHEMA_VERSION: '2.0.0'
63
+ SCHEMA_VERSION: '2.1.0'
64
64
  };
File without changes
File without changes
@@ -156,10 +156,11 @@ function checkMigration(cookbook, detectedVersion) {
156
156
  if ('timeoutMs' in step) {
157
157
  suggestions.push(`- Step ${idx}: Rename 'timeoutMs' to 'timeout_ms'`);
158
158
  }
159
- if ('maxAttempts' in step.retry || {}) {
159
+ const retry = step.retry || {};
160
+ if ('maxAttempts' in retry) {
160
161
  suggestions.push(`- Step ${idx}: Rename 'retry.maxAttempts' to 'retry.max_attempts'`);
161
162
  }
162
- if ('delayMs' in step.retry || {}) {
163
+ if ('delayMs' in retry) {
163
164
  suggestions.push(`- Step ${idx}: Rename 'retry.delayMs' to 'retry.delay_ms'`);
164
165
  }
165
166
  });
package/src/parser.js CHANGED
File without changes
File without changes
package/src/schema.js CHANGED
File without changes
package/src/validator.js CHANGED
File without changes