@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 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limiter.d.ts","sourceRoot":"","sources":["../../src/utils/rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,kBAAkB;IACjC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,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,YAAY,CAAC,CAAC,EAClC,GAAG,EAAE,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EACzB,OAAO,CAAC,EAAE;IACR,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD,GACA,OAAO,CAAC,CAAC,EAAE,CAAC,CA2Bd"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rate Limiter Module
|
|
3
|
+
*
|
|
4
|
+
* Implements rate limiting with exponential backoff for PowerPlatform API calls.
|
|
5
|
+
* Prevents API throttling errors (429) and manages concurrent request limits.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Rate Limiter Class
|
|
9
|
+
*/
|
|
10
|
+
export class RateLimiter {
|
|
11
|
+
options;
|
|
12
|
+
requestTimestamps = [];
|
|
13
|
+
activeRequests = 0;
|
|
14
|
+
queue = [];
|
|
15
|
+
processing = false;
|
|
16
|
+
constructor(options = {}) {
|
|
17
|
+
this.options = {
|
|
18
|
+
maxRequestsPerMinute: options.maxRequestsPerMinute || 60,
|
|
19
|
+
maxConcurrentRequests: options.maxConcurrentRequests || 10,
|
|
20
|
+
retryAttempts: options.retryAttempts || 3,
|
|
21
|
+
initialBackoffMs: options.initialBackoffMs || 1000,
|
|
22
|
+
maxBackoffMs: options.maxBackoffMs || 60000,
|
|
23
|
+
backoffMultiplier: options.backoffMultiplier || 2,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Execute a function with rate limiting
|
|
28
|
+
*/
|
|
29
|
+
async execute(fn) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
this.queue.push({
|
|
32
|
+
fn,
|
|
33
|
+
resolve: resolve,
|
|
34
|
+
reject,
|
|
35
|
+
retryCount: 0,
|
|
36
|
+
});
|
|
37
|
+
this.processQueue();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Process the request queue
|
|
42
|
+
*/
|
|
43
|
+
async processQueue() {
|
|
44
|
+
if (this.processing) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.processing = true;
|
|
48
|
+
while (this.queue.length > 0) {
|
|
49
|
+
// Wait if we've hit the concurrent request limit
|
|
50
|
+
while (this.activeRequests >= this.options.maxConcurrentRequests) {
|
|
51
|
+
await this.sleep(100);
|
|
52
|
+
}
|
|
53
|
+
// Wait if we've hit the rate limit
|
|
54
|
+
while (!this.canMakeRequest()) {
|
|
55
|
+
await this.sleep(1000);
|
|
56
|
+
}
|
|
57
|
+
const item = this.queue.shift();
|
|
58
|
+
if (!item)
|
|
59
|
+
break;
|
|
60
|
+
// Execute the request
|
|
61
|
+
this.executeRequest(item);
|
|
62
|
+
}
|
|
63
|
+
this.processing = false;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Execute a single request with retry logic
|
|
67
|
+
*/
|
|
68
|
+
async executeRequest(item) {
|
|
69
|
+
this.activeRequests++;
|
|
70
|
+
this.recordRequest();
|
|
71
|
+
try {
|
|
72
|
+
const result = await item.fn();
|
|
73
|
+
item.resolve(result);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
// Check if it's a rate limit error (429)
|
|
77
|
+
const isRateLimitError = this.isRateLimitError(error);
|
|
78
|
+
if (isRateLimitError && item.retryCount < this.options.retryAttempts) {
|
|
79
|
+
// Retry with exponential backoff
|
|
80
|
+
const backoffMs = this.calculateBackoff(item.retryCount);
|
|
81
|
+
console.error(`[RATE-LIMITER] Rate limit hit, retrying in ${backoffMs}ms (attempt ${item.retryCount + 1}/${this.options.retryAttempts})`);
|
|
82
|
+
await this.sleep(backoffMs);
|
|
83
|
+
// Re-queue the request
|
|
84
|
+
item.retryCount++;
|
|
85
|
+
this.queue.unshift(item);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// Max retries exceeded or non-retriable error
|
|
89
|
+
item.reject(error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
this.activeRequests--;
|
|
94
|
+
// Continue processing queue
|
|
95
|
+
if (this.queue.length > 0) {
|
|
96
|
+
this.processQueue();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if we can make a request without exceeding rate limits
|
|
102
|
+
*/
|
|
103
|
+
canMakeRequest() {
|
|
104
|
+
this.cleanupOldTimestamps();
|
|
105
|
+
return this.requestTimestamps.length < this.options.maxRequestsPerMinute;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Record a request timestamp
|
|
109
|
+
*/
|
|
110
|
+
recordRequest() {
|
|
111
|
+
this.requestTimestamps.push(Date.now());
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Remove timestamps older than 1 minute
|
|
115
|
+
*/
|
|
116
|
+
cleanupOldTimestamps() {
|
|
117
|
+
const oneMinuteAgo = Date.now() - 60000;
|
|
118
|
+
this.requestTimestamps = this.requestTimestamps.filter((ts) => ts > oneMinuteAgo);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Calculate backoff time for retry
|
|
122
|
+
*/
|
|
123
|
+
calculateBackoff(retryCount) {
|
|
124
|
+
const backoff = this.options.initialBackoffMs * Math.pow(this.options.backoffMultiplier, retryCount);
|
|
125
|
+
return Math.min(backoff, this.options.maxBackoffMs);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Check if error is a rate limit error
|
|
129
|
+
*/
|
|
130
|
+
isRateLimitError(error) {
|
|
131
|
+
const err = error;
|
|
132
|
+
// Check for 429 status code
|
|
133
|
+
if (err.status === 429 || err.statusCode === 429) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
// Check for rate limit in error message
|
|
137
|
+
const errorMessage = err.message?.toLowerCase() || '';
|
|
138
|
+
return (errorMessage.includes('rate limit') ||
|
|
139
|
+
errorMessage.includes('throttl') ||
|
|
140
|
+
errorMessage.includes('too many requests'));
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Sleep helper
|
|
144
|
+
*/
|
|
145
|
+
sleep(ms) {
|
|
146
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get current rate limiter stats
|
|
150
|
+
*/
|
|
151
|
+
getStats() {
|
|
152
|
+
this.cleanupOldTimestamps();
|
|
153
|
+
return {
|
|
154
|
+
activeRequests: this.activeRequests,
|
|
155
|
+
queuedRequests: this.queue.length,
|
|
156
|
+
requestsLastMinute: this.requestTimestamps.length,
|
|
157
|
+
maxRequestsPerMinute: this.options.maxRequestsPerMinute,
|
|
158
|
+
maxConcurrentRequests: this.options.maxConcurrentRequests,
|
|
159
|
+
utilizationPercentage: (this.requestTimestamps.length / this.options.maxRequestsPerMinute) * 100,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Wait until rate limiter has capacity
|
|
164
|
+
*/
|
|
165
|
+
async waitForCapacity() {
|
|
166
|
+
while (!this.canMakeRequest() || this.activeRequests >= this.options.maxConcurrentRequests) {
|
|
167
|
+
await this.sleep(100);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Clear the queue
|
|
172
|
+
*/
|
|
173
|
+
clearQueue() {
|
|
174
|
+
// Reject all queued requests
|
|
175
|
+
for (const item of this.queue) {
|
|
176
|
+
item.reject(new Error('Queue cleared'));
|
|
177
|
+
}
|
|
178
|
+
this.queue = [];
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Reset rate limiter
|
|
182
|
+
*/
|
|
183
|
+
reset() {
|
|
184
|
+
this.clearQueue();
|
|
185
|
+
this.requestTimestamps = [];
|
|
186
|
+
this.activeRequests = 0;
|
|
187
|
+
this.processing = false;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Update rate limiter options
|
|
191
|
+
*/
|
|
192
|
+
updateOptions(options) {
|
|
193
|
+
this.options = {
|
|
194
|
+
...this.options,
|
|
195
|
+
...options,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
// Export singleton instance with default settings
|
|
200
|
+
export const rateLimiter = new RateLimiter({
|
|
201
|
+
maxRequestsPerMinute: 60,
|
|
202
|
+
maxConcurrentRequests: 10,
|
|
203
|
+
retryAttempts: 3,
|
|
204
|
+
initialBackoffMs: 1000,
|
|
205
|
+
maxBackoffMs: 60000,
|
|
206
|
+
backoffMultiplier: 2,
|
|
207
|
+
});
|
|
208
|
+
/**
|
|
209
|
+
* Helper function to wrap API calls with rate limiting
|
|
210
|
+
*/
|
|
211
|
+
export async function withRateLimit(fn) {
|
|
212
|
+
return rateLimiter.execute(fn);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Batch execution with rate limiting
|
|
216
|
+
* Processes an array of functions with rate limiting
|
|
217
|
+
*/
|
|
218
|
+
export async function batchExecute(fns, options) {
|
|
219
|
+
const results = [];
|
|
220
|
+
const errors = [];
|
|
221
|
+
for (let i = 0; i < fns.length; i++) {
|
|
222
|
+
try {
|
|
223
|
+
const result = await rateLimiter.execute(fns[i]);
|
|
224
|
+
results.push(result);
|
|
225
|
+
if (options?.onProgress) {
|
|
226
|
+
options.onProgress(i + 1, fns.length);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
errors.push({ index: i, error });
|
|
231
|
+
if (options?.onError) {
|
|
232
|
+
options.onError(error, i);
|
|
233
|
+
}
|
|
234
|
+
// Re-throw if all requests have failed
|
|
235
|
+
if (errors.length === fns.length) {
|
|
236
|
+
throw new Error(`All batch requests failed: ${errors.length} errors`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return results;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=rate-limiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate-limiter.js","sourceRoot":"","sources":["../../src/utils/rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH;;GAEG;AACH,MAAM,OAAO,WAAW;IACd,OAAO,CAA+B;IACtC,iBAAiB,GAAa,EAAE,CAAC;IACjC,cAAc,GAAW,CAAC,CAAC;IAC3B,KAAK,GAAgC,EAAE,CAAC;IACxC,UAAU,GAAY,KAAK,CAAC;IAEpC,YAAY,UAA8B,EAAE;QAC1C,IAAI,CAAC,OAAO,GAAG;YACb,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,EAAE;YACxD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,IAAI,EAAE;YAC1D,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,CAAC;YACzC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,IAAI,IAAI;YAClD,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,KAAK;YAC3C,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,CAAC;SAClD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,CAAI,EAAoB;QACnC,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;gBACd,EAAE;gBACF,OAAO,EAAE,OAAmC;gBAC5C,MAAM;gBACN,UAAU,EAAE,CAAC;aACd,CAAC,CAAC;YAEH,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,YAAY;QACxB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,IAA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zB,OAGC;IAED,MAAM,OAAO,GAAQ,EAAE,CAAC;IACxB,MAAM,MAAM,GAAwC,EAAE,CAAC;IAEvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAErB,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;gBACxB,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YAEjC,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;gBACrB,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC5B,CAAC;YAED,uCAAuC;YACvC,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,CAAC,MAAM,SAAS,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mcp-consultant-tools/powerplatform-core",
|
|
3
|
+
"version": "26.0.0-beta.2",
|
|
4
|
+
"description": "Shared core infrastructure for PowerPlatform MCP packages - authentication, HTTP client, and modular services",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./build/index.js",
|
|
7
|
+
"types": "./build/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./build/index.js",
|
|
11
|
+
"types": "./build/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./auth": {
|
|
14
|
+
"import": "./build/auth/index.js",
|
|
15
|
+
"types": "./build/auth/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./client": {
|
|
18
|
+
"import": "./build/client/index.js",
|
|
19
|
+
"types": "./build/client/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./utils": {
|
|
22
|
+
"import": "./build/utils/index.js",
|
|
23
|
+
"types": "./build/utils/index.d.ts"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"build",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"clean": "rm -rf build *.tsbuildinfo",
|
|
33
|
+
"prepublishOnly": "npm run build"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"mcp",
|
|
37
|
+
"model-context-protocol",
|
|
38
|
+
"powerplatform",
|
|
39
|
+
"dynamics",
|
|
40
|
+
"dataverse",
|
|
41
|
+
"crm",
|
|
42
|
+
"core",
|
|
43
|
+
"shared"
|
|
44
|
+
],
|
|
45
|
+
"author": "Michal Sobieraj",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"repository": {
|
|
48
|
+
"type": "git",
|
|
49
|
+
"url": "git+https://github.com/klemensms/mcp-consultant-tools.git",
|
|
50
|
+
"directory": "packages/powerplatform-core"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=16.0.0"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@azure/msal-node": "^3.3.0",
|
|
57
|
+
"@mcp-consultant-tools/core": "^22.0.0",
|
|
58
|
+
"axios": "^1.8.3",
|
|
59
|
+
"open": "^10.1.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^22.10.5",
|
|
63
|
+
"typescript": "^5.8.2"
|
|
64
|
+
}
|
|
65
|
+
}
|