atmx-cli 0.64.0 → 0.66.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.
@@ -15,6 +15,8 @@ function generateSdk(multiIr, isReact = false) {
15
15
  }
16
16
  for (const [ns, ir] of Object.entries(multiIr)) {
17
17
  const camelNs = (0, utils_1.camelCase)(ns);
18
+ // 👉 THIS LINE WAS MISSING IN THE PREVIOUS STEP!
19
+ lines.push(`export const ${camelNs}Module = {`);
18
20
  lines.push(` axiom: {`);
19
21
  if (isReact) {
20
22
  lines.push(` setAuthToken(methodName: string, token: string) {`);
@@ -28,6 +30,9 @@ function generateSdk(multiIr, isReact = false) {
28
30
  lines.push(` },`);
29
31
  lines.push(` disconnect(methodName: string, args?: Record<string, any>) {`);
30
32
  lines.push(` console.warn("Manual disconnect not implemented for React. Unmount the component.");`);
33
+ lines.push(` },`);
34
+ lines.push(` send(methodName: string, payload: any, args?: Record<string, any>) {`);
35
+ lines.push(` console.warn("Manual send not implemented for React. Use useAxiomQuery.");`);
31
36
  lines.push(` }`);
32
37
  }
33
38
  else {
@@ -44,6 +49,10 @@ function generateSdk(multiIr, isReact = false) {
44
49
  lines.push(` disconnect(methodName: string, args?: Record<string, any>) {`);
45
50
  lines.push(` const argsStr = args && Object.keys(args).length > 0 ? JSON.stringify(args) : '';`);
46
51
  lines.push(` (window as any).atmx?.disconnect(\`${ns}.\${methodName}(\${argsStr})\`);`);
52
+ lines.push(` },`);
53
+ lines.push(` send(methodName: string, payload: any, args?: Record<string, any>) {`);
54
+ lines.push(` const argsStr = args && Object.keys(args).length > 0 ? JSON.stringify(args) : '';`);
55
+ lines.push(` (window as any).atmx?.send(\`${ns}.\${methodName}(\${argsStr})\`, payload);`);
47
56
  lines.push(` }`);
48
57
  }
49
58
  lines.push(` },`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmx-cli",
3
- "version": "0.64.0",
3
+ "version": "0.66.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -22,6 +22,10 @@ export function generateSdk(
22
22
 
23
23
  for (const [ns, ir] of Object.entries(multiIr)) {
24
24
  const camelNs = camelCase(ns);
25
+
26
+ // 👉 THIS LINE WAS MISSING IN THE PREVIOUS STEP!
27
+ lines.push(`export const ${camelNs}Module = {`);
28
+
25
29
  lines.push(` axiom: {`);
26
30
  if (isReact) {
27
31
  lines.push(` setAuthToken(methodName: string, token: string) {`);
@@ -43,6 +47,13 @@ export function generateSdk(
43
47
  lines.push(
44
48
  ` console.warn("Manual disconnect not implemented for React. Unmount the component.");`,
45
49
  );
50
+ lines.push(` },`);
51
+ lines.push(
52
+ ` send(methodName: string, payload: any, args?: Record<string, any>) {`,
53
+ );
54
+ lines.push(
55
+ ` console.warn("Manual send not implemented for React. Use useAxiomQuery.");`,
56
+ );
46
57
  lines.push(` }`);
47
58
  } else {
48
59
  lines.push(` setAuthToken(methodName: string, token: string) {`);
@@ -74,6 +85,16 @@ export function generateSdk(
74
85
  lines.push(
75
86
  ` (window as any).atmx?.disconnect(\`${ns}.\${methodName}(\${argsStr})\`);`,
76
87
  );
88
+ lines.push(` },`);
89
+ lines.push(
90
+ ` send(methodName: string, payload: any, args?: Record<string, any>) {`,
91
+ );
92
+ lines.push(
93
+ ` const argsStr = args && Object.keys(args).length > 0 ? JSON.stringify(args) : '';`,
94
+ );
95
+ lines.push(
96
+ ` (window as any).atmx?.send(\`${ns}.\${methodName}(\${argsStr})\`, payload);`,
97
+ );
77
98
  lines.push(` }`);
78
99
  }
79
100
  lines.push(` },`);