snow-flow 3.5.16 ā 3.5.17
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.
|
@@ -109,6 +109,7 @@ export declare class ArtifactLocalSync {
|
|
|
109
109
|
getSyncStatus(sys_id: string): string;
|
|
110
110
|
/**
|
|
111
111
|
* Pull any supported artifact type by detecting table from sys_id
|
|
112
|
+
* ENHANCED: Better error logging and more robust detection
|
|
112
113
|
*/
|
|
113
114
|
pullArtifactBySysId(sys_id: string): Promise<LocalArtifact>;
|
|
114
115
|
/**
|
|
@@ -703,26 +703,55 @@ snow-flow sync status ${widget.sys_id}
|
|
|
703
703
|
}
|
|
704
704
|
/**
|
|
705
705
|
* Pull any supported artifact type by detecting table from sys_id
|
|
706
|
+
* ENHANCED: Better error logging and more robust detection
|
|
706
707
|
*/
|
|
707
708
|
async pullArtifactBySysId(sys_id) {
|
|
708
|
-
|
|
709
|
-
|
|
709
|
+
console.log(`\nš Auto-detecting artifact type for sys_id: ${sys_id}`);
|
|
710
|
+
console.log(`š Checking ${Object.keys(artifact_registry_1.ARTIFACT_REGISTRY).length} supported tables...`);
|
|
711
|
+
// SMART ORDER: Check most common tables first for better performance
|
|
712
|
+
const allTables = Object.keys(artifact_registry_1.ARTIFACT_REGISTRY);
|
|
713
|
+
const commonTables = ['sp_widget', 'sys_script_include', 'sys_script', 'sys_ui_page'];
|
|
714
|
+
const otherTables = allTables.filter(t => !commonTables.includes(t));
|
|
715
|
+
const tables = [...commonTables, ...otherTables]; // Common tables first
|
|
710
716
|
const timeoutConfig = (0, mcp_timeout_config_js_1.getMCPTimeoutConfig)();
|
|
717
|
+
const errors = [];
|
|
711
718
|
for (const table of tables) {
|
|
712
719
|
try {
|
|
713
|
-
|
|
714
|
-
|
|
720
|
+
console.log(` š Checking table: ${table}...`);
|
|
721
|
+
// Increased timeout for better reliability
|
|
722
|
+
const response = await (0, mcp_timeout_config_js_1.withMCPTimeout)(this.client.searchRecords(table, `sys_id=${sys_id}`, 1), 8000, // 8 second timeout per table (was 3s)
|
|
715
723
|
`Detect table for ${sys_id}`);
|
|
716
724
|
if (response.result?.[0]) {
|
|
717
|
-
console.log(
|
|
725
|
+
console.log(` ā
Found in table: ${table}`);
|
|
726
|
+
console.log(`š Auto-detection successful! Proceeding with pull...`);
|
|
718
727
|
return this.pullArtifact(table, sys_id);
|
|
719
728
|
}
|
|
729
|
+
else {
|
|
730
|
+
console.log(` ā Not found in: ${table}`);
|
|
731
|
+
}
|
|
720
732
|
}
|
|
721
733
|
catch (error) {
|
|
722
|
-
|
|
734
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
735
|
+
console.log(` ā ļø Error checking ${table}: ${errorMsg}`);
|
|
736
|
+
errors.push({ table, error: errorMsg });
|
|
737
|
+
// Don't fail on permission errors, timeouts, etc. - keep trying other tables
|
|
723
738
|
}
|
|
724
739
|
}
|
|
725
|
-
|
|
740
|
+
// Generate detailed error message
|
|
741
|
+
console.log(`\nā Artifact detection failed!`);
|
|
742
|
+
console.log(`š Searched ${tables.length} tables for sys_id: ${sys_id}`);
|
|
743
|
+
if (errors.length > 0) {
|
|
744
|
+
console.log(`\nā ļø Errors encountered:`);
|
|
745
|
+
errors.forEach(({ table, error }) => {
|
|
746
|
+
console.log(` ${table}: ${error}`);
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
console.log(`\nš” Troubleshooting tips:`);
|
|
750
|
+
console.log(` 1. Verify the sys_id exists in ServiceNow`);
|
|
751
|
+
console.log(` 2. Check your permissions for the target table`);
|
|
752
|
+
console.log(` 3. Try specifying the table explicitly: snow_pull_artifact({sys_id, table: 'sp_widget'})`);
|
|
753
|
+
console.log(` 4. Supported tables: ${tables.join(', ')}`);
|
|
754
|
+
throw new Error(`Could not find artifact with sys_id ${sys_id} in any supported table. See details above.`);
|
|
726
755
|
}
|
|
727
756
|
/**
|
|
728
757
|
* Get supported artifact types
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "3.5.
|
|
4
|
-
"description": "ServiceNow development framework with
|
|
3
|
+
"version": "3.5.17",
|
|
4
|
+
"description": "ServiceNow development framework with ROBUST artifact detection fix. v3.5.17 FIXES the intermittent 'Could not find artifact' errors in snow_pull_artifact. Enhanced pullArtifactBySysId with detailed error logging, longer timeouts (8s per table), smart table ordering, and comprehensive troubleshooting guidance. ULTRA-CONSERVATIVE wrapper system prevents duplicate HTML comments. Enhanced 'snow-flow init' creates optimized settings.json with 18 MCP servers, extensive development permissions, intelligent hooks, and ServiceNow-specific commands. Features intelligent timeout configuration and comprehensive ServiceNow development workflow.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"bin": {
|