atmx-cli 0.34.0 → 0.35.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.
|
@@ -30,12 +30,16 @@ function generateSdk(multiIr) {
|
|
|
30
30
|
function generateEndpointMethod(ep, ns, pascalNs) {
|
|
31
31
|
const params = ep.parameters || [];
|
|
32
32
|
const argType = params.length > 0
|
|
33
|
-
? `{ ${params
|
|
33
|
+
? `{ ${params
|
|
34
|
+
.map((p) => {
|
|
35
|
+
// ✨ FIX: Make everything optional so DOM forms can fill in the blanks!
|
|
36
|
+
return `${(0, utils_1.camelCase)(p.name)}?: ${prefixModels((0, utils_1.mapTypeToTs)(p.typeRef, pascalNs))}`;
|
|
37
|
+
})
|
|
38
|
+
.join(", ")} }`
|
|
34
39
|
: "void";
|
|
35
|
-
// We generate a method that takes the typed arguments and returns the exact string ATMX expects
|
|
36
40
|
return `
|
|
37
41
|
/** RPC String Generator for <AxQuery> or <AxMutate> */
|
|
38
|
-
${(0, utils_1.camelCase)(ep.name)}(args${params.length > 0 ? "" : "
|
|
42
|
+
${(0, utils_1.camelCase)(ep.name)}(args${params.length > 0 ? "?" : ""}: ${argType} | void): string {
|
|
39
43
|
const argsStr = args && Object.keys(args).length > 0 ? JSON.stringify(args) : '';
|
|
40
44
|
return \`${ns}.${ep.name}(\${argsStr})\`;
|
|
41
45
|
}\n`;
|
package/package.json
CHANGED
|
@@ -44,13 +44,17 @@ function generateEndpointMethod(
|
|
|
44
44
|
|
|
45
45
|
const argType =
|
|
46
46
|
params.length > 0
|
|
47
|
-
? `{ ${params
|
|
47
|
+
? `{ ${params
|
|
48
|
+
.map((p) => {
|
|
49
|
+
// ✨ FIX: Make everything optional so DOM forms can fill in the blanks!
|
|
50
|
+
return `${camelCase(p.name)}?: ${prefixModels(mapTypeToTs(p.typeRef, pascalNs))}`;
|
|
51
|
+
})
|
|
52
|
+
.join(", ")} }`
|
|
48
53
|
: "void";
|
|
49
54
|
|
|
50
|
-
// We generate a method that takes the typed arguments and returns the exact string ATMX expects
|
|
51
55
|
return `
|
|
52
56
|
/** RPC String Generator for <AxQuery> or <AxMutate> */
|
|
53
|
-
${camelCase(ep.name)}(args${params.length > 0 ? "" : "
|
|
57
|
+
${camelCase(ep.name)}(args${params.length > 0 ? "?" : ""}: ${argType} | void): string {
|
|
54
58
|
const argsStr = args && Object.keys(args).length > 0 ? JSON.stringify(args) : '';
|
|
55
59
|
return \`${ns}.${ep.name}(\${argsStr})\`;
|
|
56
60
|
}\n`;
|