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

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 +16 -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
@@ -42,7 +42,7 @@ describe('query.resolver.ts.ejs', () => {
42
42
  },
43
43
  },
44
44
  ],
45
- specs: { name: '', rules: [] },
45
+ specs: [],
46
46
  },
47
47
  },
48
48
  ],
@@ -165,7 +165,7 @@ describe('query.resolver.ts.ejs', () => {
165
165
  },
166
166
  },
167
167
  ],
168
- specs: { name: '', rules: [] },
168
+ specs: [],
169
169
  },
170
170
  },
171
171
  ],
@@ -274,54 +274,62 @@ describe('query.resolver.ts.ejs', () => {
274
274
  origin: { type: 'projection', name: 'Questionnaires', idField: 'questionnaire-participantId' },
275
275
  },
276
276
  ],
277
- specs: {
278
- name: '',
279
- rules: [
280
- {
281
- description: 'questionnaires show current progress',
282
- examples: [
283
- {
284
- description: 'a question has already been answered',
285
- given: [
286
- {
287
- eventRef: 'QuestionAnswered',
288
- exampleData: {
289
- questionnaireId: 'q-001',
290
- participantId: 'participant-abc',
291
- link: 'https://app.example.com/q/q-001?participant=participant-abc',
292
- 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: 'QuestionAnswered',
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
+ },
293
297
  },
294
- },
295
- {
296
- eventRef: 'QuestionAnswered',
297
- exampleData: {
298
- questionnaireId: 'q-001',
299
- participantId: 'participant-abc',
300
- questionId: 'q1',
301
- answer: 'Yes',
302
- savedAt: '2030-01-01T09:05:00.000Z',
298
+ {
299
+ keyword: 'Given',
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
+ },
303
308
  },
304
- },
305
- ],
306
- when: { exampleData: {}, eventRef: 'QuestionnaireLinkSent' },
307
- then: [
308
- {
309
- stateRef: 'QuestionnaireProgress',
310
- exampleData: {
311
- questionnaireId: 'q-001',
312
- participantId: 'participant-abc',
313
- status: 'in_progress',
314
- currentQuestionId: 'q2',
315
- remainingQuestions: ['q2', 'q3'],
316
- answers: [{ questionId: 'q1', value: 'Yes' }],
309
+ {
310
+ keyword: 'When',
311
+ text: 'QuestionnaireLinkSent',
312
+ docString: {},
317
313
  },
318
- },
319
- ],
320
- },
321
- ],
322
- },
323
- ],
324
- },
314
+ {
315
+ keyword: 'Then',
316
+ text: 'QuestionnaireProgress',
317
+ docString: {
318
+ questionnaireId: 'q-001',
319
+ participantId: 'participant-abc',
320
+ status: 'in_progress',
321
+ currentQuestionId: 'q2',
322
+ remainingQuestions: ['q2', 'q3'],
323
+ answers: [{ questionId: 'q1', value: 'Yes' }],
324
+ },
325
+ },
326
+ ],
327
+ },
328
+ ],
329
+ },
330
+ ],
331
+ },
332
+ ],
325
333
  },
326
334
  },
327
335
  ],
@@ -454,7 +462,7 @@ describe('query.resolver.ts.ejs', () => {
454
462
  },
455
463
  },
456
464
  ],
457
- specs: { name: '', rules: [] },
465
+ specs: [],
458
466
  },
459
467
  },
460
468
  ],
@@ -517,7 +525,7 @@ describe('query.resolver.ts.ejs', () => {
517
525
  },
518
526
  },
519
527
  ],
520
- specs: { name: '', rules: [] },
528
+ specs: [],
521
529
  },
522
530
  },
523
531
  ],
@@ -577,7 +585,7 @@ describe('query.resolver.ts.ejs', () => {
577
585
  },
578
586
  },
579
587
  ],
580
- specs: { name: '', rules: [] },
588
+ specs: [],
581
589
  },
582
590
  },
583
591
  ],
@@ -641,7 +649,7 @@ describe('query.resolver.ts.ejs', () => {
641
649
  },
642
650
  },
643
651
  ],
644
- specs: { name: '', rules: [] },
652
+ specs: [],
645
653
  },
646
654
  },
647
655
  ],
@@ -31,7 +31,7 @@ describe('state.ts.ejs', () => {
31
31
  },
32
32
  },
33
33
  ],
34
- specs: { name: '', rules: [] },
34
+ specs: [],
35
35
  },
36
36
  },
37
37
  ],
