@auto-engineer/server-generator-apollo-emmett 0.13.0 → 0.13.1

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 (92) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +8 -0
  3. package/dist/src/codegen/extract/commands.d.ts +7 -14
  4. package/dist/src/codegen/extract/commands.d.ts.map +1 -1
  5. package/dist/src/codegen/extract/commands.js.map +1 -1
  6. package/dist/src/codegen/extract/data-sink.d.ts +1 -1
  7. package/dist/src/codegen/extract/data-sink.d.ts.map +1 -1
  8. package/dist/src/codegen/extract/data-sink.js +9 -31
  9. package/dist/src/codegen/extract/data-sink.js.map +1 -1
  10. package/dist/src/codegen/extract/events.d.ts +4 -8
  11. package/dist/src/codegen/extract/events.d.ts.map +1 -1
  12. package/dist/src/codegen/extract/events.js.map +1 -1
  13. package/dist/src/codegen/extract/gwt.d.ts +2 -2
  14. package/dist/src/codegen/extract/gwt.d.ts.map +1 -1
  15. package/dist/src/codegen/extract/gwt.js +6 -21
  16. package/dist/src/codegen/extract/gwt.js.map +1 -1
  17. package/dist/src/codegen/extract/messages.d.ts +4 -4
  18. package/dist/src/codegen/extract/messages.d.ts.map +1 -1
  19. package/dist/src/codegen/extract/messages.js +24 -47
  20. package/dist/src/codegen/extract/messages.js.map +1 -1
  21. package/dist/src/codegen/extract/query.d.ts +5 -7
  22. package/dist/src/codegen/extract/query.d.ts.map +1 -1
  23. package/dist/src/codegen/extract/query.js +10 -8
  24. package/dist/src/codegen/extract/query.js.map +1 -1
  25. package/dist/src/codegen/extract/slice-normalizer.d.ts +29 -0
  26. package/dist/src/codegen/extract/slice-normalizer.d.ts.map +1 -0
  27. package/dist/src/codegen/extract/slice-normalizer.js +48 -0
  28. package/dist/src/codegen/extract/slice-normalizer.js.map +1 -0
  29. package/dist/src/codegen/extract/step-converter.d.ts +17 -0
  30. package/dist/src/codegen/extract/step-converter.d.ts.map +1 -0
  31. package/dist/src/codegen/extract/step-converter.js +82 -0
  32. package/dist/src/codegen/extract/step-converter.js.map +1 -0
  33. package/dist/src/codegen/extract/step-types.d.ts +30 -0
  34. package/dist/src/codegen/extract/step-types.d.ts.map +1 -0
  35. package/dist/src/codegen/extract/step-types.js +16 -0
  36. package/dist/src/codegen/extract/step-types.js.map +1 -0
  37. package/dist/src/codegen/scaffoldFromSchema.d.ts.map +1 -1
  38. package/dist/src/codegen/scaffoldFromSchema.js +7 -29
  39. package/dist/src/codegen/scaffoldFromSchema.js.map +1 -1
  40. package/dist/src/codegen/templates/command/commands.specs.ts +33 -28
  41. package/dist/src/codegen/templates/command/decide.specs.specs.ts +153 -138
  42. package/dist/src/codegen/templates/command/decide.specs.ts +169 -146
  43. package/dist/src/codegen/templates/command/events.specs.ts +43 -38
  44. package/dist/src/codegen/templates/command/evolve.specs.ts +38 -33
  45. package/dist/src/codegen/templates/command/handle.specs.ts +71 -61
  46. package/dist/src/codegen/templates/command/mutation.resolver.specs.ts +122 -102
  47. package/dist/src/codegen/templates/command/register.specs.ts +39 -34
  48. package/dist/src/codegen/templates/command/state.specs.ts +39 -34
  49. package/dist/src/codegen/templates/query/projection.specs.specs.ts +399 -359
  50. package/dist/src/codegen/templates/query/projection.specs.ts +242 -216
  51. package/dist/src/codegen/templates/query/projection.specs.ts.ejs +38 -12
  52. package/dist/src/codegen/templates/query/query.resolver.specs.ts +59 -51
  53. package/dist/src/codegen/templates/query/state.specs.ts +1 -1
  54. package/dist/src/codegen/templates/react/react.specs.specs.ts +93 -85
  55. package/dist/src/codegen/templates/react/react.specs.ts +135 -122
  56. package/dist/src/codegen/templates/react/register.specs.ts +135 -122
  57. package/dist/src/codegen/test-data/specVariant1.d.ts.map +1 -1
  58. package/dist/src/codegen/test-data/specVariant1.js +101 -90
  59. package/dist/src/codegen/test-data/specVariant1.js.map +1 -1
  60. package/dist/src/codegen/types.d.ts +5 -7
  61. package/dist/src/codegen/types.d.ts.map +1 -1
  62. package/dist/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +4 -4
  64. package/src/codegen/extract/commands.ts +7 -8
  65. package/src/codegen/extract/data-sink.ts +16 -43
  66. package/src/codegen/extract/events.ts +4 -5
  67. package/src/codegen/extract/gwt.ts +12 -29
  68. package/src/codegen/extract/messages.ts +43 -70
  69. package/src/codegen/extract/query.ts +14 -12
  70. package/src/codegen/extract/slice-normalizer.ts +88 -0
  71. package/src/codegen/extract/step-converter.ts +124 -0
  72. package/src/codegen/extract/step-types.ts +52 -0
  73. package/src/codegen/scaffoldFromSchema.ts +8 -45
  74. package/src/codegen/templates/command/commands.specs.ts +33 -28
  75. package/src/codegen/templates/command/decide.specs.specs.ts +153 -138
  76. package/src/codegen/templates/command/decide.specs.ts +169 -146
  77. package/src/codegen/templates/command/events.specs.ts +43 -38
  78. package/src/codegen/templates/command/evolve.specs.ts +38 -33
  79. package/src/codegen/templates/command/handle.specs.ts +71 -61
  80. package/src/codegen/templates/command/mutation.resolver.specs.ts +122 -102
  81. package/src/codegen/templates/command/register.specs.ts +39 -34
  82. package/src/codegen/templates/command/state.specs.ts +39 -34
  83. package/src/codegen/templates/query/projection.specs.specs.ts +399 -359
  84. package/src/codegen/templates/query/projection.specs.ts +242 -216
  85. package/src/codegen/templates/query/projection.specs.ts.ejs +38 -12
  86. package/src/codegen/templates/query/query.resolver.specs.ts +59 -51
  87. package/src/codegen/templates/query/state.specs.ts +1 -1
  88. package/src/codegen/templates/react/react.specs.specs.ts +93 -85
  89. package/src/codegen/templates/react/react.specs.ts +135 -122
  90. package/src/codegen/templates/react/register.specs.ts +135 -122
  91. package/src/codegen/test-data/specVariant1.ts +101 -90
  92. package/src/codegen/types.ts +6 -4
