@mcp-consultant-tools/azure-devops 30.0.0-beta.16 → 30.0.0-beta.18
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/build/services/sync-service.d.ts.map +1 -1
- package/build/services/sync-service.js +16 -12
- package/build/services/sync-service.js.map +1 -1
- package/build/sync/annotation-parser.d.ts +49 -0
- package/build/sync/annotation-parser.d.ts.map +1 -0
- package/build/sync/annotation-parser.js +81 -0
- package/build/sync/annotation-parser.js.map +1 -0
- package/build/sync/field-aliases.d.ts +35 -0
- package/build/sync/field-aliases.d.ts.map +1 -0
- package/build/sync/field-aliases.js +76 -0
- package/build/sync/field-aliases.js.map +1 -0
- package/build/sync/html-detection.d.ts +16 -65
- package/build/sync/html-detection.d.ts.map +1 -1
- package/build/sync/html-detection.js +63 -112
- package/build/sync/html-detection.js.map +1 -1
- package/build/sync/image-sync.d.ts +8 -5
- package/build/sync/image-sync.d.ts.map +1 -1
- package/build/sync/image-sync.js +18 -10
- package/build/sync/image-sync.js.map +1 -1
- package/build/sync/index.d.ts +4 -0
- package/build/sync/index.d.ts.map +1 -1
- package/build/sync/index.js +4 -0
- package/build/sync/index.js.map +1 -1
- package/build/sync/legacy-mappings.d.ts +37 -0
- package/build/sync/legacy-mappings.d.ts.map +1 -0
- package/build/sync/legacy-mappings.js +75 -0
- package/build/sync/legacy-mappings.js.map +1 -0
- package/build/sync/markdown-serializer.d.ts +52 -60
- package/build/sync/markdown-serializer.d.ts.map +1 -1
- package/build/sync/markdown-serializer.js +603 -603
- package/build/sync/markdown-serializer.js.map +1 -1
- package/build/sync/template-loader.d.ts +56 -0
- package/build/sync/template-loader.d.ts.map +1 -0
- package/build/sync/template-loader.js +138 -0
- package/build/sync/template-loader.js.map +1 -0
- package/build/sync/templates/bug.md +25 -0
- package/build/sync/templates/epic.md +23 -0
- package/build/sync/templates/feature.md +23 -0
- package/build/sync/templates/task.md +14 -0
- package/build/sync/templates/user-story.md +26 -0
- package/package.json +2 -2
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
* Markdown Serialization Utilities
|
|
3
3
|
*
|
|
4
4
|
* Convert between ADO work items and local markdown files.
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Files use YAML frontmatter (scalar fields — ADO refnames or friendly
|
|
7
|
+
* aliases) + body sections (long text fields tagged with
|
|
8
|
+
* `<!-- ado-field: REFNAME -->` comments). The sync engine is generic:
|
|
9
|
+
* any field named in the file is pushed to ADO, any field not named is
|
|
10
|
+
* left alone.
|
|
11
|
+
*
|
|
12
|
+
* Legacy files (pre-annotation) are detected and parsed via a
|
|
13
|
+
* legacy-mappings fallback table. They auto-upgrade to the annotated
|
|
14
|
+
* format on the next pull.
|
|
15
|
+
*/
|
|
16
|
+
import { type LocalOnlySection } from './annotation-parser.js';
|
|
17
|
+
/**
|
|
18
|
+
* Subset of frontmatter values used by downstream services (sync-service,
|
|
19
|
+
* file-utils) via stable friendly names. Always populated on parse by
|
|
20
|
+
* pulling the corresponding refname out of `fieldMap`.
|
|
6
21
|
*/
|
|
7
22
|
export interface WorkItemFrontmatter {
|
|
8
23
|
id: number;
|
|
@@ -20,6 +35,11 @@ export interface WorkItemFrontmatter {
|
|
|
20
35
|
lastSyncedRevision: number;
|
|
21
36
|
lastSyncedAt: string;
|
|
22
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Legacy slot for the four historically-supported custom fields. Retained
|
|
40
|
+
* so that pre-annotation callers (and reports) keep working. New-style
|
|
41
|
+
* consumers should read `bodyFieldMap` instead.
|
|
42
|
+
*/
|
|
23
43
|
export interface AdditionalFields {
|
|
24
44
|
howToTest?: string;
|
|
25
45
|
deploymentInformation?: string;
|
|
@@ -27,13 +47,23 @@ export interface AdditionalFields {
|
|
|
27
47
|
postdeploymentSteps?: string;
|
|
28
48
|
}
|
|
29
49
|
export interface ParsedWorkItemFile {
|
|
50
|
+
/** Friendly-name frontmatter view for back-compat. */
|
|
30
51
|
frontmatter: WorkItemFrontmatter;
|
|
52
|
+
/** All scalar ADO fields from frontmatter, keyed by refname. */
|
|
53
|
+
fieldMap: Record<string, FieldValue>;
|
|
54
|
+
/** All body text fields (from annotated sections OR legacy headings), keyed by refname. */
|
|
55
|
+
bodyFieldMap: Record<string, string>;
|
|
56
|
+
/** Sections with no ADO-field annotation — preserved in the file but not pushed. */
|
|
57
|
+
localOnlySections: LocalOnlySection[];
|
|
58
|
+
/** Work item type (mirrors frontmatter.type). */
|
|
59
|
+
workItemType: string;
|
|
31
60
|
description: string;
|
|
32
61
|
reproSteps: string;
|
|
33
62
|
acceptanceCriteria: string;
|
|
34
63
|
additionalFields: AdditionalFields;
|
|
35
64
|
rawContent: string;
|
|
36
65
|
}
|
|
66
|
+
export type FieldValue = string | number | boolean | string[];
|
|
37
67
|
export interface CommentsFrontmatter {
|
|
38
68
|
id: number;
|
|
39
69
|
title: string;
|
|
@@ -45,50 +75,25 @@ export interface ParsedComment {
|
|
|
45
75
|
date: string;
|
|
46
76
|
content: string;
|
|
47
77
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Result of converting work item to markdown
|
|
50
|
-
*/
|
|
51
78
|
export interface WorkItemToMarkdownResult {
|
|
52
79
|
content: string;
|
|
53
80
|
skippedFields: string[];
|
|
54
81
|
}
|
|
55
82
|
/**
|
|
56
|
-
*
|
|
83
|
+
* Serialize an ADO work item to an annotated markdown file.
|
|
57
84
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
85
|
+
* Follows the template for `fields['System.WorkItemType']`. Frontmatter
|
|
86
|
+
* order and body-section order come from the template. Fields the ADO
|
|
87
|
+
* response carries but the template doesn't mention are appended to the
|
|
88
|
+
* frontmatter with a discovery comment (see D4 in the design plan).
|
|
61
89
|
*/
|
|
62
90
|
export declare function workItemToMarkdown(workItem: any, revision: number): WorkItemToMarkdownResult;
|
|
63
|
-
/**
|
|
64
|
-
* Parse a markdown file to extract frontmatter and content sections
|
|
65
|
-
*/
|
|
66
91
|
export declare function parseWorkItemMarkdown(content: string): ParsedWorkItemFile;
|
|
67
|
-
/**
|
|
68
|
-
* Convert ADO comments to a read-only markdown file
|
|
69
|
-
*/
|
|
70
|
-
export declare function commentsToMarkdown(workItem: any, comments: any[]): string;
|
|
71
|
-
/**
|
|
72
|
-
* Build ADO patch operations from parsed markdown changes
|
|
73
|
-
* Only updates fields that have actually changed.
|
|
74
|
-
* Auto-converts HTML fields to markdown format unless skipAutoConvert is true.
|
|
75
|
-
*
|
|
76
|
-
* @param parsed - Parsed work item file
|
|
77
|
-
* @param currentWorkItem - Current work item from ADO
|
|
78
|
-
* @param skipAutoConvert - Skip automatic HTML-to-markdown conversion (default: false)
|
|
79
|
-
*/
|
|
80
92
|
export declare function buildPatchOperations(parsed: ParsedWorkItemFile, currentWorkItem: any, skipAutoConvert?: boolean): {
|
|
81
93
|
operations: any[];
|
|
82
94
|
skippedFields: string[];
|
|
83
95
|
convertedFields: string[];
|
|
84
96
|
};
|
|
85
|
-
/**
|
|
86
|
-
* Update the lastSyncedRevision in a markdown file content
|
|
87
|
-
*/
|
|
88
|
-
export declare function updateSyncRevision(content: string, newRevision: number): string;
|
|
89
|
-
/**
|
|
90
|
-
* Frontmatter for new work items (before they have an ID)
|
|
91
|
-
*/
|
|
92
97
|
export interface NewWorkItemFrontmatter {
|
|
93
98
|
title: string;
|
|
94
99
|
type: string;
|
|
@@ -101,53 +106,40 @@ export interface NewWorkItemFrontmatter {
|
|
|
101
106
|
areaPath?: string;
|
|
102
107
|
iterationPath?: string;
|
|
103
108
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Parsed new work item file structure
|
|
106
|
-
*/
|
|
107
109
|
export interface ParsedNewWorkItemFile {
|
|
108
110
|
frontmatter: NewWorkItemFrontmatter;
|
|
111
|
+
fieldMap: Record<string, FieldValue>;
|
|
112
|
+
bodyFieldMap: Record<string, string>;
|
|
113
|
+
localOnlySections: LocalOnlySection[];
|
|
114
|
+
workItemType: string;
|
|
109
115
|
description: string;
|
|
110
116
|
reproSteps: string;
|
|
111
117
|
acceptanceCriteria: string;
|
|
112
118
|
additionalFields: AdditionalFields;
|
|
113
119
|
rawContent: string;
|
|
114
120
|
}
|
|
115
|
-
/**
|
|
116
|
-
* Check if a work item frontmatter indicates a new (not yet created) work item
|
|
117
|
-
* New work items don't have an 'id' field
|
|
118
|
-
*/
|
|
119
121
|
export declare function isNewWorkItem(frontmatter: Record<string, any>): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Parse a markdown file for a NEW work item (no id required)
|
|
122
|
-
*/
|
|
123
122
|
export declare function parseNewWorkItemMarkdown(content: string): ParsedNewWorkItemFile;
|
|
124
123
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
124
|
+
* Split new-work-item fields into standard (safe for creation) and custom
|
|
125
|
+
* (must be set via a follow-up update because ADO rejects custom fields
|
|
126
|
+
* during creation).
|
|
127
|
+
*
|
|
128
|
+
* Standard = refname starts with `System.*` or `Microsoft.VSTS.*`.
|
|
129
|
+
* Custom = everything else (conventionally `Custom.*`).
|
|
128
130
|
*/
|
|
129
131
|
export interface NewWorkItemFieldSplit {
|
|
130
|
-
/** Standard ADO fields safe for creation */
|
|
131
132
|
standardFields: Record<string, any>;
|
|
132
|
-
/** Custom fields that must be set via update after creation */
|
|
133
133
|
customFields: Record<string, any>;
|
|
134
134
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Build ADO fields object for creating a new work item
|
|
137
|
-
* Inherits areaPath and iterationPath from parent work item when available
|
|
138
|
-
*
|
|
139
|
-
* Returns fields split into standard (safe for creation) and custom (require
|
|
140
|
-
* a follow-up update) because ADO rejects custom fields during work item creation.
|
|
141
|
-
*/
|
|
142
135
|
export declare function buildNewWorkItemFields(parsed: ParsedNewWorkItemFile, parentWorkItem?: any): NewWorkItemFieldSplit;
|
|
143
|
-
/**
|
|
144
|
-
* Generate a new work item template markdown file
|
|
145
|
-
* When parentId is undefined, creates a standalone work item template
|
|
146
|
-
*/
|
|
147
136
|
export declare function generateNewWorkItemTemplate(parentId: number | undefined, parentTitle: string, project: string, workItemType?: string): string;
|
|
137
|
+
export declare function commentsToMarkdown(workItem: any, comments: any[]): string;
|
|
138
|
+
export declare function updateSyncRevision(content: string, newRevision: number): string;
|
|
139
|
+
export declare function convertNewFileToSynced(content: string, workItemId: number, revision: number, url: string): string;
|
|
148
140
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
141
|
+
* Return the list of large-text (body) refnames that should be HTML-checked
|
|
142
|
+
* for a given work-item type. Driven by the loaded template.
|
|
151
143
|
*/
|
|
152
|
-
export declare function
|
|
144
|
+
export declare function templateBodyRefnamesForType(workItemType: string): string[];
|
|
153
145
|
//# sourceMappingURL=markdown-serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-serializer.d.ts","sourceRoot":"","sources":["../../src/sync/markdown-serializer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"markdown-serializer.d.ts","sourceRoot":"","sources":["../../src/sync/markdown-serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAiBhC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE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