@auto-engineer/narrative 0.12.0 → 0.13.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 (76) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +24 -0
  3. package/dist/src/fluent-builder.d.ts.map +1 -1
  4. package/dist/src/fluent-builder.js +9 -12
  5. package/dist/src/fluent-builder.js.map +1 -1
  6. package/dist/src/getNarratives.specs.js +51 -35
  7. package/dist/src/getNarratives.specs.js.map +1 -1
  8. package/dist/src/id/addAutoIds.specs.js +12 -26
  9. package/dist/src/id/addAutoIds.specs.js.map +1 -1
  10. package/dist/src/id/generators.js +1 -1
  11. package/dist/src/id/generators.js.map +1 -1
  12. package/dist/src/id/hasAllIds.specs.js +28 -28
  13. package/dist/src/index.d.ts +3 -1
  14. package/dist/src/index.d.ts.map +1 -1
  15. package/dist/src/index.js +1 -1
  16. package/dist/src/index.js.map +1 -1
  17. package/dist/src/model-to-narrative.specs.js +132 -130
  18. package/dist/src/model-to-narrative.specs.js.map +1 -1
  19. package/dist/src/narrative-context.d.ts +4 -2
  20. package/dist/src/narrative-context.d.ts.map +1 -1
  21. package/dist/src/narrative-context.js +98 -95
  22. package/dist/src/narrative-context.js.map +1 -1
  23. package/dist/src/narrative.d.ts +7 -1
  24. package/dist/src/narrative.d.ts.map +1 -1
  25. package/dist/src/narrative.js +27 -6
  26. package/dist/src/narrative.js.map +1 -1
  27. package/dist/src/samples/items.narrative.js +7 -7
  28. package/dist/src/samples/items.narrative.js.map +1 -1
  29. package/dist/src/samples/place-order.narrative.js +4 -4
  30. package/dist/src/samples/place-order.narrative.js.map +1 -1
  31. package/dist/src/samples/questionnaires.narrative.js +26 -28
  32. package/dist/src/samples/questionnaires.narrative.js.map +1 -1
  33. package/dist/src/samples/seasonal-assistant.schema.json +37 -31
  34. package/dist/src/schema.d.ts +1156 -1527
  35. package/dist/src/schema.d.ts.map +1 -1
  36. package/dist/src/schema.js +22 -24
  37. package/dist/src/schema.js.map +1 -1
  38. package/dist/src/slice-builder.js +2 -2
  39. package/dist/src/slice-builder.js.map +1 -1
  40. package/dist/src/transformers/model-to-narrative/generators/flow.d.ts.map +1 -1
  41. package/dist/src/transformers/model-to-narrative/generators/flow.js +34 -10
  42. package/dist/src/transformers/model-to-narrative/generators/flow.js.map +1 -1
  43. package/dist/src/transformers/model-to-narrative/generators/imports.d.ts +1 -1
  44. package/dist/src/transformers/model-to-narrative/generators/imports.d.ts.map +1 -1
  45. package/dist/src/transformers/model-to-narrative/generators/imports.js +2 -1
  46. package/dist/src/transformers/model-to-narrative/generators/imports.js.map +1 -1
  47. package/dist/src/transformers/narrative-to-model/index.d.ts.map +1 -1
  48. package/dist/src/transformers/narrative-to-model/index.js +4 -8
  49. package/dist/src/transformers/narrative-to-model/index.js.map +1 -1
  50. package/dist/src/transformers/narrative-to-model/type-inference.specs.js +3 -3
  51. package/dist/src/transformers/narrative-to-model/type-inference.specs.js.map +1 -1
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +5 -5
  54. package/src/fluent-builder.ts +9 -12
  55. package/src/getNarratives.specs.ts +51 -36
  56. package/src/id/addAutoIds.specs.ts +12 -26
  57. package/src/id/generators.ts +1 -1
  58. package/src/id/hasAllIds.specs.ts +28 -28
  59. package/src/index.ts +4 -1
  60. package/src/model-to-narrative.specs.ts +132 -130
  61. package/src/narrative-context.ts +103 -101
  62. package/src/narrative.ts +44 -6
  63. package/src/samples/items.narrative.ts +7 -7
  64. package/src/samples/place-order.narrative.ts +4 -4
  65. package/src/samples/questionnaires.narrative.ts +27 -28
  66. package/src/samples/seasonal-assistant.schema.json +37 -31
  67. package/src/schema.ts +33 -24
  68. package/src/slice-builder.ts +2 -2
  69. package/src/transformers/model-to-narrative/generators/flow.ts +53 -23
  70. package/src/transformers/model-to-narrative/generators/imports.ts +2 -1
  71. package/src/transformers/narrative-to-model/index.ts +4 -7
  72. package/src/transformers/narrative-to-model/type-inference.specs.ts +3 -3
  73. package/.turbo/turbo-format.log +0 -4
  74. package/.turbo/turbo-lint.log +0 -4
  75. package/.turbo/turbo-test.log +0 -14
  76. package/.turbo/turbo-type-check.log +0 -4
