@mcp-consultant-tools/powerplatform-core 26.0.0-beta.2
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/auth/index.d.ts +64 -0
- package/build/auth/index.d.ts.map +1 -0
- package/build/auth/index.js +39 -0
- package/build/auth/index.js.map +1 -0
- package/build/auth/interactive-auth.d.ts +60 -0
- package/build/auth/interactive-auth.d.ts.map +1 -0
- package/build/auth/interactive-auth.js +429 -0
- package/build/auth/interactive-auth.js.map +1 -0
- package/build/auth/service-principal-auth.d.ts +26 -0
- package/build/auth/service-principal-auth.d.ts.map +1 -0
- package/build/auth/service-principal-auth.js +60 -0
- package/build/auth/service-principal-auth.js.map +1 -0
- package/build/auth/token-cache.d.ts +40 -0
- package/build/auth/token-cache.d.ts.map +1 -0
- package/build/auth/token-cache.js +108 -0
- package/build/auth/token-cache.js.map +1 -0
- package/build/client/PowerPlatformClient.d.ts +78 -0
- package/build/client/PowerPlatformClient.d.ts.map +1 -0
- package/build/client/PowerPlatformClient.js +198 -0
- package/build/client/PowerPlatformClient.js.map +1 -0
- package/build/client/index.d.ts +6 -0
- package/build/client/index.d.ts.map +1 -0
- package/build/client/index.js +6 -0
- package/build/client/index.js.map +1 -0
- package/build/client/types.d.ts +300 -0
- package/build/client/types.d.ts.map +1 -0
- package/build/client/types.js +5 -0
- package/build/client/types.js.map +1 -0
- package/build/index.d.ts +36 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +55 -0
- package/build/index.js.map +1 -0
- package/build/services/AppManagementService.d.ts +95 -0
- package/build/services/AppManagementService.d.ts.map +1 -0
- package/build/services/AppManagementService.js +322 -0
- package/build/services/AppManagementService.js.map +1 -0
- package/build/services/AppService.d.ts +39 -0
- package/build/services/AppService.d.ts.map +1 -0
- package/build/services/AppService.js +173 -0
- package/build/services/AppService.js.map +1 -0
- package/build/services/AttributeService.d.ts +28 -0
- package/build/services/AttributeService.d.ts.map +1 -0
- package/build/services/AttributeService.js +86 -0
- package/build/services/AttributeService.js.map +1 -0
- package/build/services/BusinessRuleService.d.ts +22 -0
- package/build/services/BusinessRuleService.d.ts.map +1 -0
- package/build/services/BusinessRuleService.js +85 -0
- package/build/services/BusinessRuleService.js.map +1 -0
- package/build/services/DataService.d.ts +53 -0
- package/build/services/DataService.d.ts.map +1 -0
- package/build/services/DataService.js +204 -0
- package/build/services/DataService.js.map +1 -0
- package/build/services/DependencyService.d.ts +27 -0
- package/build/services/DependencyService.d.ts.map +1 -0
- package/build/services/DependencyService.js +47 -0
- package/build/services/DependencyService.js.map +1 -0
- package/build/services/EntityService.d.ts +42 -0
- package/build/services/EntityService.d.ts.map +1 -0
- package/build/services/EntityService.js +132 -0
- package/build/services/EntityService.js.map +1 -0
- package/build/services/FlowService.d.ts +55 -0
- package/build/services/FlowService.d.ts.map +1 -0
- package/build/services/FlowService.js +608 -0
- package/build/services/FlowService.js.map +1 -0
- package/build/services/FormService.d.ts +36 -0
- package/build/services/FormService.d.ts.map +1 -0
- package/build/services/FormService.js +55 -0
- package/build/services/FormService.js.map +1 -0
- package/build/services/MetadataService.d.ts +63 -0
- package/build/services/MetadataService.d.ts.map +1 -0
- package/build/services/MetadataService.js +176 -0
- package/build/services/MetadataService.js.map +1 -0
- package/build/services/OptionSetService.d.ts +40 -0
- package/build/services/OptionSetService.d.ts.map +1 -0
- package/build/services/OptionSetService.js +91 -0
- package/build/services/OptionSetService.js.map +1 -0
- package/build/services/PluginDeploymentService.d.ts +102 -0
- package/build/services/PluginDeploymentService.d.ts.map +1 -0
- package/build/services/PluginDeploymentService.js +412 -0
- package/build/services/PluginDeploymentService.js.map +1 -0
- package/build/services/PluginService.d.ts +61 -0
- package/build/services/PluginService.d.ts.map +1 -0
- package/build/services/PluginService.js +289 -0
- package/build/services/PluginService.js.map +1 -0
- package/build/services/PublishingService.d.ts +37 -0
- package/build/services/PublishingService.d.ts.map +1 -0
- package/build/services/PublishingService.js +65 -0
- package/build/services/PublishingService.js.map +1 -0
- package/build/services/RelationshipService.d.ts +29 -0
- package/build/services/RelationshipService.d.ts.map +1 -0
- package/build/services/RelationshipService.js +46 -0
- package/build/services/RelationshipService.js.map +1 -0
- package/build/services/SolutionService.d.ts +60 -0
- package/build/services/SolutionService.d.ts.map +1 -0
- package/build/services/SolutionService.js +125 -0
- package/build/services/SolutionService.js.map +1 -0
- package/build/services/ValidationService.d.ts +31 -0
- package/build/services/ValidationService.d.ts.map +1 -0
- package/build/services/ValidationService.js +391 -0
- package/build/services/ValidationService.js.map +1 -0
- package/build/services/ViewService.d.ts +36 -0
- package/build/services/ViewService.d.ts.map +1 -0
- package/build/services/ViewService.js +55 -0
- package/build/services/ViewService.js.map +1 -0
- package/build/services/WebResourceService.d.ts +40 -0
- package/build/services/WebResourceService.d.ts.map +1 -0
- package/build/services/WebResourceService.js +64 -0
- package/build/services/WebResourceService.js.map +1 -0
- package/build/services/WorkflowManagementService.d.ts +157 -0
- package/build/services/WorkflowManagementService.d.ts.map +1 -0
- package/build/services/WorkflowManagementService.js +567 -0
- package/build/services/WorkflowManagementService.js.map +1 -0
- package/build/services/WorkflowService.d.ts +28 -0
- package/build/services/WorkflowService.d.ts.map +1 -0
- package/build/services/WorkflowService.js +285 -0
- package/build/services/WorkflowService.js.map +1 -0
- package/build/services/index.d.ts +29 -0
- package/build/services/index.d.ts.map +1 -0
- package/build/services/index.js +31 -0
- package/build/services/index.js.map +1 -0
- package/build/utils/auditLogger.d.ts +76 -0
- package/build/utils/auditLogger.d.ts.map +1 -0
- package/build/utils/auditLogger.js +110 -0
- package/build/utils/auditLogger.js.map +1 -0
- package/build/utils/best-practices-formatters.d.ts +26 -0
- package/build/utils/best-practices-formatters.d.ts.map +1 -0
- package/build/utils/best-practices-formatters.js +238 -0
- package/build/utils/best-practices-formatters.js.map +1 -0
- package/build/utils/bestPractices.d.ts +150 -0
- package/build/utils/bestPractices.d.ts.map +1 -0
- package/build/utils/bestPractices.js +324 -0
- package/build/utils/bestPractices.js.map +1 -0
- package/build/utils/iconManager.d.ts +84 -0
- package/build/utils/iconManager.d.ts.map +1 -0
- package/build/utils/iconManager.js +338 -0
- package/build/utils/iconManager.js.map +1 -0
- package/build/utils/index.d.ts +11 -0
- package/build/utils/index.d.ts.map +1 -0
- package/build/utils/index.js +18 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/prompt-templates.d.ts +9 -0
- package/build/utils/prompt-templates.d.ts.map +1 -0
- package/build/utils/prompt-templates.js +31 -0
- package/build/utils/prompt-templates.js.map +1 -0
- package/build/utils/publisherConfig.d.ts +33 -0
- package/build/utils/publisherConfig.d.ts.map +1 -0
- package/build/utils/publisherConfig.js +54 -0
- package/build/utils/publisherConfig.js.map +1 -0
- package/build/utils/rate-limiter.d.ts +108 -0
- package/build/utils/rate-limiter.d.ts.map +1 -0
- package/build/utils/rate-limiter.js +242 -0
- package/build/utils/rate-limiter.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowManagementService
|
|
3
|
+
*
|
|
4
|
+
* Service for workflow state management and documentation.
|
|
5
|
+
* Note: This service should only be used by powerplatform-customization package.
|
|
6
|
+
*/
|
|
7
|
+
import { auditLogger } from '../utils/auditLogger.js';
|
|
8
|
+
export class WorkflowManagementService {
|
|
9
|
+
client;
|
|
10
|
+
constructor(client) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Update workflow description
|
|
15
|
+
*/
|
|
16
|
+
async updateWorkflowDescription(workflowId, description) {
|
|
17
|
+
const MAX_DESCRIPTION_LENGTH = 1024;
|
|
18
|
+
if (description.length > MAX_DESCRIPTION_LENGTH) {
|
|
19
|
+
const overage = description.length - MAX_DESCRIPTION_LENGTH;
|
|
20
|
+
throw new Error(`Description too long (${description.length}/${MAX_DESCRIPTION_LENGTH} chars). ` +
|
|
21
|
+
`Please shorten by ${overage} character${overage === 1 ? '' : 's'}.`);
|
|
22
|
+
}
|
|
23
|
+
// Get current description
|
|
24
|
+
const currentWorkflow = await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})?$select=description`);
|
|
25
|
+
const previousDescription = currentWorkflow.description || '';
|
|
26
|
+
// Update
|
|
27
|
+
await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})`, 'PATCH', { description });
|
|
28
|
+
return {
|
|
29
|
+
success: true,
|
|
30
|
+
previousDescription,
|
|
31
|
+
newDescription: description,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Update flow description (alias for updateWorkflowDescription)
|
|
36
|
+
*/
|
|
37
|
+
async updateFlowDescription(flowId, description) {
|
|
38
|
+
return this.updateWorkflowDescription(flowId, description);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Deactivate a workflow (set to Draft state)
|
|
42
|
+
*/
|
|
43
|
+
async deactivateWorkflow(workflowId) {
|
|
44
|
+
const currentWorkflow = await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})?$select=workflowid,name,statecode,statuscode`);
|
|
45
|
+
const previousState = currentWorkflow.statecode === 0
|
|
46
|
+
? 'Draft'
|
|
47
|
+
: currentWorkflow.statecode === 1
|
|
48
|
+
? 'Activated'
|
|
49
|
+
: 'Suspended';
|
|
50
|
+
// Already Draft
|
|
51
|
+
if (currentWorkflow.statecode === 0) {
|
|
52
|
+
auditLogger.log({
|
|
53
|
+
operation: 'deactivate-workflow',
|
|
54
|
+
operationType: 'UPDATE',
|
|
55
|
+
componentType: 'workflow',
|
|
56
|
+
componentName: currentWorkflow.name,
|
|
57
|
+
componentId: workflowId,
|
|
58
|
+
parameters: { previousState, result: 'already-draft' },
|
|
59
|
+
success: true,
|
|
60
|
+
});
|
|
61
|
+
return {
|
|
62
|
+
success: true,
|
|
63
|
+
workflowId,
|
|
64
|
+
workflowName: currentWorkflow.name,
|
|
65
|
+
previousState,
|
|
66
|
+
newState: 'Draft',
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})/Microsoft.Dynamics.CRM.SetState`, 'POST', { State: 0, Status: 1 });
|
|
71
|
+
auditLogger.log({
|
|
72
|
+
operation: 'deactivate-workflow',
|
|
73
|
+
operationType: 'UPDATE',
|
|
74
|
+
componentType: 'workflow',
|
|
75
|
+
componentName: currentWorkflow.name,
|
|
76
|
+
componentId: workflowId,
|
|
77
|
+
parameters: { previousState, newState: 'Draft' },
|
|
78
|
+
success: true,
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
success: true,
|
|
82
|
+
workflowId,
|
|
83
|
+
workflowName: currentWorkflow.name,
|
|
84
|
+
previousState,
|
|
85
|
+
newState: 'Draft',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
// Check for "already in target state" error
|
|
90
|
+
const err = error;
|
|
91
|
+
if (err.response?.data?.error?.code === '0x80045003') {
|
|
92
|
+
return {
|
|
93
|
+
success: true,
|
|
94
|
+
workflowId,
|
|
95
|
+
workflowName: currentWorkflow.name,
|
|
96
|
+
previousState,
|
|
97
|
+
newState: 'Draft',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Activate a workflow (set to Activated state)
|
|
105
|
+
*/
|
|
106
|
+
async activateWorkflow(workflowId) {
|
|
107
|
+
const currentWorkflow = await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})?$select=workflowid,name,statecode,statuscode`);
|
|
108
|
+
const previousState = currentWorkflow.statecode === 0
|
|
109
|
+
? 'Draft'
|
|
110
|
+
: currentWorkflow.statecode === 1
|
|
111
|
+
? 'Activated'
|
|
112
|
+
: 'Suspended';
|
|
113
|
+
// Already Activated
|
|
114
|
+
if (currentWorkflow.statecode === 1) {
|
|
115
|
+
auditLogger.log({
|
|
116
|
+
operation: 'activate-workflow',
|
|
117
|
+
operationType: 'UPDATE',
|
|
118
|
+
componentType: 'workflow',
|
|
119
|
+
componentName: currentWorkflow.name,
|
|
120
|
+
componentId: workflowId,
|
|
121
|
+
parameters: { previousState, result: 'already-activated' },
|
|
122
|
+
success: true,
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
success: true,
|
|
126
|
+
workflowId,
|
|
127
|
+
workflowName: currentWorkflow.name,
|
|
128
|
+
previousState,
|
|
129
|
+
newState: 'Activated',
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
try {
|
|
133
|
+
await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})/Microsoft.Dynamics.CRM.SetState`, 'POST', { State: 1, Status: 2 });
|
|
134
|
+
auditLogger.log({
|
|
135
|
+
operation: 'activate-workflow',
|
|
136
|
+
operationType: 'UPDATE',
|
|
137
|
+
componentType: 'workflow',
|
|
138
|
+
componentName: currentWorkflow.name,
|
|
139
|
+
componentId: workflowId,
|
|
140
|
+
parameters: { previousState, newState: 'Activated' },
|
|
141
|
+
success: true,
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
success: true,
|
|
145
|
+
workflowId,
|
|
146
|
+
workflowName: currentWorkflow.name,
|
|
147
|
+
previousState,
|
|
148
|
+
newState: 'Activated',
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
const err = error;
|
|
153
|
+
if (err.response?.data?.error?.code === '0x80045003') {
|
|
154
|
+
return {
|
|
155
|
+
success: true,
|
|
156
|
+
workflowId,
|
|
157
|
+
workflowName: currentWorkflow.name,
|
|
158
|
+
previousState,
|
|
159
|
+
newState: 'Activated',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
throw error;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Generate YAML metadata block for documentation
|
|
167
|
+
*/
|
|
168
|
+
generateAutomationYaml(analysis) {
|
|
169
|
+
const today = new Date().toISOString().split('T')[0];
|
|
170
|
+
return `[AUTO-DOCS:v1]
|
|
171
|
+
tables_modified: ${analysis.tablesModified.join(', ') || 'none'}
|
|
172
|
+
trigger: ${analysis.trigger}
|
|
173
|
+
trigger_fields: ${analysis.triggerFields.join(', ') || 'none'}
|
|
174
|
+
custom_apis_called: ${analysis.customApisCalled.length > 0 ? analysis.customApisCalled.join(', ') : 'none'}
|
|
175
|
+
action_count: ${analysis.actionCount}
|
|
176
|
+
analyzed: ${today}
|
|
177
|
+
---`;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Merge YAML metadata with existing description
|
|
181
|
+
*/
|
|
182
|
+
mergeDescriptionWithYaml(yamlBlock, existingDescription) {
|
|
183
|
+
// Empty description
|
|
184
|
+
if (!existingDescription || existingDescription.trim() === '') {
|
|
185
|
+
return `${yamlBlock}\n[Manual notes below this line are preserved on re-analysis]`;
|
|
186
|
+
}
|
|
187
|
+
// Has [AUTO-DOCS: tag
|
|
188
|
+
const autoDocsMatch = existingDescription.match(/\[AUTO-DOCS:v\d+\]([\s\S]*?)^---$/m);
|
|
189
|
+
if (autoDocsMatch) {
|
|
190
|
+
const separatorIndex = existingDescription.indexOf('---', autoDocsMatch.index);
|
|
191
|
+
const manualNotes = existingDescription
|
|
192
|
+
.substring(separatorIndex + 3)
|
|
193
|
+
.trim();
|
|
194
|
+
if (manualNotes) {
|
|
195
|
+
return `${yamlBlock}\n${manualNotes}`;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return `${yamlBlock}\n[Manual notes below this line are preserved on re-analysis]`;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// No [AUTO-DOCS: tag - preserve content as manual notes
|
|
202
|
+
return `${yamlBlock}\n${existingDescription.trim()}`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Document automation with YAML metadata
|
|
206
|
+
*/
|
|
207
|
+
async documentAutomation(automationId, type, parseFlowSummary, parseWorkflowXamlSummary) {
|
|
208
|
+
const accessToken = await this.client.getAccessToken();
|
|
209
|
+
const config = this.client.getConfig();
|
|
210
|
+
const response = await fetch(`${config.organizationUrl}/api/data/v9.2/workflows(${automationId})?$select=category,clientdata,description`, {
|
|
211
|
+
headers: {
|
|
212
|
+
Authorization: `Bearer ${accessToken}`,
|
|
213
|
+
Accept: 'application/json',
|
|
214
|
+
'OData-MaxVersion': '4.0',
|
|
215
|
+
'OData-Version': '4.0',
|
|
216
|
+
},
|
|
217
|
+
});
|
|
218
|
+
if (!response.ok) {
|
|
219
|
+
throw new Error(`Failed to fetch automation: ${response.status} ${response.statusText}`);
|
|
220
|
+
}
|
|
221
|
+
const automation = (await response.json());
|
|
222
|
+
const previousDescription = automation.description || '';
|
|
223
|
+
// Detect type if not provided
|
|
224
|
+
const detectedType = type || (automation.category === 5 ? 'flow' : 'workflow');
|
|
225
|
+
let analysis;
|
|
226
|
+
if (detectedType === 'flow') {
|
|
227
|
+
if (!automation.clientdata) {
|
|
228
|
+
throw new Error('Flow has no clientdata (definition)');
|
|
229
|
+
}
|
|
230
|
+
const flowDefinition = JSON.parse(automation.clientdata);
|
|
231
|
+
const summary = parseFlowSummary(flowDefinition);
|
|
232
|
+
const actionNames = Array.isArray(summary.actions)
|
|
233
|
+
? summary.actions
|
|
234
|
+
.map((a) => {
|
|
235
|
+
const action = a;
|
|
236
|
+
return (action.name || action.type || 'unknown');
|
|
237
|
+
})
|
|
238
|
+
.slice(0, 10)
|
|
239
|
+
: [];
|
|
240
|
+
analysis = {
|
|
241
|
+
tablesModified: summary.tablesModified,
|
|
242
|
+
trigger: summary.triggerInfo,
|
|
243
|
+
triggerFields: summary.triggerFields,
|
|
244
|
+
actions: actionNames,
|
|
245
|
+
actionCount: Array.isArray(summary.actions) ? summary.actions.length : 0,
|
|
246
|
+
customApisCalled: summary.customApisCalled || [],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
// Fetch XAML
|
|
251
|
+
const xamlResponse = await fetch(`${config.organizationUrl}/api/data/v9.2/workflows(${automationId})?$select=xaml`, {
|
|
252
|
+
headers: {
|
|
253
|
+
Authorization: `Bearer ${accessToken}`,
|
|
254
|
+
Accept: 'application/json',
|
|
255
|
+
'OData-MaxVersion': '4.0',
|
|
256
|
+
'OData-Version': '4.0',
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
if (!xamlResponse.ok) {
|
|
260
|
+
throw new Error(`Failed to fetch workflow XAML: ${xamlResponse.status}`);
|
|
261
|
+
}
|
|
262
|
+
const xamlData = (await xamlResponse.json());
|
|
263
|
+
if (!xamlData.xaml) {
|
|
264
|
+
throw new Error('Workflow has no XAML definition');
|
|
265
|
+
}
|
|
266
|
+
const summary = parseWorkflowXamlSummary(xamlData.xaml);
|
|
267
|
+
const actions = [];
|
|
268
|
+
if (summary.createEntityCount > 0)
|
|
269
|
+
actions.push('create_record');
|
|
270
|
+
if (summary.updateEntityCount > 0)
|
|
271
|
+
actions.push('update_record');
|
|
272
|
+
if (summary.assignEntityCount > 0)
|
|
273
|
+
actions.push('assign_record');
|
|
274
|
+
if (summary.setStateCount > 0)
|
|
275
|
+
actions.push('set_state');
|
|
276
|
+
analysis = {
|
|
277
|
+
tablesModified: summary.tablesModified,
|
|
278
|
+
trigger: summary.triggerInfo,
|
|
279
|
+
triggerFields: summary.triggerFields,
|
|
280
|
+
actions,
|
|
281
|
+
actionCount: actions.length,
|
|
282
|
+
customApisCalled: [],
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
// Generate YAML and merge
|
|
286
|
+
const yamlBlock = this.generateAutomationYaml(analysis);
|
|
287
|
+
const newDescription = this.mergeDescriptionWithYaml(yamlBlock, previousDescription);
|
|
288
|
+
// Update description
|
|
289
|
+
const updateResult = await this.updateWorkflowDescription(automationId, newDescription);
|
|
290
|
+
return {
|
|
291
|
+
analysis,
|
|
292
|
+
descriptionUpdated: updateResult.success,
|
|
293
|
+
previousDescription: updateResult.previousDescription,
|
|
294
|
+
newDescription: updateResult.newDescription,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Document workflow safely with deactivate/reactivate
|
|
299
|
+
*/
|
|
300
|
+
async documentWorkflowSafe(workflowId, type, parseFlowSummary, parseWorkflowXamlSummary) {
|
|
301
|
+
// Get initial state
|
|
302
|
+
const currentWorkflow = await this.client.makeRequest(`api/data/v9.2/workflows(${workflowId})?$select=workflowid,name,statecode,statuscode`);
|
|
303
|
+
const initialState = currentWorkflow.statecode === 0
|
|
304
|
+
? 'Draft'
|
|
305
|
+
: currentWorkflow.statecode === 1
|
|
306
|
+
? 'Activated'
|
|
307
|
+
: 'Suspended';
|
|
308
|
+
const wasInitiallyActive = currentWorkflow.statecode === 1;
|
|
309
|
+
auditLogger.log({
|
|
310
|
+
operation: 'document-workflow-safe-start',
|
|
311
|
+
operationType: 'UPDATE',
|
|
312
|
+
componentType: 'workflow',
|
|
313
|
+
componentName: currentWorkflow.name,
|
|
314
|
+
componentId: workflowId,
|
|
315
|
+
parameters: { initialState },
|
|
316
|
+
success: true,
|
|
317
|
+
});
|
|
318
|
+
let wasDeactivated = false;
|
|
319
|
+
let wasReactivated = false;
|
|
320
|
+
try {
|
|
321
|
+
// Deactivate if needed
|
|
322
|
+
if (wasInitiallyActive) {
|
|
323
|
+
const deactivateResult = await this.deactivateWorkflow(workflowId);
|
|
324
|
+
wasDeactivated = deactivateResult.success;
|
|
325
|
+
if (!wasDeactivated) {
|
|
326
|
+
throw new Error('Failed to deactivate workflow');
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
// Document
|
|
330
|
+
let documentResult;
|
|
331
|
+
try {
|
|
332
|
+
documentResult = await this.documentAutomation(workflowId, type, parseFlowSummary, parseWorkflowXamlSummary);
|
|
333
|
+
}
|
|
334
|
+
catch (documentError) {
|
|
335
|
+
// Rollback on failure
|
|
336
|
+
if (wasDeactivated && wasInitiallyActive) {
|
|
337
|
+
try {
|
|
338
|
+
await this.activateWorkflow(workflowId);
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
// Log but continue to throw original error
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const errorMsg = documentError instanceof Error
|
|
345
|
+
? documentError.message
|
|
346
|
+
: 'Unknown error';
|
|
347
|
+
throw new Error(`Documentation failed: ${errorMsg}`);
|
|
348
|
+
}
|
|
349
|
+
// Reactivate if was initially active
|
|
350
|
+
if (wasInitiallyActive) {
|
|
351
|
+
try {
|
|
352
|
+
const activateResult = await this.activateWorkflow(workflowId);
|
|
353
|
+
wasReactivated = activateResult.success;
|
|
354
|
+
if (!wasReactivated) {
|
|
355
|
+
return {
|
|
356
|
+
success: true,
|
|
357
|
+
workflowId,
|
|
358
|
+
workflowName: currentWorkflow.name,
|
|
359
|
+
analysis: documentResult.analysis,
|
|
360
|
+
descriptionUpdated: documentResult.descriptionUpdated,
|
|
361
|
+
previousDescription: documentResult.previousDescription,
|
|
362
|
+
newDescription: documentResult.newDescription,
|
|
363
|
+
stateManagement: {
|
|
364
|
+
initialState,
|
|
365
|
+
wasDeactivated,
|
|
366
|
+
wasReactivated: false,
|
|
367
|
+
finalState: 'Draft (⚠️ Manual reactivation required)',
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
catch {
|
|
373
|
+
return {
|
|
374
|
+
success: true,
|
|
375
|
+
workflowId,
|
|
376
|
+
workflowName: currentWorkflow.name,
|
|
377
|
+
analysis: documentResult.analysis,
|
|
378
|
+
descriptionUpdated: documentResult.descriptionUpdated,
|
|
379
|
+
previousDescription: documentResult.previousDescription,
|
|
380
|
+
newDescription: documentResult.newDescription,
|
|
381
|
+
stateManagement: {
|
|
382
|
+
initialState,
|
|
383
|
+
wasDeactivated,
|
|
384
|
+
wasReactivated: false,
|
|
385
|
+
finalState: 'Draft (⚠️ Manual reactivation required)',
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
const finalState = wasInitiallyActive ? 'Activated' : 'Draft';
|
|
391
|
+
auditLogger.log({
|
|
392
|
+
operation: 'document-workflow-safe-complete',
|
|
393
|
+
operationType: 'UPDATE',
|
|
394
|
+
componentType: 'workflow',
|
|
395
|
+
componentName: currentWorkflow.name,
|
|
396
|
+
componentId: workflowId,
|
|
397
|
+
parameters: { initialState, finalState, wasDeactivated, wasReactivated },
|
|
398
|
+
success: true,
|
|
399
|
+
});
|
|
400
|
+
return {
|
|
401
|
+
success: true,
|
|
402
|
+
workflowId,
|
|
403
|
+
workflowName: currentWorkflow.name,
|
|
404
|
+
analysis: documentResult.analysis,
|
|
405
|
+
descriptionUpdated: documentResult.descriptionUpdated,
|
|
406
|
+
previousDescription: documentResult.previousDescription,
|
|
407
|
+
newDescription: documentResult.newDescription,
|
|
408
|
+
stateManagement: {
|
|
409
|
+
initialState,
|
|
410
|
+
wasDeactivated,
|
|
411
|
+
wasReactivated,
|
|
412
|
+
finalState,
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
418
|
+
auditLogger.log({
|
|
419
|
+
operation: 'document-workflow-safe-error',
|
|
420
|
+
operationType: 'UPDATE',
|
|
421
|
+
componentType: 'workflow',
|
|
422
|
+
componentName: currentWorkflow.name,
|
|
423
|
+
componentId: workflowId,
|
|
424
|
+
success: false,
|
|
425
|
+
error: errorMessage,
|
|
426
|
+
});
|
|
427
|
+
throw error;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
// =====================================================
|
|
431
|
+
// FLOW MANAGEMENT METHODS
|
|
432
|
+
// =====================================================
|
|
433
|
+
/**
|
|
434
|
+
* Create a new Power Automate flow from an existing template flow
|
|
435
|
+
*/
|
|
436
|
+
async createFlow(name, templateFlowId, options = {}) {
|
|
437
|
+
// 1. Validate template flow exists and is accessible
|
|
438
|
+
const templateFlow = await this.client.makeRequest(`api/data/v9.2/workflows(${templateFlowId})?$select=workflowid,name,clientdata,primaryentity,category`);
|
|
439
|
+
// Verify it's a flow (category = 5)
|
|
440
|
+
if (templateFlow.category !== 5) {
|
|
441
|
+
throw new Error(`Template '${templateFlow.name}' is not a flow (category=${templateFlow.category}). Use a Power Automate cloud flow as template.`);
|
|
442
|
+
}
|
|
443
|
+
if (!templateFlow.clientdata) {
|
|
444
|
+
throw new Error(`Template flow '${templateFlow.name}' has no clientdata (definition)`);
|
|
445
|
+
}
|
|
446
|
+
// 2. Parse clientdata JSON
|
|
447
|
+
let templateDefinition;
|
|
448
|
+
try {
|
|
449
|
+
templateDefinition = JSON.parse(templateFlow.clientdata);
|
|
450
|
+
}
|
|
451
|
+
catch (error) {
|
|
452
|
+
throw new Error(`Template flow has invalid JSON definition: ${error instanceof Error ? error.message : String(error)}`);
|
|
453
|
+
}
|
|
454
|
+
// 3. Update connection references if mappings provided
|
|
455
|
+
let updatedConnectionsCount = 0;
|
|
456
|
+
if (options.connectionReferenceMappings) {
|
|
457
|
+
const properties = templateDefinition.properties;
|
|
458
|
+
const connectionReferences = properties?.connectionReferences || {};
|
|
459
|
+
for (const [refName, newConnectionId] of Object.entries(options.connectionReferenceMappings)) {
|
|
460
|
+
const ref = connectionReferences[refName];
|
|
461
|
+
if (ref?.connection) {
|
|
462
|
+
const connection = ref.connection;
|
|
463
|
+
connection.connectionReferenceLogicalName = newConnectionId;
|
|
464
|
+
updatedConnectionsCount++;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
// 4. Generate new flow ID
|
|
469
|
+
const newFlowId = crypto.randomUUID();
|
|
470
|
+
// 5. Create new workflow record
|
|
471
|
+
const createPayload = {
|
|
472
|
+
workflowid: newFlowId,
|
|
473
|
+
name: name,
|
|
474
|
+
category: 5, // Cloud Flow
|
|
475
|
+
type: 1, // Definition
|
|
476
|
+
statecode: options.state === 'activated' ? 1 : 0,
|
|
477
|
+
statuscode: options.state === 'activated' ? 2 : 1,
|
|
478
|
+
primaryentity: templateFlow.primaryentity || 'none',
|
|
479
|
+
clientdata: JSON.stringify(templateDefinition),
|
|
480
|
+
description: options.description || ''
|
|
481
|
+
};
|
|
482
|
+
// 6. Execute POST request
|
|
483
|
+
await this.client.makeRequest('api/data/v9.2/workflows', 'POST', createPayload);
|
|
484
|
+
// 7. Audit log
|
|
485
|
+
auditLogger.log({
|
|
486
|
+
operation: 'create-flow',
|
|
487
|
+
operationType: 'CREATE',
|
|
488
|
+
componentType: 'flow',
|
|
489
|
+
componentName: name,
|
|
490
|
+
componentId: newFlowId,
|
|
491
|
+
parameters: { templateFlowId, state: options.state || 'draft' },
|
|
492
|
+
success: true,
|
|
493
|
+
});
|
|
494
|
+
return {
|
|
495
|
+
success: true,
|
|
496
|
+
flowId: newFlowId,
|
|
497
|
+
flowName: name,
|
|
498
|
+
state: options.state || 'draft',
|
|
499
|
+
connectionReferencesUpdated: updatedConnectionsCount,
|
|
500
|
+
warnings: []
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Delete a Power Automate flow (permanent operation)
|
|
505
|
+
*/
|
|
506
|
+
async deleteFlow(flowId) {
|
|
507
|
+
// 1. Get current flow to validate and capture name
|
|
508
|
+
const flow = await this.client.makeRequest(`api/data/v9.2/workflows(${flowId})?$select=workflowid,name,statecode,statuscode,category`);
|
|
509
|
+
const flowName = flow.name;
|
|
510
|
+
const previousState = flow.statecode === 0 ? 'Draft' :
|
|
511
|
+
flow.statecode === 1 ? 'Activated' : 'Suspended';
|
|
512
|
+
// Verify it's a flow (category = 5)
|
|
513
|
+
if (flow.category !== 5) {
|
|
514
|
+
throw new Error(`Cannot delete '${flowName}' - it is not a flow (category=${flow.category}). This tool is for Power Automate cloud flows only.`);
|
|
515
|
+
}
|
|
516
|
+
// 2. Check if flow is activated (must deactivate first)
|
|
517
|
+
if (flow.statecode === 1) {
|
|
518
|
+
throw new Error(`Flow '${flowName}' is currently Activated. Deactivate the flow before deletion using deactivate-flow tool.`);
|
|
519
|
+
}
|
|
520
|
+
// 3. Execute DELETE request
|
|
521
|
+
await this.client.makeRequest(`api/data/v9.2/workflows(${flowId})`, 'DELETE');
|
|
522
|
+
// 4. Audit log
|
|
523
|
+
auditLogger.log({
|
|
524
|
+
operation: 'delete-flow',
|
|
525
|
+
operationType: 'DELETE',
|
|
526
|
+
componentType: 'flow',
|
|
527
|
+
componentName: flowName,
|
|
528
|
+
componentId: flowId,
|
|
529
|
+
parameters: { previousState },
|
|
530
|
+
success: true,
|
|
531
|
+
});
|
|
532
|
+
return {
|
|
533
|
+
success: true,
|
|
534
|
+
flowId,
|
|
535
|
+
flowName,
|
|
536
|
+
previousState
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Clone an existing flow with a new name (convenience wrapper over createFlow)
|
|
541
|
+
*/
|
|
542
|
+
async cloneFlow(sourceFlowId, newName, options = {}) {
|
|
543
|
+
// 1. Get source flow metadata
|
|
544
|
+
const sourceFlow = await this.client.makeRequest(`api/data/v9.2/workflows(${sourceFlowId})?$select=workflowid,name,description,category`);
|
|
545
|
+
// Verify it's a flow
|
|
546
|
+
if (sourceFlow.category !== 5) {
|
|
547
|
+
throw new Error(`Cannot clone '${sourceFlow.name}' - it is not a flow (category=${sourceFlow.category}). This tool is for Power Automate cloud flows only.`);
|
|
548
|
+
}
|
|
549
|
+
// 2. Use createFlow with source as template
|
|
550
|
+
const createResult = await this.createFlow(newName, sourceFlowId, {
|
|
551
|
+
description: options.description || sourceFlow.description || '',
|
|
552
|
+
state: 'draft', // Always clone as draft
|
|
553
|
+
connectionReferenceMappings: options.updateConnectionReferences ? options.connectionReferenceMappings : undefined
|
|
554
|
+
});
|
|
555
|
+
// 3. Return clone-specific result
|
|
556
|
+
return {
|
|
557
|
+
success: true,
|
|
558
|
+
sourceFlowId,
|
|
559
|
+
sourceFlowName: sourceFlow.name,
|
|
560
|
+
newFlowId: createResult.flowId,
|
|
561
|
+
newFlowName: createResult.flowName,
|
|
562
|
+
state: 'draft',
|
|
563
|
+
connectionReferencesUpdated: createResult.connectionReferencesUpdated
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
//# sourceMappingURL=WorkflowManagementService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowManagementService.js","sourceRoot":"","sources":["../../src/services/WorkflowManagementService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA+EtD,MAAM,OAAO,yBAAyB;IAChB;IAApB,YAAoB,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;IAAG,CAAC;IAEnD;;OAEG;IACH,KAAK,CAAC,yBAAyB,CAC7B,UAAkB,EAClB,WAAmB;QAEnB,MAAM,sBAAsB,GAAG,IAAI,CAAC;QACpC,IAAI,WAAW,CAAC,MAAM,GAAG,sBAAsB,EAAE,CAAC;YAChD,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,GAAG,sBAAsB,CAAC;YAC5D,MAAM,IAAI,KAAK,CACb,yBAAyB,WAAW,CAAC,MAAM,IAAI,sBAAsB,WAAW;gBAC9E,qBAAqB,OAAO,aAAa,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CACvE,CAAC;QACJ,CAAC;QAED,0BAA0B;QAC1B,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAEnD,2BAA2B,UAAU,uBAAuB,CAAC,CAAC;QAEhE,MAAM,mBAAmB,GAAI,eAAe,CAAC,WAAsB,IAAI,EAAE,CAAC;QAE1E,SAAS;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3B,2BAA2B,UAAU,GAAG,EACxC,OAAO,EACP,EAAE,WAAW,EAAE,CAChB,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,IAAI;YACb,mBAAmB;YACnB,cAAc,EAAE,WA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,YAAY;YACZ,cAAc,EAAE,UAAU,CAAC,IAAc;YACzC,SAAS,EAAE,YAAY,CAAC,MAAM;YAC9B,WAAW,EAAE,YAAY,CAAC,QAAQ;YAClC,KAAK,EAAE,OAAO;YACd,2BAA2B,EAAE,YAAY,CAAC,2BAA2B;SACtE,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowService
|
|
3
|
+
*
|
|
4
|
+
* Read-only service for classic Dynamics workflows.
|
|
5
|
+
*/
|
|
6
|
+
import type { PowerPlatformClient } from '../client/PowerPlatformClient.js';
|
|
7
|
+
export declare class WorkflowService {
|
|
8
|
+
private client;
|
|
9
|
+
constructor(client: PowerPlatformClient);
|
|
10
|
+
/**
|
|
11
|
+
* Get all classic Dynamics workflows in the environment
|
|
12
|
+
*/
|
|
13
|
+
getWorkflows(activeOnly?: boolean, maxRecords?: number): Promise<{
|
|
14
|
+
totalCount: number;
|
|
15
|
+
hasMore: boolean;
|
|
16
|
+
requestedMax: number;
|
|
17
|
+
workflows: unknown[];
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Get a specific classic workflow with its complete XAML definition
|
|
21
|
+
*/
|
|
22
|
+
getWorkflowDefinition(workflowId: string, summary?: boolean): Promise<unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Parse workflow XAML to extract a structured summary
|
|
25
|
+
*/
|
|
26
|
+
parseWorkflowXamlSummary(xaml: string | null): Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=WorkflowService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowService.d.ts","sourceRoot":"","sources":["../../src/services/WorkflowService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG5E,qBAAa,eAAe;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,mBAAmB;IAE/C;;OAEG;IACG,YAAY,CAChB,UAAU,GAAE,OAAe,EAC3B,UAAU,GAAE,MAAW,GACtB,OAAO,CAAC;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,OAAO,EAAE,CAAC;KACtB,CAAC;IAsDF;;OAEG;IACG,qBAAqB,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,OAAO,CAAC;IA2DnB;;OAEG;IACH,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAsNvE"}
|