@coldtea/pr-lens-schema 0.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.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -0
  3. package/dist/apply.d.ts +42 -0
  4. package/dist/apply.d.ts.map +1 -0
  5. package/dist/apply.js +315 -0
  6. package/dist/apply.js.map +1 -0
  7. package/dist/config.d.ts +58 -0
  8. package/dist/config.d.ts.map +1 -0
  9. package/dist/config.js +61 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/errors.d.ts +24 -0
  12. package/dist/errors.d.ts.map +1 -0
  13. package/dist/errors.js +12 -0
  14. package/dist/errors.js.map +1 -0
  15. package/dist/examples/baseline.d.ts +18 -0
  16. package/dist/examples/baseline.d.ts.map +1 -0
  17. package/dist/examples/baseline.js +433 -0
  18. package/dist/examples/baseline.js.map +1 -0
  19. package/dist/examples/index.d.ts +1194 -0
  20. package/dist/examples/index.d.ts.map +1 -0
  21. package/dist/examples/index.js +20 -0
  22. package/dist/examples/index.js.map +1 -0
  23. package/dist/examples/minimal.d.ts +4 -0
  24. package/dist/examples/minimal.d.ts.map +1 -0
  25. package/dist/examples/minimal.js +25 -0
  26. package/dist/examples/minimal.js.map +1 -0
  27. package/dist/examples/postmark-refactor.d.ts +16 -0
  28. package/dist/examples/postmark-refactor.d.ts.map +1 -0
  29. package/dist/examples/postmark-refactor.js +468 -0
  30. package/dist/examples/postmark-refactor.js.map +1 -0
  31. package/dist/graph.d.ts +568 -0
  32. package/dist/graph.d.ts.map +1 -0
  33. package/dist/graph.js +266 -0
  34. package/dist/graph.js.map +1 -0
  35. package/dist/index.d.ts +12 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +12 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/integrity.d.ts +20 -0
  40. package/dist/integrity.d.ts.map +1 -0
  41. package/dist/integrity.js +167 -0
  42. package/dist/integrity.js.map +1 -0
  43. package/dist/manifest.d.ts +65 -0
  44. package/dist/manifest.d.ts.map +1 -0
  45. package/dist/manifest.js +60 -0
  46. package/dist/manifest.js.map +1 -0
  47. package/dist/patch.d.ts +824 -0
  48. package/dist/patch.d.ts.map +1 -0
  49. package/dist/patch.js +84 -0
  50. package/dist/patch.js.map +1 -0
  51. package/dist/primitives.d.ts +92 -0
  52. package/dist/primitives.d.ts.map +1 -0
  53. package/dist/primitives.js +120 -0
  54. package/dist/primitives.js.map +1 -0
  55. package/dist/utils.d.ts +6 -0
  56. package/dist/utils.d.ts.map +1 -0
  57. package/dist/utils.js +8 -0
  58. package/dist/utils.js.map +1 -0
  59. package/dist/validate.d.ts +18 -0
  60. package/dist/validate.d.ts.map +1 -0
  61. package/dist/validate.js +95 -0
  62. package/dist/validate.js.map +1 -0
  63. package/dist/version.d.ts +21 -0
  64. package/dist/version.d.ts.map +1 -0
  65. package/dist/version.js +24 -0
  66. package/dist/version.js.map +1 -0
  67. package/examples/broadcast-baseline.graph.json +289 -0
  68. package/examples/broadcast-baseline.patch.json +321 -0
  69. package/examples/minimal.graph.json +45 -0
  70. package/examples/postmark-refactor.graph.json +580 -0
  71. package/examples/postmark-refactor.render-manifest.json +67 -0
  72. package/examples/pr-lens.config.json +32 -0
  73. package/json-schema/config.schema.json +153 -0
  74. package/json-schema/graph-doc.schema.json +1032 -0
  75. package/json-schema/patch-doc.schema.json +1383 -0
  76. package/json-schema/render-manifest.schema.json +183 -0
  77. package/package.json +66 -0
  78. package/src/apply.ts +399 -0
  79. package/src/config.ts +69 -0
  80. package/src/errors.ts +34 -0
  81. package/src/examples/baseline.ts +437 -0
  82. package/src/examples/index.ts +25 -0
  83. package/src/examples/minimal.ts +26 -0
  84. package/src/examples/postmark-refactor.ts +480 -0
  85. package/src/graph.ts +331 -0
  86. package/src/index.ts +82 -0
  87. package/src/integrity.ts +216 -0
  88. package/src/manifest.ts +64 -0
  89. package/src/patch.ts +100 -0
  90. package/src/primitives.ts +146 -0
  91. package/src/utils.ts +7 -0
  92. package/src/validate.ts +132 -0
  93. package/src/version.ts +31 -0
