snow-flow 3.0.13 → 3.0.14

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.
@@ -1835,7 +1835,7 @@ ${args.widgets && args.widgets.length > 0 ? args.widgets.map((w, i) => `
1835
1835
  switch (flowType) {
1836
1836
  case 'flow':
1837
1837
  // Create workflow record in ServiceNow
1838
- result = await this.client.create('wf_workflow', {
1838
+ result = await this.client.createRecord('wf_workflow', {
1839
1839
  name: flowData.name || `flow_${Date.now()}`,
1840
1840
  description: flowData.description || 'Created by Snow-Flow',
1841
1841
  table: flowData.table || 'incident',
@@ -1847,7 +1847,7 @@ ${args.widgets && args.widgets.length > 0 ? args.widgets.map((w, i) => `
1847
1847
  break;
1848
1848
  case 'subflow':
1849
1849
  // Create subflow as a workflow activity
1850
- result = await this.client.create('wf_workflow', {
1850
+ result = await this.client.createRecord('wf_workflow', {
1851
1851
  name: flowData.name || `subflow_${Date.now()}`,
1852
1852
  description: `${flowData.description || 'Subflow created by Snow-Flow'} [SUBFLOW]`,
1853
1853
  table: flowData.table || 'incident',
@@ -1862,7 +1862,7 @@ ${args.widgets && args.widgets.length > 0 ? args.widgets.map((w, i) => `
1862
1862
  if (!flowData.workflow_id) {
1863
1863
  throw new Error('workflow_id is required for flow actions');
1864
1864
  }
1865
- result = await this.client.create('wf_activity', {
1865
+ result = await this.client.createRecord('wf_activity', {
1866
1866
  workflow: flowData.workflow_id,
1867
1867
  name: flowData.name || `action_${Date.now()}`,
1868
1868
  script: flowData.script || '// Action script here',
@@ -2627,7 +2627,7 @@ ${hasErrors ? '❌ Validation failed - fix errors before deployment' : '✅ Vali
2627
2627
  let rollbackResult;
2628
2628
  try {
2629
2629
  // Set update set to ignore state (ServiceNow's way of "rolling back")
2630
- rollbackResult = await this.client.update(`sys_update_set/${update_set_id}`, {
2630
+ rollbackResult = await this.client.updateRecord(`sys_update_set/${update_set_id}`, {
2631
2631
  state: 'ignore',
2632
2632
  description: `${updateSet.description || ''} - ROLLED BACK: ${reason}`
2633
2633
  });
@@ -3067,12 +3067,12 @@ ${deploymentList || 'No recent deployments found in the last 7 days'}
3067
3067
  if (existingArtifact) {
3068
3068
  // Update existing artifact
3069
3069
  const { sys_id, ...updateData } = artifact;
3070
- result = await this.client.update(`${tableName}/${sys_id}`, updateData);
3070
+ result = await this.client.updateRecord(`${tableName}/${sys_id}`, updateData);
3071
3071
  action = 'updated';
3072
3072
  }
3073
3073
  else {
3074
3074
  // Create new artifact
3075
- result = await this.client.create(tableName, artifact);
3075
+ result = await this.client.createRecord(tableName, artifact);
3076
3076
  action = 'created';
3077
3077
  }
3078
3078
  if (!result?.result) {
@@ -3835,25 +3835,39 @@ This will use your .env credentials to start the OAuth flow and generate access
3835
3835
  template: '<div>Test widget - safe to delete</div>',
3836
3836
  description: 'Temporary test widget created by Snow-Flow MCP diagnostics'
3837
3837
  };
3838
- const createResult = await this.client.create('sp_widget', testWidget);
3839
- if (createResult?.result?.sys_id) {
3838
+ const createResult = await this.client.createRecord('sp_widget', testWidget);
3839
+ if (createResult?.success && createResult?.data?.sys_id) {
3840
3840
  // Immediately delete the test widget
3841
3841
  try {
3842
- await this.client.delete(`sp_widget/${createResult.result.sys_id}`);
3842
+ await this.client.deleteRecord('sp_widget', createResult.data.sys_id);
3843
3843
  realApiTests.writePermissions = {
3844
3844
  status: '✅ Full Access',
3845
3845
  description: 'Can create and delete artifacts - full deployment capability',
3846
- details: `Successfully created and cleaned up test widget ${createResult.result.sys_id}`
3846
+ details: `Successfully created and cleaned up test widget ${createResult.data.sys_id}`
3847
3847
  };
3848
3848
  }
3849
3849
  catch (deleteError) {
3850
3850
  realApiTests.writePermissions = {
3851
3851
  status: '⚠️ Partial',
3852
3852
  description: 'Can create but cannot delete - cleanup may be needed',
3853
- details: `Created test widget ${createResult.result.sys_id} but failed to delete: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`
3853
+ details: `Created test widget ${createResult.data.sys_id} but failed to delete: ${deleteError instanceof Error ? deleteError.message : String(deleteError)}`
3854
3854
  };
3855
3855
  }
3856
3856
  }
3857
+ else {
3858
+ // Log what we got for debugging
3859
+ this.logger.warn('Create succeeded but unexpected response structure:', {
3860
+ success: createResult?.success,
3861
+ hasData: !!createResult?.data,
3862
+ hasSysId: !!createResult?.data?.sys_id,
3863
+ dataKeys: createResult?.data ? Object.keys(createResult.data) : []
3864
+ });
3865
+ realApiTests.writePermissions = {
3866
+ status: '⚠️ Partial',
3867
+ description: 'Created widget but response structure unexpected',
3868
+ details: `Response structure: ${JSON.stringify(createResult?.data || {})}`
3869
+ };
3870
+ }
3857
3871
  }
3858
3872
  catch (writeError) {
3859
3873
  realApiTests.writePermissions = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "3.0.13",
4
- "description": "Snow-Flow v3.0.13: ZERO MOCK DATA GUARANTEE! 🔥 All reporting, dashboards, and analytics tools now use 100% REAL ServiceNow data with anti-mock validation. Advanced AI table discovery, race condition fixes, and comprehensive real-data enforcement. NO demo/sample/test data ever used - only live data from your actual ServiceNow instance. Plus intelligent reporting, deployment fixes, and 100+ MCP tools.",
3
+ "version": "3.0.14",
4
+ "description": "Snow-Flow v3.0.14: WRITE PERMISSIONS FIX! 🔧 Fixed 'this.client.create is not a function' error that was blocking all deployments. Corrected API method calls to use createRecord/deleteRecord. Write permissions diagnostic now works correctly. Plus all features: Zero Mock Data Guarantee, race condition fixes, intelligent reporting, and 100+ MCP tools.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
7
7
  "bin": {