atmx-cli 0.66.0 → 0.67.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.
@@ -25,14 +25,21 @@ function generateSdk(multiIr, isReact = false) {
25
25
  lines.push(` clearAuthToken(methodName: string) {`);
26
26
  lines.push(` clearAuthToken("${ns}", methodName);`);
27
27
  lines.push(` },`);
28
+ // ✨ FIX: Properly generate React WebSocket imperative methods!
28
29
  lines.push(` connect(methodName: string, args?: Record<string, any>) {`);
29
- lines.push(` console.warn("Manual connect not implemented for React. Use useAxiomQuery.");`);
30
+ lines.push(` const { axiomQueryManager } = require('atmx-react');`);
31
+ lines.push(` const def = (this as any)[\`get\${methodName.charAt(0).toUpperCase() + methodName.slice(1)}Def\`](args);`);
32
+ lines.push(` axiomQueryManager.connect(def);`);
30
33
  lines.push(` },`);
31
34
  lines.push(` disconnect(methodName: string, args?: Record<string, any>) {`);
32
- lines.push(` console.warn("Manual disconnect not implemented for React. Unmount the component.");`);
35
+ lines.push(` const { axiomQueryManager } = require('atmx-react');`);
36
+ lines.push(` const def = (this as any)[\`get\${methodName.charAt(0).toUpperCase() + methodName.slice(1)}Def\`](args);`);
37
+ lines.push(` axiomQueryManager.disconnect(def);`);
33
38
  lines.push(` },`);
34
39
  lines.push(` send(methodName: string, payload: any, args?: Record<string, any>) {`);
35
- lines.push(` console.warn("Manual send not implemented for React. Use useAxiomQuery.");`);
40
+ lines.push(` const { axiomQueryManager } = require('atmx-react');`);
41
+ lines.push(` const def = (this as any)[\`get\${methodName.charAt(0).toUpperCase() + methodName.slice(1)}Def\`](args);`);
42
+ lines.push(` axiomQueryManager.send(def, payload);`);
36
43
  lines.push(` }`);
37
44
  }
38
45
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmx-cli",
3
- "version": "0.66.0",
3
+ "version": "0.67.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -34,26 +34,33 @@ export function generateSdk(
34
34
  lines.push(` clearAuthToken(methodName: string) {`);
35
35
  lines.push(` clearAuthToken("${ns}", methodName);`);
36
36
  lines.push(` },`);
37
+ // ✨ FIX: Properly generate React WebSocket imperative methods!
37
38
  lines.push(
38
39
  ` connect(methodName: string, args?: Record<string, any>) {`,
39
40
  );
41
+ lines.push(` const { axiomQueryManager } = require('atmx-react');`);
40
42
  lines.push(
41
- ` console.warn("Manual connect not implemented for React. Use useAxiomQuery.");`,
43
+ ` const def = (this as any)[\`get\${methodName.charAt(0).toUpperCase() + methodName.slice(1)}Def\`](args);`,
42
44
  );
45
+ lines.push(` axiomQueryManager.connect(def);`);
43
46
  lines.push(` },`);
44
47
  lines.push(
45
48
  ` disconnect(methodName: string, args?: Record<string, any>) {`,
46
49
  );
50
+ lines.push(` const { axiomQueryManager } = require('atmx-react');`);
47
51
  lines.push(
48
- ` console.warn("Manual disconnect not implemented for React. Unmount the component.");`,
52
+ ` const def = (this as any)[\`get\${methodName.charAt(0).toUpperCase() + methodName.slice(1)}Def\`](args);`,
49
53
  );
54
+ lines.push(` axiomQueryManager.disconnect(def);`);
50
55
  lines.push(` },`);
51
56
  lines.push(
52
57
  ` send(methodName: string, payload: any, args?: Record<string, any>) {`,
53
58
  );
59
+ lines.push(` const { axiomQueryManager } = require('atmx-react');`);
54
60
  lines.push(
55
- ` console.warn("Manual send not implemented for React. Use useAxiomQuery.");`,
61
+ ` const def = (this as any)[\`get\${methodName.charAt(0).toUpperCase() + methodName.slice(1)}Def\`](args);`,
56
62
  );
63
+ lines.push(` axiomQueryManager.send(def, payload);`);
57
64
  lines.push(` }`);
58
65
  } else {
59
66
  lines.push(` setAuthToken(methodName: string, token: string) {`);