@avodado/core 0.0.2 → 0.2.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
@@ -48,7 +48,9 @@ var BLOCK_TYPES = [
48
48
  "network",
49
49
  "dag",
50
50
  // Phase 6 — UI mockups
51
- "wireframe"
51
+ "wireframe",
52
+ // Phase 7 — API reference
53
+ "endpoint"
52
54
  ];
53
55
  var BLOCK_TYPE_SET = new Set(BLOCK_TYPES);
54
56
 
@@ -334,7 +336,7 @@ var erdRelationSchema = z.object({
334
336
  from: z.string(),
335
337
  to: z.string(),
336
338
  label: z.string().optional(),
337
- card: z.enum(["1:1", "1:N", "N:M"]).optional()
339
+ card: z.enum(["1:1", "1:N", "N:1", "N:M"]).optional()
338
340
  }).strict();
339
341
  var erdSchema = z.object({
340
342
  title: z.string().optional(),
@@ -501,8 +503,8 @@ var funnelSchema = z.object({
501
503
  }).strict();
502
504
  var flowNodeSchema = z.object({
503
505
  id: z.string(),
504
- col: z.number(),
505
- row: z.number(),
506
+ col: z.number().optional(),
507
+ row: z.number().optional(),
506
508
  w: z.number().optional(),
507
509
  label: z.string(),
508
510
  kind: z.enum(["start", "end", "decision", "process"]).optional()
@@ -522,8 +524,8 @@ var flowSchema = z.object({
522
524
  }).strict();
523
525
  var stateNodeSchema = z.object({
524
526
  id: z.string(),
525
- col: z.number(),
526
- row: z.number(),
527
+ col: z.number().optional(),
528
+ row: z.number().optional(),
527
529
  name: z.string().optional(),
528
530
  kind: z.enum(["start", "terminal", "active", "wait"]).optional()
529
531
  }).strict();
@@ -542,8 +544,8 @@ var stateSchema = z.object({
542
544
  }).strict();
543
545
  var dfdNodeSchema = z.object({
544
546
  id: z.string(),
545
- col: z.number(),
546
- row: z.number(),
547
+ col: z.number().optional(),
548
+ row: z.number().optional(),
547
549
  name: z.string(),
548
550
  kind: z.enum(["process", "external", "store", "datastore"]).optional(),
549
551
  num: z.union([z.string(), z.number()]).optional()
@@ -647,8 +649,8 @@ var swimlaneSchema = z.object({
647
649
  }).strict();
648
650
  var c4NodeSchema = z.object({
649
651
  id: z.string(),
650
- col: z.number(),
651
- row: z.number(),
652
+ col: z.number().optional(),
653
+ row: z.number().optional(),
652
654
  w: z.number().optional(),
653
655
  kind: z.enum(["person", "system", "external", "store", "container", "component"]),
654
656
  family: z.string().optional(),
@@ -674,8 +676,8 @@ var c4Schema = z.object({
674
676
  }).strict();
675
677
  var umlClassSchema = z.object({
676
678
  id: z.string(),
677
- col: z.number(),
678
- row: z.number(),
679
+ col: z.number().optional(),
680
+ row: z.number().optional(),
679
681
  name: z.string(),
680
682
  stereotype: z.string().optional(),
681
683
  attrs: z.array(z.string()).optional(),
@@ -863,6 +865,36 @@ var wireframeSchema = z.object({
863
865
  lede: z.string().optional(),
864
866
  screens: z.array(wireframeScreenSchema).optional()
865
867
  }).strict();
868
+ var endpointParamSchema = z.object({
869
+ name: z.string(),
870
+ in: z.enum(["path", "query", "header", "cookie"]).optional(),
871
+ type: z.string().optional(),
872
+ required: z.boolean().optional(),
873
+ desc: z.string().optional()
874
+ }).strict();
875
+ var endpointFieldSchema = z.object({
876
+ name: z.string(),
877
+ type: z.string().optional(),
878
+ required: z.boolean().optional(),
879
+ desc: z.string().optional()
880
+ }).strict();
881
+ var endpointResponseSchema = z.object({
882
+ status: z.union([z.string(), z.number()]),
883
+ desc: z.string().optional(),
884
+ example: z.string().optional()
885
+ }).strict();
886
+ var endpointSchema = z.object({
887
+ method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
888
+ path: z.string(),
889
+ title: z.string().optional(),
890
+ description: z.string().optional(),
891
+ auth: z.string().optional(),
892
+ params: z.array(endpointParamSchema).optional(),
893
+ body: z.array(endpointFieldSchema).optional(),
894
+ responses: z.array(endpointResponseSchema).optional(),
895
+ request: z.string().optional(),
896
+ response: z.string().optional()
897
+ }).strict();
866
898
  var blockSchemas = {
867
899
  meta: metaSchema,
868
900
  callout: calloutSchema,
@@ -904,7 +936,8 @@ var blockSchemas = {
904
936
  felogic: felogicSchema,
905
937
  belogic: felogicSchema,
906
938
  dag: dagSchema,
907
- wireframe: wireframeSchema
939
+ wireframe: wireframeSchema,
940
+ endpoint: endpointSchema
908
941
  };
909
942
 
910
943
  // src/blocks/registry.ts
@@ -961,7 +994,8 @@ var blockRegistry = {
961
994
  felogic: { type: "felogic", schema: blockSchemas.felogic },
962
995
  belogic: { type: "belogic", schema: blockSchemas.belogic },
963
996
  dag: { type: "dag", schema: blockSchemas.dag },
964
- wireframe: { type: "wireframe", schema: blockSchemas.wireframe }
997
+ wireframe: { type: "wireframe", schema: blockSchemas.wireframe },
998
+ endpoint: { type: "endpoint", schema: blockSchemas.endpoint }
965
999
  };
966
1000
 
967
1001
  // src/validate.ts