@xrmforge/typegen 0.12.0 → 0.12.1
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.
- package/LICENSE +21 -21
- package/dist/index.d.ts +6 -7
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/docs/architecture/13-helpers.md +1 -1
- package/docs/architektur/13-helpers.md +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 XrmForge Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 XrmForge Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1209,7 +1209,7 @@ declare function disambiguateEnumMembers(members: Array<{
|
|
|
1209
1209
|
/**
|
|
1210
1210
|
* @xrmforge/typegen - Entity Interface Generator
|
|
1211
1211
|
*
|
|
1212
|
-
* Generates
|
|
1212
|
+
* Generates Dataverse entity interfaces as a flat ES module (.ts file).
|
|
1213
1213
|
* These interfaces represent the data types returned by the Web API.
|
|
1214
1214
|
*
|
|
1215
1215
|
* Output pattern (flat ES module, one file per entity):
|
|
@@ -1232,7 +1232,7 @@ interface EntityGeneratorOptions {
|
|
|
1232
1232
|
*
|
|
1233
1233
|
* @param info - Complete entity metadata (from MetadataClient.getEntityTypeInfo)
|
|
1234
1234
|
* @param options - Generator options
|
|
1235
|
-
* @returns TypeScript
|
|
1235
|
+
* @returns TypeScript source string (flat ES module)
|
|
1236
1236
|
*/
|
|
1237
1237
|
declare function generateEntityInterface(info: EntityTypeInfo, options?: EntityGeneratorOptions): string;
|
|
1238
1238
|
|
|
@@ -1448,9 +1448,8 @@ declare function generateEntityNamesEnum(entityNames: string[], _options?: Entit
|
|
|
1448
1448
|
/**
|
|
1449
1449
|
* @xrmforge/typegen - Action/Function Generator
|
|
1450
1450
|
*
|
|
1451
|
-
* Generates
|
|
1452
|
-
*
|
|
1453
|
-
* - .ts: Runtime modules that import factory functions from @xrmforge/helpers
|
|
1451
|
+
* Generates a flat ES module (.ts) per Custom API group: exported Param/Result
|
|
1452
|
+
* interfaces plus runtime executors that import factory functions from @xrmforge/helpers.
|
|
1454
1453
|
*
|
|
1455
1454
|
* Input: CustomApiTypeInfo[] (from fixture JSON or live Dataverse query)
|
|
1456
1455
|
* Output: Grouped by entity (bound) or "global" (unbound)
|
|
@@ -1483,7 +1482,7 @@ interface ActionGeneratorOptions {
|
|
|
1483
1482
|
declare function generateActionDeclarations(apis: CustomApiTypeInfo[], _isFunction: boolean, _entityName?: string, _options?: ActionGeneratorOptions): string;
|
|
1484
1483
|
/**
|
|
1485
1484
|
* Generate a single .ts file with both interfaces and runtime executors for a group of Custom APIs.
|
|
1486
|
-
*
|
|
1485
|
+
* Emits the Param/Result interfaces and the runtime executors together in one .ts file.
|
|
1487
1486
|
*
|
|
1488
1487
|
* @param apis - Custom APIs to generate
|
|
1489
1488
|
* @param isFunction - true for functions, false for actions
|
|
@@ -1515,7 +1514,7 @@ interface GenerateConfig {
|
|
|
1515
1514
|
entities: string[];
|
|
1516
1515
|
/** Solution unique names to discover entities automatically (merged with entities, deduplicated) */
|
|
1517
1516
|
solutionNames?: string[];
|
|
1518
|
-
/** Output directory for generated .
|
|
1517
|
+
/** Output directory for generated .ts files */
|
|
1519
1518
|
outputDir: string;
|
|
1520
1519
|
/** Label language configuration */
|
|
1521
1520
|
labelConfig: LabelConfig;
|
package/dist/index.js
CHANGED
|
@@ -1946,6 +1946,12 @@ function generateEntityOptionSets(picklistAttributes, entityLogicalName, options
|
|
|
1946
1946
|
return results;
|
|
1947
1947
|
}
|
|
1948
1948
|
|
|
1949
|
+
// src/generators/string-escape.ts
|
|
1950
|
+
function singleQuoted(value) {
|
|
1951
|
+
const escaped = value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\r/g, "\\r").replace(/\n/g, "\\n");
|
|
1952
|
+
return `'${escaped}'`;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1949
1955
|
// src/generators/form-generator.ts
|
|
1950
1956
|
var FORM_TYPE_QUICK_CREATE2 = 7;
|
|
1951
1957
|
function specialControlToXrmType(controlType) {
|
|
@@ -2076,7 +2082,7 @@ function generateFormInterface(form, entityLogicalName, attributeMap, options =
|
|
|
2076
2082
|
if (field.label) {
|
|
2077
2083
|
lines.push(` /** ${field.label} */`);
|
|
2078
2084
|
}
|
|
2079
|
-
lines.push(` ${field.enumMemberName} =
|
|
2085
|
+
lines.push(` ${field.enumMemberName} = ${singleQuoted(field.logicalName)},`);
|
|
2080
2086
|
}
|
|
2081
2087
|
lines.push("}");
|
|
2082
2088
|
lines.push("");
|
|
@@ -2103,7 +2109,7 @@ function generateFormInterface(form, entityLogicalName, attributeMap, options =
|
|
|
2103
2109
|
if (tab.label) {
|
|
2104
2110
|
lines.push(` /** ${tab.label} */`);
|
|
2105
2111
|
}
|
|
2106
|
-
lines.push(` ${tabMemberNames[i]} =
|
|
2112
|
+
lines.push(` ${tabMemberNames[i]} = ${singleQuoted(tab.name)},`);
|
|
2107
2113
|
}
|
|
2108
2114
|
lines.push("}");
|
|
2109
2115
|
lines.push("");
|
|
@@ -2128,7 +2134,7 @@ function generateFormInterface(form, entityLogicalName, attributeMap, options =
|
|
|
2128
2134
|
sCounter++;
|
|
2129
2135
|
}
|
|
2130
2136
|
usedSectionMembers.add(sectionMember);
|
|
2131
|
-
lines.push(` ${sectionMember} =
|
|
2137
|
+
lines.push(` ${sectionMember} = ${singleQuoted(section.name)},`);
|
|
2132
2138
|
}
|
|
2133
2139
|
lines.push("}");
|
|
2134
2140
|
lines.push("");
|
|
@@ -2153,7 +2159,7 @@ function generateFormInterface(form, entityLogicalName, attributeMap, options =
|
|
|
2153
2159
|
usedMembers.add(member);
|
|
2154
2160
|
const label = sg.targetEntityType ? `Subgrid: ${sg.targetEntityType}` : `Subgrid`;
|
|
2155
2161
|
lines.push(` /** ${label} */`);
|
|
2156
|
-
lines.push(` ${member} =
|
|
2162
|
+
lines.push(` ${member} = ${singleQuoted(sg.id)},`);
|
|
2157
2163
|
}
|
|
2158
2164
|
lines.push("}");
|
|
2159
2165
|
lines.push("");
|
|
@@ -2173,7 +2179,7 @@ function generateFormInterface(form, entityLogicalName, attributeMap, options =
|
|
|
2173
2179
|
}
|
|
2174
2180
|
usedMembers.add(member);
|
|
2175
2181
|
lines.push(` /** Quick View */`);
|
|
2176
|
-
lines.push(` ${member} =
|
|
2182
|
+
lines.push(` ${member} = ${singleQuoted(qv.id)},`);
|
|
2177
2183
|
}
|
|
2178
2184
|
lines.push("}");
|
|
2179
2185
|
lines.push("");
|