@@ -0,0 +1,1383 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/coldteadotai/pr-lens/main/packages/schema/json-schema/patch-doc.schema.json",
4
+ "title": "PR Lens patch document",
5
+ "version": "0.1.0",
6
+ "type": "object",
7
+ "properties": {
8
+ "schemaVersion": {
9
+ "type": "string",
10
+ "pattern": "^0\\.1\\.\\d+$",
11
+ "description": "Contract version the document targets. Current: 0.1.0."
12
+ },
13
+ "kind": {
14
+ "type": "string",
15
+ "const": "patch"
16
+ },
17
+ "generatedAt": {
18
+ "type": "string",
19
+ "format": "date-time",
20
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
21
+ },
22
+ "summary": {
23
+ "description": "Why the map is changing, in prose.",
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "maxLength": 2000
27
+ },
28
+ "target": {
29
+ "type": "object",
30
+ "properties": {
31
+ "graphId": {
32
+ "type": "string",
33
+ "minLength": 1,
34
+ "maxLength": 128,
35
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
36
+ "description": "Id of the stored graph being patched."
37
+ },
38
+ "fromSha": {
39
+ "type": "string",
40
+ "pattern": "^[0-9a-f]{40}$",
41
+ "description": "Commit the stored graph reflects before the operations run."
42
+ },
43
+ "toSha": {
44
+ "type": "string",
45
+ "pattern": "^[0-9a-f]{40}$",
46
+ "description": "Commit it reflects once they have."
47
+ }
48
+ },
49
+ "required": [
50
+ "graphId",
51
+ "fromSha",
52
+ "toSha"
53
+ ],
54
+ "additionalProperties": false,
55
+ "description": "Which stored graph these operations belong to, and which commits they carry it between. All three are required, and the commits must differ: they are what stops a patch landing on the wrong map, on a stale one, or twice."
56
+ },
57
+ "ops": {
58
+ "minItems": 1,
59
+ "maxItems": 512,
60
+ "type": "array",
61
+ "items": {
62
+ "oneOf": [
63
+ {
64
+ "type": "object",
65
+ "properties": {
66
+ "op": {
67
+ "type": "string",
68
+ "const": "add_lane"
69
+ },
70
+ "lane": {
71
+ "type": "object",
72
+ "properties": {
73
+ "id": {
74
+ "type": "string",
75
+ "minLength": 1,
76
+ "maxLength": 128,
77
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
78
+ "description": "Stable identifier, unique within its collection in a document."
79
+ },
80
+ "label": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 120,
84
+ "description": "Short display label."
85
+ },
86
+ "subtitle": {
87
+ "description": "Secondary line in the lane header, e.g. the platform.",
88
+ "type": "string",
89
+ "minLength": 1,
90
+ "maxLength": 120
91
+ },
92
+ "order": {
93
+ "description": "Left-to-right placement. Ties fall back to array order.",
94
+ "type": "integer",
95
+ "minimum": 0,
96
+ "maximum": 64
97
+ },
98
+ "delta": {
99
+ "description": "Set only when the lane itself is new or gone.",
100
+ "type": "string",
101
+ "enum": [
102
+ "added",
103
+ "modified",
104
+ "removed",
105
+ "unchanged"
106
+ ]
107
+ },
108
+ "summary": {
109
+ "type": "string",
110
+ "minLength": 1,
111
+ "maxLength": 2000,
112
+ "description": "One or two sentences of plain prose. No markdown headings."
113
+ }
114
+ },
115
+ "required": [
116
+ "id",
117
+ "label"
118
+ ],
119
+ "additionalProperties": false,
120
+ "description": "A grouping band of the diagram. Every node belongs to exactly one lane."
121
+ }
122
+ },
123
+ "required": [
124
+ "op",
125
+ "lane"
126
+ ],
127
+ "additionalProperties": false
128
+ },
129
+ {
130
+ "type": "object",
131
+ "properties": {
132
+ "op": {
133
+ "type": "string",
134
+ "const": "update_lane"
135
+ },
136
+ "id": {
137
+ "type": "string",
138
+ "minLength": 1,
139
+ "maxLength": 128,
140
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
141
+ "description": "Stable identifier, unique within its collection in a document."
142
+ },
143
+ "patch": {
144
+ "type": "object",
145
+ "properties": {
146
+ "label": {
147
+ "type": "string",
148
+ "minLength": 1,
149
+ "maxLength": 120,
150
+ "description": "Short display label."
151
+ },
152
+ "subtitle": {
153
+ "description": "Secondary line in the lane header, e.g. the platform.",
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "maxLength": 120
157
+ },
158
+ "order": {
159
+ "description": "Left-to-right placement. Ties fall back to array order.",
160
+ "type": "integer",
161
+ "minimum": 0,
162
+ "maximum": 64
163
+ },
164
+ "delta": {
165
+ "description": "Set only when the lane itself is new or gone.",
166
+ "type": "string",
167
+ "enum": [
168
+ "added",
169
+ "modified",
170
+ "removed",
171
+ "unchanged"
172
+ ]
173
+ },
174
+ "summary": {
175
+ "type": "string",
176
+ "minLength": 1,
177
+ "maxLength": 2000,
178
+ "description": "One or two sentences of plain prose. No markdown headings."
179
+ }
180
+ },
181
+ "additionalProperties": false
182
+ }
183
+ },
184
+ "required": [
185
+ "op",
186
+ "id",
187
+ "patch"
188
+ ],
189
+ "additionalProperties": false
190
+ },
191
+ {
192
+ "type": "object",
193
+ "properties": {
194
+ "op": {
195
+ "type": "string",
196
+ "const": "remove_lane"
197
+ },
198
+ "id": {
199
+ "type": "string",
200
+ "minLength": 1,
201
+ "maxLength": 128,
202
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
203
+ "description": "Stable identifier, unique within its collection in a document."
204
+ }
205
+ },
206
+ "required": [
207
+ "op",
208
+ "id"
209
+ ],
210
+ "additionalProperties": false
211
+ },
212
+ {
213
+ "type": "object",
214
+ "properties": {
215
+ "op": {
216
+ "type": "string",
217
+ "const": "add_node"
218
+ },
219
+ "node": {
220
+ "type": "object",
221
+ "properties": {
222
+ "id": {
223
+ "type": "string",
224
+ "minLength": 1,
225
+ "maxLength": 128,
226
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
227
+ "description": "Stable identifier, unique within its collection in a document."
228
+ },
229
+ "label": {
230
+ "type": "string",
231
+ "minLength": 1,
232
+ "maxLength": 120,
233
+ "description": "Short display label."
234
+ },
235
+ "kind": {
236
+ "type": "string",
237
+ "enum": [
238
+ "service",
239
+ "app",
240
+ "module",
241
+ "function",
242
+ "route",
243
+ "job",
244
+ "queue",
245
+ "datastore",
246
+ "cache",
247
+ "external",
248
+ "ui",
249
+ "config",
250
+ "test",
251
+ "package",
252
+ "other"
253
+ ]
254
+ },
255
+ "delta": {
256
+ "type": "string",
257
+ "enum": [
258
+ "added",
259
+ "modified",
260
+ "removed",
261
+ "unchanged"
262
+ ],
263
+ "description": "Change state relative to the base commit."
264
+ },
265
+ "lane": {
266
+ "type": "string",
267
+ "minLength": 1,
268
+ "maxLength": 128,
269
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
270
+ "description": "Id of the lane this node sits in."
271
+ },
272
+ "group": {
273
+ "description": "Optional sub-cluster within the lane, e.g. a package.",
274
+ "type": "string",
275
+ "minLength": 1,
276
+ "maxLength": 128,
277
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$"
278
+ },
279
+ "subtitle": {
280
+ "description": "Secondary line on the card, e.g. a symbol signature.",
281
+ "type": "string",
282
+ "minLength": 1,
283
+ "maxLength": 120
284
+ },
285
+ "summary": {
286
+ "description": "Body text for this node's drill-down section.",
287
+ "type": "string",
288
+ "minLength": 1,
289
+ "maxLength": 2000
290
+ },
291
+ "files": {
292
+ "default": [],
293
+ "description": "Backing source locations, used to build diff permalinks.",
294
+ "maxItems": 64,
295
+ "type": "array",
296
+ "items": {
297
+ "type": "object",
298
+ "properties": {
299
+ "path": {
300
+ "type": "string",
301
+ "minLength": 1,
302
+ "maxLength": 1024,
303
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
304
+ "description": "Repository-relative path, POSIX separators."
305
+ },
306
+ "startLine": {
307
+ "description": "1-based first line.",
308
+ "type": "integer",
309
+ "minimum": 1,
310
+ "maximum": 9007199254740991
311
+ },
312
+ "endLine": {
313
+ "description": "1-based last line, inclusive.",
314
+ "type": "integer",
315
+ "minimum": 1,
316
+ "maximum": 9007199254740991
317
+ },
318
+ "revision": {
319
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
320
+ "type": "string",
321
+ "enum": [
322
+ "head",
323
+ "base"
324
+ ]
325
+ }
326
+ },
327
+ "required": [
328
+ "path"
329
+ ],
330
+ "additionalProperties": false,
331
+ "dependentRequired": {
332
+ "endLine": [
333
+ "startLine"
334
+ ]
335
+ },
336
+ "description": "A file (and optional line range) backing an element."
337
+ }
338
+ },
339
+ "badges": {
340
+ "default": [],
341
+ "description": "Extra chips on the card, beyond the delta badge the renderer adds.",
342
+ "maxItems": 6,
343
+ "type": "array",
344
+ "items": {
345
+ "type": "string",
346
+ "minLength": 1,
347
+ "maxLength": 120,
348
+ "description": "Short display label."
349
+ }
350
+ }
351
+ },
352
+ "required": [
353
+ "id",
354
+ "label",
355
+ "kind",
356
+ "delta",
357
+ "lane"
358
+ ],
359
+ "additionalProperties": false,
360
+ "description": "A node in the architecture graph."
361
+ }
362
+ },
363
+ "required": [
364
+ "op",
365
+ "node"
366
+ ],
367
+ "additionalProperties": false
368
+ },
369
+ {
370
+ "type": "object",
371
+ "properties": {
372
+ "op": {
373
+ "type": "string",
374
+ "const": "update_node"
375
+ },
376
+ "id": {
377
+ "type": "string",
378
+ "minLength": 1,
379
+ "maxLength": 128,
380
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
381
+ "description": "Stable identifier, unique within its collection in a document."
382
+ },
383
+ "patch": {
384
+ "type": "object",
385
+ "properties": {
386
+ "label": {
387
+ "type": "string",
388
+ "minLength": 1,
389
+ "maxLength": 120,
390
+ "description": "Short display label."
391
+ },
392
+ "kind": {
393
+ "type": "string",
394
+ "enum": [
395
+ "service",
396
+ "app",
397
+ "module",
398
+ "function",
399
+ "route",
400
+ "job",
401
+ "queue",
402
+ "datastore",
403
+ "cache",
404
+ "external",
405
+ "ui",
406
+ "config",
407
+ "test",
408
+ "package",
409
+ "other"
410
+ ]
411
+ },
412
+ "delta": {
413
+ "type": "string",
414
+ "enum": [
415
+ "added",
416
+ "modified",
417
+ "removed",
418
+ "unchanged"
419
+ ],
420
+ "description": "Change state relative to the base commit."
421
+ },
422
+ "lane": {
423
+ "type": "string",
424
+ "minLength": 1,
425
+ "maxLength": 128,
426
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
427
+ "description": "Id of the lane this node sits in."
428
+ },
429
+ "group": {
430
+ "description": "Optional sub-cluster within the lane, e.g. a package.",
431
+ "type": "string",
432
+ "minLength": 1,
433
+ "maxLength": 128,
434
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$"
435
+ },
436
+ "subtitle": {
437
+ "description": "Secondary line on the card, e.g. a symbol signature.",
438
+ "type": "string",
439
+ "minLength": 1,
440
+ "maxLength": 120
441
+ },
442
+ "summary": {
443
+ "description": "Body text for this node's drill-down section.",
444
+ "type": "string",
445
+ "minLength": 1,
446
+ "maxLength": 2000
447
+ },
448
+ "files": {
449
+ "default": [],
450
+ "description": "Backing source locations, used to build diff permalinks.",
451
+ "maxItems": 64,
452
+ "type": "array",
453
+ "items": {
454
+ "type": "object",
455
+ "properties": {
456
+ "path": {
457
+ "type": "string",
458
+ "minLength": 1,
459
+ "maxLength": 1024,
460
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
461
+ "description": "Repository-relative path, POSIX separators."
462
+ },
463
+ "startLine": {
464
+ "description": "1-based first line.",
465
+ "type": "integer",
466
+ "minimum": 1,
467
+ "maximum": 9007199254740991
468
+ },
469
+ "endLine": {
470
+ "description": "1-based last line, inclusive.",
471
+ "type": "integer",
472
+ "minimum": 1,
473
+ "maximum": 9007199254740991
474
+ },
475
+ "revision": {
476
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
477
+ "type": "string",
478
+ "enum": [
479
+ "head",
480
+ "base"
481
+ ]
482
+ }
483
+ },
484
+ "required": [
485
+ "path"
486
+ ],
487
+ "additionalProperties": false,
488
+ "dependentRequired": {
489
+ "endLine": [
490
+ "startLine"
491
+ ]
492
+ },
493
+ "description": "A file (and optional line range) backing an element."
494
+ }
495
+ },
496
+ "badges": {
497
+ "default": [],
498
+ "description": "Extra chips on the card, beyond the delta badge the renderer adds.",
499
+ "maxItems": 6,
500
+ "type": "array",
501
+ "items": {
502
+ "type": "string",
503
+ "minLength": 1,
504
+ "maxLength": 120,
505
+ "description": "Short display label."
506
+ }
507
+ }
508
+ },
509
+ "additionalProperties": false
510
+ }
511
+ },
512
+ "required": [
513
+ "op",
514
+ "id",
515
+ "patch"
516
+ ],
517
+ "additionalProperties": false
518
+ },
519
+ {
520
+ "type": "object",
521
+ "properties": {
522
+ "op": {
523
+ "type": "string",
524
+ "const": "remove_node"
525
+ },
526
+ "id": {
527
+ "type": "string",
528
+ "minLength": 1,
529
+ "maxLength": 128,
530
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
531
+ "description": "Stable identifier, unique within its collection in a document."
532
+ }
533
+ },
534
+ "required": [
535
+ "op",
536
+ "id"
537
+ ],
538
+ "additionalProperties": false
539
+ },
540
+ {
541
+ "type": "object",
542
+ "properties": {
543
+ "op": {
544
+ "type": "string",
545
+ "const": "add_edge"
546
+ },
547
+ "edge": {
548
+ "type": "object",
549
+ "properties": {
550
+ "id": {
551
+ "type": "string",
552
+ "minLength": 1,
553
+ "maxLength": 128,
554
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
555
+ "description": "Stable identifier, unique within its collection in a document."
556
+ },
557
+ "from": {
558
+ "type": "string",
559
+ "minLength": 1,
560
+ "maxLength": 128,
561
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
562
+ "description": "Source node id."
563
+ },
564
+ "to": {
565
+ "type": "string",
566
+ "minLength": 1,
567
+ "maxLength": 128,
568
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
569
+ "description": "Target node id."
570
+ },
571
+ "kind": {
572
+ "type": "string",
573
+ "enum": [
574
+ "call",
575
+ "http",
576
+ "rpc",
577
+ "event",
578
+ "queue",
579
+ "data",
580
+ "dependency",
581
+ "render",
582
+ "other"
583
+ ]
584
+ },
585
+ "delta": {
586
+ "type": "string",
587
+ "enum": [
588
+ "added",
589
+ "modified",
590
+ "removed",
591
+ "unchanged"
592
+ ],
593
+ "description": "Change state relative to the base commit."
594
+ },
595
+ "label": {
596
+ "description": "Text on the edge, e.g. a payload size or protocol.",
597
+ "type": "string",
598
+ "minLength": 1,
599
+ "maxLength": 120
600
+ },
601
+ "emphasis": {
602
+ "default": "normal",
603
+ "type": "string",
604
+ "enum": [
605
+ "normal",
606
+ "hero",
607
+ "muted"
608
+ ]
609
+ },
610
+ "animated": {
611
+ "default": false,
612
+ "description": "Render a travelling pulse along this edge in the architecture lens.",
613
+ "type": "boolean"
614
+ },
615
+ "summary": {
616
+ "type": "string",
617
+ "minLength": 1,
618
+ "maxLength": 2000,
619
+ "description": "One or two sentences of plain prose. No markdown headings."
620
+ },
621
+ "files": {
622
+ "default": [],
623
+ "maxItems": 32,
624
+ "type": "array",
625
+ "items": {
626
+ "type": "object",
627
+ "properties": {
628
+ "path": {
629
+ "type": "string",
630
+ "minLength": 1,
631
+ "maxLength": 1024,
632
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
633
+ "description": "Repository-relative path, POSIX separators."
634
+ },
635
+ "startLine": {
636
+ "description": "1-based first line.",
637
+ "type": "integer",
638
+ "minimum": 1,
639
+ "maximum": 9007199254740991
640
+ },
641
+ "endLine": {
642
+ "description": "1-based last line, inclusive.",
643
+ "type": "integer",
644
+ "minimum": 1,
645
+ "maximum": 9007199254740991
646
+ },
647
+ "revision": {
648
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
649
+ "type": "string",
650
+ "enum": [
651
+ "head",
652
+ "base"
653
+ ]
654
+ }
655
+ },
656
+ "required": [
657
+ "path"
658
+ ],
659
+ "additionalProperties": false,
660
+ "dependentRequired": {
661
+ "endLine": [
662
+ "startLine"
663
+ ]
664
+ },
665
+ "description": "A file (and optional line range) backing an element."
666
+ }
667
+ }
668
+ },
669
+ "required": [
670
+ "id",
671
+ "from",
672
+ "to",
673
+ "kind",
674
+ "delta"
675
+ ],
676
+ "additionalProperties": false,
677
+ "description": "A directed connection between two nodes."
678
+ }
679
+ },
680
+ "required": [
681
+ "op",
682
+ "edge"
683
+ ],
684
+ "additionalProperties": false
685
+ },
686
+ {
687
+ "type": "object",
688
+ "properties": {
689
+ "op": {
690
+ "type": "string",
691
+ "const": "update_edge"
692
+ },
693
+ "id": {
694
+ "type": "string",
695
+ "minLength": 1,
696
+ "maxLength": 128,
697
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
698
+ "description": "Stable identifier, unique within its collection in a document."
699
+ },
700
+ "patch": {
701
+ "type": "object",
702
+ "properties": {
703
+ "from": {
704
+ "type": "string",
705
+ "minLength": 1,
706
+ "maxLength": 128,
707
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
708
+ "description": "Source node id."
709
+ },
710
+ "to": {
711
+ "type": "string",
712
+ "minLength": 1,
713
+ "maxLength": 128,
714
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
715
+ "description": "Target node id."
716
+ },
717
+ "kind": {
718
+ "type": "string",
719
+ "enum": [
720
+ "call",
721
+ "http",
722
+ "rpc",
723
+ "event",
724
+ "queue",
725
+ "data",
726
+ "dependency",
727
+ "render",
728
+ "other"
729
+ ]
730
+ },
731
+ "delta": {
732
+ "type": "string",
733
+ "enum": [
734
+ "added",
735
+ "modified",
736
+ "removed",
737
+ "unchanged"
738
+ ],
739
+ "description": "Change state relative to the base commit."
740
+ },
741
+ "label": {
742
+ "description": "Text on the edge, e.g. a payload size or protocol.",
743
+ "type": "string",
744
+ "minLength": 1,
745
+ "maxLength": 120
746
+ },
747
+ "emphasis": {
748
+ "default": "normal",
749
+ "type": "string",
750
+ "enum": [
751
+ "normal",
752
+ "hero",
753
+ "muted"
754
+ ]
755
+ },
756
+ "animated": {
757
+ "default": false,
758
+ "description": "Render a travelling pulse along this edge in the architecture lens.",
759
+ "type": "boolean"
760
+ },
761
+ "summary": {
762
+ "type": "string",
763
+ "minLength": 1,
764
+ "maxLength": 2000,
765
+ "description": "One or two sentences of plain prose. No markdown headings."
766
+ },
767
+ "files": {
768
+ "default": [],
769
+ "maxItems": 32,
770
+ "type": "array",
771
+ "items": {
772
+ "type": "object",
773
+ "properties": {
774
+ "path": {
775
+ "type": "string",
776
+ "minLength": 1,
777
+ "maxLength": 1024,
778
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
779
+ "description": "Repository-relative path, POSIX separators."
780
+ },
781
+ "startLine": {
782
+ "description": "1-based first line.",
783
+ "type": "integer",
784
+ "minimum": 1,
785
+ "maximum": 9007199254740991
786
+ },
787
+ "endLine": {
788
+ "description": "1-based last line, inclusive.",
789
+ "type": "integer",
790
+ "minimum": 1,
791
+ "maximum": 9007199254740991
792
+ },
793
+ "revision": {
794
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
795
+ "type": "string",
796
+ "enum": [
797
+ "head",
798
+ "base"
799
+ ]
800
+ }
801
+ },
802
+ "required": [
803
+ "path"
804
+ ],
805
+ "additionalProperties": false,
806
+ "dependentRequired": {
807
+ "endLine": [
808
+ "startLine"
809
+ ]
810
+ },
811
+ "description": "A file (and optional line range) backing an element."
812
+ }
813
+ }
814
+ },
815
+ "additionalProperties": false
816
+ }
817
+ },
818
+ "required": [
819
+ "op",
820
+ "id",
821
+ "patch"
822
+ ],
823
+ "additionalProperties": false
824
+ },
825
+ {
826
+ "type": "object",
827
+ "properties": {
828
+ "op": {
829
+ "type": "string",
830
+ "const": "remove_edge"
831
+ },
832
+ "id": {
833
+ "type": "string",
834
+ "minLength": 1,
835
+ "maxLength": 128,
836
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
837
+ "description": "Stable identifier, unique within its collection in a document."
838
+ }
839
+ },
840
+ "required": [
841
+ "op",
842
+ "id"
843
+ ],
844
+ "additionalProperties": false
845
+ },
846
+ {
847
+ "type": "object",
848
+ "properties": {
849
+ "op": {
850
+ "type": "string",
851
+ "const": "add_flow"
852
+ },
853
+ "flow": {
854
+ "type": "object",
855
+ "properties": {
856
+ "id": {
857
+ "type": "string",
858
+ "minLength": 1,
859
+ "maxLength": 128,
860
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
861
+ "description": "Stable identifier, unique within its collection in a document."
862
+ },
863
+ "title": {
864
+ "type": "string",
865
+ "minLength": 1,
866
+ "maxLength": 120,
867
+ "description": "Short display label."
868
+ },
869
+ "summary": {
870
+ "type": "string",
871
+ "minLength": 1,
872
+ "maxLength": 2000,
873
+ "description": "One or two sentences of plain prose. No markdown headings."
874
+ },
875
+ "delta": {
876
+ "default": "modified",
877
+ "type": "string",
878
+ "enum": [
879
+ "added",
880
+ "modified",
881
+ "removed",
882
+ "unchanged"
883
+ ],
884
+ "description": "Change state relative to the base commit."
885
+ },
886
+ "participants": {
887
+ "minItems": 2,
888
+ "maxItems": 12,
889
+ "type": "array",
890
+ "items": {
891
+ "type": "object",
892
+ "properties": {
893
+ "node": {
894
+ "type": "string",
895
+ "minLength": 1,
896
+ "maxLength": 128,
897
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
898
+ "description": "Id of the graph node this column represents."
899
+ },
900
+ "label": {
901
+ "description": "Shorter name for the column when the node label is long.",
902
+ "type": "string",
903
+ "minLength": 1,
904
+ "maxLength": 120
905
+ }
906
+ },
907
+ "required": [
908
+ "node"
909
+ ],
910
+ "additionalProperties": false,
911
+ "description": "A column in the sequence diagram, ordered by array position."
912
+ }
913
+ },
914
+ "messages": {
915
+ "minItems": 1,
916
+ "maxItems": 64,
917
+ "type": "array",
918
+ "items": {
919
+ "type": "object",
920
+ "properties": {
921
+ "id": {
922
+ "type": "string",
923
+ "minLength": 1,
924
+ "maxLength": 128,
925
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
926
+ "description": "Stable identifier, unique within its collection in a document."
927
+ },
928
+ "from": {
929
+ "type": "string",
930
+ "minLength": 1,
931
+ "maxLength": 128,
932
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
933
+ "description": "Participant node id the message originates from."
934
+ },
935
+ "to": {
936
+ "type": "string",
937
+ "minLength": 1,
938
+ "maxLength": 128,
939
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
940
+ "description": "Participant node id the message arrives at. Equals `from` when kind is self."
941
+ },
942
+ "label": {
943
+ "type": "string",
944
+ "minLength": 1,
945
+ "maxLength": 120,
946
+ "description": "Short display label."
947
+ },
948
+ "kind": {
949
+ "default": "sync",
950
+ "type": "string",
951
+ "enum": [
952
+ "sync",
953
+ "async",
954
+ "return",
955
+ "self"
956
+ ]
957
+ },
958
+ "delta": {
959
+ "type": "string",
960
+ "enum": [
961
+ "added",
962
+ "modified",
963
+ "removed",
964
+ "unchanged"
965
+ ],
966
+ "description": "Change state relative to the base commit."
967
+ },
968
+ "animated": {
969
+ "default": true,
970
+ "description": "Whether the data-flow lens pulses this step.",
971
+ "type": "boolean"
972
+ },
973
+ "repeat": {
974
+ "description": "Times the step occurs per run, e.g. 4 batched requests.",
975
+ "type": "integer",
976
+ "minimum": 1,
977
+ "maximum": 1000000
978
+ },
979
+ "note": {
980
+ "description": "Aside rendered beside the step in the drill-down.",
981
+ "type": "string",
982
+ "minLength": 1,
983
+ "maxLength": 2000
984
+ },
985
+ "files": {
986
+ "default": [],
987
+ "maxItems": 32,
988
+ "type": "array",
989
+ "items": {
990
+ "type": "object",
991
+ "properties": {
992
+ "path": {
993
+ "type": "string",
994
+ "minLength": 1,
995
+ "maxLength": 1024,
996
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
997
+ "description": "Repository-relative path, POSIX separators."
998
+ },
999
+ "startLine": {
1000
+ "description": "1-based first line.",
1001
+ "type": "integer",
1002
+ "minimum": 1,
1003
+ "maximum": 9007199254740991
1004
+ },
1005
+ "endLine": {
1006
+ "description": "1-based last line, inclusive.",
1007
+ "type": "integer",
1008
+ "minimum": 1,
1009
+ "maximum": 9007199254740991
1010
+ },
1011
+ "revision": {
1012
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
1013
+ "type": "string",
1014
+ "enum": [
1015
+ "head",
1016
+ "base"
1017
+ ]
1018
+ }
1019
+ },
1020
+ "required": [
1021
+ "path"
1022
+ ],
1023
+ "additionalProperties": false,
1024
+ "dependentRequired": {
1025
+ "endLine": [
1026
+ "startLine"
1027
+ ]
1028
+ },
1029
+ "description": "A file (and optional line range) backing an element."
1030
+ }
1031
+ }
1032
+ },
1033
+ "required": [
1034
+ "id",
1035
+ "from",
1036
+ "to",
1037
+ "label",
1038
+ "delta"
1039
+ ],
1040
+ "additionalProperties": false,
1041
+ "description": "One ordered step in a flow."
1042
+ },
1043
+ "description": "Ordered by array position."
1044
+ }
1045
+ },
1046
+ "required": [
1047
+ "id",
1048
+ "title",
1049
+ "participants",
1050
+ "messages"
1051
+ ],
1052
+ "additionalProperties": false,
1053
+ "description": "An ordered message sequence for the data-flow lens."
1054
+ }
1055
+ },
1056
+ "required": [
1057
+ "op",
1058
+ "flow"
1059
+ ],
1060
+ "additionalProperties": false
1061
+ },
1062
+ {
1063
+ "type": "object",
1064
+ "properties": {
1065
+ "op": {
1066
+ "type": "string",
1067
+ "const": "update_flow"
1068
+ },
1069
+ "id": {
1070
+ "type": "string",
1071
+ "minLength": 1,
1072
+ "maxLength": 128,
1073
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
1074
+ "description": "Stable identifier, unique within its collection in a document."
1075
+ },
1076
+ "patch": {
1077
+ "type": "object",
1078
+ "properties": {
1079
+ "title": {
1080
+ "type": "string",
1081
+ "minLength": 1,
1082
+ "maxLength": 120,
1083
+ "description": "Short display label."
1084
+ },
1085
+ "summary": {
1086
+ "type": "string",
1087
+ "minLength": 1,
1088
+ "maxLength": 2000,
1089
+ "description": "One or two sentences of plain prose. No markdown headings."
1090
+ },
1091
+ "delta": {
1092
+ "default": "modified",
1093
+ "type": "string",
1094
+ "enum": [
1095
+ "added",
1096
+ "modified",
1097
+ "removed",
1098
+ "unchanged"
1099
+ ],
1100
+ "description": "Change state relative to the base commit."
1101
+ },
1102
+ "participants": {
1103
+ "minItems": 2,
1104
+ "maxItems": 12,
1105
+ "type": "array",
1106
+ "items": {
1107
+ "type": "object",
1108
+ "properties": {
1109
+ "node": {
1110
+ "type": "string",
1111
+ "minLength": 1,
1112
+ "maxLength": 128,
1113
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
1114
+ "description": "Id of the graph node this column represents."
1115
+ },
1116
+ "label": {
1117
+ "description": "Shorter name for the column when the node label is long.",
1118
+ "type": "string",
1119
+ "minLength": 1,
1120
+ "maxLength": 120
1121
+ }
1122
+ },
1123
+ "required": [
1124
+ "node"
1125
+ ],
1126
+ "additionalProperties": false,
1127
+ "description": "A column in the sequence diagram, ordered by array position."
1128
+ }
1129
+ },
1130
+ "messages": {
1131
+ "minItems": 1,
1132
+ "maxItems": 64,
1133
+ "type": "array",
1134
+ "items": {
1135
+ "type": "object",
1136
+ "properties": {
1137
+ "id": {
1138
+ "type": "string",
1139
+ "minLength": 1,
1140
+ "maxLength": 128,
1141
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
1142
+ "description": "Stable identifier, unique within its collection in a document."
1143
+ },
1144
+ "from": {
1145
+ "type": "string",
1146
+ "minLength": 1,
1147
+ "maxLength": 128,
1148
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
1149
+ "description": "Participant node id the message originates from."
1150
+ },
1151
+ "to": {
1152
+ "type": "string",
1153
+ "minLength": 1,
1154
+ "maxLength": 128,
1155
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
1156
+ "description": "Participant node id the message arrives at. Equals `from` when kind is self."
1157
+ },
1158
+ "label": {
1159
+ "type": "string",
1160
+ "minLength": 1,
1161
+ "maxLength": 120,
1162
+ "description": "Short display label."
1163
+ },
1164
+ "kind": {
1165
+ "default": "sync",
1166
+ "type": "string",
1167
+ "enum": [
1168
+ "sync",
1169
+ "async",
1170
+ "return",
1171
+ "self"
1172
+ ]
1173
+ },
1174
+ "delta": {
1175
+ "type": "string",
1176
+ "enum": [
1177
+ "added",
1178
+ "modified",
1179
+ "removed",
1180
+ "unchanged"
1181
+ ],
1182
+ "description": "Change state relative to the base commit."
1183
+ },
1184
+ "animated": {
1185
+ "default": true,
1186
+ "description": "Whether the data-flow lens pulses this step.",
1187
+ "type": "boolean"
1188
+ },
1189
+ "repeat": {
1190
+ "description": "Times the step occurs per run, e.g. 4 batched requests.",
1191
+ "type": "integer",
1192
+ "minimum": 1,
1193
+ "maximum": 1000000
1194
+ },
1195
+ "note": {
1196
+ "description": "Aside rendered beside the step in the drill-down.",
1197
+ "type": "string",
1198
+ "minLength": 1,
1199
+ "maxLength": 2000
1200
+ },
1201
+ "files": {
1202
+ "default": [],
1203
+ "maxItems": 32,
1204
+ "type": "array",
1205
+ "items": {
1206
+ "type": "object",
1207
+ "properties": {
1208
+ "path": {
1209
+ "type": "string",
1210
+ "minLength": 1,
1211
+ "maxLength": 1024,
1212
+ "pattern": "^(?!\\/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$",
1213
+ "description": "Repository-relative path, POSIX separators."
1214
+ },
1215
+ "startLine": {
1216
+ "description": "1-based first line.",
1217
+ "type": "integer",
1218
+ "minimum": 1,
1219
+ "maximum": 9007199254740991
1220
+ },
1221
+ "endLine": {
1222
+ "description": "1-based last line, inclusive.",
1223
+ "type": "integer",
1224
+ "minimum": 1,
1225
+ "maximum": 9007199254740991
1226
+ },
1227
+ "revision": {
1228
+ "description": "Which side of the diff the lines refer to. Defaults to head.",
1229
+ "type": "string",
1230
+ "enum": [
1231
+ "head",
1232
+ "base"
1233
+ ]
1234
+ }
1235
+ },
1236
+ "required": [
1237
+ "path"
1238
+ ],
1239
+ "additionalProperties": false,
1240
+ "dependentRequired": {
1241
+ "endLine": [
1242
+ "startLine"
1243
+ ]
1244
+ },
1245
+ "description": "A file (and optional line range) backing an element."
1246
+ }
1247
+ }
1248
+ },
1249
+ "required": [
1250
+ "id",
1251
+ "from",
1252
+ "to",
1253
+ "label",
1254
+ "delta"
1255
+ ],
1256
+ "additionalProperties": false,
1257
+ "description": "One ordered step in a flow."
1258
+ },
1259
+ "description": "Ordered by array position."
1260
+ }
1261
+ },
1262
+ "additionalProperties": false
1263
+ }
1264
+ },
1265
+ "required": [
1266
+ "op",
1267
+ "id",
1268
+ "patch"
1269
+ ],
1270
+ "additionalProperties": false
1271
+ },
1272
+ {
1273
+ "type": "object",
1274
+ "properties": {
1275
+ "op": {
1276
+ "type": "string",
1277
+ "const": "remove_flow"
1278
+ },
1279
+ "id": {
1280
+ "type": "string",
1281
+ "minLength": 1,
1282
+ "maxLength": 128,
1283
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]*$",
1284
+ "description": "Stable identifier, unique within its collection in a document."
1285
+ }
1286
+ },
1287
+ "required": [
1288
+ "op",
1289
+ "id"
1290
+ ],
1291
+ "additionalProperties": false
1292
+ },
1293
+ {
1294
+ "type": "object",
1295
+ "properties": {
1296
+ "op": {
1297
+ "type": "string",
1298
+ "const": "set_stats"
1299
+ },
1300
+ "stats": {
1301
+ "type": "object",
1302
+ "properties": {
1303
+ "filesChanged": {
1304
+ "type": "integer",
1305
+ "minimum": 0,
1306
+ "maximum": 9007199254740991
1307
+ },
1308
+ "additions": {
1309
+ "description": "Lines added across the diff.",
1310
+ "type": "integer",
1311
+ "minimum": 0,
1312
+ "maximum": 9007199254740991
1313
+ },
1314
+ "deletions": {
1315
+ "description": "Lines removed across the diff.",
1316
+ "type": "integer",
1317
+ "minimum": 0,
1318
+ "maximum": 9007199254740991
1319
+ },
1320
+ "chips": {
1321
+ "default": [],
1322
+ "maxItems": 8,
1323
+ "type": "array",
1324
+ "items": {
1325
+ "type": "object",
1326
+ "properties": {
1327
+ "label": {
1328
+ "type": "string",
1329
+ "minLength": 1,
1330
+ "maxLength": 120,
1331
+ "description": "Short display label."
1332
+ },
1333
+ "value": {
1334
+ "type": "string",
1335
+ "minLength": 1,
1336
+ "maxLength": 32
1337
+ },
1338
+ "tone": {
1339
+ "default": "neutral",
1340
+ "type": "string",
1341
+ "enum": [
1342
+ "neutral",
1343
+ "added",
1344
+ "modified",
1345
+ "removed",
1346
+ "hero"
1347
+ ]
1348
+ }
1349
+ },
1350
+ "required": [
1351
+ "label",
1352
+ "value"
1353
+ ],
1354
+ "additionalProperties": false,
1355
+ "description": "A headline chip above the diagram."
1356
+ }
1357
+ }
1358
+ },
1359
+ "additionalProperties": false,
1360
+ "description": "Headline numbers for the comment header."
1361
+ }
1362
+ },
1363
+ "required": [
1364
+ "op",
1365
+ "stats"
1366
+ ],
1367
+ "additionalProperties": false
1368
+ }
1369
+ ],
1370
+ "description": "A single change to a stored graph document."
1371
+ },
1372
+ "description": "Applied in array order."
1373
+ }
1374
+ },
1375
+ "required": [
1376
+ "schemaVersion",
1377
+ "kind",
1378
+ "target",
1379
+ "ops"
1380
+ ],
1381
+ "additionalProperties": false,
1382
+ "description": "A PR Lens patch document."
1383
+ }