@xrmforge/typegen 0.5.1 → 0.7.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.
- package/LICENSE +21 -0
- package/MIGRATION.md +14 -3
- package/package.json +65 -65
package/LICENSE
ADDED
|
@@ -0,0 +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.
|
package/MIGRATION.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
How to convert legacy Dynamics 365 JavaScript to type-safe TypeScript with XrmForge.
|
|
4
4
|
|
|
5
|
+
## Breaking Changes in v0.7.0
|
|
6
|
+
|
|
7
|
+
- The `@xrmforge/typegen/helpers` subpath export has been removed.
|
|
8
|
+
- All browser-safe runtime code (`select`, `parseLookup`, `parseFormattedValue`,
|
|
9
|
+
`withProgress`, Xrm constants, Action/Function executors, `typedForm`) is now
|
|
10
|
+
in the new package `@xrmforge/helpers`.
|
|
11
|
+
- Update imports: `import { select } from '@xrmforge/typegen/helpers'` becomes
|
|
12
|
+
`import { select } from '@xrmforge/helpers'`.
|
|
13
|
+
- `@xrmforge/formhelpers` has been removed. `typedForm()` is now in
|
|
14
|
+
`@xrmforge/helpers`.
|
|
15
|
+
|
|
5
16
|
## Step 1: Initialize Project
|
|
6
17
|
|
|
7
18
|
```bash
|
|
@@ -86,8 +97,8 @@ export function onLoad(executionContext: Xrm.Events.EventContext): void {
|
|
|
86
97
|
var value = formContext.getAttribute("primarycontactid").getValue();
|
|
87
98
|
var id = value[0].id.replace("{","").replace("}","");
|
|
88
99
|
|
|
89
|
-
// After: use parseLookup from @xrmforge/
|
|
90
|
-
import { parseLookup } from '@xrmforge/
|
|
100
|
+
// After: use parseLookup from @xrmforge/helpers
|
|
101
|
+
import { parseLookup } from '@xrmforge/helpers';
|
|
91
102
|
const contact = parseLookup(form.getAttribute(Fields.PrimaryContactId));
|
|
92
103
|
if (contact) {
|
|
93
104
|
console.log(contact.id); // already clean GUID
|
|
@@ -102,7 +113,7 @@ Xrm.WebApi.retrieveMultipleRecords("account",
|
|
|
102
113
|
"?$select=name,revenue&$filter=statecode eq 0");
|
|
103
114
|
|
|
104
115
|
// After: use Fields enum for $select
|
|
105
|
-
import { select } from '@xrmforge/
|
|
116
|
+
import { select } from '@xrmforge/helpers';
|
|
106
117
|
import { AccountFields } from '../../typings/entities/account';
|
|
107
118
|
Xrm.WebApi.retrieveMultipleRecords("account",
|
|
108
119
|
`?$select=${select(AccountFields.Name, AccountFields.Revenue)}&$filter=statecode eq 0`);
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xrmforge/typegen",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript declaration generator for Dynamics 365 / Dataverse",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"dynamics-365",
|
|
7
|
-
"typescript",
|
|
8
|
-
"xrm",
|
|
9
|
-
"dataverse",
|
|
10
|
-
"type-generator",
|
|
11
|
-
"declaration-files"
|
|
12
|
-
],
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"author": "XrmForge Contributors",
|
|
15
|
-
"homepage": "https://github.com/juergenbeck/XrmForge/tree/main/packages/typegen",
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "https://github.com/juergenbeck/XrmForge.git",
|
|
19
|
-
"directory": "packages/typegen"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/juergenbeck/XrmForge/issues"
|
|
23
|
-
},
|
|
24
|
-
"type": "module",
|
|
25
|
-
"main": "./dist/index.js",
|
|
26
|
-
"types": "./dist/index.d.ts",
|
|
27
|
-
"exports": {
|
|
28
|
-
".": {
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"import": "./dist/index.js",
|
|
31
|
-
"default": "./dist/index.js"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"files": [
|
|
35
|
-
"dist",
|
|
36
|
-
"MIGRATION.md"
|
|
37
|
-
],
|
|
38
|
-
"sideEffects": false,
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xrmforge/typegen",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "TypeScript declaration generator for Dynamics 365 / Dataverse",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dynamics-365",
|
|
7
|
+
"typescript",
|
|
8
|
+
"xrm",
|
|
9
|
+
"dataverse",
|
|
10
|
+
"type-generator",
|
|
11
|
+
"declaration-files"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "XrmForge Contributors",
|
|
15
|
+
"homepage": "https://github.com/juergenbeck/XrmForge/tree/main/packages/typegen",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/juergenbeck/XrmForge.git",
|
|
19
|
+
"directory": "packages/typegen"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/juergenbeck/XrmForge/issues"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"MIGRATION.md"
|
|
37
|
+
],
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@azure/identity": "^4.6.0",
|
|
41
|
+
"fast-xml-parser": "^5.5.9"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^22.0.0",
|
|
45
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
46
|
+
"tsup": "^8.3.0",
|
|
47
|
+
"typescript": "^5.7.0",
|
|
48
|
+
"vitest": "^3.0.0"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@types/xrm": ">=9.0.0"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=20.0.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"dev": "tsup --watch",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest",
|
|
61
|
+
"typecheck": "tsc --noEmit",
|
|
62
|
+
"lint": "eslint src/",
|
|
63
|
+
"clean": "rm -rf dist"
|
|
64
|
+
}
|
|
65
|
+
}
|