snow-flow 3.0.22 → 3.0.23

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.
@@ -3427,14 +3427,38 @@ Use ServiceNow's official deployment process:
3427
3427
  artifact_tracker_js_1.artifactTracker.trackArtifact(args.sys_id, args.table, args.name, args.type, 'update' // Assume existing artifact
3428
3428
  );
3429
3429
  }
3430
- // Validate the artifact exists
3431
- const isValid = await artifact_tracker_js_1.artifactTracker.validateArtifact(args.sys_id);
3432
- // Get the artifact details if valid
3430
+ // Use direct API query (snow_query_table approach) for validation
3431
+ let isValid = false;
3433
3432
  let artifactDetails = null;
3434
- if (isValid) {
3435
- const response = await this.client.getRecord(args.table, args.sys_id);
3436
- if (response.success && response.data) {
3437
- artifactDetails = response.data;
3433
+ try {
3434
+ // Direct API call using query parameter with sys_id
3435
+ const apiResponse = await this.client.get(`/api/now/table/${args.table}`, {
3436
+ sysparm_query: `sys_id=${args.sys_id}`,
3437
+ sysparm_limit: 1,
3438
+ sysparm_fields: 'sys_id,name,title,active,sys_created_on,sys_updated_on,sys_created_by,sys_updated_by'
3439
+ });
3440
+ if (apiResponse?.result && apiResponse.result.length > 0) {
3441
+ isValid = true;
3442
+ artifactDetails = apiResponse.result[0];
3443
+ this.logger.info(`✅ Artifact found via direct API: ${artifactDetails.sys_id}`);
3444
+ }
3445
+ else {
3446
+ this.logger.info(`❌ Artifact not found: ${args.sys_id} in table ${args.table}`);
3447
+ }
3448
+ }
3449
+ catch (error) {
3450
+ this.logger.warn(`Failed to query artifact: ${error}`);
3451
+ // Try alternative method as fallback
3452
+ try {
3453
+ const response = await this.client.getRecord(args.table, args.sys_id);
3454
+ if (response.success && response.data) {
3455
+ isValid = true;
3456
+ artifactDetails = response.data;
3457
+ this.logger.info(`✅ Artifact found via getRecord fallback: ${args.sys_id}`);
3458
+ }
3459
+ }
3460
+ catch (fallbackError) {
3461
+ this.logger.error(`Both validation methods failed: ${fallbackError}`);
3438
3462
  }
3439
3463
  }
3440
3464
  // Check for inconsistencies
@@ -3452,14 +3476,16 @@ Use ServiceNow's official deployment process:
3452
3476
  - Expected Name: ${args.name || 'Not specified'}
3453
3477
  - Expected Type: ${args.type || 'Not specified'}
3454
3478
 
3455
- **Validation Status:** ${isValid ? '✅ Valid' : '❌ Invalid'}
3479
+ **Validation Status:** ${isValid ? '✅ Valid - Artifact exists' : '❌ Not Found - Artifact does not exist in this table'}
3456
3480
 
3457
3481
  ${artifactDetails ? `**Actual Artifact Details:**
3458
3482
  - Name: ${artifactDetails.name || artifactDetails.title || 'Unknown'}
3459
- - Active: ${artifactDetails.active}
3460
- - Created: ${artifactDetails.sys_created_on}
3461
- - Updated: ${artifactDetails.sys_updated_on}
3462
- ` : ''}
3483
+ - Active: ${artifactDetails.active !== undefined ? artifactDetails.active : 'N/A'}
3484
+ - Created: ${artifactDetails.sys_created_on || 'N/A'}
3485
+ - Updated: ${artifactDetails.sys_updated_on || 'N/A'}
3486
+ - Created By: ${artifactDetails.sys_created_by || 'N/A'}
3487
+ - Updated By: ${artifactDetails.sys_updated_by || 'N/A'}
3488
+ ` : '**Artifact not found in ServiceNow**'}
3463
3489
 
3464
3490
  ${trackedArtifact ? `**Tracking Info:**
3465
3491
  - Status: ${trackedArtifact.status}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.0.22",
3
+ "version": "3.0.23",
4
4
  "description": "Snow-Flow v3.0.18: DIRECT API VERIFICATION! 🚀 Replaced unreliable searchRecords with direct API calls (snow_query_table style) for widget verification. All null/403 error recovery now uses GET /api/now/table/sp_widget with precise queries. NO MORE FALSE NEGATIVES - verification works consistently every time!",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",