@@ -17,56 +17,63 @@ describe('projection.specs.ts.ejs', () => {
17
17
  client: { specs: [] },
18
18
  server: {
19
19
  description: '',
20
- specs: {
21
- name: 'CreateListing command',
22
- rules: [
23
- {
24
- description: 'Should handle listing operations',
25
- examples: [
26
- {
27
- description: 'User creates listing successfully',
28
- when: {
29
- commandRef: 'CreateListing',
30
- exampleData: {
31
- propertyId: 'listing_123',
32
- title: 'Sea View Flat',
33
- pricePerNight: 120,
34
- location: 'Brighton',
35
- maxGuests: 4,
36
- },
20
+ specs: [
21
+ {
22
+ type: 'gherkin',
23
+ feature: 'CreateListing command',
24
+ rules: [
25
+ {
26
+ name: 'Should handle listing operations',
27
+ examples: [
28
+ {
29
+ name: 'User creates listing successfully',
30
+ steps: [
31
+ {
32
+ keyword: 'When',
33
+ text: 'CreateListing',
34
+ docString: {
35
+ propertyId: 'listing_123',
36
+ title: 'Sea View Flat',
37
+ pricePerNight: 120,
38
+ location: 'Brighton',
39
+ maxGuests: 4,
40
+ },
41
+ },
42
+ {
43
+ keyword: 'Then',
44
+ text: 'ListingCreated',
45
+ docString: {
46
+ propertyId: 'listing_123',
47
+ title: 'Sea View Flat',
48
+ pricePerNight: 120,
49
+ location: 'Brighton',
50
+ maxGuests: 4,
51
+ },
52
+ },
53
+ ],
37
54
  },
38
- then: [
39
- {
40
- eventRef: 'ListingCreated',
41
- exampleData: {
42
- propertyId: 'listing_123',
43
- title: 'Sea View Flat',
44
- pricePerNight: 120,
45
- location: 'Brighton',
46
- maxGuests: 4,
55
+ {
56
+ name: 'User removes listing successfully',
57
+ steps: [
58
+ {
59
+ keyword: 'When',
60
+ text: 'RemoveListing',
61
+ docString: {
62
+ propertyId: 'listing_123',
63
+ },
47
64
  },
48
- },
49
- ],
50
- },
51
- {
52
- description: 'User removes listing successfully',
53
- when: {
54
- commandRef: 'RemoveListing',
55
- exampleData: {
56
- propertyId: 'listing_123',
57
- },
65
+ {
66
+ keyword: 'Then',
67
+ text: 'ListingRemoved',
68
+ docString: {},
69
+ },
70
+ ],
58
71
  },
59
- then: [
60
- {
61
- eventRef: 'ListingRemoved',
62
- exampleData: {},
63
- },
64
- ],
65
- },
66
- ],
67
- },
68
- ],
69
- },
72
+ ],
73
+ },
74
+ ],
75
+ },
76
+ ],
70
77
  },
71
78
  },
72
79
  {
@@ -89,43 +96,46 @@ describe('projection.specs.ts.ejs', () => {
89
96
  },
90
97
  },
91
98
  ],
92
- specs: {
93
- name: 'Search listings query',
94
- rules: [
95
- {
96
- description: 'Should project listings correctly',
97
- examples: [
98
- {
99
- description: 'Listing created shows in search results',
100
- when: [
101
- {
102
- eventRef: 'ListingCreated',
103
- exampleData: {
104
- propertyId: 'listing_123',
105
- title: 'Sea View Flat',
106
- pricePerNight: 120,
107
- location: 'Brighton',
108
- maxGuests: 4,
99
+ specs: [
100
+ {
101
+ type: 'gherkin',
102
+ feature: 'Search listings query',
103
+ rules: [
104
+ {
105
+ name: 'Should project listings correctly',
106
+ examples: [
107
+ {
108
+ name: 'Listing created shows in search results',
109
+ steps: [
110
+ {
111
+ keyword: 'When',
112
+ text: 'ListingCreated',
113
+ docString: {
114
+ propertyId: 'listing_123',
115
+ title: 'Sea View Flat',
116
+ pricePerNight: 120,
117
+ location: 'Brighton',
118
+ maxGuests: 4,
119
+ },
109
120
  },
110
- },
111
- ],
112
- then: [
113
- {
114
- stateRef: 'AvailableListings',
115
- exampleData: {
116
- propertyId: 'listing_123',
117
- title: 'Sea View Flat',
118
- pricePerNight: 120,
119
- location: 'Brighton',
120
- maxGuests: 4,
121
+ {
122
+ keyword: 'Then',
123
+ text: 'AvailableListings',
124
+ docString: {
125
+ propertyId: 'listing_123',
126
+ title: 'Sea View Flat',
127
+ pricePerNight: 120,
128
+ location: 'Brighton',
129
+ maxGuests: 4,
130
+ },
121
131
  },
122
- },
123
- ],
124
- },
125
- ],
126
- },
127
- ],
128
- },
132
+ ],
133
+ },
134
+ ],
135
+ },
136
+ ],
137
+ },
138
+ ],
129
139
  },
130
140
  },
131
141
  ],
@@ -264,60 +274,62 @@ describe('projection.specs.ts.ejs', () => {
264
274
  },
265
275
  },
266
276
  ],
267
- specs: {
268
- name: '',
269
- rules: [
270
- {
271
- description: 'questionnaires show current progress',
272
- examples: [
273
- {
274
- description: 'a question has already been answered',
275
- given: [
276
- {
277
- eventRef: 'QuestionnaireLinkSent',
278
- exampleData: {
279
- questionnaireId: 'q-001',
280
- participantId: 'participant-abc',
281
- link: 'https://app.example.com/q/q-001?participant=participant-abc',
282
- sentAt: '2030-01-01T09:00:00.000Z',
277
+ specs: [
278
+ {
279
+ type: 'gherkin',
280
+ feature: '',
281
+ rules: [
282
+ {
283
+ name: 'questionnaires show current progress',
284
+ examples: [
285
+ {
286
+ name: 'a question has already been answered',
287
+ steps: [
288
+ {
289
+ keyword: 'Given',
290
+ text: 'QuestionnaireLinkSent',
291
+ docString: {
292
+ questionnaireId: 'q-001',
293
+ participantId: 'participant-abc',
294
+ link: 'https://app.example.com/q/q-001?participant=participant-abc',
295
+ sentAt: '2030-01-01T09:00:00.000Z',
296
+ },
283
297
  },
284
- },
285
- ],
286
- when: [
287
- {
288
- eventRef: 'QuestionAnswered',
289
- exampleData: {
290
- questionnaireId: 'q-001',
291
- participantId: 'participant-abc',
292
- questionId: 'q1',
293
- answer: 'Yes',
294
- savedAt: '2030-01-01T09:05:00.000Z',
298
+ {
299
+ keyword: 'When',
300
+ text: 'QuestionAnswered',
301
+ docString: {
302
+ questionnaireId: 'q-001',
303
+ participantId: 'participant-abc',
304
+ questionId: 'q1',
305
+ answer: 'Yes',
306
+ savedAt: '2030-01-01T09:05:00.000Z',
307
+ },
295
308
  },
296
- },
297
- ],
298
- then: [
299
- {
300
- stateRef: 'QuestionnaireProgress',
301
- exampleData: {
302
- questionnaireId: 'q-001',
303
- participantId: 'participant-abc',
304
- status: 'in_progress',
305
- currentQuestionId: 'q2',
306
- remainingQuestions: ['q2', 'q3'],
307
- answers: [
308
- {
309
- questionId: 'q1',
310
- value: 'Yes',
311
- },
312
- ],
309
+ {
310
+ keyword: 'Then',
311
+ text: 'QuestionnaireProgress',
312
+ docString: {
313
+ questionnaireId: 'q-001',
314
+ participantId: 'participant-abc',
315
+ status: 'in_progress',
316
+ currentQuestionId: 'q2',
317
+ remainingQuestions: ['q2', 'q3'],
318
+ answers: [
319
+ {
320
+ questionId: 'q1',
321
+ value: 'Yes',
322
+ },
323
+ ],
324
+ },
313
325
  },
314
- },
315
- ],
316
- },
317
- ],
318
- },
319
- ],
320
- },
326
+ ],
327
+ },
328
+ ],
329
+ },
330
+ ],
331
+ },
332
+ ],
321
333
  },
322
334
  },
323
335
  ],
@@ -390,37 +402,42 @@ describe('projection.specs.ts.ejs', () => {
390
402
  client: { specs: [] },
391
403
  server: {
392
404
  description: '',
393
- specs: {
394
- name: 'Sends questionnaire link',
395
- rules: [
396
- {
397
- description: 'sends questionnaire link to participant',
398
- examples: [
399
- {
400
- description: 'sends link successfully',
401
- when: {
402
- commandRef: 'SendQuestionnaireLink',
403
- exampleData: {
404
- questionnaireId: 'q-001',
405
- participantId: 'participant-abc',
406
- },
407
- },
408
- then: [
409
- {
410
- eventRef: 'QuestionnaireLinkSent', // This event is produced here
411
- exampleData: {
412
- questionnaireId: 'q-001',
413
- participantId: 'participant-abc',
414
- link: 'https://app.example.com/q/q-001?participant=participant-abc',
415
- sentAt: new Date('2030-01-01T09:00:00Z'),
405
+ specs: [
406
+ {
407
+ type: 'gherkin',
408
+ feature: 'Sends questionnaire link',
409
+ rules: [
410
+ {
411
+ name: 'sends questionnaire link to participant',
412
+ examples: [
413
+ {
414
+ name: 'sends link successfully',
415
+ steps: [
416
+ {
417
+ keyword: 'When',
418
+ text: 'SendQuestionnaireLink',
419
+ docString: {
420
+ questionnaireId: 'q-001',
421
+ participantId: 'participant-abc',
422
+ },
416
423
  },
417
- },
418
- ],
419
- },
420
- ],
421
- },
422
- ],
423
- },
424
+ {
425
+ keyword: 'Then',
426
+ text: 'QuestionnaireLinkSent',
427
+ docString: {
428
+ questionnaireId: 'q-001',
429
+ participantId: 'participant-abc',
430
+ link: 'https://app.example.com/q/q-001?participant=participant-abc',
431
+ sentAt: new Date('2030-01-01T09:00:00Z'),
432
+ },
433
+ },
434
+ ],
435
+ },
436
+ ],
437
+ },
438
+ ],
439
+ },
440
+ ],
424
441
  },
425
442
  },
426
443
  {
@@ -429,40 +446,45 @@ describe('projection.specs.ts.ejs', () => {
429
446
  client: { specs: [] },
430
447
  server: {
431
448
  description: '',
432
- specs: {
433
- name: 'Submits questionnaire answer',
434
- rules: [
435
- {
436
- description: 'submits answer successfully',
437
- examples: [
438
- {
439
- description: 'answers question',
440
- when: {
441
- commandRef: 'AnswerQuestion',
442
- exampleData: {
443
- questionnaireId: 'q-001',
444
- participantId: 'participant-abc',
445
- questionId: 'q1',
446
- answer: 'Yes',
447
- },
448
- },
449
- then: [
450
- {
451
- eventRef: 'QuestionAnswered', // This event is produced here
452
- exampleData: {
453
- questionnaireId: 'q-001',
454
- participantId: 'participant-abc',
455
- questionId: 'q1',
456
- answer: 'Yes',
457
- savedAt: new Date('2030-01-01T09:05:00Z'),
449
+ specs: [
450
+ {
451
+ type: 'gherkin',
452
+ feature: 'Submits questionnaire answer',
453
+ rules: [
454
+ {
455
+ name: 'submits answer successfully',
456
+ examples: [
457
+ {
458
+ name: 'answers question',
459
+ steps: [
460
+ {
461
+ keyword: 'When',
462
+ text: 'AnswerQuestion',
463
+ docString: {
464
+ questionnaireId: 'q-001',
465
+ participantId: 'participant-abc',
466
+ questionId: 'q1',
467
+ answer: 'Yes',
468
+ },
458
469
  },
459
- },
460
- ],
461
- },
462
- ],
463
- },
464
- ],
465
- },
470
+ {
471
+ keyword: 'Then',
472
+ text: 'QuestionAnswered',
473
+ docString: {
474
+ questionnaireId: 'q-001',
475
+ participantId: 'participant-abc',
476
+ questionId: 'q1',
477
+ answer: 'Yes',
478
+ savedAt: new Date('2030-01-01T09:05:00Z'),
479
+ },
480
+ },
481
+ ],
482
+ },
483
+ ],
484
+ },
485
+ ],
486
+ },
487
+ ],
466
488
  },
467
489
  },
468
490
  {
@@ -471,55 +493,57 @@ describe('projection.specs.ts.ejs', () => {
471
493
  client: { specs: [] },
472
494
  server: {
473
495
  description: '',
474
- specs: {
475
- name: 'Views the questionnaire',
476
- rules: [
477
- {
478
- description: 'questionnaires show current progress',
479
- examples: [
480
- {
481
- description: 'a question has already been answered',
482
- given: [
483
- {
484
- eventRef: 'QuestionnaireLinkSent',
485
- exampleData: {
486
- questionnaireId: 'q-001',
487
- participantId: 'participant-abc',
488
- link: 'https://app.example.com/q/q-001?participant=participant-abc',
489
- sentAt: new Date('2030-01-01T09:00:00Z'),
496
+ specs: [
497
+ {
498
+ type: 'gherkin',
499
+ feature: 'Views the questionnaire',
500
+ rules: [
501
+ {
502
+ name: 'questionnaires show current progress',
503
+ examples: [
504
+ {
505
+ name: 'a question has already been answered',
506
+ steps: [
507
+ {
508
+ keyword: 'Given',
509
+ text: 'QuestionnaireLinkSent',
510
+ docString: {
511
+ questionnaireId: 'q-001',
512
+ participantId: 'participant-abc',
513
+ link: 'https://app.example.com/q/q-001?participant=participant-abc',
514
+ sentAt: new Date('2030-01-01T09:00:00Z'),
515
+ },
490
516
  },
491
- },
492
- ],
493
- when: [
494
- {
495
- eventRef: 'QuestionAnswered', // This should be included in imports!
496
- exampleData: {
497
- questionnaireId: 'q-001',
498
- participantId: 'participant-abc',
499
- questionId: 'q1',
500
- answer: 'Yes',
501
- savedAt: new Date('2030-01-01T09:05:00Z'),
517
+ {
518
+ keyword: 'When',
519
+ text: 'QuestionAnswered',
520
+ docString: {
521
+ questionnaireId: 'q-001',
522
+ participantId: 'participant-abc',
523
+ questionId: 'q1',
524
+ answer: 'Yes',
525
+ savedAt: new Date('2030-01-01T09:05:00Z'),
526
+ },
502
527
  },
503
- },
504
- ],
505
- then: [
506
- {
507
- stateRef: 'QuestionnaireProgress',
508
- exampleData: {
509
- questionnaireId: 'q-001',
510
- participantId: 'participant-abc',
511
- status: 'in_progress',
512
- currentQuestionId: 'q2',
513
- remainingQuestions: ['q2'],
514
- answers: [{ questionId: 'q1', value: 'Yes' }],
528
+ {
529
+ keyword: 'Then',
530
+ text: 'QuestionnaireProgress',
531
+ docString: {
532
+ questionnaireId: 'q-001',
533
+ participantId: 'participant-abc',
534
+ status: 'in_progress',
535
+ currentQuestionId: 'q2',
536
+ remainingQuestions: ['q2'],
537
+ answers: [{ questionId: 'q1', value: 'Yes' }],
538
+ },
515
539
  },
516
- },
517
- ],
518
- },
519
- ],
520
- },
521
- ],
522
- },
540
+ ],
541
+ },
542
+ ],
543
+ },
544
+ ],
545
+ },
546
+ ],
523
547
  data: [
524
548
  {
525
549
  origin: { name: 'Questionnaires', idField: 'questionnaireId-participantId' },
@@ -635,35 +659,40 @@ describe('projection.specs.ts.ejs', () => {
635
659
  client: { specs: [] },
636
660
  server: {
637
661
  description: '',
638
- specs: {
639
- name: 'Manage todo command',
640
- rules: [
641
- {
642
- description: 'Should handle todo operations',
643
- examples: [
644
- {
645
- description: 'User adds todo',
646
- when: {
647
- commandRef: 'AddTodo',
648
- exampleData: {
649
- todoId: 'todo_123',
650
- title: 'Buy milk',
651
- },
652
- },
653
- then: [
654
- {
655
- eventRef: 'TodoAdded',
656
- exampleData: {
657
- todoId: 'todo_123',
658
- title: 'Buy milk',
662
+ specs: [
663
+ {
664
+ type: 'gherkin',
665
+ feature: 'Manage todo command',
666
+ rules: [
667
+ {
668
+ name: 'Should handle todo operations',
669
+ examples: [
670
+ {
671
+ name: 'User adds todo',
672
+ steps: [
673
+ {
674
+ keyword: 'When',
675
+ text: 'AddTodo',
676
+ docString: {
677
+ todoId: 'todo_123',
678
+ title: 'Buy milk',
679
+ },
659
680
  },
660
- },
661
- ],
662
- },
663
- ],
664
- },
665
- ],
666
- },
681
+ {
682
+ keyword: 'Then',
683
+ text: 'TodoAdded',
684
+ docString: {
685
+ todoId: 'todo_123',
686
+ title: 'Buy milk',
687
+ },
688
+ },
689
+ ],
690
+ },
691
+ ],
692
+ },
693
+ ],
694
+ },
695
+ ],
667
696
  },
668
697
  },
669
698
  {
@@ -686,36 +715,39 @@ describe('projection.specs.ts.ejs', () => {
686
715
  },
687
716
  },
688
717
  ],
689
- specs: {
690
- name: 'View summary query',
691
- rules: [
692
- {
693
- description: 'Should aggregate todo counts',
694
- examples: [
695
- {
696
- description: 'Todo added updates count',
697
- when: [
698
- {
699
- eventRef: 'TodoAdded',
700
- exampleData: {
701
- todoId: 'todo_123',
702
- title: 'Buy milk',
718
+ specs: [
719
+ {
720
+ type: 'gherkin',
721
+ feature: 'View summary query',
722
+ rules: [
723
+ {
724
+ name: 'Should aggregate todo counts',
725
+ examples: [
726
+ {
727
+ name: 'Todo added updates count',
728
+ steps: [
729
+ {
730
+ keyword: 'When',
731
+ text: 'TodoAdded',
732
+ docString: {
733
+ todoId: 'todo_123',
734
+ title: 'Buy milk',
735
+ },
703
736
  },
704
- },
705
- ],
706
- then: [
707
- {
708
- stateRef: 'TodoSummary',
709
- exampleData: {
710
- totalCount: 1,
737
+ {
738
+ keyword: 'Then',
739
+ text: 'TodoSummary',
740
+ docString: {
741
+ totalCount: 1,
742
+ },
711
743
  },
712
- },
713
- ],
714
- },
715
- ],
716
- },
717
- ],
718
- },
744
+ ],
745
+ },
746
+ ],
747
+ },
748
+ ],
749
+ },
750
+ ],
719
751
  },
720
752
  },
721
753
  ],
@@ -810,37 +842,42 @@ describe('projection.specs.ts.ejs', () => {
810
842
  client: { specs: [] },
811
843
  server: {
812
844
  description: '',
813
- specs: {
814
- name: 'Manage user project command',
815
- rules: [
816
- {
817
- description: 'Should handle user project operations',
818
- examples: [
819
- {
820
- description: 'User joins project',
821
- when: {
822
- commandRef: 'JoinProject',
823
- exampleData: {
824
- userId: 'user_123',
825
- projectId: 'proj_456',
826
- role: 'developer',
827
- },
828
- },
829
- then: [
830
- {
831
- eventRef: 'UserJoinedProject',
832
- exampleData: {
833
- userId: 'user_123',
834
- projectId: 'proj_456',
835
- role: 'developer',
845
+ specs: [
846
+ {
847
+ type: 'gherkin',
848
+ feature: 'Manage user project command',
849
+ rules: [
850
+ {
851
+ name: 'Should handle user project operations',
852
+ examples: [
853
+ {
854
+ name: 'User joins project',
855
+ steps: [
856
+ {
857
+ keyword: 'When',
858
+ text: 'JoinProject',
859
+ docString: {
860
+ userId: 'user_123',
861
+ projectId: 'proj_456',
862
+ role: 'developer',
863
+ },
836
864
  },
837
- },
838
- ],
839
- },
840
- ],
841
- },
842
- ],
843
- },
865
+ {
866
+ keyword: 'Then',
867
+ text: 'UserJoinedProject',
868
+ docString: {
869
+ userId: 'user_123',
870
+ projectId: 'proj_456',
871
+ role: 'developer',
872
+ },
873
+ },
874
+ ],
875
+ },
876
+ ],
877
+ },
878
+ ],
879
+ },
880
+ ],
844
881
  },
845
882
  },
846
883
  {
@@ -863,39 +900,42 @@ describe('projection.specs.ts.ejs', () => {
863
900
  },
864
901
  },
865
902
  ],
866
- specs: {
867
- name: 'View user projects query',
868
- rules: [
869
- {
870
- description: 'Should track user project memberships',
871
- examples: [
872
- {
873
- description: 'User joins project',
874
- when: [
875
- {
876
- eventRef: 'UserJoinedProject',
877
- exampleData: {
878
- userId: 'user_123',
879
- projectId: 'proj_456',
880
- role: 'developer',
903
+ specs: [
904
+ {
905
+ type: 'gherkin',
906
+ feature: 'View user projects query',
907
+ rules: [
908
+ {
909
+ name: 'Should track user project memberships',
910
+ examples: [
911
+ {
912
+ name: 'User joins project',
913
+ steps: [
914
+ {
915
+ keyword: 'When',
916
+ text: 'UserJoinedProject',
917
+ docString: {
918
+ userId: 'user_123',
919
+ projectId: 'proj_456',
920
+ role: 'developer',
921
+ },
881
922
  },
882
- },
883
- ],
884
- then: [
885
- {
886
- stateRef: 'UserProject',
887
- exampleData: {
888
- userId: 'user_123',
889
- projectId: 'proj_456',
890
- role: 'developer',
923
+ {
924
+ keyword: 'Then',
925
+ text: 'UserProject',
926
+ docString: {
927
+ userId: 'user_123',
928
+ projectId: 'proj_456',
929
+ role: 'developer',
930
+ },
891
931
  },
892
- },
893
- ],
894
- },
895
- ],
896
- },
897
- ],
898
- },
932
+ ],
933
+ },
934
+ ],
935
+ },
936
+ ],
937
+ },
938
+ ],
899
939
  },
900
940
  },
901
941
  ],