@@ -16,50 +16,55 @@ describe('react.specs.ts.ejs (react slice)', () => {
16
16
  client: { specs: [] },
17
17
  server: {
18
18
  description: '',
19
- specs: {
20
- name: 'Guest submits booking request command',
21
- rules: [
22
- {
23
- description: 'Should handle booking request successfully',
24
- examples: [
25
- {
26
- description: 'User submits booking request successfully',
27
- when: {
28
- commandRef: 'RequestBooking',
29
- exampleData: {
30
- propertyId: 'listing_123',
31
- hostId: 'host_123',
32
- guestId: 'guest_456',
33
- checkIn: '2025-07-15',
34
- checkOut: '2025-07-18',
35
- guests: 2,
36
- message: 'Looking forward to my stay!',
37
- metadata: { now: 'bar', bookingId: '123' },
38
- },
39
- },
40
- then: [
41
- {
42
- eventRef: 'BookingRequested',
43
- exampleData: {
44
- bookingId: 'book_xyz789',
45
- hostId: 'host_123',
46
- propertyId: 'prop_789',
47
- guestId: 'guest_456',
48
- checkIn: '2025-07-15',
49
- checkOut: '2025-07-18',
50
- guests: 2,
51
- message: 'Hey',
52
- status: 'pending_host_approval',
53
- requestedAt: '2025-06-10T16:30:00.000Z',
54
- expiresAt: '2025-06-11T16:30:00.000Z',
19
+ specs: [
20
+ {
21
+ type: 'gherkin',
22
+ feature: 'Guest submits booking request command',
23
+ rules: [
24
+ {
25
+ name: 'Should handle booking request successfully',
26
+ examples: [
27
+ {
28
+ name: 'User submits booking request successfully',
29
+ steps: [
30
+ {
31
+ keyword: 'When',
32
+ text: 'RequestBooking',
33
+ docString: {
34
+ propertyId: 'listing_123',
35
+ hostId: 'host_123',
36
+ guestId: 'guest_456',
37
+ checkIn: '2025-07-15',
38
+ checkOut: '2025-07-18',
39
+ guests: 2,
40
+ message: 'Looking forward to my stay!',
41
+ metadata: { now: 'bar', bookingId: '123' },
42
+ },
43
+ },
44
+ {
45
+ keyword: 'Then',
46
+ text: 'BookingRequested',
47
+ docString: {
48
+ bookingId: 'book_xyz789',
49
+ hostId: 'host_123',
50
+ propertyId: 'prop_789',
51
+ guestId: 'guest_456',
52
+ checkIn: '2025-07-15',
53
+ checkOut: '2025-07-18',
54
+ guests: 2,
55
+ message: 'Hey',
56
+ status: 'pending_host_approval',
57
+ requestedAt: '2025-06-10T16:30:00.000Z',
58
+ expiresAt: '2025-06-11T16:30:00.000Z',
59
+ },
55
60
  },
56
- },
57
- ],
58
- },
59
- ],
60
- },
61
- ],
62
- },
61
+ ],
62
+ },
63
+ ],
64
+ },
65
+ ],
66
+ },
67
+ ],
63
68
  },
64
69
  },
65
70
  {
@@ -73,50 +78,53 @@ describe('react.specs.ts.ejs (react slice)', () => {
73
78
  destination: { type: 'stream', pattern: 'booking-${hostId}' },
74
79
  },
75
80
  ],
76
- specs: {
77
- name: 'Send notification to host reaction',
78
- rules: [
79
- {
80
- description: 'Should send host notification on booking request',
81
- examples: [
82
- {
83
- description: 'Booking request triggers host notification',
84
- when: [
85
- {
86
- eventRef: 'BookingRequested',
87
- exampleData: {
88
- bookingId: 'book_xyz789',
89
- hostId: 'host_123',
90
- propertyId: 'prop_789',
91
- guestId: 'guest_456',
92
- checkIn: '2025-07-15',
93
- checkOut: '2025-07-18',
94
- guests: 2,
95
- message: 'Hey',
96
- status: 'pending_host_approval',
97
- requestedAt: '2025-06-10T16:30:00.000Z',
98
- expiresAt: '2025-06-11T16:30:00.000Z',
81
+ specs: [
82
+ {
83
+ type: 'gherkin',
84
+ feature: 'Send notification to host reaction',
85
+ rules: [
86
+ {
87
+ name: 'Should send host notification on booking request',
88
+ examples: [
89
+ {
90
+ name: 'Booking request triggers host notification',
91
+ steps: [
92
+ {
93
+ keyword: 'When',
94
+ text: 'BookingRequested',
95
+ docString: {
96
+ bookingId: 'book_xyz789',
97
+ hostId: 'host_123',
98
+ propertyId: 'prop_789',
99
+ guestId: 'guest_456',
100
+ checkIn: '2025-07-15',
101
+ checkOut: '2025-07-18',
102
+ guests: 2,
103
+ message: 'Hey',
104
+ status: 'pending_host_approval',
105
+ requestedAt: '2025-06-10T16:30:00.000Z',
106
+ expiresAt: '2025-06-11T16:30:00.000Z',
107
+ },
99
108
  },
100
- },
101
- ],
102
- then: [
103
- {
104
- commandRef: 'NotifyHost',
105
- exampleData: {
106
- hostId: 'host_123',
107
- notificationType: 'booking_request',
108
- priority: 'high',
109
- channels: ['email', 'push'],
110
- message: 'A guest has requested to book your place.',
111
- actionRequired: true,
109
+ {
110
+ keyword: 'Then',
111
+ text: 'NotifyHost',
112
+ docString: {
113
+ hostId: 'host_123',
114
+ notificationType: 'booking_request',
115
+ priority: 'high',
116
+ channels: ['email', 'push'],
117
+ message: 'A guest has requested to book your place.',
118
+ actionRequired: true,
119
+ },
112
120
  },
113
- },
114
- ],
115
- },
116
- ],
117
- },
118
- ],
119
- },
121
+ ],
122
+ },
123
+ ],
124
+ },
125
+ ],
126
+ },
127
+ ],
120
128
  },
121
129
  },
122
130
  ],