@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
@@ -16,50 +16,55 @@ describe('handle.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
  {
@@ -67,50 +72,53 @@ describe('handle.ts.ejs (react slice)', () => {
67
72
  name: 'Send notification to host',
68
73
  server: {
69
74
  description: 'Sends a host notification command in response to BookingRequested',
70
- specs: {
71
- name: 'Send notification to host reaction',
72
- rules: [
73
- {
74
- description: 'Should send host notification on booking request',
75
- examples: [
76
- {
77
- description: 'Booking request triggers host notification',
78
- when: [
79
- {
80
- eventRef: 'BookingRequested',
81
- exampleData: {
82
- bookingId: 'book_xyz789',
83
- hostId: 'host_123',
84
- propertyId: 'prop_789',
85
- guestId: 'guest_456',
86
- checkIn: '2025-07-15',
87
- checkOut: '2025-07-18',
88
- guests: 2,
89
- message: 'Hey',
90
- status: 'pending_host_approval',
91
- requestedAt: '2025-06-10T16:30:00.000Z',
92
- expiresAt: '2025-06-11T16:30:00.000Z',
75
+ specs: [
76
+ {
77
+ type: 'gherkin',
78
+ feature: 'Send notification to host reaction',
79
+ rules: [
80
+ {
81
+ name: 'Should send host notification on booking request',
82
+ examples: [
83
+ {
84
+ name: 'Booking request triggers host notification',
85
+ steps: [
86
+ {
87
+ keyword: 'When',
88
+ text: 'BookingRequested',
89
+ docString: {
90
+ bookingId: 'book_xyz789',
91
+ hostId: 'host_123',
92
+ propertyId: 'prop_789',
93
+ guestId: 'guest_456',
94
+ checkIn: '2025-07-15',
95
+ checkOut: '2025-07-18',
96
+ guests: 2,
97
+ message: 'Hey',
98
+ status: 'pending_host_approval',
99
+ requestedAt: '2025-06-10T16:30:00.000Z',
100
+ expiresAt: '2025-06-11T16:30:00.000Z',
101
+ },
93
102
  },
94
- },
95
- ],
96
- then: [
97
- {
98
- commandRef: 'NotifyHost',
99
- exampleData: {
100
- hostId: 'host_123',
101
- notificationType: 'booking_request',
102
- priority: 'high',
103
- channels: ['email', 'push'],
104
- message: 'A guest has requested to book your place.',
105
- actionRequired: true,
103
+ {
104
+ keyword: 'Then',
105
+ text: 'NotifyHost',
106
+ docString: {
107
+ hostId: 'host_123',
108
+ notificationType: 'booking_request',
109
+ priority: 'high',
110
+ channels: ['email', 'push'],
111
+ message: 'A guest has requested to book your place.',
112
+ actionRequired: true,
113
+ },
106
114
  },
107
- },
108
- ],
109
- },
110
- ],
111
- },
112
- ],
113
- },
115
+ ],
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ ],
114
122
  },
115
123
  },
116
124
  {
@@ -119,44 +127,49 @@ describe('handle.ts.ejs (react slice)', () => {
119
127
  client: { specs: [] },
120
128
  server: {
121
129
  description: '',
122
- specs: {
123
- name: 'Notify host command',
124
- rules: [
125
- {
126
- description: 'Should notify host successfully',
127
- examples: [
128
- {
129
- description: 'Host notification sent successfully',
130
- when: {
131
- commandRef: 'NotifyHost',
132
- exampleData: {
133
- hostId: 'host_123',
134
- notificationType: 'booking_request',
135
- priority: 'high',
136
- channels: ['email', 'push'],
137
- message: 'A guest has requested to book your place.',
138
- actionRequired: true,
139
- },
140
- },
141
- then: [
142
- {
143
- eventRef: 'HostNotified',
144
- exampleData: {
145
- bookingId: 'book_xyz789',
146
- hostId: 'host_123',
147
- notificationType: 'booking_request',
148
- channels: ['email', 'push'],
149
- message: 'hi.',
150
- notifiedAt: '2025-06-10T16:30:00.000Z',
151
- actionRequired: true,
130
+ specs: [
131
+ {
132
+ type: 'gherkin',
133
+ feature: 'Notify host command',
134
+ rules: [
135
+ {
136
+ name: 'Should notify host successfully',
137
+ examples: [
138
+ {
139
+ name: 'Host notification sent successfully',
140
+ steps: [
141
+ {
142
+ keyword: 'When',
143
+ text: 'NotifyHost',
144
+ docString: {
145
+ hostId: 'host_123',
146
+ notificationType: 'booking_request',
147
+ priority: 'high',
148
+ channels: ['email', 'push'],
149
+ message: 'A guest has requested to book your place.',
150
+ actionRequired: true,
151
+ },
152
+ },
153
+ {
154
+ keyword: 'Then',
155
+ text: 'HostNotified',
156
+ docString: {
157
+ bookingId: 'book_xyz789',
158
+ hostId: 'host_123',
159
+ notificationType: 'booking_request',
160
+ channels: ['email', 'push'],
161
+ message: 'hi.',
162
+ notifiedAt: '2025-06-10T16:30:00.000Z',
163
+ actionRequired: true,
164
+ },
152
165
  },
153
- },
154
- ],
155
- },
156
- ],
157
- },
158
- ],
159
- },
166
+ ],
167
+ },
168
+ ],
169
+ },
170
+ ],
171
+ },
172
+ ],
160
173
  },
161
174
  },
162
175
  ],
@@ -16,50 +16,55 @@ describe('register.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
  {
@@ -67,50 +72,53 @@ describe('register.ts.ejs (react slice)', () => {
67
72
  name: 'Send notification to host',
68
73
  server: {
69
74
  description: 'Sends a host notification command in response to BookingRequested',
70
- specs: {
71
- name: 'Send notification to host reaction',
72
- rules: [
73
- {
74
- description: 'Should send host notification on booking request',
75
- examples: [
76
- {
77
- description: 'Booking request triggers host notification',
78
- when: [
79
- {
80
- eventRef: 'BookingRequested',
81
- exampleData: {
82
- bookingId: 'book_xyz789',
83
- hostId: 'host_123',
84
- propertyId: 'prop_789',
85
- guestId: 'guest_456',
86
- checkIn: '2025-07-15',
87
- checkOut: '2025-07-18',
88
- guests: 2,
89
- message: 'Hey',
90
- status: 'pending_host_approval',
91
- requestedAt: '2025-06-10T16:30:00.000Z',
92
- expiresAt: '2025-06-11T16:30:00.000Z',
75
+ specs: [
76
+ {
77
+ type: 'gherkin',
78
+ feature: 'Send notification to host reaction',
79
+ rules: [
80
+ {
81
+ name: 'Should send host notification on booking request',
82
+ examples: [
83
+ {
84
+ name: 'Booking request triggers host notification',
85
+ steps: [
86
+ {
87
+ keyword: 'When',
88
+ text: 'BookingRequested',
89
+ docString: {
90
+ bookingId: 'book_xyz789',
91
+ hostId: 'host_123',
92
+ propertyId: 'prop_789',
93
+ guestId: 'guest_456',
94
+ checkIn: '2025-07-15',
95
+ checkOut: '2025-07-18',
96
+ guests: 2,
97
+ message: 'Hey',
98
+ status: 'pending_host_approval',
99
+ requestedAt: '2025-06-10T16:30:00.000Z',
100
+ expiresAt: '2025-06-11T16:30:00.000Z',
101
+ },
93
102
  },
94
- },
95
- ],
96
- then: [
97
- {
98
- commandRef: 'NotifyHost',
99
- exampleData: {
100
- hostId: 'host_123',
101
- notificationType: 'booking_request',
102
- priority: 'high',
103
- channels: ['email', 'push'],
104
- message: 'A guest has requested to book your place.',
105
- actionRequired: true,
103
+ {
104
+ keyword: 'Then',
105
+ text: 'NotifyHost',
106
+ docString: {
107
+ hostId: 'host_123',
108
+ notificationType: 'booking_request',
109
+ priority: 'high',
110
+ channels: ['email', 'push'],
111
+ message: 'A guest has requested to book your place.',
112
+ actionRequired: true,
113
+ },
106
114
  },
107
- },
108
- ],
109
- },
110
- ],
111
- },
112
- ],
113
- },
115
+ ],
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ ],
114
122
  },
115
123
  },
116
124
  {
@@ -119,44 +127,49 @@ describe('register.ts.ejs (react slice)', () => {
119
127
  client: { specs: [] },
120
128
  server: {
121
129
  description: '',
122
- specs: {
123
- name: 'Notify host command',
124
- rules: [
125
- {
126
- description: 'Should notify host successfully',
127
- examples: [
128
- {
129
- description: 'Host notification sent successfully',
130
- when: {
131
- commandRef: 'NotifyHost',
132
- exampleData: {
133
- hostId: 'host_123',
134
- notificationType: 'booking_request',
135
- priority: 'high',
136
- channels: ['email', 'push'],
137
- message: 'A guest has requested to book your place.',
138
- actionRequired: true,
139
- },
140
- },
141
- then: [
142
- {
143
- eventRef: 'HostNotified',
144
- exampleData: {
145
- bookingId: 'book_xyz789',
146
- hostId: 'host_123',
147
- notificationType: 'booking_request',
148
- channels: ['email', 'push'],
149
- message: 'hi.',
150
- notifiedAt: '2025-06-10T16:30:00.000Z',
151
- actionRequired: true,
130
+ specs: [
131
+ {
132
+ type: 'gherkin',
133
+ feature: 'Notify host command',
134
+ rules: [
135
+ {
136
+ name: 'Should notify host successfully',
137
+ examples: [
138
+ {
139
+ name: 'Host notification sent successfully',
140
+ steps: [
141
+ {
142
+ keyword: 'When',
143
+ text: 'NotifyHost',
144
+ docString: {
145
+ hostId: 'host_123',
146
+ notificationType: 'booking_request',
147
+ priority: 'high',
148
+ channels: ['email', 'push'],
149
+ message: 'A guest has requested to book your place.',
150
+ actionRequired: true,
151
+ },
152
+ },
153
+ {
154
+ keyword: 'Then',
155
+ text: 'HostNotified',
156
+ docString: {
157
+ bookingId: 'book_xyz789',
158
+ hostId: 'host_123',
159
+ notificationType: 'booking_request',
160
+ channels: ['email', 'push'],
161
+ message: 'hi.',
162
+ notifiedAt: '2025-06-10T16:30:00.000Z',
163
+ actionRequired: true,
164
+ },
152
165
  },
153
- },
154
- ],
155
- },
156
- ],
157
- },
158
- ],
159
- },
166
+ ],
167
+ },
168
+ ],
169
+ },
170
+ ],
171
+ },
172
+ ],
160
173
  },
161
174
  },
162
175
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"specVariant1.d.ts","sourceRoot":"","sources":["../../../../src/codegen/test-data/specVariant1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEhE,QAAA,MAAM,YAAY,EAAE,WAsNnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"specVariant1.d.ts","sourceRoot":"","sources":["../../../../src/codegen/test-data/specVariant1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEhE,QAAA,MAAM,YAAY,EAAE,WAiOnB,CAAC;AAEF,eAAe,YAAY,CAAC"}