@@ -10,13 +10,14 @@ describe('modelToNarrative', () => {
10
10
  expect(code).toEqual(`import {
11
11
  command,
12
12
  data,
13
+ describe,
13
14
  example,
14
15
  gql,
16
+ it,
15
17
  narrative,
16
18
  query,
17
19
  react,
18
20
  rule,
19
- should,
20
21
  sink,
21
22
  source,
22
23
  specs,
@@ -92,13 +93,13 @@ type ItemsAddedToCart = Event<
92
93
  narrative('Seasonal Assistant', () => {
93
94
  command('enters shopping criteria into assistant')
94
95
  .client(() => {
95
- specs('Assistant Chat Interface', () => {
96
- should('allow shopper to describe their shopping needs in natural language');
97
- should('provide a text input for entering criteria');
98
- should('show examples of what to include (age, interests, budget)');
99
- should('show a button to submit the criteria');
100
- should('generate a persisted session id for a visit');
101
- should('show the header on top of the page');
96
+ describe('Assistant Chat Interface', () => {
97
+ it('allow shopper to describe their shopping needs in natural language');
98
+ it('provide a text input for entering criteria');
99
+ it('show examples of what to include (age, interests, budget)');
100
+ it('show a button to submit the criteria');
101
+ it('generate a persisted session id for a visit');
102
+ it('show the header on top of the page');
102
103
  });
103
104
  })
104
105
  .request(
@@ -236,11 +237,11 @@ narrative('Seasonal Assistant', () => {
236
237
  });
237
238
  query('views suggested items')
238
239
  .client(() => {
239
- specs('Suggested Items Screen', () => {
240
- should('display all suggested items with names and reasons');
241
- should('show quantity selectors for each item');
242
- should('have an "Add to Cart" button for selected items');
243
- should('allow removing items from the suggestions');
240
+ describe('Suggested Items Screen', () => {
241
+ it('display all suggested items with names and reasons');
242
+ it('show quantity selectors for each item');
243
+ it('have an "Add to Cart" button for selected items');
244
+ it('allow removing items from the suggestions');
244
245
  });
245
246
  })
246
247
  .request(
@@ -323,10 +324,10 @@ narrative('Seasonal Assistant', () => {
323
324
  });
324
325
  command('accepts items and adds to their cart')
325
326
  .client(() => {
326
- specs('Suggested Items Screen', () => {
327
- should('allow selecting specific items to add');
328
- should('update quantities before adding to cart');
329
- should('provide feedback when items are added');
327
+ describe('Suggested Items Screen', () => {
328
+ it('allow selecting specific items to add');
329
+ it('update quantities before adding to cart');
330
+ it('provide feedback when items are added');
330
331
  });
331
332
  })
332
333
  .server(() => {
@@ -372,10 +373,10 @@ narrative('Seasonal Assistant', () => {
372
373
  id: 'EXP-001',
373
374
  type: 'experience',
374
375
  client: {
375
- specs: {
376
- name: '',
377
- rules: ['show a hero section with a welcome message', 'allow user to start the questionnaire'],
378
- },
376
+ specs: [
377
+ { type: 'it', title: 'show a hero section with a welcome message' },
378
+ { type: 'it', title: 'allow user to start the questionnaire' },
379
+ ],
379
380
  },
380
381
  },
381
382
  ],
@@ -387,13 +388,11 @@ narrative('Seasonal Assistant', () => {
387
388
 
388
389
  const code = await modelToNarrative(experienceModel);
389
390
 
390
- expect(code).toEqual(`import { experience, narrative, should, specs } from '@auto-engineer/narrative';
391
+ expect(code).toEqual(`import { experience, it, narrative } from '@auto-engineer/narrative';
391
392
  narrative('Test Experience Flow', 'TEST-001', () => {
392
393
  experience('Homepage', 'EXP-001').client(() => {
393
- specs(() => {
394
- should('show a hero section with a welcome message');
395
- should('allow user to start the questionnaire');
396
- });
394
+ it('show a hero section with a welcome message');
395
+ it('allow user to start the questionnaire');
397
396
  });
398
397
  });
399
398
  `);
@@ -412,10 +411,16 @@ narrative('Test Experience Flow', 'TEST-001', () => {
412
411
  // id: undefined - no ID
413
412
  type: 'experience',
414
413
  client: {
415
- specs: {
416
- name: 'Homepage specs',
417
- rules: ['show welcome message', 'display navigation'],
418
- },
414
+ specs: [
415
+ {
416
+ type: 'describe',
417
+ title: 'Homepage specs',
418
+ children: [
419
+ { type: 'it', title: 'show welcome message' },
420
+ { type: 'it', title: 'display navigation' },
421
+ ],
422
+ },
423
+ ],
419
424
  },
420
425
  },
421
426
  ],
@@ -427,12 +432,12 @@ narrative('Test Experience Flow', 'TEST-001', () => {
427
432
 
428
433
  const code = await modelToNarrative(modelWithoutIds);
429
434
 
430
- expect(code).toEqual(`import { experience, narrative, should, specs } from '@auto-engineer/narrative';
435
+ expect(code).toEqual(`import { describe, experience, it, narrative } from '@auto-engineer/narrative';
431
436
  narrative('Test Flow without IDs', () => {
432
437
  experience('Homepage').client(() => {
433
- specs('Homepage specs', () => {
434
- should('show welcome message');
435
- should('display navigation');
438
+ describe('Homepage specs', () => {
439
+ it('show welcome message');
440
+ it('display navigation');
436
441
  });
437
442
  });
438
443
  });
@@ -452,10 +457,16 @@ narrative('Test Flow without IDs', () => {
452
457
  id: 'SLICE-ABC',
453
458
  type: 'experience',
454
459
  client: {
455
- specs: {
456
- name: 'Homepage specs',
457
- rules: ['show welcome message', 'display navigation'],
458
- },
460
+ specs: [
461
+ {
462
+ type: 'describe',
463
+ title: 'Homepage specs',
464
+ children: [
465
+ { type: 'it', title: 'show welcome message' },
466
+ { type: 'it', title: 'display navigation' },
467
+ ],
468
+ },
469
+ ],
459
470
  },
460
471
  },
461
472
  {
@@ -463,11 +474,16 @@ narrative('Test Flow without IDs', () => {
463
474
  id: 'SLICE-XYZ',
464
475
  type: 'query',
465
476
  client: {
466
- description: 'Product query client',
467
- specs: {
468
- name: 'Product list specs',
469
- rules: ['display all products', 'allow filtering'],
470
- },
477
+ specs: [
478
+ {
479
+ type: 'describe',
480
+ title: 'Product list specs',
481
+ children: [
482
+ { type: 'it', title: 'display all products' },
483
+ { type: 'it', title: 'allow filtering' },
484
+ ],
485
+ },
486
+ ],
471
487
  },
472
488
  server: {
473
489
  description: 'Product query server',
@@ -486,19 +502,19 @@ narrative('Test Flow without IDs', () => {
486
502
 
487
503
  const code = await modelToNarrative(modelWithIds);
488
504
 
489
- expect(code).toEqual(`import { experience, narrative, query, should, specs } from '@auto-engineer/narrative';
505
+ expect(code).toEqual(`import { describe, experience, it, narrative, query, specs } from '@auto-engineer/narrative';
490
506
  narrative('Test Flow with IDs', 'FLOW-123', () => {
491
507
  experience('Homepage', 'SLICE-ABC').client(() => {
492
- specs('Homepage specs', () => {
493
- should('show welcome message');
494
- should('display navigation');
508
+ describe('Homepage specs', () => {
509
+ it('show welcome message');
510
+ it('display navigation');
495
511
  });
496
512
  });
497
513
  query('view products', 'SLICE-XYZ')
498
514
  .client(() => {
499
- specs('Product list specs', () => {
500
- should('display all products');
501
- should('allow filtering');
515
+ describe('Product list specs', () => {
516
+ it('display all products');
517
+ it('allow filtering');
502
518
  });
503
519
  })
504
520
  .server(() => {
@@ -521,7 +537,7 @@ narrative('Test Flow with IDs', 'FLOW-123', () => {
521
537
  id: 'SLICE-789',
522
538
  type: 'command',
523
539
  client: {
524
- description: 'Command processing client',
540
+ specs: [],
525
541
  },
526
542
  server: {
527
543
  description: 'Command processing server',
@@ -683,34 +699,36 @@ narrative('Questionnaire Flow', 'QUEST-001', () => {});
683
699
  narratives: [
684
700
  {
685
701
  name: 'Questionnaires',
686
- id: 'AUTO-Q9m2Kp4Lx',
702
+ id: 'Q9m2Kp4Lx',
687
703
  slices: [
688
704
  {
689
705
  name: 'Homepage',
690
- id: 'AUTO-H1a4Bn6Cy',
706
+ id: 'H1a4Bn6Cy',
691
707
  type: 'experience',
692
708
  client: {
693
- specs: {
694
- name: '',
695
- rules: ['show a hero section with a welcome message', 'allow user to start the questionnaire'],
696
- },
709
+ specs: [
710
+ { type: 'it', title: 'show a hero section with a welcome message' },
711
+ { type: 'it', title: 'allow user to start the questionnaire' },
712
+ ],
697
713
  },
698
714
  },
699
715
  {
700
716
  name: 'views the questionnaire',
701
- id: 'AUTO-V7n8Rq5M',
717
+ id: 'V7n8Rq5M',
702
718
  type: 'query',
703
719
  client: {
704
- description: '',
705
- specs: {
706
- name: 'Questionnaire Progress',
707
- rules: [
708
- 'focus on the current question based on the progress state',
709
- 'display the list of answered questions',
710
- 'display the list of remaining questions',
711
- 'show a progress indicator that is always visible as the user scrolls',
712
- ],
713
- },
720
+ specs: [
721
+ {
722
+ type: 'describe',
723
+ title: 'Questionnaire Progress',
724
+ children: [
725
+ { type: 'it', title: 'focus on the current question based on the progress state' },
726
+ { type: 'it', title: 'display the list of answered questions' },
727
+ { type: 'it', title: 'display the list of remaining questions' },
728
+ { type: 'it', title: 'show a progress indicator that is always visible as the user scrolls' },
729
+ ],
730
+ },
731
+ ],
714
732
  },
715
733
  request:
716
734
  'query QuestionnaireProgress($participantId: ID!) {\n questionnaireProgress(participantId: $participantId) {\n questionnaireId\n participantId\n currentQuestionId\n remainingQuestions\n status\n answers {\n questionId\n value\n }\n }\n}',
@@ -733,7 +751,7 @@ narrative('Questionnaire Flow', 'QUEST-001', () => {});
733
751
  name: '',
734
752
  rules: [
735
753
  {
736
- id: 'AUTO-r1A3Bp9W',
754
+ id: 'r1A3Bp9W',
737
755
  description: 'questionnaires show current progress',
738
756
  examples: [
739
757
  {
@@ -900,13 +918,14 @@ narrative('Questionnaire Flow', 'QUEST-001', () => {});
900
918
 
901
919
  expect(code).toEqual(`import {
902
920
  data,
921
+ describe,
903
922
  example,
904
923
  experience,
905
924
  gql,
925
+ it,
906
926
  narrative,
907
927
  query,
908
928
  rule,
909
- should,
910
929
  source,
911
930
  specs,
912
931
  } from '@auto-engineer/narrative';
@@ -944,20 +963,18 @@ type QuestionnaireProgress = State<
944
963
  }[];
945
964
  }
946
965
  >;
947
- narrative('Questionnaires', 'AUTO-Q9m2Kp4Lx', () => {
948
- experience('Homepage', 'AUTO-H1a4Bn6Cy').client(() => {
949
- specs(() => {
950
- should('show a hero section with a welcome message');
951
- should('allow user to start the questionnaire');
952
- });
966
+ narrative('Questionnaires', 'Q9m2Kp4Lx', () => {
967
+ experience('Homepage', 'H1a4Bn6Cy').client(() => {
968
+ it('show a hero section with a welcome message');
969
+ it('allow user to start the questionnaire');
953
970
  });
954
- query('views the questionnaire', 'AUTO-V7n8Rq5M')
971
+ query('views the questionnaire', 'V7n8Rq5M')
955
972
  .client(() => {
956
- specs('Questionnaire Progress', () => {
957
- should('focus on the current question based on the progress state');
958
- should('display the list of answered questions');
959
- should('display the list of remaining questions');
960
- should('show a progress indicator that is always visible as the user scrolls');
973
+ describe('Questionnaire Progress', () => {
974
+ it('focus on the current question based on the progress state');
975
+ it('display the list of answered questions');
976
+ it('display the list of remaining questions');
977
+ it('show a progress indicator that is always visible as the user scrolls');
961
978
  });
962
979
  })
963
980
  .request(
@@ -978,7 +995,7 @@ narrative('Questionnaires', 'AUTO-Q9m2Kp4Lx', () => {
978
995
  .server(() => {
979
996
  data([source().state('QuestionnaireProgress').fromProjection('Questionnaires', 'questionnaire-participantId')]);
980
997
  specs(() => {
981
- rule('questionnaires show current progress', 'AUTO-r1A3Bp9W', () => {
998
+ rule('questionnaires show current progress', 'r1A3Bp9W', () => {
982
999
  example('a question has already been answered')
983
1000
  .given<QuestionnaireLinkSent>({
984
1001
  questionnaireId: 'q-001',
@@ -1021,7 +1038,7 @@ narrative('Questionnaires', 'AUTO-Q9m2Kp4Lx', () => {
1021
1038
  id: 'TEST-SLICE',
1022
1039
  type: 'query',
1023
1040
  client: {
1024
- description: 'Test client for duplicate rules',
1041
+ specs: [],
1025
1042
  },
1026
1043
  server: {
1027
1044
  description: 'Test server for duplicate rules',
@@ -1029,7 +1046,7 @@ narrative('Questionnaires', 'AUTO-Q9m2Kp4Lx', () => {
1029
1046
  name: 'Test Rules',
1030
1047
  rules: [
1031
1048
  {
1032
- id: 'AUTO-r1A3Bp9W',
1049
+ id: 'r1A3Bp9W',
1033
1050
  description: 'questionnaires show current progress',
1034
1051
  examples: [
1035
1052
  {
@@ -1159,7 +1176,7 @@ type QuestionnaireProgress = State<
1159
1176
  narrative('Test Flow', 'TEST-FLOW', () => {
1160
1177
  query('test slice', 'TEST-SLICE').server(() => {
1161
1178
  specs('Test Rules', () => {
1162
- rule('questionnaires show current progress', 'AUTO-r1A3Bp9W', () => {
1179
+ rule('questionnaires show current progress', 'r1A3Bp9W', () => {
1163
1180
  example('a question has already been answered')
1164
1181
  .given<QuestionnaireLinkSent>({ questionnaireId: 'q-001', participantId: 'participant-abc' })
1165
1182
  .when<QuestionAnswered>({ questionnaireId: 'q-001', questionId: 'q1', answer: 'Yes' })
@@ -1188,7 +1205,7 @@ narrative('Test Flow', 'TEST-FLOW', () => {
1188
1205
  id: 'MULTI-SLICE',
1189
1206
  type: 'query',
1190
1207
  client: {
1191
- description: 'Multi given client',
1208
+ specs: [],
1192
1209
  },
1193
1210
  server: {
1194
1211
  description: 'Multi given server rules',
@@ -1196,7 +1213,7 @@ narrative('Test Flow', 'TEST-FLOW', () => {
1196
1213
  name: 'Multi Given Rules',
1197
1214
  rules: [
1198
1215
  {
1199
- id: 'AUTO-MultiGiven',
1216
+ id: 'MultiGiven',
1200
1217
  description: 'all questions have been answered',
1201
1218
  examples: [
1202
1219
  {
@@ -1374,7 +1391,7 @@ type QuestionnaireProgress = State<
1374
1391
  narrative('Multi Given Flow', 'MULTI-GIVEN', () => {
1375
1392
  query('multi given slice', 'MULTI-SLICE').server(() => {
1376
1393
  specs('Multi Given Rules', () => {
1377
- rule('all questions have been answered', 'AUTO-MultiGiven', () => {
1394
+ rule('all questions have been answered', 'MultiGiven', () => {
1378
1395
  example('questionnaire with multiple events')
1379
1396
  .given<QuestionnaireConfig>({ questionnaireId: 'q-001', numberOfQuestions: 3 })
1380
1397
  .and<QuestionnaireLinkSent>({
@@ -1435,7 +1452,7 @@ narrative('Multi Given Flow', 'MULTI-GIVEN', () => {
1435
1452
  id: 'REF-SLICE',
1436
1453
  type: 'query',
1437
1454
  client: {
1438
- description: 'Client for referenced states',
1455
+ specs: [],
1439
1456
  },
1440
1457
  server: {
1441
1458
  description: 'Server for referenced states',
@@ -1467,7 +1484,7 @@ narrative('Multi Given Flow', 'MULTI-GIVEN', () => {
1467
1484
  name: 'Database State Rules',
1468
1485
  rules: [
1469
1486
  {
1470
- id: 'AUTO-RefState',
1487
+ id: 'RefState',
1471
1488
  description: 'questionnaire config is available when referenced',
1472
1489
  examples: [
1473
1490
  {
@@ -1562,7 +1579,7 @@ narrative('Referenced States Flow', 'REF-STATES', () => {
1562
1579
  source().state('QuestionnaireConfig').fromDatabase('ConfigStore', { questionnaireId: '$questionnaireId' }),
1563
1580
  ]);
1564
1581
  specs('Database State Rules', () => {
1565
- rule('questionnaire config is available when referenced', 'AUTO-RefState', () => {
1582
+ rule('questionnaire config is available when referenced', 'RefState', () => {
1566
1583
  example('config from database is accessible')
1567
1584
  .given<QuestionnaireConfig>({
1568
1585
  questionnaireId: 'q-001',
@@ -1596,7 +1613,7 @@ narrative('Referenced States Flow', 'REF-STATES', () => {
1596
1613
  id: 'DATE-SLICE',
1597
1614
  type: 'query',
1598
1615
  client: {
1599
- description: 'Date client',
1616
+ specs: [],
1600
1617
  },
1601
1618
  server: {
1602
1619
  description: 'Date server with Date fields',
@@ -1604,7 +1621,7 @@ narrative('Referenced States Flow', 'REF-STATES', () => {
1604
1621
  name: 'Date Field Rules',
1605
1622
  rules: [
1606
1623
  {
1607
- id: 'AUTO-DateRule',
1624
+ id: 'DateRule',
1608
1625
  description: 'handles Date fields correctly',
1609
1626
  examples: [
1610
1627
  {
@@ -1713,7 +1730,7 @@ type ProcessState = State<
1713
1730
  narrative('Date Handling Flow', 'DATE-FLOW', () => {
1714
1731
  query('date handling slice', 'DATE-SLICE').server(() => {
1715
1732
  specs('Date Field Rules', () => {
1716
- rule('handles Date fields correctly', 'AUTO-DateRule', () => {
1733
+ rule('handles Date fields correctly', 'DateRule', () => {
1717
1734
  example('event with Date fields')
1718
1735
  .given<TimestampedEvent>({
1719
1736
  id: 'event-123',
@@ -1745,13 +1762,10 @@ narrative('Date Handling Flow', 'DATE-FLOW', () => {
1745
1762
  slices: [
1746
1763
  {
1747
1764
  name: 'Active Surveys Summary',
1748
- id: 'AUTO-aifPcU3hw',
1765
+ id: 'aifPcU3hw',
1749
1766
  type: 'experience',
1750
1767
  client: {
1751
- specs: {
1752
- name: '',
1753
- rules: ['show active surveys summary'],
1754
- },
1768
+ specs: [{ type: 'it', title: 'show active surveys summary' }],
1755
1769
  },
1756
1770
  },
1757
1771
  ],
@@ -1762,13 +1776,10 @@ narrative('Date Handling Flow', 'DATE-FLOW', () => {
1762
1776
  slices: [
1763
1777
  {
1764
1778
  name: 'Create Survey Form',
1765
- id: 'AUTO-MPviTMrQC',
1779
+ id: 'MPviTMrQC',
1766
1780
  type: 'experience',
1767
1781
  client: {
1768
- specs: {
1769
- name: '',
1770
- rules: ['allow entering survey title'],
1771
- },
1782
+ specs: [{ type: 'it', title: 'allow entering survey title' }],
1772
1783
  },
1773
1784
  },
1774
1785
  ],
@@ -1779,13 +1790,10 @@ narrative('Date Handling Flow', 'DATE-FLOW', () => {
1779
1790
  slices: [
1780
1791
  {
1781
1792
  name: 'Response Rate Charts',
1782
- id: 'AUTO-eME978Euk',
1793
+ id: 'eME978Euk',
1783
1794
  type: 'experience',
1784
1795
  client: {
1785
- specs: {
1786
- name: '',
1787
- rules: ['show daily response rate charts'],
1788
- },
1796
+ specs: [{ type: 'it', title: 'show daily response rate charts' }],
1789
1797
  },
1790
1798
  },
1791
1799
  ],
@@ -1797,26 +1805,20 @@ narrative('Date Handling Flow', 'DATE-FLOW', () => {
1797
1805
 
1798
1806
  const code = await modelToNarrative(modelWithMultipleFlowsSameSource);
1799
1807
 
1800
- expect(code).toEqual(`import { experience, narrative, should, specs } from '@auto-engineer/narrative';
1808
+ expect(code).toEqual(`import { experience, it, narrative } from '@auto-engineer/narrative';
1801
1809
  narrative('Home Screen', () => {
1802
- experience('Active Surveys Summary', 'AUTO-aifPcU3hw').client(() => {
1803
- specs(() => {
1804
- should('show active surveys summary');
1805
- });
1810
+ experience('Active Surveys Summary', 'aifPcU3hw').client(() => {
1811
+ it('show active surveys summary');
1806
1812
  });
1807
1813
  });
1808
1814
  narrative('Create Survey', () => {
1809
- experience('Create Survey Form', 'AUTO-MPviTMrQC').client(() => {
1810
- specs(() => {
1811
- should('allow entering survey title');
1812
- });
1815
+ experience('Create Survey Form', 'MPviTMrQC').client(() => {
1816
+ it('allow entering survey title');
1813
1817
  });
1814
1818
  });
1815
1819
  narrative('Response Analytics', () => {
1816
- experience('Response Rate Charts', 'AUTO-eME978Euk').client(() => {
1817
- specs(() => {
1818
- should('show daily response rate charts');
1819
- });
1820
+ experience('Response Rate Charts', 'eME978Euk').client(() => {
1821
+ it('show daily response rate charts');
1820
1822
  });
1821
1823
  });
1822
1824
  `);
@@ -1835,7 +1837,7 @@ narrative('Response Analytics', () => {
1835
1837
  id: 'SUMMARY-001',
1836
1838
  type: 'query',
1837
1839
  client: {
1838
- description: 'Summary view client',
1840
+ specs: [],
1839
1841
  },
1840
1842
  server: {
1841
1843
  description: 'Summary calculation server',
@@ -2048,7 +2050,7 @@ narrative('Todo List Summary', 'TODO-001', () => {
2048
2050
  id: 'SUMMARY-SLICE',
2049
2051
  type: 'query',
2050
2052
  client: {
2051
- description: 'Summary client',
2053
+ specs: [],
2052
2054
  },
2053
2055
  server: {
2054
2056
  description: 'Summary server',
@@ -2121,7 +2123,7 @@ narrative('Todo Summary Flow', 'TODO-SUMMARY', () => {
2121
2123
  id: 'TODO-SLICE',
2122
2124
  type: 'query',
2123
2125
  client: {
2124
- description: 'Todo client',
2126
+ specs: [],
2125
2127
  },
2126
2128
  server: {
2127
2129
  description: 'Todo server',
@@ -2194,7 +2196,7 @@ narrative('Todo Flow', 'TODO-FLOW', () => {
2194
2196
  id: 'USER-PROJECT-SLICE',
2195
2197
  type: 'query',
2196
2198
  client: {
2197
- description: 'User project client',
2199
+ specs: [],
2198
2200
  },
2199
2201
  server: {
2200
2202
  description: 'User project server',
@@ -2269,7 +2271,7 @@ narrative('User Project Flow', 'USER-PROJECT-FLOW', () => {
2269
2271
  id: 'SUMMARY-SLICE',
2270
2272
  type: 'query',
2271
2273
  client: {
2272
- description: 'Summary client',
2274
+ specs: [],
2273
2275
  },
2274
2276
  server: {
2275
2277
  description: 'Summary server',
@@ -2297,7 +2299,7 @@ narrative('User Project Flow', 'USER-PROJECT-FLOW', () => {
2297
2299
  id: 'TODO-SLICE',
2298
2300
  type: 'query',
2299
2301
  client: {
2300
- description: 'Todo client',
2302
+ specs: [],
2301
2303
  },
2302
2304
  server: {
2303
2305
  description: 'Todo server',
@@ -2325,7 +2327,7 @@ narrative('User Project Flow', 'USER-PROJECT-FLOW', () => {
2325
2327
  id: 'USER-PROJECT-SLICE',
2326
2328
  type: 'query',
2327
2329
  client: {
2328
- description: 'User project client',
2330
+ specs: [],
2329
2331
  },
2330
2332
  server: {
2331
2333
  description: 'User project server',