@auto-engineer/server-generator-apollo-emmett 0.12.1 → 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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/src/codegen/extract/commands.d.ts +7 -14
- package/dist/src/codegen/extract/commands.d.ts.map +1 -1
- package/dist/src/codegen/extract/commands.js.map +1 -1
- package/dist/src/codegen/extract/data-sink.d.ts +1 -1
- package/dist/src/codegen/extract/data-sink.d.ts.map +1 -1
- package/dist/src/codegen/extract/data-sink.js +9 -31
- package/dist/src/codegen/extract/data-sink.js.map +1 -1
- package/dist/src/codegen/extract/events.d.ts +4 -8
- package/dist/src/codegen/extract/events.d.ts.map +1 -1
- package/dist/src/codegen/extract/events.js.map +1 -1
- package/dist/src/codegen/extract/gwt.d.ts +2 -2
- package/dist/src/codegen/extract/gwt.d.ts.map +1 -1
- package/dist/src/codegen/extract/gwt.js +6 -21
- package/dist/src/codegen/extract/gwt.js.map +1 -1
- package/dist/src/codegen/extract/messages.d.ts +4 -4
- package/dist/src/codegen/extract/messages.d.ts.map +1 -1
- package/dist/src/codegen/extract/messages.js +24 -47
- package/dist/src/codegen/extract/messages.js.map +1 -1
- package/dist/src/codegen/extract/query.d.ts +5 -7
- package/dist/src/codegen/extract/query.d.ts.map +1 -1
- package/dist/src/codegen/extract/query.js +10 -8
- package/dist/src/codegen/extract/query.js.map +1 -1
- package/dist/src/codegen/extract/slice-normalizer.d.ts +29 -0
- package/dist/src/codegen/extract/slice-normalizer.d.ts.map +1 -0
- package/dist/src/codegen/extract/slice-normalizer.js +48 -0
- package/dist/src/codegen/extract/slice-normalizer.js.map +1 -0
- package/dist/src/codegen/extract/step-converter.d.ts +17 -0
- package/dist/src/codegen/extract/step-converter.d.ts.map +1 -0
- package/dist/src/codegen/extract/step-converter.js +82 -0
- package/dist/src/codegen/extract/step-converter.js.map +1 -0
- package/dist/src/codegen/extract/step-types.d.ts +30 -0
- package/dist/src/codegen/extract/step-types.d.ts.map +1 -0
- package/dist/src/codegen/extract/step-types.js +16 -0
- package/dist/src/codegen/extract/step-types.js.map +1 -0
- package/dist/src/codegen/scaffoldFromSchema.d.ts.map +1 -1
- package/dist/src/codegen/scaffoldFromSchema.js +7 -29
- package/dist/src/codegen/scaffoldFromSchema.js.map +1 -1
- package/dist/src/codegen/templates/command/commands.specs.ts +33 -28
- package/dist/src/codegen/templates/command/decide.specs.specs.ts +153 -138
- package/dist/src/codegen/templates/command/decide.specs.ts +169 -146
- package/dist/src/codegen/templates/command/events.specs.ts +43 -38
- package/dist/src/codegen/templates/command/evolve.specs.ts +38 -33
- package/dist/src/codegen/templates/command/handle.specs.ts +71 -61
- package/dist/src/codegen/templates/command/mutation.resolver.specs.ts +122 -102
- package/dist/src/codegen/templates/command/register.specs.ts +39 -34
- package/dist/src/codegen/templates/command/state.specs.ts +39 -34
- package/dist/src/codegen/templates/query/projection.specs.specs.ts +399 -359
- package/dist/src/codegen/templates/query/projection.specs.ts +242 -216
- package/dist/src/codegen/templates/query/projection.specs.ts.ejs +38 -12
- package/dist/src/codegen/templates/query/query.resolver.specs.ts +59 -51
- package/dist/src/codegen/templates/query/state.specs.ts +1 -1
- package/dist/src/codegen/templates/react/react.specs.specs.ts +93 -85
- package/dist/src/codegen/templates/react/react.specs.ts +135 -122
- package/dist/src/codegen/templates/react/register.specs.ts +135 -122
- package/dist/src/codegen/test-data/specVariant1.d.ts.map +1 -1
- package/dist/src/codegen/test-data/specVariant1.js +101 -90
- package/dist/src/codegen/test-data/specVariant1.js.map +1 -1
- package/dist/src/codegen/types.d.ts +5 -7
- package/dist/src/codegen/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/codegen/extract/commands.ts +7 -8
- package/src/codegen/extract/data-sink.ts +16 -43
- package/src/codegen/extract/events.ts +4 -5
- package/src/codegen/extract/gwt.ts +12 -29
- package/src/codegen/extract/messages.ts +43 -70
- package/src/codegen/extract/query.ts +14 -12
- package/src/codegen/extract/slice-normalizer.ts +88 -0
- package/src/codegen/extract/step-converter.ts +124 -0
- package/src/codegen/extract/step-types.ts +52 -0
- package/src/codegen/scaffoldFromSchema.ts +8 -45
- package/src/codegen/templates/command/commands.specs.ts +33 -28
- package/src/codegen/templates/command/decide.specs.specs.ts +153 -138
- package/src/codegen/templates/command/decide.specs.ts +169 -146
- package/src/codegen/templates/command/events.specs.ts +43 -38
- package/src/codegen/templates/command/evolve.specs.ts +38 -33
- package/src/codegen/templates/command/handle.specs.ts +71 -61
- package/src/codegen/templates/command/mutation.resolver.specs.ts +122 -102
- package/src/codegen/templates/command/register.specs.ts +39 -34
- package/src/codegen/templates/command/state.specs.ts +39 -34
- package/src/codegen/templates/query/projection.specs.specs.ts +399 -359
- package/src/codegen/templates/query/projection.specs.ts +242 -216
- package/src/codegen/templates/query/projection.specs.ts.ejs +38 -12
- package/src/codegen/templates/query/query.resolver.specs.ts +59 -51
- package/src/codegen/templates/query/state.specs.ts +1 -1
- package/src/codegen/templates/react/react.specs.specs.ts +93 -85
- package/src/codegen/templates/react/react.specs.ts +135 -122
- package/src/codegen/templates/react/register.specs.ts +135 -122
- package/src/codegen/test-data/specVariant1.ts +101 -90
- package/src/codegen/types.ts +6 -4
|
@@ -16,45 +16,50 @@ describe('spec.ts.ejs', () => {
|
|
|
16
16
|
client: { specs: [] },
|
|
17
17
|
server: {
|
|
18
18
|
description: '',
|
|
19
|
-
specs:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
exampleData: {
|
|
46
|
-
propertyId: 'listing_123',
|
|
47
|
-
listedAt: '2024-01-15T10:00:00Z',
|
|
48
|
-
rating: 4.8,
|
|
49
|
-
metadata: { foo: 'bar' },
|
|
19
|
+
specs: [
|
|
20
|
+
{
|
|
21
|
+
type: 'gherkin',
|
|
22
|
+
feature: 'Create listing spec',
|
|
23
|
+
rules: [
|
|
24
|
+
{
|
|
25
|
+
name: 'Should create listing successfully',
|
|
26
|
+
examples: [
|
|
27
|
+
{
|
|
28
|
+
name: 'User creates listing with valid data',
|
|
29
|
+
steps: [
|
|
30
|
+
{
|
|
31
|
+
keyword: 'When',
|
|
32
|
+
text: 'CreateListing',
|
|
33
|
+
docString: {
|
|
34
|
+
propertyId: 'listing_123',
|
|
35
|
+
title: 'blah',
|
|
36
|
+
pricePerNight: 250,
|
|
37
|
+
maxGuests: 4,
|
|
38
|
+
amenities: ['wifi', 'kitchen'],
|
|
39
|
+
available: true,
|
|
40
|
+
tags: ['some tag'],
|
|
41
|
+
rating: 4.8,
|
|
42
|
+
metadata: { foo: 'bar' },
|
|
43
|
+
listedAt: '2024-01-15T10:00:00Z',
|
|
44
|
+
},
|
|
50
45
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
{
|
|
47
|
+
keyword: 'Then',
|
|
48
|
+
text: 'ListingCreated',
|
|
49
|
+
docString: {
|
|
50
|
+
propertyId: 'listing_123',
|
|
51
|
+
listedAt: '2024-01-15T10:00:00Z',
|
|
52
|
+
rating: 4.8,
|
|
53
|
+
metadata: { foo: 'bar' },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
58
63
|
},
|
|
59
64
|
},
|
|
60
65
|
],
|
|
@@ -160,45 +165,49 @@ describe('spec.ts.ejs', () => {
|
|
|
160
165
|
client: { specs: [] },
|
|
161
166
|
server: {
|
|
162
167
|
description: '',
|
|
163
|
-
specs:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
168
|
+
specs: [
|
|
169
|
+
{
|
|
170
|
+
type: 'gherkin',
|
|
171
|
+
feature: 'Remove listing spec',
|
|
172
|
+
rules: [
|
|
173
|
+
{
|
|
174
|
+
name: 'Should remove existing listing',
|
|
175
|
+
examples: [
|
|
176
|
+
{
|
|
177
|
+
name: 'Existing listing can be removed',
|
|
178
|
+
steps: [
|
|
179
|
+
{
|
|
180
|
+
keyword: 'Given',
|
|
181
|
+
text: 'ListingCreated',
|
|
182
|
+
docString: {
|
|
183
|
+
propertyId: 'listing_123',
|
|
184
|
+
listedAt: '2024-01-15T10:00:00Z',
|
|
185
|
+
rating: 4.8,
|
|
186
|
+
metadata: { foo: 'bar' },
|
|
187
|
+
},
|
|
179
188
|
},
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
then: [
|
|
189
|
-
{
|
|
190
|
-
eventRef: 'ListingRemoved',
|
|
191
|
-
exampleData: {
|
|
192
|
-
propertyId: 'listing_123',
|
|
193
|
-
removedAt: '2024-01-16T10:00:00Z',
|
|
189
|
+
{
|
|
190
|
+
keyword: 'When',
|
|
191
|
+
text: 'RemoveListing',
|
|
192
|
+
docString: {
|
|
193
|
+
propertyId: 'listing_123',
|
|
194
|
+
},
|
|
194
195
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
{
|
|
197
|
+
keyword: 'Then',
|
|
198
|
+
text: 'ListingRemoved',
|
|
199
|
+
docString: {
|
|
200
|
+
propertyId: 'listing_123',
|
|
201
|
+
removedAt: '2024-01-16T10:00:00Z',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
],
|
|
202
211
|
},
|
|
203
212
|
},
|
|
204
213
|
],
|
|
@@ -302,73 +311,79 @@ describe('spec.ts.ejs', () => {
|
|
|
302
311
|
client: { specs: [] },
|
|
303
312
|
server: {
|
|
304
313
|
description: '',
|
|
305
|
-
specs:
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
exampleData: {
|
|
326
|
-
questionnaireId: 'q-001',
|
|
327
|
-
participantId: 'participant-abc',
|
|
328
|
-
questionId: 'q1',
|
|
329
|
-
answer: 'Yes',
|
|
330
|
-
savedAt: '2030-01-01T09:05:00.000Z',
|
|
314
|
+
specs: [
|
|
315
|
+
{
|
|
316
|
+
type: 'gherkin',
|
|
317
|
+
feature: 'Answer question spec',
|
|
318
|
+
rules: [
|
|
319
|
+
{
|
|
320
|
+
name: 'answers are allowed while the questionnaire has not been submitted',
|
|
321
|
+
examples: [
|
|
322
|
+
{
|
|
323
|
+
name: 'no questions have been answered yet',
|
|
324
|
+
steps: [
|
|
325
|
+
{
|
|
326
|
+
keyword: 'When',
|
|
327
|
+
text: 'AnswerQuestion',
|
|
328
|
+
docString: {
|
|
329
|
+
questionnaireId: 'q-001',
|
|
330
|
+
participantId: 'participant-abc',
|
|
331
|
+
questionId: 'q1',
|
|
332
|
+
answer: 'Yes',
|
|
333
|
+
},
|
|
331
334
|
},
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
participantId: 'participant-abc',
|
|
343
|
-
submittedAt: '2030-01-01T09:00:00.000Z',
|
|
335
|
+
{
|
|
336
|
+
keyword: 'Then',
|
|
337
|
+
text: 'QuestionAnswered',
|
|
338
|
+
docString: {
|
|
339
|
+
questionnaireId: 'q-001',
|
|
340
|
+
participantId: 'participant-abc',
|
|
341
|
+
questionId: 'q1',
|
|
342
|
+
answer: 'Yes',
|
|
343
|
+
savedAt: '2030-01-01T09:05:00.000Z',
|
|
344
|
+
},
|
|
344
345
|
},
|
|
345
|
-
|
|
346
|
-
],
|
|
347
|
-
when: {
|
|
348
|
-
commandRef: 'AnswerQuestion',
|
|
349
|
-
exampleData: {
|
|
350
|
-
questionnaireId: 'q-001',
|
|
351
|
-
participantId: 'participant-abc',
|
|
352
|
-
questionId: 'q1',
|
|
353
|
-
answer: 'Yes',
|
|
354
|
-
},
|
|
346
|
+
],
|
|
355
347
|
},
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
348
|
+
{
|
|
349
|
+
name: 'all questions have already been answered and submitted',
|
|
350
|
+
steps: [
|
|
351
|
+
{
|
|
352
|
+
keyword: 'Given',
|
|
353
|
+
text: 'QuestionnaireSubmitted',
|
|
354
|
+
docString: {
|
|
355
|
+
questionnaireId: 'q-001',
|
|
356
|
+
participantId: 'participant-abc',
|
|
357
|
+
submittedAt: '2030-01-01T09:00:00.000Z',
|
|
358
|
+
},
|
|
364
359
|
},
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
360
|
+
{
|
|
361
|
+
keyword: 'When',
|
|
362
|
+
text: 'AnswerQuestion',
|
|
363
|
+
docString: {
|
|
364
|
+
questionnaireId: 'q-001',
|
|
365
|
+
participantId: 'participant-abc',
|
|
366
|
+
questionId: 'q1',
|
|
367
|
+
answer: 'Yes',
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
keyword: 'Then',
|
|
372
|
+
text: 'QuestionnaireEditRejected',
|
|
373
|
+
docString: {
|
|
374
|
+
questionnaireId: 'q-001',
|
|
375
|
+
participantId: 'participant-abc',
|
|
376
|
+
reason: 'Questionnaire already submitted',
|
|
377
|
+
attemptedAt: '2030-01-01T09:05:00.000Z',
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
},
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
],
|
|
372
387
|
},
|
|
373
388
|
},
|
|
374
389
|
],
|