@contractspec/example.kb-update-pipeline 1.46.2 → 1.48.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.
- package/.turbo/turbo-build$colon$bundle.log +24 -20
- package/.turbo/turbo-build.log +56 -54
- package/CHANGELOG.md +34 -0
- package/dist/events.d.ts +21 -21
- package/dist/events.d.ts.map +1 -1
- package/dist/example.d.ts +2 -2
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +4 -2
- package/dist/example.js.map +1 -1
- package/dist/handlers/memory.handlers.js.map +1 -1
- package/dist/kb-update-pipeline.feature.d.ts +2 -2
- package/dist/kb-update-pipeline.feature.d.ts.map +1 -1
- package/dist/kb-update-pipeline.feature.js +4 -2
- package/dist/kb-update-pipeline.feature.js.map +1 -1
- package/dist/operations/pipeline.d.ts +39 -39
- package/dist/operations/pipeline.d.ts.map +1 -1
- package/dist/presentations.d.ts +4 -4
- package/dist/presentations.d.ts.map +1 -1
- package/dist/presentations.js +7 -7
- package/dist/presentations.js.map +1 -1
- package/dist/tests/operations.test-spec.d.ts +9 -0
- package/dist/tests/operations.test-spec.d.ts.map +1 -0
- package/dist/tests/operations.test-spec.js +94 -0
- package/dist/tests/operations.test-spec.js.map +1 -0
- package/package.json +7 -8
- package/src/example.ts +3 -3
- package/src/kb-update-pipeline.feature.ts +3 -3
- package/src/presentations.ts +7 -8
- package/src/tests/operations.test-spec.ts +82 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_contracts11 from "@contractspec/lib.contracts";
|
|
2
|
+
import * as _contractspec_lib_schema18 from "@contractspec/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/operations/pipeline.d.ts
|
|
5
|
-
declare const KbPipelineRunWatchContract:
|
|
5
|
+
declare const KbPipelineRunWatchContract: _contractspec_lib_contracts11.OperationSpec<_contractspec_lib_schema18.SchemaModel<{
|
|
6
6
|
jurisdiction: {
|
|
7
|
-
type:
|
|
7
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
8
8
|
isOptional: false;
|
|
9
9
|
};
|
|
10
|
-
}>,
|
|
10
|
+
}>, _contractspec_lib_schema18.SchemaModel<{
|
|
11
11
|
candidates: {
|
|
12
|
-
type:
|
|
12
|
+
type: _contractspec_lib_schema18.SchemaModel<{
|
|
13
13
|
id: {
|
|
14
|
-
type:
|
|
14
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
15
15
|
isOptional: false;
|
|
16
16
|
};
|
|
17
17
|
sourceDocumentId: {
|
|
18
|
-
type:
|
|
18
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
19
19
|
isOptional: false;
|
|
20
20
|
};
|
|
21
21
|
detectedAt: {
|
|
22
|
-
type:
|
|
22
|
+
type: _contractspec_lib_schema18.FieldType<Date, string>;
|
|
23
23
|
isOptional: false;
|
|
24
24
|
};
|
|
25
25
|
diffSummary: {
|
|
26
|
-
type:
|
|
26
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
27
27
|
isOptional: false;
|
|
28
28
|
};
|
|
29
29
|
riskLevel: {
|
|
30
|
-
type:
|
|
30
|
+
type: _contractspec_lib_schema18.EnumType<[string, string, string]>;
|
|
31
31
|
isOptional: false;
|
|
32
32
|
};
|
|
33
33
|
}>;
|
|
@@ -35,100 +35,100 @@ declare const KbPipelineRunWatchContract: _contractspec_lib_contracts0.Operation
|
|
|
35
35
|
isOptional: false;
|
|
36
36
|
};
|
|
37
37
|
}>, undefined>;
|
|
38
|
-
declare const KbPipelineCreateReviewTaskContract:
|
|
38
|
+
declare const KbPipelineCreateReviewTaskContract: _contractspec_lib_contracts11.OperationSpec<_contractspec_lib_schema18.SchemaModel<{
|
|
39
39
|
changeCandidateId: {
|
|
40
|
-
type:
|
|
40
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
41
41
|
isOptional: false;
|
|
42
42
|
};
|
|
43
|
-
}>,
|
|
43
|
+
}>, _contractspec_lib_schema18.SchemaModel<{
|
|
44
44
|
id: {
|
|
45
|
-
type:
|
|
45
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
46
46
|
isOptional: false;
|
|
47
47
|
};
|
|
48
48
|
changeCandidateId: {
|
|
49
|
-
type:
|
|
49
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
50
50
|
isOptional: false;
|
|
51
51
|
};
|
|
52
52
|
status: {
|
|
53
|
-
type:
|
|
53
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
54
54
|
isOptional: false;
|
|
55
55
|
};
|
|
56
56
|
assignedRole: {
|
|
57
|
-
type:
|
|
57
|
+
type: _contractspec_lib_schema18.EnumType<[string, string]>;
|
|
58
58
|
isOptional: false;
|
|
59
59
|
};
|
|
60
60
|
decision: {
|
|
61
|
-
type:
|
|
61
|
+
type: _contractspec_lib_schema18.EnumType<[string, string]>;
|
|
62
62
|
isOptional: true;
|
|
63
63
|
};
|
|
64
64
|
decidedAt: {
|
|
65
|
-
type:
|
|
65
|
+
type: _contractspec_lib_schema18.FieldType<Date, string>;
|
|
66
66
|
isOptional: true;
|
|
67
67
|
};
|
|
68
68
|
decidedBy: {
|
|
69
|
-
type:
|
|
69
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
70
70
|
isOptional: true;
|
|
71
71
|
};
|
|
72
72
|
}>, undefined>;
|
|
73
|
-
declare const KbPipelineSubmitDecisionContract:
|
|
73
|
+
declare const KbPipelineSubmitDecisionContract: _contractspec_lib_contracts11.OperationSpec<_contractspec_lib_schema18.SchemaModel<{
|
|
74
74
|
reviewTaskId: {
|
|
75
|
-
type:
|
|
75
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
76
76
|
isOptional: false;
|
|
77
77
|
};
|
|
78
78
|
decision: {
|
|
79
|
-
type:
|
|
79
|
+
type: _contractspec_lib_schema18.EnumType<[string, string]>;
|
|
80
80
|
isOptional: false;
|
|
81
81
|
};
|
|
82
82
|
decidedBy: {
|
|
83
|
-
type:
|
|
83
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
84
84
|
isOptional: false;
|
|
85
85
|
};
|
|
86
86
|
decidedByRole: {
|
|
87
|
-
type:
|
|
87
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
88
88
|
isOptional: false;
|
|
89
89
|
};
|
|
90
|
-
}>,
|
|
90
|
+
}>, _contractspec_lib_schema18.SchemaModel<{
|
|
91
91
|
id: {
|
|
92
|
-
type:
|
|
92
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
93
93
|
isOptional: false;
|
|
94
94
|
};
|
|
95
95
|
changeCandidateId: {
|
|
96
|
-
type:
|
|
96
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
97
97
|
isOptional: false;
|
|
98
98
|
};
|
|
99
99
|
status: {
|
|
100
|
-
type:
|
|
100
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
101
101
|
isOptional: false;
|
|
102
102
|
};
|
|
103
103
|
assignedRole: {
|
|
104
|
-
type:
|
|
104
|
+
type: _contractspec_lib_schema18.EnumType<[string, string]>;
|
|
105
105
|
isOptional: false;
|
|
106
106
|
};
|
|
107
107
|
decision: {
|
|
108
|
-
type:
|
|
108
|
+
type: _contractspec_lib_schema18.EnumType<[string, string]>;
|
|
109
109
|
isOptional: true;
|
|
110
110
|
};
|
|
111
111
|
decidedAt: {
|
|
112
|
-
type:
|
|
112
|
+
type: _contractspec_lib_schema18.FieldType<Date, string>;
|
|
113
113
|
isOptional: true;
|
|
114
114
|
};
|
|
115
115
|
decidedBy: {
|
|
116
|
-
type:
|
|
116
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
117
117
|
isOptional: true;
|
|
118
118
|
};
|
|
119
119
|
}>, undefined>;
|
|
120
|
-
declare const KbPipelinePublishIfReadyContract:
|
|
120
|
+
declare const KbPipelinePublishIfReadyContract: _contractspec_lib_contracts11.OperationSpec<_contractspec_lib_schema18.SchemaModel<{
|
|
121
121
|
jurisdiction: {
|
|
122
|
-
type:
|
|
122
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
123
123
|
isOptional: false;
|
|
124
124
|
};
|
|
125
|
-
}>,
|
|
125
|
+
}>, _contractspec_lib_schema18.SchemaModel<{
|
|
126
126
|
published: {
|
|
127
|
-
type:
|
|
127
|
+
type: _contractspec_lib_schema18.FieldType<boolean, boolean>;
|
|
128
128
|
isOptional: false;
|
|
129
129
|
};
|
|
130
130
|
reason: {
|
|
131
|
-
type:
|
|
131
|
+
type: _contractspec_lib_schema18.FieldType<string, string>;
|
|
132
132
|
isOptional: true;
|
|
133
133
|
};
|
|
134
134
|
}>, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","names":[],"sources":["../../src/operations/pipeline.ts"],"sourcesContent":[],"mappings":";;;;cAwEa,
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","names":[],"sources":["../../src/operations/pipeline.ts"],"sourcesContent":[],"mappings":";;;;cAwEa,0DAA0B,yCAAA;;UAarC,0BAAA,CAAA;;EAbW,CAAA;CAaX,CAAA,wCAAA,CAAA;;IAbqC,IAAA,wCAAA,CAAA;;cAAA,0BAAA,CAAA;;;;;;;MAAA,UAAA,EAAA;QAe1B,IAAA,sCAaX,KAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;;MAb6C,WAAA,EAAA;;;;;;;;;;IAAA,UAAA,EAAA,KAAA;EAelC,CAAA;CA8BX,CAAA,EAAA,SAAA,CAAA;cA7CW,kEAAkC,yCAAA;;UAa7C,0BAAA,CAAA;;EAE2C,CAAA;;;UAfE,0BAAA,CAAA;;;;;;;EAeF,MAAA,EAAA;IAgChC,IAAA,sCAwBX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;EAxB2C,YAAA,EAAA;;;;EAAA,QAAA,EAAA;;;;;;;;;;;;;cAhChC,gEAAgC,yCAAA;;UA8B3C,0BAAA,CAAA;;;;;;;;;;;;;;;;;UA9B2C,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgChC,gEAAgC,yCAAA;;UAwB3C,0BAAA,CAAA;;;;;UAxB2C,0BAAA,CAAA"}
|
package/dist/presentations.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _contractspec_lib_contracts8 from "@contractspec/lib.contracts";
|
|
2
2
|
|
|
3
3
|
//#region src/presentations.d.ts
|
|
4
|
-
declare const KbDashboardPresentation: PresentationSpec;
|
|
5
|
-
declare const KbReviewListPresentation: PresentationSpec;
|
|
6
|
-
declare const KbReviewFormPresentation: PresentationSpec;
|
|
4
|
+
declare const KbDashboardPresentation: _contractspec_lib_contracts8.PresentationSpec;
|
|
5
|
+
declare const KbReviewListPresentation: _contractspec_lib_contracts8.PresentationSpec;
|
|
6
|
+
declare const KbReviewFormPresentation: _contractspec_lib_contracts8.PresentationSpec;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { KbDashboardPresentation, KbReviewFormPresentation, KbReviewListPresentation };
|
|
9
9
|
//# sourceMappingURL=presentations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.d.ts","names":[],"sources":["../src/presentations.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"presentations.d.ts","names":[],"sources":["../src/presentations.ts"],"sourcesContent":[],"mappings":";;;cAGa,yBAoBX,4BAAA,CApBkC;cAsBvB,0BAoBX,4BAAA,CApBmC;cAsBxB,0BAoBX,4BAAA,CApBmC"}
|
package/dist/presentations.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChangeCandidateModel, ReviewTaskModel } from "./entities/models.js";
|
|
2
|
-
import { StabilityEnum } from "@contractspec/lib.contracts";
|
|
2
|
+
import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
|
|
3
3
|
|
|
4
4
|
//#region src/presentations.ts
|
|
5
|
-
const KbDashboardPresentation = {
|
|
5
|
+
const KbDashboardPresentation = definePresentation({
|
|
6
6
|
meta: {
|
|
7
7
|
key: "kb.dashboard",
|
|
8
8
|
version: "1.0.0",
|
|
@@ -22,8 +22,8 @@ const KbDashboardPresentation = {
|
|
|
22
22
|
props: ChangeCandidateModel
|
|
23
23
|
},
|
|
24
24
|
targets: ["react", "markdown"]
|
|
25
|
-
};
|
|
26
|
-
const KbReviewListPresentation = {
|
|
25
|
+
});
|
|
26
|
+
const KbReviewListPresentation = definePresentation({
|
|
27
27
|
meta: {
|
|
28
28
|
key: "kb.review.list",
|
|
29
29
|
version: "1.0.0",
|
|
@@ -43,8 +43,8 @@ const KbReviewListPresentation = {
|
|
|
43
43
|
props: ReviewTaskModel
|
|
44
44
|
},
|
|
45
45
|
targets: ["react", "markdown"]
|
|
46
|
-
};
|
|
47
|
-
const KbReviewFormPresentation = {
|
|
46
|
+
});
|
|
47
|
+
const KbReviewFormPresentation = definePresentation({
|
|
48
48
|
meta: {
|
|
49
49
|
key: "kb.review.form",
|
|
50
50
|
version: "1.0.0",
|
|
@@ -64,7 +64,7 @@ const KbReviewFormPresentation = {
|
|
|
64
64
|
props: ReviewTaskModel
|
|
65
65
|
},
|
|
66
66
|
targets: ["react"]
|
|
67
|
-
};
|
|
67
|
+
});
|
|
68
68
|
|
|
69
69
|
//#endregion
|
|
70
70
|
export { KbDashboardPresentation, KbReviewFormPresentation, KbReviewListPresentation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentations.js","names":[
|
|
1
|
+
{"version":3,"file":"presentations.js","names":[],"sources":["../src/presentations.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport { ChangeCandidateModel, ReviewTaskModel } from './entities/models';\n\nexport const KbDashboardPresentation = definePresentation({\n meta: {\n key: 'kb.dashboard',\n version: '1.0.0',\n title: 'KB Update Dashboard',\n description: 'Overview of KB change candidates and review tasks.',\n domain: 'knowledge',\n owners: ['@examples'],\n tags: ['dashboard', 'knowledge'],\n stability: StabilityEnum.Experimental,\n goal: 'Visualize status',\n context: 'Dashboard',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'KbDashboard',\n props: ChangeCandidateModel, // Simplified props mapping for example\n },\n targets: ['react', 'markdown'],\n});\n\nexport const KbReviewListPresentation = definePresentation({\n meta: {\n key: 'kb.review.list',\n version: '1.0.0',\n title: 'Review Tasks',\n description: 'List of pending review tasks for the current user.',\n domain: 'knowledge',\n owners: ['@examples'],\n tags: ['list', 'review'],\n stability: StabilityEnum.Experimental,\n goal: 'List tasks',\n context: 'Inbox',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ReviewTaskList',\n props: ReviewTaskModel,\n },\n targets: ['react', 'markdown'],\n});\n\nexport const KbReviewFormPresentation = definePresentation({\n meta: {\n key: 'kb.review.form',\n version: '1.0.0',\n title: 'Review Change',\n description: 'Form to approve or reject a KB change candidate.',\n domain: 'knowledge',\n owners: ['@examples'],\n tags: ['form', 'review'],\n stability: StabilityEnum.Experimental,\n goal: 'Review',\n context: 'Detail',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'ReviewDecisionForm',\n props: ReviewTaskModel,\n },\n targets: ['react'],\n});\n"],"mappings":";;;;AAGA,MAAa,0BAA0B,mBAAmB;CACxD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,aAAa,YAAY;EAChC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC/B,CAAC;AAEF,MAAa,2BAA2B,mBAAmB;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,QAAQ,SAAS;EACxB,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC/B,CAAC;AAEF,MAAa,2BAA2B,mBAAmB;CACzD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,QAAQ,SAAS;EACxB,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,QAAQ;CACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/operations.test-spec.d.ts
|
|
4
|
+
declare const RunWatchTest: _contractspec_lib_contracts0.TestSpec;
|
|
5
|
+
declare const CreateReviewTaskTest: _contractspec_lib_contracts0.TestSpec;
|
|
6
|
+
declare const SubmitDecisionTest: _contractspec_lib_contracts0.TestSpec;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CreateReviewTaskTest, RunWatchTest, SubmitDecisionTest };
|
|
9
|
+
//# sourceMappingURL=operations.test-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.test-spec.d.ts","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":[],"mappings":";;;cAEa,cAyBX,4BAAA,CAzBuB;cA2BZ,sBAyBX,4BAAA,CAzB+B;cA2BpB,oBAyBX,4BAAA,CAzB6B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineTestSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/tests/operations.test-spec.ts
|
|
4
|
+
const RunWatchTest = defineTestSpec({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "kbPipeline.runWatch.test",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
stability: "experimental",
|
|
9
|
+
owners: ["@example.kb-update-pipeline"],
|
|
10
|
+
description: "Test for run watch operation",
|
|
11
|
+
tags: ["test"]
|
|
12
|
+
},
|
|
13
|
+
target: {
|
|
14
|
+
type: "operation",
|
|
15
|
+
operation: {
|
|
16
|
+
key: "kbPipeline.runWatch",
|
|
17
|
+
version: "1.0.0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
scenarios: [{
|
|
21
|
+
key: "success",
|
|
22
|
+
when: { operation: { key: "kbPipeline.runWatch" } },
|
|
23
|
+
then: [{
|
|
24
|
+
type: "expectOutput",
|
|
25
|
+
match: {}
|
|
26
|
+
}]
|
|
27
|
+
}, {
|
|
28
|
+
key: "error",
|
|
29
|
+
when: { operation: { key: "kbPipeline.runWatch" } },
|
|
30
|
+
then: [{ type: "expectError" }]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
const CreateReviewTaskTest = defineTestSpec({
|
|
34
|
+
meta: {
|
|
35
|
+
key: "kbPipeline.createReviewTask.test",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
stability: "experimental",
|
|
38
|
+
owners: ["@example.kb-update-pipeline"],
|
|
39
|
+
description: "Test for creating review task",
|
|
40
|
+
tags: ["test"]
|
|
41
|
+
},
|
|
42
|
+
target: {
|
|
43
|
+
type: "operation",
|
|
44
|
+
operation: {
|
|
45
|
+
key: "kbPipeline.createReviewTask",
|
|
46
|
+
version: "1.0.0"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
scenarios: [{
|
|
50
|
+
key: "success",
|
|
51
|
+
when: { operation: { key: "kbPipeline.createReviewTask" } },
|
|
52
|
+
then: [{
|
|
53
|
+
type: "expectOutput",
|
|
54
|
+
match: {}
|
|
55
|
+
}]
|
|
56
|
+
}, {
|
|
57
|
+
key: "error",
|
|
58
|
+
when: { operation: { key: "kbPipeline.createReviewTask" } },
|
|
59
|
+
then: [{ type: "expectError" }]
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
const SubmitDecisionTest = defineTestSpec({
|
|
63
|
+
meta: {
|
|
64
|
+
key: "kbPipeline.submitDecision.test",
|
|
65
|
+
version: "1.0.0",
|
|
66
|
+
stability: "experimental",
|
|
67
|
+
owners: ["@example.kb-update-pipeline"],
|
|
68
|
+
description: "Test for submitting decision",
|
|
69
|
+
tags: ["test"]
|
|
70
|
+
},
|
|
71
|
+
target: {
|
|
72
|
+
type: "operation",
|
|
73
|
+
operation: {
|
|
74
|
+
key: "kbPipeline.submitDecision",
|
|
75
|
+
version: "1.0.0"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
scenarios: [{
|
|
79
|
+
key: "success",
|
|
80
|
+
when: { operation: { key: "kbPipeline.submitDecision" } },
|
|
81
|
+
then: [{
|
|
82
|
+
type: "expectOutput",
|
|
83
|
+
match: {}
|
|
84
|
+
}]
|
|
85
|
+
}, {
|
|
86
|
+
key: "error",
|
|
87
|
+
when: { operation: { key: "kbPipeline.submitDecision" } },
|
|
88
|
+
then: [{ type: "expectError" }]
|
|
89
|
+
}]
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { CreateReviewTaskTest, RunWatchTest, SubmitDecisionTest };
|
|
94
|
+
//# sourceMappingURL=operations.test-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.test-spec.js","names":[],"sources":["../../src/tests/operations.test-spec.ts"],"sourcesContent":["import { defineTestSpec } from '@contractspec/lib.contracts';\n\nexport const RunWatchTest = defineTestSpec({\n meta: {\n key: 'kbPipeline.runWatch.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.kb-update-pipeline'],\n description: 'Test for run watch operation',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'kbPipeline.runWatch', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'kbPipeline.runWatch' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'kbPipeline.runWatch' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const CreateReviewTaskTest = defineTestSpec({\n meta: {\n key: 'kbPipeline.createReviewTask.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.kb-update-pipeline'],\n description: 'Test for creating review task',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'kbPipeline.createReviewTask', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'kbPipeline.createReviewTask' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'kbPipeline.createReviewTask' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const SubmitDecisionTest = defineTestSpec({\n meta: {\n key: 'kbPipeline.submitDecision.test',\n version: '1.0.0',\n stability: 'experimental',\n owners: ['@example.kb-update-pipeline'],\n description: 'Test for submitting decision',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'kbPipeline.submitDecision', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'kbPipeline.submitDecision' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'kbPipeline.submitDecision' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n"],"mappings":";;;AAEA,MAAa,eAAe,eAAe;CACzC,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,8BAA8B;EACvC,aAAa;EACb,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAAuB,SAAS;GAAS;EAC5D;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,uBAAuB,EAAE;EACnD,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,uBAAuB,EAAE;EACnD,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC;AAEF,MAAa,uBAAuB,eAAe;CACjD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,8BAA8B;EACvC,aAAa;EACb,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAA+B,SAAS;GAAS;EACpE;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,+BAA+B,EAAE;EAC3D,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,+BAA+B,EAAE;EAC3D,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC;AAEF,MAAa,qBAAqB,eAAe;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,8BAA8B;EACvC,aAAa;EACb,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAA6B,SAAS;GAAS;EAClE;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,6BAA6B,EAAE;EACzD,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,6BAA6B,EAAE;EACzD,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.kb-update-pipeline",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.0",
|
|
4
4
|
"description": "Example: KB update automation pipeline with HITL review and auditability.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
6
|
"types": "./dist/index.d.ts",
|
|
9
7
|
"exports": {
|
|
10
8
|
".": "./dist/index.js",
|
|
@@ -20,6 +18,7 @@
|
|
|
20
18
|
"./operations": "./dist/operations/index.js",
|
|
21
19
|
"./operations/pipeline": "./dist/operations/pipeline.js",
|
|
22
20
|
"./presentations": "./dist/presentations.js",
|
|
21
|
+
"./tests/operations.test-spec": "./dist/tests/operations.test-spec.js",
|
|
23
22
|
"./*": "./*"
|
|
24
23
|
},
|
|
25
24
|
"scripts": {
|
|
@@ -36,13 +35,13 @@
|
|
|
36
35
|
"test": "bun test"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@contractspec/lib.contracts": "1.
|
|
40
|
-
"@contractspec/lib.schema": "1.
|
|
38
|
+
"@contractspec/lib.contracts": "1.48.0",
|
|
39
|
+
"@contractspec/lib.schema": "1.48.0"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@contractspec/tool.tsdown": "1.
|
|
44
|
-
"@contractspec/tool.typescript": "1.
|
|
45
|
-
"tsdown": "^0.
|
|
42
|
+
"@contractspec/tool.tsdown": "1.48.0",
|
|
43
|
+
"@contractspec/tool.typescript": "1.48.0",
|
|
44
|
+
"tsdown": "^0.19.0",
|
|
46
45
|
"typescript": "^5.9.3"
|
|
47
46
|
},
|
|
48
47
|
"publishConfig": {
|
package/src/example.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineExample } from '@contractspec/lib.contracts';
|
|
2
2
|
|
|
3
|
-
const example
|
|
3
|
+
const example = defineExample({
|
|
4
4
|
meta: {
|
|
5
5
|
key: 'kb-update-pipeline',
|
|
6
6
|
version: '1.0.0',
|
|
@@ -29,6 +29,6 @@ const example: ExampleSpec = {
|
|
|
29
29
|
studio: { enabled: true, installable: true },
|
|
30
30
|
mcp: { enabled: true },
|
|
31
31
|
},
|
|
32
|
-
};
|
|
32
|
+
});
|
|
33
33
|
|
|
34
34
|
export default example;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineFeature } from '@contractspec/lib.contracts';
|
|
2
2
|
|
|
3
|
-
export const KbUpdatePipelineFeature
|
|
3
|
+
export const KbUpdatePipelineFeature = defineFeature({
|
|
4
4
|
meta: {
|
|
5
5
|
key: 'kb-update-pipeline',
|
|
6
6
|
version: '1.0.0',
|
|
@@ -56,4 +56,4 @@ export const KbUpdatePipelineFeature: FeatureModuleSpec = {
|
|
|
56
56
|
{ key: 'audit-trail', version: '1.0.0' },
|
|
57
57
|
],
|
|
58
58
|
},
|
|
59
|
-
};
|
|
59
|
+
});
|
package/src/presentations.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { StabilityEnum } from '@contractspec/lib.contracts';
|
|
2
|
-
import type { PresentationSpec } from '@contractspec/lib.contracts';
|
|
1
|
+
import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';
|
|
3
2
|
import { ChangeCandidateModel, ReviewTaskModel } from './entities/models';
|
|
4
3
|
|
|
5
|
-
export const KbDashboardPresentation
|
|
4
|
+
export const KbDashboardPresentation = definePresentation({
|
|
6
5
|
meta: {
|
|
7
6
|
key: 'kb.dashboard',
|
|
8
7
|
version: '1.0.0',
|
|
@@ -22,9 +21,9 @@ export const KbDashboardPresentation: PresentationSpec = {
|
|
|
22
21
|
props: ChangeCandidateModel, // Simplified props mapping for example
|
|
23
22
|
},
|
|
24
23
|
targets: ['react', 'markdown'],
|
|
25
|
-
};
|
|
24
|
+
});
|
|
26
25
|
|
|
27
|
-
export const KbReviewListPresentation
|
|
26
|
+
export const KbReviewListPresentation = definePresentation({
|
|
28
27
|
meta: {
|
|
29
28
|
key: 'kb.review.list',
|
|
30
29
|
version: '1.0.0',
|
|
@@ -44,9 +43,9 @@ export const KbReviewListPresentation: PresentationSpec = {
|
|
|
44
43
|
props: ReviewTaskModel,
|
|
45
44
|
},
|
|
46
45
|
targets: ['react', 'markdown'],
|
|
47
|
-
};
|
|
46
|
+
});
|
|
48
47
|
|
|
49
|
-
export const KbReviewFormPresentation
|
|
48
|
+
export const KbReviewFormPresentation = definePresentation({
|
|
50
49
|
meta: {
|
|
51
50
|
key: 'kb.review.form',
|
|
52
51
|
version: '1.0.0',
|
|
@@ -66,4 +65,4 @@ export const KbReviewFormPresentation: PresentationSpec = {
|
|
|
66
65
|
props: ReviewTaskModel,
|
|
67
66
|
},
|
|
68
67
|
targets: ['react'],
|
|
69
|
-
};
|
|
68
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineTestSpec } from '@contractspec/lib.contracts';
|
|
2
|
+
|
|
3
|
+
export const RunWatchTest = defineTestSpec({
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'kbPipeline.runWatch.test',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
stability: 'experimental',
|
|
8
|
+
owners: ['@example.kb-update-pipeline'],
|
|
9
|
+
description: 'Test for run watch operation',
|
|
10
|
+
tags: ['test'],
|
|
11
|
+
},
|
|
12
|
+
target: {
|
|
13
|
+
type: 'operation',
|
|
14
|
+
operation: { key: 'kbPipeline.runWatch', version: '1.0.0' },
|
|
15
|
+
},
|
|
16
|
+
scenarios: [
|
|
17
|
+
{
|
|
18
|
+
key: 'success',
|
|
19
|
+
when: { operation: { key: 'kbPipeline.runWatch' } },
|
|
20
|
+
then: [{ type: 'expectOutput', match: {} }],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'error',
|
|
24
|
+
when: { operation: { key: 'kbPipeline.runWatch' } },
|
|
25
|
+
then: [{ type: 'expectError' }],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const CreateReviewTaskTest = defineTestSpec({
|
|
31
|
+
meta: {
|
|
32
|
+
key: 'kbPipeline.createReviewTask.test',
|
|
33
|
+
version: '1.0.0',
|
|
34
|
+
stability: 'experimental',
|
|
35
|
+
owners: ['@example.kb-update-pipeline'],
|
|
36
|
+
description: 'Test for creating review task',
|
|
37
|
+
tags: ['test'],
|
|
38
|
+
},
|
|
39
|
+
target: {
|
|
40
|
+
type: 'operation',
|
|
41
|
+
operation: { key: 'kbPipeline.createReviewTask', version: '1.0.0' },
|
|
42
|
+
},
|
|
43
|
+
scenarios: [
|
|
44
|
+
{
|
|
45
|
+
key: 'success',
|
|
46
|
+
when: { operation: { key: 'kbPipeline.createReviewTask' } },
|
|
47
|
+
then: [{ type: 'expectOutput', match: {} }],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'error',
|
|
51
|
+
when: { operation: { key: 'kbPipeline.createReviewTask' } },
|
|
52
|
+
then: [{ type: 'expectError' }],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const SubmitDecisionTest = defineTestSpec({
|
|
58
|
+
meta: {
|
|
59
|
+
key: 'kbPipeline.submitDecision.test',
|
|
60
|
+
version: '1.0.0',
|
|
61
|
+
stability: 'experimental',
|
|
62
|
+
owners: ['@example.kb-update-pipeline'],
|
|
63
|
+
description: 'Test for submitting decision',
|
|
64
|
+
tags: ['test'],
|
|
65
|
+
},
|
|
66
|
+
target: {
|
|
67
|
+
type: 'operation',
|
|
68
|
+
operation: { key: 'kbPipeline.submitDecision', version: '1.0.0' },
|
|
69
|
+
},
|
|
70
|
+
scenarios: [
|
|
71
|
+
{
|
|
72
|
+
key: 'success',
|
|
73
|
+
when: { operation: { key: 'kbPipeline.submitDecision' } },
|
|
74
|
+
then: [{ type: 'expectOutput', match: {} }],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'error',
|
|
78
|
+
when: { operation: { key: 'kbPipeline.submitDecision' } },
|
|
79
|
+
then: [{ type: 'expectError' }],
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
});
|