@auto-engineer/narrative 0.11.20 → 0.12.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 +24 -0
- package/dist/src/fluent-builder.d.ts.map +1 -1
- package/dist/src/fluent-builder.js +9 -12
- package/dist/src/fluent-builder.js.map +1 -1
- package/dist/src/getNarratives.specs.js +43 -27
- package/dist/src/getNarratives.specs.js.map +1 -1
- package/dist/src/id/addAutoIds.specs.js +11 -25
- package/dist/src/id/addAutoIds.specs.js.map +1 -1
- package/dist/src/id/hasAllIds.specs.js +12 -12
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/model-to-narrative.specs.js +110 -108
- package/dist/src/model-to-narrative.specs.js.map +1 -1
- package/dist/src/narrative-context.d.ts +4 -2
- package/dist/src/narrative-context.d.ts.map +1 -1
- package/dist/src/narrative-context.js +98 -95
- package/dist/src/narrative-context.js.map +1 -1
- package/dist/src/narrative.d.ts +7 -1
- package/dist/src/narrative.d.ts.map +1 -1
- package/dist/src/narrative.js +27 -6
- package/dist/src/narrative.js.map +1 -1
- package/dist/src/samples/items.narrative.js +7 -7
- package/dist/src/samples/items.narrative.js.map +1 -1
- package/dist/src/samples/place-order.narrative.js +4 -4
- package/dist/src/samples/place-order.narrative.js.map +1 -1
- package/dist/src/samples/questionnaires.narrative.js +16 -18
- package/dist/src/samples/questionnaires.narrative.js.map +1 -1
- package/dist/src/samples/seasonal-assistant.schema.json +37 -31
- package/dist/src/schema.d.ts +91 -462
- package/dist/src/schema.d.ts.map +1 -1
- package/dist/src/schema.js +22 -24
- package/dist/src/schema.js.map +1 -1
- package/dist/src/slice-builder.js +2 -2
- package/dist/src/slice-builder.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/flow.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/flow.js +34 -10
- package/dist/src/transformers/model-to-narrative/generators/flow.js.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/imports.d.ts +1 -1
- package/dist/src/transformers/model-to-narrative/generators/imports.d.ts.map +1 -1
- package/dist/src/transformers/model-to-narrative/generators/imports.js +2 -1
- package/dist/src/transformers/model-to-narrative/generators/imports.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/index.d.ts.map +1 -1
- package/dist/src/transformers/narrative-to-model/index.js +4 -8
- package/dist/src/transformers/narrative-to-model/index.js.map +1 -1
- package/dist/src/transformers/narrative-to-model/type-inference.specs.js +3 -3
- package/dist/src/transformers/narrative-to-model/type-inference.specs.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/fluent-builder.ts +9 -12
- package/src/getNarratives.specs.ts +43 -28
- package/src/id/addAutoIds.specs.ts +11 -25
- package/src/id/hasAllIds.specs.ts +12 -12
- package/src/index.ts +2 -1
- package/src/model-to-narrative.specs.ts +110 -108
- package/src/narrative-context.ts +103 -101
- package/src/narrative.ts +44 -6
- package/src/samples/items.narrative.ts +7 -7
- package/src/samples/place-order.narrative.ts +4 -4
- package/src/samples/questionnaires.narrative.ts +17 -18
- package/src/samples/seasonal-assistant.schema.json +37 -31
- package/src/schema.ts +33 -24
- package/src/slice-builder.ts +2 -2
- package/src/transformers/model-to-narrative/generators/flow.ts +53 -23
- package/src/transformers/model-to-narrative/generators/imports.ts +2 -1
- package/src/transformers/narrative-to-model/index.ts +4 -7
- package/src/transformers/narrative-to-model/type-inference.specs.ts +3 -3
package/package.json
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"typescript": "^5.9.2",
|
|
24
24
|
"zod": "^3.22.4",
|
|
25
25
|
"zod-to-json-schema": "^3.22.3",
|
|
26
|
-
"@auto-engineer/file-store": "0.
|
|
27
|
-
"@auto-engineer/id": "0.
|
|
28
|
-
"@auto-engineer/message-bus": "0.
|
|
26
|
+
"@auto-engineer/file-store": "0.12.1",
|
|
27
|
+
"@auto-engineer/id": "0.12.1",
|
|
28
|
+
"@auto-engineer/message-bus": "0.12.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^20.0.0",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
34
34
|
"fake-indexeddb": "^6.0.0",
|
|
35
35
|
"tsx": "^4.20.3",
|
|
36
|
-
"@auto-engineer/cli": "0.
|
|
36
|
+
"@auto-engineer/cli": "0.12.1"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"version": "0.
|
|
41
|
+
"version": "0.12.1",
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsx scripts/build.ts",
|
|
44
44
|
"test": "vitest run --reporter=dot",
|
package/src/fluent-builder.ts
CHANGED
|
@@ -72,7 +72,7 @@ class CommandSliceBuilderImpl implements FluentCommandSliceBuilder {
|
|
|
72
72
|
type: 'command',
|
|
73
73
|
name,
|
|
74
74
|
id,
|
|
75
|
-
client: {
|
|
75
|
+
client: { specs: [] },
|
|
76
76
|
server: { description: '', specs: { name: '', rules: [] }, data: undefined },
|
|
77
77
|
};
|
|
78
78
|
addSlice(this.slice);
|
|
@@ -88,16 +88,15 @@ class CommandSliceBuilderImpl implements FluentCommandSliceBuilder {
|
|
|
88
88
|
client(fn: () => void): FluentCommandSliceBuilder;
|
|
89
89
|
client(description: string, fn: () => void): FluentCommandSliceBuilder;
|
|
90
90
|
client(descriptionOrFn: string | (() => void), fn?: () => void): FluentCommandSliceBuilder {
|
|
91
|
-
const description = typeof descriptionOrFn === 'string' ? descriptionOrFn : '';
|
|
92
91
|
const callback = typeof descriptionOrFn === 'function' ? descriptionOrFn : fn;
|
|
93
92
|
|
|
94
|
-
debugCommand('Adding client block to slice %s
|
|
93
|
+
debugCommand('Adding client block to slice %s', this.slice.name);
|
|
95
94
|
|
|
96
95
|
if (callback) {
|
|
97
96
|
const slice = getCurrentSlice();
|
|
98
97
|
if (slice) {
|
|
99
98
|
debugCommand('Starting client block execution');
|
|
100
|
-
startClientBlock(slice
|
|
99
|
+
startClientBlock(slice);
|
|
101
100
|
callback();
|
|
102
101
|
endClientBlock();
|
|
103
102
|
debugCommand('Client block execution completed');
|
|
@@ -179,7 +178,7 @@ class QuerySliceBuilderImpl implements FluentQuerySliceBuilder {
|
|
|
179
178
|
type: 'query',
|
|
180
179
|
name,
|
|
181
180
|
id,
|
|
182
|
-
client: {
|
|
181
|
+
client: { specs: [] },
|
|
183
182
|
server: { description: '', specs: { name: '', rules: [] }, data: undefined },
|
|
184
183
|
};
|
|
185
184
|
addSlice(this.slice);
|
|
@@ -189,16 +188,15 @@ class QuerySliceBuilderImpl implements FluentQuerySliceBuilder {
|
|
|
189
188
|
client(fn: () => void): FluentQuerySliceBuilder;
|
|
190
189
|
client(description: string, fn: () => void): FluentQuerySliceBuilder;
|
|
191
190
|
client(descriptionOrFn: string | (() => void), fn?: () => void): FluentQuerySliceBuilder {
|
|
192
|
-
const description = typeof descriptionOrFn === 'string' ? descriptionOrFn : '';
|
|
193
191
|
const callback = typeof descriptionOrFn === 'function' ? descriptionOrFn : fn;
|
|
194
192
|
|
|
195
|
-
debugQuery('Adding client block to slice %s
|
|
193
|
+
debugQuery('Adding client block to slice %s', this.slice.name);
|
|
196
194
|
|
|
197
195
|
if (callback) {
|
|
198
196
|
const slice = getCurrentSlice();
|
|
199
197
|
if (slice) {
|
|
200
198
|
debugQuery('Starting client block execution');
|
|
201
|
-
startClientBlock(slice
|
|
199
|
+
startClientBlock(slice);
|
|
202
200
|
callback();
|
|
203
201
|
endClientBlock();
|
|
204
202
|
debugQuery('Client block execution completed');
|
|
@@ -320,7 +318,7 @@ class ExperienceSliceBuilderImpl implements FluentExperienceSliceBuilder {
|
|
|
320
318
|
type: 'experience',
|
|
321
319
|
name,
|
|
322
320
|
id,
|
|
323
|
-
client: {
|
|
321
|
+
client: { specs: [] },
|
|
324
322
|
};
|
|
325
323
|
addSlice(this.slice);
|
|
326
324
|
debugExperience('Experience slice added to flow: %s', name);
|
|
@@ -329,16 +327,15 @@ class ExperienceSliceBuilderImpl implements FluentExperienceSliceBuilder {
|
|
|
329
327
|
client(fn: () => void): FluentExperienceSliceBuilder;
|
|
330
328
|
client(description: string, fn: () => void): FluentExperienceSliceBuilder;
|
|
331
329
|
client(descriptionOrFn: string | (() => void), fn?: () => void): FluentExperienceSliceBuilder {
|
|
332
|
-
const description = typeof descriptionOrFn === 'string' ? descriptionOrFn : '';
|
|
333
330
|
const callback = typeof descriptionOrFn === 'function' ? descriptionOrFn : fn;
|
|
334
331
|
|
|
335
|
-
debugExperience('Adding client block to slice %s
|
|
332
|
+
debugExperience('Adding client block to slice %s', this.slice.name);
|
|
336
333
|
|
|
337
334
|
if (callback) {
|
|
338
335
|
const slice = getCurrentSlice();
|
|
339
336
|
if (slice) {
|
|
340
337
|
debugExperience('Starting client block execution');
|
|
341
|
-
startClientBlock(slice
|
|
338
|
+
startClientBlock(slice);
|
|
342
339
|
callback();
|
|
343
340
|
endClientBlock();
|
|
344
341
|
debugExperience('Client block execution completed');
|
|
@@ -56,8 +56,13 @@ describe('getNarratives', (_mode) => {
|
|
|
56
56
|
expect(createItemSlice.stream).toBe('item-${id}');
|
|
57
57
|
if (createItemSlice.type === 'command') {
|
|
58
58
|
expect(createItemSlice.client.specs).toBeDefined();
|
|
59
|
-
expect(createItemSlice.client.specs
|
|
60
|
-
expect(createItemSlice.client.specs
|
|
59
|
+
expect(Array.isArray(createItemSlice.client.specs)).toBe(true);
|
|
60
|
+
expect(createItemSlice.client.specs).toHaveLength(1);
|
|
61
|
+
expect(createItemSlice.client.specs[0].type).toBe('describe');
|
|
62
|
+
expect(createItemSlice.client.specs[0].title).toBe('A form that allows users to add items');
|
|
63
|
+
if (createItemSlice.client.specs[0].type === 'describe') {
|
|
64
|
+
expect(createItemSlice.client.specs[0].children).toHaveLength(1);
|
|
65
|
+
}
|
|
61
66
|
expect(createItemSlice.server.specs).toBeDefined();
|
|
62
67
|
const spec = createItemSlice.server.specs;
|
|
63
68
|
expect(spec.name).toBeDefined();
|
|
@@ -91,8 +96,13 @@ describe('getNarratives', (_mode) => {
|
|
|
91
96
|
expect(viewItemSlice.type).toBe('query');
|
|
92
97
|
expect(viewItemSlice.name).toBe('view items');
|
|
93
98
|
expect(viewItemSlice.client.specs).toBeDefined();
|
|
94
|
-
expect(viewItemSlice.client.specs
|
|
95
|
-
expect(viewItemSlice.client.specs
|
|
99
|
+
expect(Array.isArray(viewItemSlice.client.specs)).toBe(true);
|
|
100
|
+
expect(viewItemSlice.client.specs).toHaveLength(1);
|
|
101
|
+
expect(viewItemSlice.client.specs[0].type).toBe('describe');
|
|
102
|
+
expect(viewItemSlice.client.specs[0].title).toBe('view Items Screen');
|
|
103
|
+
if (viewItemSlice.client.specs[0].type === 'describe') {
|
|
104
|
+
expect(viewItemSlice.client.specs[0].children).toHaveLength(3);
|
|
105
|
+
}
|
|
96
106
|
expect(viewItemSlice.request).toBeDefined();
|
|
97
107
|
expect(viewItemSlice.request).toMatch(
|
|
98
108
|
/query items\(\$itemId: String!\) {\s+items\(itemId: \$itemId\) {\s+id\s+description\s+}/,
|
|
@@ -119,8 +129,13 @@ describe('getNarratives', (_mode) => {
|
|
|
119
129
|
|
|
120
130
|
if (submitOrderSlice.type === 'command') {
|
|
121
131
|
expect(submitOrderSlice.client.specs).toBeDefined();
|
|
122
|
-
expect(submitOrderSlice.client.specs
|
|
123
|
-
expect(submitOrderSlice.client.specs
|
|
132
|
+
expect(Array.isArray(submitOrderSlice.client.specs)).toBe(true);
|
|
133
|
+
expect(submitOrderSlice.client.specs).toHaveLength(1);
|
|
134
|
+
expect(submitOrderSlice.client.specs[0].type).toBe('describe');
|
|
135
|
+
expect(submitOrderSlice.client.specs[0].title).toBe('Order submission form');
|
|
136
|
+
if (submitOrderSlice.client.specs[0].type === 'describe') {
|
|
137
|
+
expect(submitOrderSlice.client.specs[0].children).toHaveLength(2);
|
|
138
|
+
}
|
|
124
139
|
expect(submitOrderSlice.server.specs).toBeDefined();
|
|
125
140
|
const spec = submitOrderSlice.server.specs;
|
|
126
141
|
expect(spec.rules).toHaveLength(1);
|
|
@@ -390,13 +405,13 @@ describe('getNarratives', (_mode) => {
|
|
|
390
405
|
it('should handle experience slice with client specs', async () => {
|
|
391
406
|
const memoryVfs = new InMemoryFileStore();
|
|
392
407
|
const flowWithExperienceContent = `
|
|
393
|
-
import { flow, experience,
|
|
408
|
+
import { flow, experience, it, specs } from '@auto-engineer/narrative';
|
|
394
409
|
|
|
395
410
|
flow('Test Experience Flow', () => {
|
|
396
411
|
experience('Homepage', 'AUTO-H1a4Bn6Cy').client(() => {
|
|
397
412
|
specs(() => {
|
|
398
|
-
|
|
399
|
-
|
|
413
|
+
it('show a hero section with a welcome message');
|
|
414
|
+
it('allow user to start the questionnaire');
|
|
400
415
|
});
|
|
401
416
|
});
|
|
402
417
|
});
|
|
@@ -418,15 +433,12 @@ flow('Test Experience Flow', () => {
|
|
|
418
433
|
if (homepageSlice?.type === 'experience') {
|
|
419
434
|
expect(homepageSlice.client).toBeDefined();
|
|
420
435
|
expect(homepageSlice.client.specs).toBeDefined();
|
|
421
|
-
expect(homepageSlice.client.specs
|
|
422
|
-
expect(homepageSlice.client.specs
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
expect(rules[0]).toBe('show a hero section with a welcome message');
|
|
428
|
-
expect(rules[1]).toBe('allow user to start the questionnaire');
|
|
429
|
-
}
|
|
436
|
+
expect(Array.isArray(homepageSlice.client.specs)).toBe(true);
|
|
437
|
+
expect(homepageSlice.client.specs).toHaveLength(2);
|
|
438
|
+
expect(homepageSlice.client.specs[0].type).toBe('it');
|
|
439
|
+
expect(homepageSlice.client.specs[0].title).toBe('show a hero section with a welcome message');
|
|
440
|
+
expect(homepageSlice.client.specs[1].type).toBe('it');
|
|
441
|
+
expect(homepageSlice.client.specs[1].title).toBe('allow user to start the questionnaire');
|
|
430
442
|
}
|
|
431
443
|
}
|
|
432
444
|
});
|
|
@@ -434,12 +446,12 @@ flow('Test Experience Flow', () => {
|
|
|
434
446
|
it('simulates browser execution with transpiled CommonJS code', async () => {
|
|
435
447
|
const memoryVfs = new InMemoryFileStore();
|
|
436
448
|
const flowContent = `
|
|
437
|
-
import { flow, experience,
|
|
449
|
+
import { flow, experience, it, specs } from '@auto-engineer/narrative';
|
|
438
450
|
|
|
439
451
|
flow('Browser Test Flow', () => {
|
|
440
452
|
experience('HomePage').client(() => {
|
|
441
453
|
specs(() => {
|
|
442
|
-
|
|
454
|
+
it('render correctly');
|
|
443
455
|
});
|
|
444
456
|
});
|
|
445
457
|
});
|
|
@@ -466,8 +478,10 @@ flow('Browser Test Flow', () => {
|
|
|
466
478
|
if (slice.type === 'experience') {
|
|
467
479
|
expect(slice.client).toBeDefined();
|
|
468
480
|
expect(slice.client.specs).toBeDefined();
|
|
469
|
-
expect(slice.client.specs
|
|
470
|
-
expect(slice.client.specs
|
|
481
|
+
expect(Array.isArray(slice.client.specs)).toBe(true);
|
|
482
|
+
expect(slice.client.specs).toHaveLength(1);
|
|
483
|
+
expect(slice.client.specs[0].type).toBe('it');
|
|
484
|
+
expect(slice.client.specs[0].title).toBe('render correctly');
|
|
471
485
|
}
|
|
472
486
|
});
|
|
473
487
|
|
|
@@ -972,7 +986,8 @@ import {
|
|
|
972
986
|
query,
|
|
973
987
|
experience,
|
|
974
988
|
flow,
|
|
975
|
-
|
|
989
|
+
describe,
|
|
990
|
+
it,
|
|
976
991
|
specs,
|
|
977
992
|
rule,
|
|
978
993
|
example,
|
|
@@ -1048,9 +1063,9 @@ flow('Questionnaires', 'AUTO-Q9m2Kp4Lx', () => {
|
|
|
1048
1063
|
}
|
|
1049
1064
|
\`)
|
|
1050
1065
|
.client(() => {
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1066
|
+
describe('Questionnaire Link', () => {
|
|
1067
|
+
it('display a confirmation message when the link is sent');
|
|
1068
|
+
it('handle errors when the link cannot be sent');
|
|
1054
1069
|
});
|
|
1055
1070
|
});
|
|
1056
1071
|
|
|
@@ -1080,8 +1095,8 @@ flow('Questionnaires', 'AUTO-Q9m2Kp4Lx', () => {
|
|
|
1080
1095
|
}
|
|
1081
1096
|
\`)
|
|
1082
1097
|
.client(() => {
|
|
1083
|
-
|
|
1084
|
-
|
|
1098
|
+
describe('Submission Confirmation', () => {
|
|
1099
|
+
it('display a confirmation message upon successful submission');
|
|
1085
1100
|
});
|
|
1086
1101
|
});
|
|
1087
1102
|
});`;
|
|
@@ -12,7 +12,7 @@ describe('addAutoIds', () => {
|
|
|
12
12
|
{
|
|
13
13
|
type: 'command',
|
|
14
14
|
name: 'Test Command Slice',
|
|
15
|
-
client: {
|
|
15
|
+
client: { specs: [] },
|
|
16
16
|
server: {
|
|
17
17
|
description: 'Test server',
|
|
18
18
|
specs: {
|
|
@@ -35,7 +35,7 @@ describe('addAutoIds', () => {
|
|
|
35
35
|
type: 'query',
|
|
36
36
|
name: 'Test Query Slice',
|
|
37
37
|
id: 'EXISTING-SLICE-001',
|
|
38
|
-
client: {
|
|
38
|
+
client: { specs: [] },
|
|
39
39
|
server: {
|
|
40
40
|
description: 'Test server',
|
|
41
41
|
specs: {
|
|
@@ -135,7 +135,7 @@ describe('addAutoIds', () => {
|
|
|
135
135
|
{
|
|
136
136
|
type: 'command',
|
|
137
137
|
name: 'Simple Command',
|
|
138
|
-
client: {
|
|
138
|
+
client: { specs: [] },
|
|
139
139
|
server: {
|
|
140
140
|
description: 'Simple server',
|
|
141
141
|
specs: {
|
|
@@ -176,11 +176,10 @@ describe('addAutoIds', () => {
|
|
|
176
176
|
type: 'experience',
|
|
177
177
|
name: 'User Onboarding Experience',
|
|
178
178
|
client: {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
},
|
|
179
|
+
specs: [
|
|
180
|
+
{ type: 'it', title: 'User should see welcome message' },
|
|
181
|
+
{ type: 'it', title: 'User should complete profile setup' },
|
|
182
|
+
],
|
|
184
183
|
},
|
|
185
184
|
},
|
|
186
185
|
{
|
|
@@ -188,11 +187,7 @@ describe('addAutoIds', () => {
|
|
|
188
187
|
name: 'Checkout Experience',
|
|
189
188
|
id: 'EXISTING-EXPERIENCE-SLICE-001',
|
|
190
189
|
client: {
|
|
191
|
-
|
|
192
|
-
specs: {
|
|
193
|
-
name: 'Checkout Specs',
|
|
194
|
-
rules: ['User should review cart items'],
|
|
195
|
-
},
|
|
190
|
+
specs: [{ type: 'it', title: 'User should review cart items' }],
|
|
196
191
|
},
|
|
197
192
|
},
|
|
198
193
|
],
|
|
@@ -226,10 +221,7 @@ describe('addAutoIds', () => {
|
|
|
226
221
|
name: 'Active Surveys Summary',
|
|
227
222
|
type: 'experience',
|
|
228
223
|
client: {
|
|
229
|
-
specs: {
|
|
230
|
-
name: '',
|
|
231
|
-
rules: ['show active surveys summary'],
|
|
232
|
-
},
|
|
224
|
+
specs: [{ type: 'it', title: 'show active surveys summary' }],
|
|
233
225
|
},
|
|
234
226
|
},
|
|
235
227
|
],
|
|
@@ -242,10 +234,7 @@ describe('addAutoIds', () => {
|
|
|
242
234
|
name: 'Create Survey Form',
|
|
243
235
|
type: 'experience',
|
|
244
236
|
client: {
|
|
245
|
-
specs: {
|
|
246
|
-
name: '',
|
|
247
|
-
rules: ['allow entering survey title'],
|
|
248
|
-
},
|
|
237
|
+
specs: [{ type: 'it', title: 'allow entering survey title' }],
|
|
249
238
|
},
|
|
250
239
|
},
|
|
251
240
|
],
|
|
@@ -258,10 +247,7 @@ describe('addAutoIds', () => {
|
|
|
258
247
|
name: 'Response Rate Charts',
|
|
259
248
|
type: 'experience',
|
|
260
249
|
client: {
|
|
261
|
-
specs: {
|
|
262
|
-
name: '',
|
|
263
|
-
rules: ['show daily response rate charts'],
|
|
264
|
-
},
|
|
250
|
+
specs: [{ type: 'it', title: 'show daily response rate charts' }],
|
|
265
251
|
},
|
|
266
252
|
},
|
|
267
253
|
],
|
|
@@ -58,13 +58,13 @@ flow('Test Flow with IDs', 'FLOW-001', () => {
|
|
|
58
58
|
});`;
|
|
59
59
|
|
|
60
60
|
const multipleFlowsSameSource = `
|
|
61
|
-
import { flow, specs,
|
|
61
|
+
import { flow, specs, it } from '../narrative';
|
|
62
62
|
import { experience } from '../fluent-builder';
|
|
63
63
|
|
|
64
64
|
flow('Home Screen', 'AUTO-aifPcU3hw', () => {
|
|
65
65
|
experience('Active Surveys Summary', 'AUTO-slice1').client(() => {
|
|
66
66
|
specs(() => {
|
|
67
|
-
|
|
67
|
+
it('show active surveys summary');
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
});
|
|
@@ -72,7 +72,7 @@ flow('Home Screen', 'AUTO-aifPcU3hw', () => {
|
|
|
72
72
|
flow('Create Survey', 'AUTO-MPviTMrQC', () => {
|
|
73
73
|
experience('Create Survey Form', 'AUTO-slice2').client(() => {
|
|
74
74
|
specs(() => {
|
|
75
|
-
|
|
75
|
+
it('allow entering survey title');
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -80,19 +80,19 @@ flow('Create Survey', 'AUTO-MPviTMrQC', () => {
|
|
|
80
80
|
flow('Response Analytics', 'AUTO-eME978Euk', () => {
|
|
81
81
|
experience('Response Rate Charts', 'AUTO-slice3').client(() => {
|
|
82
82
|
specs(() => {
|
|
83
|
-
|
|
83
|
+
it('show daily response rate charts');
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
});`;
|
|
87
87
|
|
|
88
88
|
const multipleFlowsIncomplete = `
|
|
89
|
-
import { flow, specs,
|
|
89
|
+
import { flow, specs, it } from '../narrative';
|
|
90
90
|
import { experience } from '../fluent-builder';
|
|
91
91
|
|
|
92
92
|
flow('Home Screen', 'AUTO-aifPcU3hw', () => {
|
|
93
93
|
experience('Active Surveys Summary', 'AUTO-slice1').client(() => {
|
|
94
94
|
specs(() => {
|
|
95
|
-
|
|
95
|
+
it('show active surveys summary');
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
98
|
});
|
|
@@ -100,7 +100,7 @@ flow('Home Screen', 'AUTO-aifPcU3hw', () => {
|
|
|
100
100
|
flow('Create Survey', () => {
|
|
101
101
|
experience('Create Survey Form', 'AUTO-slice2').client(() => {
|
|
102
102
|
specs(() => {
|
|
103
|
-
|
|
103
|
+
it('allow entering survey title');
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
});
|
|
@@ -108,19 +108,19 @@ flow('Create Survey', () => {
|
|
|
108
108
|
flow('Response Analytics', 'AUTO-eME978Euk', () => {
|
|
109
109
|
experience('Response Rate Charts', 'AUTO-slice3').client(() => {
|
|
110
110
|
specs(() => {
|
|
111
|
-
|
|
111
|
+
it('show daily response rate charts');
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
});`;
|
|
115
115
|
|
|
116
116
|
const multipleFlowsSliceMissing = `
|
|
117
|
-
import { flow, specs,
|
|
117
|
+
import { flow, specs, it } from '../narrative';
|
|
118
118
|
import { experience } from '../fluent-builder';
|
|
119
119
|
|
|
120
120
|
flow('Home Screen', 'AUTO-aifPcU3hw', () => {
|
|
121
121
|
experience('Active Surveys Summary', 'AUTO-slice1').client(() => {
|
|
122
122
|
specs(() => {
|
|
123
|
-
|
|
123
|
+
it('show active surveys summary');
|
|
124
124
|
});
|
|
125
125
|
});
|
|
126
126
|
});
|
|
@@ -128,7 +128,7 @@ flow('Home Screen', 'AUTO-aifPcU3hw', () => {
|
|
|
128
128
|
flow('Create Survey', 'AUTO-MPviTMrQC', () => {
|
|
129
129
|
experience('Create Survey Form').client(() => {
|
|
130
130
|
specs(() => {
|
|
131
|
-
|
|
131
|
+
it('allow entering survey title');
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
});
|
|
@@ -136,7 +136,7 @@ flow('Create Survey', 'AUTO-MPviTMrQC', () => {
|
|
|
136
136
|
flow('Response Analytics', 'AUTO-eME978Euk', () => {
|
|
137
137
|
experience('Response Rate Charts', 'AUTO-slice3').client(() => {
|
|
138
138
|
specs(() => {
|
|
139
|
-
|
|
139
|
+
it('show daily response rate charts');
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
});`;
|
package/src/index.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type { FieldSelector } from './data-narrative-builders';
|
|
|
44
44
|
|
|
45
45
|
// Narrative language functions
|
|
46
46
|
export { narrative, narrative as flow } from './narrative';
|
|
47
|
-
export { client, server, specs, should, request, data, rule, example } from './narrative';
|
|
47
|
+
export { client, server, specs, describe, it, should, request, data, rule, example } from './narrative';
|
|
48
48
|
export type { SliceTypeValueInterface } from './narrative';
|
|
49
49
|
export { SliceType } from './narrative';
|
|
50
50
|
|
|
@@ -115,6 +115,7 @@ export type Example = z.infer<typeof ExampleSchema>;
|
|
|
115
115
|
export type MessageField = z.infer<typeof MessageFieldSchema>;
|
|
116
116
|
export type Rule = z.infer<typeof RuleSchema>;
|
|
117
117
|
export type Spec = z.infer<typeof SpecSchema>;
|
|
118
|
+
export type { ClientSpecNode } from './schema';
|
|
118
119
|
|
|
119
120
|
// ID assignment utilities
|
|
120
121
|
export { addAutoIds, hasAllIds } from './id';
|