snow-flow 1.1.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/.env.example +49 -0
- package/.mcp.json +106 -0
- package/.mcp.json.template +106 -0
- package/LICENSE +21 -0
- package/README.md +236 -0
- package/bin/snow-flow +4 -0
- package/bin/snow-flow.js +3 -0
- package/claude-flow +79 -0
- package/claude-flow.bat +18 -0
- package/claude-flow.config.json +20 -0
- package/claude-flow.ps1 +24 -0
- package/dist/agents/app-creator.agent.d.ts +55 -0
- package/dist/agents/app-creator.agent.d.ts.map +1 -0
- package/dist/agents/app-creator.agent.js +1292 -0
- package/dist/agents/app-creator.agent.js.map +1 -0
- package/dist/agents/base-snow-agent.d.ts +63 -0
- package/dist/agents/base-snow-agent.d.ts.map +1 -0
- package/dist/agents/base-snow-agent.js +296 -0
- package/dist/agents/base-snow-agent.js.map +1 -0
- package/dist/agents/script-generator.agent.d.ts +32 -0
- package/dist/agents/script-generator.agent.d.ts.map +1 -0
- package/dist/agents/script-generator.agent.js +772 -0
- package/dist/agents/script-generator.agent.js.map +1 -0
- package/dist/agents/ui-builder.agent.d.ts +50 -0
- package/dist/agents/ui-builder.agent.d.ts.map +1 -0
- package/dist/agents/ui-builder.agent.js +1539 -0
- package/dist/agents/ui-builder.agent.js.map +1 -0
- package/dist/agents/widget-builder.agent.d.ts +32 -0
- package/dist/agents/widget-builder.agent.d.ts.map +1 -0
- package/dist/agents/widget-builder.agent.js +439 -0
- package/dist/agents/widget-builder.agent.js.map +1 -0
- package/dist/agents/workflow-designer.agent.d.ts +31 -0
- package/dist/agents/workflow-designer.agent.d.ts.map +1 -0
- package/dist/agents/workflow-designer.agent.js +583 -0
- package/dist/agents/workflow-designer.agent.js.map +1 -0
- package/dist/api/error-handling.d.ts +214 -0
- package/dist/api/error-handling.d.ts.map +1 -0
- package/dist/api/error-handling.js +594 -0
- package/dist/api/error-handling.js.map +1 -0
- package/dist/api/flow-designer-api.d.ts +167 -0
- package/dist/api/flow-designer-api.d.ts.map +1 -0
- package/dist/api/flow-designer-api.js +555 -0
- package/dist/api/flow-designer-api.js.map +1 -0
- package/dist/api/natural-language-mapper.d.ts +126 -0
- package/dist/api/natural-language-mapper.d.ts.map +1 -0
- package/dist/api/natural-language-mapper.js +498 -0
- package/dist/api/natural-language-mapper.js.map +1 -0
- package/dist/api/performance-optimizer.d.ts +240 -0
- package/dist/api/performance-optimizer.d.ts.map +1 -0
- package/dist/api/performance-optimizer.js +701 -0
- package/dist/api/performance-optimizer.js.map +1 -0
- package/dist/api/transaction-manager.d.ts +189 -0
- package/dist/api/transaction-manager.d.ts.map +1 -0
- package/dist/api/transaction-manager.js +576 -0
- package/dist/api/transaction-manager.js.map +1 -0
- package/dist/cli/deploy-artifact.d.ts +7 -0
- package/dist/cli/deploy-artifact.d.ts.map +1 -0
- package/dist/cli/deploy-artifact.js +279 -0
- package/dist/cli/deploy-artifact.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2057 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/managers/scope-manager.d.ts +75 -0
- package/dist/managers/scope-manager.d.ts.map +1 -0
- package/dist/managers/scope-manager.js +448 -0
- package/dist/managers/scope-manager.js.map +1 -0
- package/dist/mcp/mcp-wrapper.d.ts +8 -0
- package/dist/mcp/mcp-wrapper.d.ts.map +1 -0
- package/dist/mcp/mcp-wrapper.js +77 -0
- package/dist/mcp/mcp-wrapper.js.map +1 -0
- package/dist/mcp/servicenow-automation-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-automation-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-automation-mcp.js +683 -0
- package/dist/mcp/servicenow-automation-mcp.js.map +1 -0
- package/dist/mcp/servicenow-deployment-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-deployment-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-deployment-mcp.js +972 -0
- package/dist/mcp/servicenow-deployment-mcp.js.map +1 -0
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-flow-composer-mcp.js +1121 -0
- package/dist/mcp/servicenow-flow-composer-mcp.js.map +1 -0
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-graph-memory-mcp.js +703 -0
- package/dist/mcp/servicenow-graph-memory-mcp.js.map +1 -0
- package/dist/mcp/servicenow-integration-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-integration-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-integration-mcp.js +689 -0
- package/dist/mcp/servicenow-integration-mcp.js.map +1 -0
- package/dist/mcp/servicenow-intelligent-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-intelligent-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-intelligent-mcp.js +1138 -0
- package/dist/mcp/servicenow-intelligent-mcp.js.map +1 -0
- package/dist/mcp/servicenow-mcp-server.d.ts +37 -0
- package/dist/mcp/servicenow-mcp-server.d.ts.map +1 -0
- package/dist/mcp/servicenow-mcp-server.js +648 -0
- package/dist/mcp/servicenow-mcp-server.js.map +1 -0
- package/dist/mcp/servicenow-operations-mcp.d.ts +15 -0
- package/dist/mcp/servicenow-operations-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-operations-mcp.js +1287 -0
- package/dist/mcp/servicenow-operations-mcp.js.map +1 -0
- package/dist/mcp/servicenow-platform-development-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-platform-development-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-platform-development-mcp.js +557 -0
- package/dist/mcp/servicenow-platform-development-mcp.js.map +1 -0
- package/dist/mcp/servicenow-progressive-indexer.d.ts +79 -0
- package/dist/mcp/servicenow-progressive-indexer.d.ts.map +1 -0
- package/dist/mcp/servicenow-progressive-indexer.js +320 -0
- package/dist/mcp/servicenow-progressive-indexer.js.map +1 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +888 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js.map +1 -0
- package/dist/mcp/servicenow-security-compliance-mcp.d.ts +8 -0
- package/dist/mcp/servicenow-security-compliance-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-security-compliance-mcp.js +812 -0
- package/dist/mcp/servicenow-security-compliance-mcp.js.map +1 -0
- package/dist/mcp/servicenow-update-set-mcp.d.ts +7 -0
- package/dist/mcp/servicenow-update-set-mcp.d.ts.map +1 -0
- package/dist/mcp/servicenow-update-set-mcp.js +599 -0
- package/dist/mcp/servicenow-update-set-mcp.js.map +1 -0
- package/dist/mcp/start-all-mcp-servers.d.ts +6 -0
- package/dist/mcp/start-all-mcp-servers.d.ts.map +1 -0
- package/dist/mcp/start-all-mcp-servers.js +65 -0
- package/dist/mcp/start-all-mcp-servers.js.map +1 -0
- package/dist/mcp/start-servicenow-mcp.d.ts +7 -0
- package/dist/mcp/start-servicenow-mcp.d.ts.map +1 -0
- package/dist/mcp/start-servicenow-mcp.js +64 -0
- package/dist/mcp/start-servicenow-mcp.js.map +1 -0
- package/dist/mcp/test-simple-mcp.d.ts +6 -0
- package/dist/mcp/test-simple-mcp.d.ts.map +1 -0
- package/dist/mcp/test-simple-mcp.js +64 -0
- package/dist/mcp/test-simple-mcp.js.map +1 -0
- package/dist/orchestrator/flow-composer.d.ts +269 -0
- package/dist/orchestrator/flow-composer.d.ts.map +1 -0
- package/dist/orchestrator/flow-composer.js +2221 -0
- package/dist/orchestrator/flow-composer.js.map +1 -0
- package/dist/orchestrator/flow-pattern-templates.d.ts +260 -0
- package/dist/orchestrator/flow-pattern-templates.d.ts.map +1 -0
- package/dist/orchestrator/flow-pattern-templates.js +906 -0
- package/dist/orchestrator/flow-pattern-templates.js.map +1 -0
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts +202 -0
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts.map +1 -0
- package/dist/orchestrator/flow-subflow-decision-engine.js +769 -0
- package/dist/orchestrator/flow-subflow-decision-engine.js.map +1 -0
- package/dist/orchestrator/flow-validation-engine.d.ts +145 -0
- package/dist/orchestrator/flow-validation-engine.d.ts.map +1 -0
- package/dist/orchestrator/flow-validation-engine.js +663 -0
- package/dist/orchestrator/flow-validation-engine.js.map +1 -0
- package/dist/orchestrator/snow-orchestrator.d.ts +49 -0
- package/dist/orchestrator/snow-orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/snow-orchestrator.js +235 -0
- package/dist/orchestrator/snow-orchestrator.js.map +1 -0
- package/dist/orchestrator/subflow-creation-handler.d.ts +230 -0
- package/dist/orchestrator/subflow-creation-handler.d.ts.map +1 -0
- package/dist/orchestrator/subflow-creation-handler.js +791 -0
- package/dist/orchestrator/subflow-creation-handler.js.map +1 -0
- package/dist/strategies/global-scope-strategy.d.ts +123 -0
- package/dist/strategies/global-scope-strategy.d.ts.map +1 -0
- package/dist/strategies/global-scope-strategy.js +585 -0
- package/dist/strategies/global-scope-strategy.js.map +1 -0
- package/dist/types/index.d.ts +138 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/servicenow.types.d.ts +260 -0
- package/dist/types/servicenow.types.d.ts.map +1 -0
- package/dist/types/servicenow.types.js +3 -0
- package/dist/types/servicenow.types.js.map +1 -0
- package/dist/types/snow-flow.types.d.ts +114 -0
- package/dist/types/snow-flow.types.d.ts.map +1 -0
- package/dist/types/snow-flow.types.js +3 -0
- package/dist/types/snow-flow.types.js.map +1 -0
- package/dist/utils/action-type-cache.d.ts +66 -0
- package/dist/utils/action-type-cache.d.ts.map +1 -0
- package/dist/utils/action-type-cache.js +237 -0
- package/dist/utils/action-type-cache.js.map +1 -0
- package/dist/utils/agent-detector.d.ts +35 -0
- package/dist/utils/agent-detector.d.ts.map +1 -0
- package/dist/utils/agent-detector.js +353 -0
- package/dist/utils/agent-detector.js.map +1 -0
- package/dist/utils/flow-api-discovery.d.ts +151 -0
- package/dist/utils/flow-api-discovery.d.ts.map +1 -0
- package/dist/utils/flow-api-discovery.js +440 -0
- package/dist/utils/flow-api-discovery.js.map +1 -0
- package/dist/utils/flow-xml-generator.d.ts +41 -0
- package/dist/utils/flow-xml-generator.d.ts.map +1 -0
- package/dist/utils/flow-xml-generator.js +258 -0
- package/dist/utils/flow-xml-generator.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +51 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/mcp-auth-middleware.d.ts +58 -0
- package/dist/utils/mcp-auth-middleware.d.ts.map +1 -0
- package/dist/utils/mcp-auth-middleware.js +227 -0
- package/dist/utils/mcp-auth-middleware.js.map +1 -0
- package/dist/utils/mcp-config-manager.d.ts +126 -0
- package/dist/utils/mcp-config-manager.d.ts.map +1 -0
- package/dist/utils/mcp-config-manager.js +209 -0
- package/dist/utils/mcp-config-manager.js.map +1 -0
- package/dist/utils/mcp-server-manager.d.ts +91 -0
- package/dist/utils/mcp-server-manager.d.ts.map +1 -0
- package/dist/utils/mcp-server-manager.js +338 -0
- package/dist/utils/mcp-server-manager.js.map +1 -0
- package/dist/utils/scope-utils.d.ts +72 -0
- package/dist/utils/scope-utils.d.ts.map +1 -0
- package/dist/utils/scope-utils.js +386 -0
- package/dist/utils/scope-utils.js.map +1 -0
- package/dist/utils/servicenow-client.d.ts +233 -0
- package/dist/utils/servicenow-client.d.ts.map +1 -0
- package/dist/utils/servicenow-client.js +1465 -0
- package/dist/utils/servicenow-client.js.map +1 -0
- package/dist/utils/snow-oauth-old.d.ts +65 -0
- package/dist/utils/snow-oauth-old.d.ts.map +1 -0
- package/dist/utils/snow-oauth-old.js +345 -0
- package/dist/utils/snow-oauth-old.js.map +1 -0
- package/dist/utils/snow-oauth.d.ts +85 -0
- package/dist/utils/snow-oauth.d.ts.map +1 -0
- package/dist/utils/snow-oauth.js +512 -0
- package/dist/utils/snow-oauth.js.map +1 -0
- package/dist/utils/template-engine.d.ts +76 -0
- package/dist/utils/template-engine.d.ts.map +1 -0
- package/dist/utils/template-engine.js +391 -0
- package/dist/utils/template-engine.js.map +1 -0
- package/dist/version.d.ts +35 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +72 -0
- package/dist/version.js.map +1 -0
- package/mcp-wrapper.sh +12 -0
- package/package.json +77 -0
- package/reports/swarm-auto-centralized-1752649029776.json +13 -0
- package/scripts/postinstall.js +30 -0
- package/scripts/setup-mcp.js +89 -0
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Global Scope Strategy for ServiceNow Flow Creation
|
|
4
|
+
*
|
|
5
|
+
* This strategy implements a global scope approach for ServiceNow artifacts,
|
|
6
|
+
* replacing the current application-scoped approach with a more flexible
|
|
7
|
+
* global scope deployment model.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.GlobalScopeStrategy = exports.ScopeType = void 0;
|
|
11
|
+
const servicenow_client_js_1 = require("../utils/servicenow-client.js");
|
|
12
|
+
const snow_oauth_js_1 = require("../utils/snow-oauth.js");
|
|
13
|
+
const logger_js_1 = require("../utils/logger.js");
|
|
14
|
+
var ScopeType;
|
|
15
|
+
(function (ScopeType) {
|
|
16
|
+
ScopeType["GLOBAL"] = "global";
|
|
17
|
+
ScopeType["APPLICATION"] = "application";
|
|
18
|
+
ScopeType["AUTO"] = "auto";
|
|
19
|
+
})(ScopeType || (exports.ScopeType = ScopeType = {}));
|
|
20
|
+
class GlobalScopeStrategy {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.client = new servicenow_client_js_1.ServiceNowClient();
|
|
23
|
+
this.oauth = new snow_oauth_js_1.ServiceNowOAuth();
|
|
24
|
+
this.logger = new logger_js_1.Logger('GlobalScopeStrategy');
|
|
25
|
+
// Default configuration prioritizes global scope
|
|
26
|
+
this.defaultConfiguration = {
|
|
27
|
+
type: ScopeType.GLOBAL,
|
|
28
|
+
globalDomain: 'global',
|
|
29
|
+
fallbackToGlobal: true,
|
|
30
|
+
permissions: ['sys_scope.write', 'sys_metadata.write']
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Analyze and determine the optimal scope for deployment
|
|
35
|
+
*/
|
|
36
|
+
async analyzeScopeRequirements(artifactType, artifactData) {
|
|
37
|
+
this.logger.info('Analyzing scope requirements', { artifactType, artifactData: artifactData.name });
|
|
38
|
+
const scopeConfig = { ...this.defaultConfiguration };
|
|
39
|
+
// Analyze artifact complexity and dependencies
|
|
40
|
+
const complexity = this.assessArtifactComplexity(artifactType, artifactData);
|
|
41
|
+
const dependencies = await this.analyzeDependencies(artifactType, artifactData);
|
|
42
|
+
const permissions = await this.checkRequiredPermissions(artifactType);
|
|
43
|
+
// Global scope is preferred for:
|
|
44
|
+
// 1. System-wide flows and utilities
|
|
45
|
+
// 2. Cross-application integrations
|
|
46
|
+
// 3. Infrastructure components
|
|
47
|
+
// 4. Shared libraries and common functions
|
|
48
|
+
const globalScopeIndicators = [
|
|
49
|
+
artifactData.name?.toLowerCase().includes('global'),
|
|
50
|
+
artifactData.name?.toLowerCase().includes('system'),
|
|
51
|
+
artifactData.name?.toLowerCase().includes('util'),
|
|
52
|
+
artifactData.description?.toLowerCase().includes('cross-application'),
|
|
53
|
+
artifactData.description?.toLowerCase().includes('shared'),
|
|
54
|
+
complexity.isInfrastructure,
|
|
55
|
+
dependencies.crossApplication,
|
|
56
|
+
artifactType === 'script_include' && artifactData.api_name?.includes('Global'),
|
|
57
|
+
artifactType === 'business_rule' && artifactData.table === 'global'
|
|
58
|
+
];
|
|
59
|
+
const globalIndicatorCount = globalScopeIndicators.filter(Boolean).length;
|
|
60
|
+
// Application scope is preferred for:
|
|
61
|
+
// 1. Application-specific business logic
|
|
62
|
+
// 2. Isolated functionality
|
|
63
|
+
// 3. Customer-specific customizations
|
|
64
|
+
const applicationScopeIndicators = [
|
|
65
|
+
artifactData.scope && artifactData.scope !== 'global',
|
|
66
|
+
artifactData.application_specific === true,
|
|
67
|
+
complexity.isApplicationSpecific,
|
|
68
|
+
!dependencies.crossApplication,
|
|
69
|
+
artifactData.name?.toLowerCase().includes('custom'),
|
|
70
|
+
artifactData.description?.toLowerCase().includes('application-specific')
|
|
71
|
+
];
|
|
72
|
+
const applicationIndicatorCount = applicationScopeIndicators.filter(Boolean).length;
|
|
73
|
+
// Decision logic
|
|
74
|
+
if (globalIndicatorCount > applicationIndicatorCount) {
|
|
75
|
+
scopeConfig.type = ScopeType.GLOBAL;
|
|
76
|
+
scopeConfig.globalDomain = 'global';
|
|
77
|
+
this.logger.info('Global scope recommended', {
|
|
78
|
+
globalIndicators: globalIndicatorCount,
|
|
79
|
+
applicationIndicators: applicationIndicatorCount
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else if (applicationIndicatorCount > globalIndicatorCount && artifactData.scope) {
|
|
83
|
+
scopeConfig.type = ScopeType.APPLICATION;
|
|
84
|
+
scopeConfig.applicationId = artifactData.scope;
|
|
85
|
+
scopeConfig.applicationName = artifactData.application_name;
|
|
86
|
+
this.logger.info('Application scope recommended', {
|
|
87
|
+
scope: artifactData.scope,
|
|
88
|
+
applicationIndicators: applicationIndicatorCount
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// Auto mode - let the system decide based on permissions and context
|
|
93
|
+
scopeConfig.type = ScopeType.AUTO;
|
|
94
|
+
this.logger.info('Auto scope mode selected - will determine at deployment time');
|
|
95
|
+
}
|
|
96
|
+
scopeConfig.permissions = permissions;
|
|
97
|
+
return scopeConfig;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Validate scope permissions and capabilities
|
|
101
|
+
*/
|
|
102
|
+
async validateScopePermissions(scopeConfig) {
|
|
103
|
+
this.logger.info('Validating scope permissions', { scopeType: scopeConfig.type });
|
|
104
|
+
const result = {
|
|
105
|
+
isValid: false,
|
|
106
|
+
hasPermissions: false,
|
|
107
|
+
canCreateGlobal: false,
|
|
108
|
+
canCreateScoped: false,
|
|
109
|
+
recommendedScope: ScopeType.GLOBAL,
|
|
110
|
+
issues: [],
|
|
111
|
+
warnings: []
|
|
112
|
+
};
|
|
113
|
+
try {
|
|
114
|
+
// Check if user has global scope permissions
|
|
115
|
+
const globalPermissions = await this.checkGlobalScopePermissions();
|
|
116
|
+
result.canCreateGlobal = globalPermissions.hasPermission;
|
|
117
|
+
if (!globalPermissions.hasPermission) {
|
|
118
|
+
result.issues.push(...globalPermissions.issues);
|
|
119
|
+
result.warnings.push('Global scope permissions not available - consider using application scope');
|
|
120
|
+
}
|
|
121
|
+
// Check if user has application scope permissions
|
|
122
|
+
const applicationPermissions = await this.checkApplicationScopePermissions(scopeConfig.applicationId);
|
|
123
|
+
result.canCreateScoped = applicationPermissions.hasPermission;
|
|
124
|
+
if (!applicationPermissions.hasPermission) {
|
|
125
|
+
result.issues.push(...applicationPermissions.issues);
|
|
126
|
+
}
|
|
127
|
+
// Determine validity and recommendation
|
|
128
|
+
if (scopeConfig.type === ScopeType.GLOBAL) {
|
|
129
|
+
result.isValid = result.canCreateGlobal;
|
|
130
|
+
result.hasPermissions = result.canCreateGlobal;
|
|
131
|
+
result.recommendedScope = result.canCreateGlobal ? ScopeType.GLOBAL : ScopeType.APPLICATION;
|
|
132
|
+
}
|
|
133
|
+
else if (scopeConfig.type === ScopeType.APPLICATION) {
|
|
134
|
+
result.isValid = result.canCreateScoped;
|
|
135
|
+
result.hasPermissions = result.canCreateScoped;
|
|
136
|
+
result.recommendedScope = result.canCreateScoped ? ScopeType.APPLICATION : ScopeType.GLOBAL;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// Auto mode - prefer global if available, fallback to application
|
|
140
|
+
result.isValid = result.canCreateGlobal || result.canCreateScoped;
|
|
141
|
+
result.hasPermissions = result.canCreateGlobal || result.canCreateScoped;
|
|
142
|
+
result.recommendedScope = result.canCreateGlobal ? ScopeType.GLOBAL : ScopeType.APPLICATION;
|
|
143
|
+
}
|
|
144
|
+
if (!result.isValid) {
|
|
145
|
+
result.issues.push('Insufficient permissions for any scope type');
|
|
146
|
+
}
|
|
147
|
+
this.logger.info('Scope validation completed', {
|
|
148
|
+
isValid: result.isValid,
|
|
149
|
+
canCreateGlobal: result.canCreateGlobal,
|
|
150
|
+
canCreateScoped: result.canCreateScoped,
|
|
151
|
+
recommendedScope: result.recommendedScope
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
this.logger.error('Scope validation failed', error);
|
|
156
|
+
result.issues.push(`Validation error: ${error instanceof Error ? error.message : String(error)}`);
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Deploy artifact using global scope strategy
|
|
162
|
+
*/
|
|
163
|
+
async deployWithGlobalScope(artifactType, artifactData, scopeConfig) {
|
|
164
|
+
this.logger.info('Starting global scope deployment', {
|
|
165
|
+
artifactType,
|
|
166
|
+
artifactName: artifactData.name,
|
|
167
|
+
scopeType: scopeConfig?.type || 'default'
|
|
168
|
+
});
|
|
169
|
+
const config = scopeConfig || await this.analyzeScopeRequirements(artifactType, artifactData);
|
|
170
|
+
const validation = await this.validateScopePermissions(config);
|
|
171
|
+
if (!validation.isValid) {
|
|
172
|
+
return {
|
|
173
|
+
success: false,
|
|
174
|
+
scope: config.type,
|
|
175
|
+
domain: config.globalDomain || 'unknown',
|
|
176
|
+
artifactId: '',
|
|
177
|
+
permissions: config.permissions || [],
|
|
178
|
+
message: `Deployment failed: ${validation.issues.join(', ')}`,
|
|
179
|
+
warnings: validation.warnings
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
// Apply the appropriate scope strategy
|
|
184
|
+
let deploymentResult;
|
|
185
|
+
let actualScope;
|
|
186
|
+
if (config.type === ScopeType.GLOBAL || validation.recommendedScope === ScopeType.GLOBAL) {
|
|
187
|
+
deploymentResult = await this.deployToGlobalScope(artifactType, artifactData, config);
|
|
188
|
+
actualScope = ScopeType.GLOBAL;
|
|
189
|
+
}
|
|
190
|
+
else if (config.type === ScopeType.APPLICATION || validation.recommendedScope === ScopeType.APPLICATION) {
|
|
191
|
+
deploymentResult = await this.deployToApplicationScope(artifactType, artifactData, config);
|
|
192
|
+
actualScope = ScopeType.APPLICATION;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
// Auto mode - try global first, fallback to application
|
|
196
|
+
try {
|
|
197
|
+
deploymentResult = await this.deployToGlobalScope(artifactType, artifactData, config);
|
|
198
|
+
actualScope = ScopeType.GLOBAL;
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
if (config.fallbackToGlobal) {
|
|
202
|
+
this.logger.warn('Global scope deployment failed, falling back to application scope', error);
|
|
203
|
+
deploymentResult = await this.deployToApplicationScope(artifactType, artifactData, config);
|
|
204
|
+
actualScope = ScopeType.APPLICATION;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
success: deploymentResult.success,
|
|
213
|
+
scope: actualScope,
|
|
214
|
+
domain: actualScope === ScopeType.GLOBAL ? 'global' : (config.applicationName || 'application'),
|
|
215
|
+
artifactId: deploymentResult.sys_id || deploymentResult.id,
|
|
216
|
+
permissions: config.permissions || [],
|
|
217
|
+
message: `Successfully deployed to ${actualScope} scope`,
|
|
218
|
+
warnings: validation.warnings,
|
|
219
|
+
fallbackApplied: config.type !== actualScope
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
this.logger.error('Global scope deployment failed', error);
|
|
224
|
+
return {
|
|
225
|
+
success: false,
|
|
226
|
+
scope: config.type,
|
|
227
|
+
domain: config.globalDomain || 'global',
|
|
228
|
+
artifactId: '',
|
|
229
|
+
permissions: config.permissions || [],
|
|
230
|
+
message: `Deployment failed: ${error instanceof Error ? error.message : String(error)}`
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Deploy artifact to global scope
|
|
236
|
+
*/
|
|
237
|
+
async deployToGlobalScope(artifactType, artifactData, config) {
|
|
238
|
+
this.logger.info('Deploying to global scope', { artifactType, name: artifactData.name });
|
|
239
|
+
// Set global scope context
|
|
240
|
+
const globalArtifactData = {
|
|
241
|
+
...artifactData,
|
|
242
|
+
sys_scope: 'global',
|
|
243
|
+
sys_domain: 'global',
|
|
244
|
+
sys_domain_path: '/',
|
|
245
|
+
application: null, // Remove application association
|
|
246
|
+
scope: 'global'
|
|
247
|
+
};
|
|
248
|
+
// Remove application-specific fields
|
|
249
|
+
delete globalArtifactData.application_id;
|
|
250
|
+
delete globalArtifactData.application_name;
|
|
251
|
+
delete globalArtifactData.vendor;
|
|
252
|
+
delete globalArtifactData.vendor_prefix;
|
|
253
|
+
// Add global scope metadata
|
|
254
|
+
globalArtifactData.sys_created_on = new Date().toISOString();
|
|
255
|
+
globalArtifactData.sys_updated_on = new Date().toISOString();
|
|
256
|
+
globalArtifactData.sys_class_name = this.getSystemClassName(artifactType);
|
|
257
|
+
// Deploy based on artifact type
|
|
258
|
+
switch (artifactType) {
|
|
259
|
+
case 'flow':
|
|
260
|
+
return await this.deployFlowToGlobalScope(globalArtifactData);
|
|
261
|
+
case 'widget':
|
|
262
|
+
return await this.deployWidgetToGlobalScope(globalArtifactData);
|
|
263
|
+
case 'script_include':
|
|
264
|
+
return await this.deployScriptIncludeToGlobalScope(globalArtifactData);
|
|
265
|
+
case 'business_rule':
|
|
266
|
+
return await this.deployBusinessRuleToGlobalScope(globalArtifactData);
|
|
267
|
+
case 'table':
|
|
268
|
+
return await this.deployTableToGlobalScope(globalArtifactData);
|
|
269
|
+
default:
|
|
270
|
+
throw new Error(`Unsupported artifact type for global scope: ${artifactType}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Deploy artifact to application scope (fallback)
|
|
275
|
+
*/
|
|
276
|
+
async deployToApplicationScope(artifactType, artifactData, config) {
|
|
277
|
+
this.logger.info('Deploying to application scope', {
|
|
278
|
+
artifactType,
|
|
279
|
+
name: artifactData.name,
|
|
280
|
+
applicationId: config.applicationId
|
|
281
|
+
});
|
|
282
|
+
// If no application is specified, create one
|
|
283
|
+
if (!config.applicationId) {
|
|
284
|
+
const application = await this.createTemporaryApplication(artifactData.name);
|
|
285
|
+
config.applicationId = application.sys_id;
|
|
286
|
+
config.applicationName = application.name;
|
|
287
|
+
}
|
|
288
|
+
// Set application scope context
|
|
289
|
+
const scopedArtifactData = {
|
|
290
|
+
...artifactData,
|
|
291
|
+
sys_scope: config.applicationId,
|
|
292
|
+
application: config.applicationId,
|
|
293
|
+
scope: config.applicationId
|
|
294
|
+
};
|
|
295
|
+
// Use existing application deployment logic
|
|
296
|
+
return await this.client.createRecord(this.getTableName(artifactType), scopedArtifactData);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Deploy flow to global scope
|
|
300
|
+
*/
|
|
301
|
+
async deployFlowToGlobalScope(flowData) {
|
|
302
|
+
this.logger.info('Deploying flow to global scope', { name: flowData.name });
|
|
303
|
+
// Enhanced flow data for global scope
|
|
304
|
+
const globalFlowData = {
|
|
305
|
+
...flowData,
|
|
306
|
+
// Global scope specific fields
|
|
307
|
+
sys_scope: 'global',
|
|
308
|
+
run_as: 'user_who_triggers', // Global flows typically run as triggering user
|
|
309
|
+
access: 'public', // Global access
|
|
310
|
+
source_ui: 'flow_designer',
|
|
311
|
+
// Remove application-specific constraints
|
|
312
|
+
application: null,
|
|
313
|
+
category: flowData.category || 'global_automation',
|
|
314
|
+
// Enhanced metadata
|
|
315
|
+
sys_class_name: 'sys_hub_flow',
|
|
316
|
+
type: 'flow',
|
|
317
|
+
status: 'published'
|
|
318
|
+
};
|
|
319
|
+
return await this.client.createFlow(globalFlowData);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Deploy widget to global scope
|
|
323
|
+
*/
|
|
324
|
+
async deployWidgetToGlobalScope(widgetData) {
|
|
325
|
+
this.logger.info('Deploying widget to global scope', { name: widgetData.name });
|
|
326
|
+
const globalWidgetData = {
|
|
327
|
+
...widgetData,
|
|
328
|
+
sys_scope: 'global',
|
|
329
|
+
category: widgetData.category || 'global_widgets',
|
|
330
|
+
has_preview: true,
|
|
331
|
+
public: true // Global widgets are public
|
|
332
|
+
};
|
|
333
|
+
return await this.client.createWidget(globalWidgetData);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Deploy script include to global scope
|
|
337
|
+
*/
|
|
338
|
+
async deployScriptIncludeToGlobalScope(scriptData) {
|
|
339
|
+
this.logger.info('Deploying script include to global scope', { name: scriptData.name });
|
|
340
|
+
const globalScriptData = {
|
|
341
|
+
...scriptData,
|
|
342
|
+
sys_scope: 'global',
|
|
343
|
+
access: 'public', // Global script includes are typically public
|
|
344
|
+
active: true,
|
|
345
|
+
api_name: scriptData.api_name || scriptData.name
|
|
346
|
+
};
|
|
347
|
+
return await this.client.createScriptInclude(globalScriptData);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Deploy business rule to global scope
|
|
351
|
+
*/
|
|
352
|
+
async deployBusinessRuleToGlobalScope(ruleData) {
|
|
353
|
+
this.logger.info('Deploying business rule to global scope', { name: ruleData.name });
|
|
354
|
+
const globalRuleData = {
|
|
355
|
+
...ruleData,
|
|
356
|
+
sys_scope: 'global',
|
|
357
|
+
active: true,
|
|
358
|
+
order: ruleData.order || 100
|
|
359
|
+
};
|
|
360
|
+
return await this.client.createBusinessRule(globalRuleData);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Deploy table to global scope
|
|
364
|
+
*/
|
|
365
|
+
async deployTableToGlobalScope(tableData) {
|
|
366
|
+
this.logger.info('Deploying table to global scope', { name: tableData.name });
|
|
367
|
+
const globalTableData = {
|
|
368
|
+
...tableData,
|
|
369
|
+
sys_scope: 'global',
|
|
370
|
+
access: 'public',
|
|
371
|
+
is_extendable: true,
|
|
372
|
+
create_access_controls: true
|
|
373
|
+
};
|
|
374
|
+
return await this.client.createTable(globalTableData);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Check global scope permissions
|
|
378
|
+
*/
|
|
379
|
+
async checkGlobalScopePermissions() {
|
|
380
|
+
try {
|
|
381
|
+
// Check if user can create global scope artifacts
|
|
382
|
+
const userRoles = await this.client.getRecords('sys_user_has_role', {
|
|
383
|
+
sysparm_query: `user=javascript:gs.getUserID()`,
|
|
384
|
+
sysparm_fields: 'role.name'
|
|
385
|
+
});
|
|
386
|
+
if (!userRoles.success) {
|
|
387
|
+
return { hasPermission: false, issues: ['Cannot check user roles'] };
|
|
388
|
+
}
|
|
389
|
+
const roles = userRoles.data.map((r) => r.role?.name).filter(Boolean);
|
|
390
|
+
const globalPermissionRoles = ['admin', 'system_administrator', 'global_admin'];
|
|
391
|
+
const hasGlobalPermission = globalPermissionRoles.some(role => roles.includes(role));
|
|
392
|
+
return {
|
|
393
|
+
hasPermission: hasGlobalPermission,
|
|
394
|
+
issues: hasGlobalPermission ? [] : ['User lacks global scope permissions (admin, system_administrator, or global_admin role required)']
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
return {
|
|
399
|
+
hasPermission: false,
|
|
400
|
+
issues: [`Permission check failed: ${error instanceof Error ? error.message : String(error)}`]
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Check application scope permissions
|
|
406
|
+
*/
|
|
407
|
+
async checkApplicationScopePermissions(applicationId) {
|
|
408
|
+
try {
|
|
409
|
+
if (!applicationId) {
|
|
410
|
+
// User can create applications if they have app_creator or admin role
|
|
411
|
+
const userRoles = await this.client.getRecords('sys_user_has_role', {
|
|
412
|
+
sysparm_query: `user=javascript:gs.getUserID()`,
|
|
413
|
+
sysparm_fields: 'role.name'
|
|
414
|
+
});
|
|
415
|
+
if (!userRoles.success) {
|
|
416
|
+
return { hasPermission: false, issues: ['Cannot check user roles'] };
|
|
417
|
+
}
|
|
418
|
+
const roles = userRoles.data.map((r) => r.role?.name).filter(Boolean);
|
|
419
|
+
const appCreatorRoles = ['admin', 'system_administrator', 'app_creator'];
|
|
420
|
+
const hasAppPermission = appCreatorRoles.some(role => roles.includes(role));
|
|
421
|
+
return {
|
|
422
|
+
hasPermission: hasAppPermission,
|
|
423
|
+
issues: hasAppPermission ? [] : ['User lacks application creation permissions (admin, system_administrator, or app_creator role required)']
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
// Check if application exists and user has access
|
|
427
|
+
const app = await this.client.getRecord('sys_app', applicationId);
|
|
428
|
+
return {
|
|
429
|
+
hasPermission: !!app,
|
|
430
|
+
issues: app ? [] : [`Application ${applicationId} not found or not accessible`]
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
catch (error) {
|
|
434
|
+
return {
|
|
435
|
+
hasPermission: false,
|
|
436
|
+
issues: [`Permission check failed: ${error instanceof Error ? error.message : String(error)}`]
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Assess artifact complexity for scope decision
|
|
442
|
+
*/
|
|
443
|
+
assessArtifactComplexity(artifactType, artifactData) {
|
|
444
|
+
const complexity = {
|
|
445
|
+
isInfrastructure: false,
|
|
446
|
+
isApplicationSpecific: false,
|
|
447
|
+
crossApplication: false,
|
|
448
|
+
sharedUtility: false
|
|
449
|
+
};
|
|
450
|
+
// Infrastructure indicators
|
|
451
|
+
const infraKeywords = ['system', 'global', 'util', 'lib', 'common', 'shared', 'infrastructure'];
|
|
452
|
+
const artifactText = `${artifactData.name} ${artifactData.description || ''}`.toLowerCase();
|
|
453
|
+
complexity.isInfrastructure = infraKeywords.some(keyword => artifactText.includes(keyword));
|
|
454
|
+
// Application-specific indicators
|
|
455
|
+
const appKeywords = ['custom', 'specific', 'application', 'business', 'process'];
|
|
456
|
+
complexity.isApplicationSpecific = appKeywords.some(keyword => artifactText.includes(keyword));
|
|
457
|
+
// Cross-application indicators
|
|
458
|
+
const crossAppKeywords = ['integration', 'cross', 'bridge', 'connector', 'api'];
|
|
459
|
+
complexity.crossApplication = crossAppKeywords.some(keyword => artifactText.includes(keyword));
|
|
460
|
+
// Shared utility indicators
|
|
461
|
+
const utilityKeywords = ['utility', 'helper', 'tool', 'function', 'method'];
|
|
462
|
+
complexity.sharedUtility = utilityKeywords.some(keyword => artifactText.includes(keyword));
|
|
463
|
+
return complexity;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Analyze artifact dependencies
|
|
467
|
+
*/
|
|
468
|
+
async analyzeDependencies(artifactType, artifactData) {
|
|
469
|
+
const dependencies = {
|
|
470
|
+
crossApplication: false,
|
|
471
|
+
globalDependencies: [],
|
|
472
|
+
applicationDependencies: []
|
|
473
|
+
};
|
|
474
|
+
// Simple dependency analysis based on artifact content
|
|
475
|
+
const content = JSON.stringify(artifactData);
|
|
476
|
+
// Check for global API calls
|
|
477
|
+
const globalApiPatterns = [
|
|
478
|
+
/gs\./g, // GlideSystem calls
|
|
479
|
+
/GlideRecord\(/g, // Database access
|
|
480
|
+
/gs\.getProperty\(/g, // System properties
|
|
481
|
+
/gs\.log\(/g // System logging
|
|
482
|
+
];
|
|
483
|
+
const hasGlobalApis = globalApiPatterns.some(pattern => pattern.test(content));
|
|
484
|
+
if (hasGlobalApis) {
|
|
485
|
+
dependencies.crossApplication = true;
|
|
486
|
+
dependencies.globalDependencies.push('system_apis');
|
|
487
|
+
}
|
|
488
|
+
return dependencies;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Check required permissions for artifact type
|
|
492
|
+
*/
|
|
493
|
+
async checkRequiredPermissions(artifactType) {
|
|
494
|
+
const permissionMap = {
|
|
495
|
+
'flow': ['sys_hub_flow.write', 'sys_metadata.write'],
|
|
496
|
+
'widget': ['sp_widget.write', 'sys_metadata.write'],
|
|
497
|
+
'script_include': ['sys_script_include.write', 'sys_metadata.write'],
|
|
498
|
+
'business_rule': ['sys_script.write', 'sys_metadata.write'],
|
|
499
|
+
'table': ['sys_db_object.write', 'sys_metadata.write']
|
|
500
|
+
};
|
|
501
|
+
return permissionMap[artifactType] || ['sys_metadata.write'];
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Create temporary application for scoped deployment
|
|
505
|
+
*/
|
|
506
|
+
async createTemporaryApplication(baseName) {
|
|
507
|
+
const applicationData = {
|
|
508
|
+
name: `Temp App for ${baseName}`,
|
|
509
|
+
scope: `x_temp_${Date.now()}`,
|
|
510
|
+
version: '1.0.0',
|
|
511
|
+
short_description: `Temporary application for ${baseName}`,
|
|
512
|
+
vendor: 'System',
|
|
513
|
+
vendor_prefix: 'x',
|
|
514
|
+
active: true
|
|
515
|
+
};
|
|
516
|
+
const result = await this.client.createApplication(applicationData);
|
|
517
|
+
if (!result.success) {
|
|
518
|
+
throw new Error(`Failed to create temporary application: ${result.error}`);
|
|
519
|
+
}
|
|
520
|
+
return result.data;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Get system class name for artifact type
|
|
524
|
+
*/
|
|
525
|
+
getSystemClassName(artifactType) {
|
|
526
|
+
const classMap = {
|
|
527
|
+
'flow': 'sys_hub_flow',
|
|
528
|
+
'widget': 'sp_widget',
|
|
529
|
+
'script_include': 'sys_script_include',
|
|
530
|
+
'business_rule': 'sys_script',
|
|
531
|
+
'table': 'sys_db_object'
|
|
532
|
+
};
|
|
533
|
+
return classMap[artifactType] || 'sys_metadata';
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Get table name for artifact type
|
|
537
|
+
*/
|
|
538
|
+
getTableName(artifactType) {
|
|
539
|
+
const tableMap = {
|
|
540
|
+
'flow': 'sys_hub_flow',
|
|
541
|
+
'widget': 'sp_widget',
|
|
542
|
+
'script_include': 'sys_script_include',
|
|
543
|
+
'business_rule': 'sys_script',
|
|
544
|
+
'table': 'sys_db_object'
|
|
545
|
+
};
|
|
546
|
+
return tableMap[artifactType] || 'sys_metadata';
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Get migration strategy for existing scoped artifacts
|
|
550
|
+
*/
|
|
551
|
+
async getMigrationStrategy(existingArtifacts) {
|
|
552
|
+
this.logger.info('Generating migration strategy', { count: existingArtifacts.length });
|
|
553
|
+
const migrationPlan = {
|
|
554
|
+
totalArtifacts: existingArtifacts.length,
|
|
555
|
+
globalCandidates: [],
|
|
556
|
+
keepScoped: [],
|
|
557
|
+
requiresReview: [],
|
|
558
|
+
estimatedTime: 0,
|
|
559
|
+
risks: [],
|
|
560
|
+
recommendations: []
|
|
561
|
+
};
|
|
562
|
+
for (const artifact of existingArtifacts) {
|
|
563
|
+
const analysis = await this.analyzeScopeRequirements(artifact.type, artifact);
|
|
564
|
+
if (analysis.type === ScopeType.GLOBAL) {
|
|
565
|
+
migrationPlan.globalCandidates.push({
|
|
566
|
+
...artifact,
|
|
567
|
+
migrationComplexity: 'low',
|
|
568
|
+
dependencies: await this.analyzeDependencies(artifact.type, artifact)
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
migrationPlan.keepScoped.push(artifact);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
// Calculate migration complexity and time
|
|
576
|
+
migrationPlan.estimatedTime = migrationPlan.globalCandidates.length * 5; // 5 minutes per artifact
|
|
577
|
+
if (migrationPlan.globalCandidates.length > 10) {
|
|
578
|
+
migrationPlan.risks.push('Large number of artifacts to migrate - consider phased approach');
|
|
579
|
+
}
|
|
580
|
+
migrationPlan.recommendations.push('Test migration in development environment first', 'Backup existing artifacts before migration', 'Monitor for breaking changes after migration');
|
|
581
|
+
return migrationPlan;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
exports.GlobalScopeStrategy = GlobalScopeStrategy;
|
|
585
|
+
//# sourceMappingURL=global-scope-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-scope-strategy.js","sourceRoot":"","sources":["../../src/strategies/global-scope-strategy.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,wEAAiE;AACjE,0DAAyD;AACzD,kDAA4C;AAE5C,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,wCAA2B,CAAA;IAC3B,0BAAa,CAAA;AACf,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAgCD,MAAa,mBAAmB;IAM9B;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,uCAAgB,EAAE,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,IAAI,+BAAe,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,kBAAM,CAAC,qBAAqB,CAAC,CAAC;QAEhD,iDAAiD;QACjD,IAAI,CAAC,oBAAoB,GAAG;YAC1B,IAAI,EAAE,SAAS,CAAC,MAAM;YACtB,YAAY,EAAE,QAAQ;YACtB,gBAAgB,EAAE,IAAI;YACtB,WAAW,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;SACvD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,wBAAwB,CAAC,YAAoB,EAAE,YAAiB;QACpE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;QAEpG,MAAM,WAAW,GAAuB,EAAE,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