@khester/create-dynamics-app 1.1.0 → 2.1.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/README.md +74 -0
- package/dist/artifacts/registry.d.ts +18 -0
- package/dist/artifacts/registry.d.ts.map +1 -0
- package/dist/artifacts/registry.js +340 -0
- package/dist/artifacts/registry.js.map +1 -0
- package/dist/artifacts/types.d.ts +122 -0
- package/dist/artifacts/types.d.ts.map +1 -0
- package/dist/artifacts/types.js +7 -0
- package/dist/artifacts/types.js.map +1 -0
- package/dist/artifacts/validators.d.ts +16 -0
- package/dist/artifacts/validators.d.ts.map +1 -0
- package/dist/artifacts/validators.js +45 -0
- package/dist/artifacts/validators.js.map +1 -0
- package/dist/fromDesign.d.ts +5 -0
- package/dist/fromDesign.d.ts.map +1 -0
- package/dist/fromDesign.js +98 -0
- package/dist/fromDesign.js.map +1 -0
- package/dist/index.js +129 -177
- package/dist/index.js.map +1 -1
- package/dist/injectDevTools.d.ts +28 -0
- package/dist/injectDevTools.d.ts.map +1 -0
- package/dist/injectDevTools.js +148 -0
- package/dist/injectDevTools.js.map +1 -0
- package/dist/scaffold.d.ts +48 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +180 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/templatePlan.d.ts +3 -0
- package/dist/templatePlan.d.ts.map +1 -0
- package/dist/templatePlan.js +43 -0
- package/dist/templatePlan.js.map +1 -0
- package/dist/utils/copyTemplate.d.ts +13 -1
- package/dist/utils/copyTemplate.d.ts.map +1 -1
- package/dist/utils/copyTemplate.js +98 -4
- package/dist/utils/copyTemplate.js.map +1 -1
- package/dist/utils/updatePackageJson.d.ts +11 -1
- package/dist/utils/updatePackageJson.d.ts.map +1 -1
- package/dist/utils/updatePackageJson.js +12 -10
- package/dist/utils/updatePackageJson.js.map +1 -1
- package/package.json +10 -7
- package/templates/_shared/dev-tools/auth/get-token.js +72 -0
- package/templates/_shared/dev-tools/dev/mock-xrm.js +42 -0
- package/templates/_shared/dev-tools/metadata-sync/index.js +152 -0
- package/templates/_shared/dev-tools/smoke/test-retrieve.js +44 -0
- package/templates/dialog-form/README.md +27 -0
- package/templates/dialog-form/_variants/App.v8.tsx +39 -0
- package/templates/dialog-form/_variants/App.v9.tsx +41 -0
- package/templates/dialog-form/gitignore +5 -0
- package/templates/dialog-form/package.json +27 -0
- package/templates/dialog-form/public/index.html +11 -0
- package/templates/dialog-form/src/index.tsx +10 -0
- package/templates/dialog-form/src/services/dataverse.ts +30 -0
- package/templates/dialog-form/tsconfig.json +15 -0
- package/templates/dialog-form/webpack.config.js +17 -0
- package/templates/grid-customizer/README.md +28 -0
- package/templates/grid-customizer/gitignore +4 -0
- package/templates/grid-customizer/package.json +25 -0
- package/templates/grid-customizer/src/GridCustomizer.ts +28 -0
- package/templates/grid-customizer/src/cell-renderers.tsx +35 -0
- package/templates/grid-customizer/src/index.ts +4 -0
- package/templates/grid-customizer/src/types/grid-types.ts +30 -0
- package/templates/grid-customizer/src/utils/color-utils.ts +24 -0
- package/templates/grid-customizer/tsconfig.json +15 -0
- package/templates/grid-customizer/webpack.config.js +17 -0
- package/templates/pcf-dataset/ControlManifest.Input.xml +16 -0
- package/templates/pcf-dataset/README.md +21 -0
- package/templates/pcf-dataset/gitignore +5 -0
- package/templates/pcf-dataset/index.ts +39 -0
- package/templates/pcf-dataset/package.json +30 -0
- package/templates/pcf-dataset/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-dataset/tsconfig.json +8 -0
- package/templates/pcf-dataset/{{componentName}}Component.tsx +39 -0
- package/templates/pcf-field/ControlManifest.Input.xml +17 -0
- package/templates/pcf-field/README.md +95 -0
- package/templates/pcf-field/_variants/ValueInput.boolean.tsx +24 -0
- package/templates/pcf-field/_variants/ValueInput.date.tsx +27 -0
- package/templates/pcf-field/_variants/ValueInput.number.tsx +35 -0
- package/templates/pcf-field/_variants/ValueInput.text.tsx +27 -0
- package/templates/pcf-field/gitignore +5 -0
- package/templates/pcf-field/index.ts +61 -0
- package/templates/pcf-field/package.json +30 -0
- package/templates/pcf-field/strings/{{componentName}}.1033.resx +47 -0
- package/templates/pcf-field/tsconfig.json +8 -0
- package/templates/pcf-field/{{componentName}}Component.tsx +35 -0
- package/templates/power-pages-starter/gitignore +5 -0
- package/templates/react-custom-page/gitignore +5 -0
- package/templates/{dynamics-365-starter → react-custom-page}/package.json +3 -3
- package/templates/react-custom-page/tools/metadata-sync/index.js +152 -0
- package/templates/static-web-app/README.md +36 -0
- package/templates/static-web-app/_variants/App.v8.tsx +32 -0
- package/templates/static-web-app/_variants/App.v9.tsx +31 -0
- package/templates/static-web-app/api/host.json +12 -0
- package/templates/static-web-app/api/package.json +19 -0
- package/templates/static-web-app/api/src/functions/hello.ts +16 -0
- package/templates/static-web-app/api/tsconfig.json +14 -0
- package/templates/static-web-app/frontend/index.html +12 -0
- package/templates/static-web-app/frontend/package.json +23 -0
- package/templates/static-web-app/frontend/src/index.tsx +8 -0
- package/templates/static-web-app/frontend/tsconfig.json +16 -0
- package/templates/static-web-app/frontend/vite.config.ts +13 -0
- package/templates/static-web-app/gitignore +8 -0
- package/templates/static-web-app/package.json +15 -0
- package/templates/static-web-app/staticwebapp.config.json +7 -0
- package/templates/teams-app/README.md +27 -0
- package/templates/teams-app/_variants/graph.off.ts +7 -0
- package/templates/teams-app/_variants/graph.on.ts +22 -0
- package/templates/teams-app/appPackage/manifest.json +26 -0
- package/templates/teams-app/gitignore +5 -0
- package/templates/teams-app/index.html +12 -0
- package/templates/teams-app/package.json +26 -0
- package/templates/teams-app/src/App.tsx +25 -0
- package/templates/teams-app/src/index.tsx +8 -0
- package/templates/teams-app/tsconfig.json +16 -0
- package/templates/teams-app/vite.config.ts +9 -0
- package/templates/web-resource/README.md +39 -0
- package/templates/web-resource/_variants/App.v8.tsx +29 -0
- package/templates/web-resource/_variants/App.v9.tsx +28 -0
- package/templates/web-resource/gitignore +5 -0
- package/templates/web-resource/package.json +27 -0
- package/templates/web-resource/public/index.html +11 -0
- package/templates/web-resource/src/index.tsx +10 -0
- package/templates/web-resource/src/services/dataverse.ts +30 -0
- package/templates/web-resource/tsconfig.json +15 -0
- package/templates/web-resource/webpack.config.js +17 -0
- package/dist/utils/consultingHelpers.d.ts +0 -13
- package/dist/utils/consultingHelpers.d.ts.map +0 -1
- package/dist/utils/consultingHelpers.js +0 -569
- package/dist/utils/consultingHelpers.js.map +0 -1
- package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +0 -302
- package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +0 -305
- package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +0 -507
- package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +0 -372
- package/templates/dynamics-365-starter/deployment/pipelines/README.md +0 -375
- package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +0 -330
- package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +0 -422
- package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +0 -636
- package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +0 -417
- package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +0 -582
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +0 -486
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +0 -567
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +0 -703
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +0 -671
- package/templates/dynamics-365-starter/docs/team-standards/README.md +0 -273
- package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +0 -577
- package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +0 -359
- package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +0 -700
- package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +0 -736
- package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +0 -727
- package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +0 -758
- package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +0 -878
- package/templates/dynamics-365-starter/src/client-project-template/README.md +0 -234
- package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +0 -114
- package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +0 -186
- package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +0 -667
- package/templates/dynamics-365-starter/src/examples/README.md +0 -52
- package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +0 -625
- package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +0 -545
- package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +0 -722
- package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +0 -662
- package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +0 -519
- package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +0 -456
- package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +0 -406
- package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +0 -578
- package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +0 -629
- package/templates/dynamics-365-starter/tools/entity-generator/index.js +0 -168
- package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +0 -124
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +0 -283
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +0 -275
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +0 -204
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +0 -413
- package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +0 -250
- package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +0 -410
- package/templates/dynamics-365-starter/tools/metadata-sync/index.js +0 -512
- package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +0 -675
- /package/templates/{dynamics-365-starter → react-custom-page}/README.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/deployment/README.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/ARCHITECTURE_OVERVIEW.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/BEST_PRACTICES.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/docs/MIGRATION_GUIDE.md +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/public/index.html +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/scripts/custom-build.js +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountForm.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/AccountManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactForm.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/ContactManagement.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LogDialog.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingContext.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingDebugPanel.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/LoggingProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/components/Logging/logger.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/account.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/constants/contact.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/index.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Account.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/BaseEntity.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/models/Contact.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/ContactControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/pcf/MultiEntityControlWrapper.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/providers/DynamicsProvider.tsx +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/MockApiService.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/ServiceFactory.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/services/XrmApiService.ts +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/src/styles/index.css +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/tsconfig.json +0 -0
- /package/templates/{dynamics-365-starter → react-custom-page}/webpack.config.js +0 -0
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { program } = require('commander');
|
|
6
|
-
|
|
7
|
-
// Entity Generator CLI Tool for Dynamics 365
|
|
8
|
-
// Generates complete entity stack from templates
|
|
9
|
-
|
|
10
|
-
program
|
|
11
|
-
.name('entity-generator')
|
|
12
|
-
.description('Generate complete entity stack for Dynamics 365')
|
|
13
|
-
.version('1.0.0');
|
|
14
|
-
|
|
15
|
-
program
|
|
16
|
-
.command('generate')
|
|
17
|
-
.description('Generate entity files')
|
|
18
|
-
.requiredOption(
|
|
19
|
-
'-e, --entity <name>',
|
|
20
|
-
'Entity logical name (e.g., customentity)'
|
|
21
|
-
)
|
|
22
|
-
.requiredOption(
|
|
23
|
-
'-d, --display-name <name>',
|
|
24
|
-
'Entity display name (e.g., "Custom Entity")'
|
|
25
|
-
)
|
|
26
|
-
.option(
|
|
27
|
-
'-p, --plural <name>',
|
|
28
|
-
'Entity plural name (defaults to entity + "s")'
|
|
29
|
-
)
|
|
30
|
-
.option('--output <path>', 'Output directory (defaults to src/)')
|
|
31
|
-
.action(generateEntity);
|
|
32
|
-
|
|
33
|
-
async function generateEntity(options) {
|
|
34
|
-
const { entity, displayName, plural, output } = options;
|
|
35
|
-
|
|
36
|
-
console.log(`🚀 Generating entity stack for: ${displayName} (${entity})`);
|
|
37
|
-
|
|
38
|
-
const config = {
|
|
39
|
-
entityName: entity.toLowerCase(),
|
|
40
|
-
entityNamePascal: toPascalCase(entity),
|
|
41
|
-
displayName,
|
|
42
|
-
pluralName: plural || entity.toLowerCase() + 's',
|
|
43
|
-
pluralNamePascal: toPascalCase(plural || entity + 's'),
|
|
44
|
-
outputDir: output || 'src',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
await generateEntityFiles(config);
|
|
49
|
-
console.log('✅ Entity stack generated successfully!');
|
|
50
|
-
console.log('\n📁 Generated files:');
|
|
51
|
-
console.log(` • src/models/${config.entityNamePascal}.ts`);
|
|
52
|
-
console.log(` • src/constants/${config.entityName}.ts`);
|
|
53
|
-
console.log(` • src/components/${config.entityNamePascal}Management.tsx`);
|
|
54
|
-
console.log(` • src/components/${config.entityNamePascal}Management.css`);
|
|
55
|
-
console.log(` • src/components/${config.entityNamePascal}Form.tsx`);
|
|
56
|
-
console.log(` • src/components/${config.entityNamePascal}Form.css`);
|
|
57
|
-
console.log('\n🎯 Next steps:');
|
|
58
|
-
console.log(' 1. Update your D365 field constants in the constants file');
|
|
59
|
-
console.log(' 2. Add the new components to your main application');
|
|
60
|
-
console.log(' 3. Run npm run build to compile');
|
|
61
|
-
} catch (error) {
|
|
62
|
-
console.error('❌ Error generating entity:', error.message);
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function generateEntityFiles(config) {
|
|
68
|
-
const templatesDir = path.join(__dirname, 'templates');
|
|
69
|
-
const projectRoot = findProjectRoot();
|
|
70
|
-
const outputDir = path.join(projectRoot, config.outputDir);
|
|
71
|
-
|
|
72
|
-
// Ensure output directories exist
|
|
73
|
-
ensureDirectoryExists(path.join(outputDir, 'models'));
|
|
74
|
-
ensureDirectoryExists(path.join(outputDir, 'constants'));
|
|
75
|
-
ensureDirectoryExists(path.join(outputDir, 'components'));
|
|
76
|
-
|
|
77
|
-
// Generate model file
|
|
78
|
-
await generateFromTemplate(
|
|
79
|
-
path.join(templatesDir, 'model.template.ts'),
|
|
80
|
-
path.join(outputDir, 'models', `${config.entityNamePascal}.ts`),
|
|
81
|
-
config
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
// Generate constants file
|
|
85
|
-
await generateFromTemplate(
|
|
86
|
-
path.join(templatesDir, 'constants.template.ts'),
|
|
87
|
-
path.join(outputDir, 'constants', `${config.entityName}.ts`),
|
|
88
|
-
config
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
// Generate management component
|
|
92
|
-
await generateFromTemplate(
|
|
93
|
-
path.join(templatesDir, 'management.template.tsx'),
|
|
94
|
-
path.join(
|
|
95
|
-
outputDir,
|
|
96
|
-
'components',
|
|
97
|
-
`${config.entityNamePascal}Management.tsx`
|
|
98
|
-
),
|
|
99
|
-
config
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
// Generate management CSS
|
|
103
|
-
await generateFromTemplate(
|
|
104
|
-
path.join(templatesDir, 'management.template.css'),
|
|
105
|
-
path.join(
|
|
106
|
-
outputDir,
|
|
107
|
-
'components',
|
|
108
|
-
`${config.entityNamePascal}Management.css`
|
|
109
|
-
),
|
|
110
|
-
config
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
// Generate form component
|
|
114
|
-
await generateFromTemplate(
|
|
115
|
-
path.join(templatesDir, 'form.template.tsx'),
|
|
116
|
-
path.join(outputDir, 'components', `${config.entityNamePascal}Form.tsx`),
|
|
117
|
-
config
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// Generate form CSS
|
|
121
|
-
await generateFromTemplate(
|
|
122
|
-
path.join(templatesDir, 'form.template.css'),
|
|
123
|
-
path.join(outputDir, 'components', `${config.entityNamePascal}Form.css`),
|
|
124
|
-
config
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
async function generateFromTemplate(templatePath, outputPath, config) {
|
|
129
|
-
const template = fs.readFileSync(templatePath, 'utf8');
|
|
130
|
-
const generated = replaceTemplateVariables(template, config);
|
|
131
|
-
fs.writeFileSync(outputPath, generated);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function replaceTemplateVariables(template, config) {
|
|
135
|
-
return template
|
|
136
|
-
.replace(/\{\{entityName\}\}/g, config.entityName)
|
|
137
|
-
.replace(/\{\{entityNamePascal\}\}/g, config.entityNamePascal)
|
|
138
|
-
.replace(/\{\{displayName\}\}/g, config.displayName)
|
|
139
|
-
.replace(/\{\{pluralName\}\}/g, config.pluralName)
|
|
140
|
-
.replace(/\{\{pluralNamePascal\}\}/g, config.pluralNamePascal);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function toPascalCase(str) {
|
|
144
|
-
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function ensureDirectoryExists(dirPath) {
|
|
148
|
-
if (!fs.existsSync(dirPath)) {
|
|
149
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function findProjectRoot() {
|
|
154
|
-
let dir = process.cwd();
|
|
155
|
-
while (dir !== '/') {
|
|
156
|
-
if (fs.existsSync(path.join(dir, 'package.json'))) {
|
|
157
|
-
return dir;
|
|
158
|
-
}
|
|
159
|
-
dir = path.dirname(dir);
|
|
160
|
-
}
|
|
161
|
-
return process.cwd();
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (require.main === module) {
|
|
165
|
-
program.parse();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
module.exports = { generateEntity };
|
package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* {{displayName}} Entity Constants
|
|
3
|
-
* Generated by Entity Generator
|
|
4
|
-
*
|
|
5
|
-
* Update these constants with actual field names from your Dynamics 365 entity
|
|
6
|
-
*/
|
|
7
|
-
// Replace 'SampleEntity' with your actual entity PascalCase name during template processing
|
|
8
|
-
export class SampleEntityConstants {
|
|
9
|
-
/** Entity logical name */
|
|
10
|
-
public static readonly EntityLogicalName: string = "{{entityName}}";
|
|
11
|
-
|
|
12
|
-
/** Entity collection name for Web API */
|
|
13
|
-
public static readonly EntityCollectionName: string = "{{pluralName}}";
|
|
14
|
-
|
|
15
|
-
/** Primary ID attribute */
|
|
16
|
-
public static readonly PrimaryIdAttribute: string = "{{entityName}}id";
|
|
17
|
-
|
|
18
|
-
/** Primary name attribute */
|
|
19
|
-
public static readonly PrimaryNameAttribute: string = "{{entityName}}_name";
|
|
20
|
-
|
|
21
|
-
// System fields
|
|
22
|
-
/** Type: DateTime, ReadOnly: true */
|
|
23
|
-
public static readonly CreatedOn: string = "createdon";
|
|
24
|
-
|
|
25
|
-
/** Type: DateTime, ReadOnly: true */
|
|
26
|
-
public static readonly ModifiedOn: string = "modifiedon";
|
|
27
|
-
|
|
28
|
-
/** Type: Lookup, ReadOnly: true */
|
|
29
|
-
public static readonly CreatedBy: string = "createdby";
|
|
30
|
-
|
|
31
|
-
/** Type: Lookup, ReadOnly: true */
|
|
32
|
-
public static readonly ModifiedBy: string = "modifiedby";
|
|
33
|
-
|
|
34
|
-
/** Type: Lookup, ReadOnly: true */
|
|
35
|
-
public static readonly OwnerId: string = "ownerid";
|
|
36
|
-
|
|
37
|
-
/** Type: Picklist, ReadOnly: true */
|
|
38
|
-
public static readonly StateCode: string = "statecode";
|
|
39
|
-
|
|
40
|
-
/** Type: Picklist, ReadOnly: true */
|
|
41
|
-
public static readonly StatusCode: string = "statuscode";
|
|
42
|
-
|
|
43
|
-
// Custom fields - Update these with your actual field names
|
|
44
|
-
/** Type: String, RequiredLevel: ApplicationRequired, MaxLength: 100 */
|
|
45
|
-
public static readonly Description: string = "{{entityName}}_description";
|
|
46
|
-
|
|
47
|
-
/** Type: DateTime, RequiredLevel: None */
|
|
48
|
-
public static readonly DueDate: string = "{{entityName}}_duedate";
|
|
49
|
-
|
|
50
|
-
/** Type: Picklist, RequiredLevel: None */
|
|
51
|
-
public static readonly Priority: string = "{{entityName}}_priority";
|
|
52
|
-
|
|
53
|
-
/** Type: Lookup, RequiredLevel: None, Target: contact */
|
|
54
|
-
public static readonly ContactId: string = "{{entityName}}_contactid";
|
|
55
|
-
|
|
56
|
-
/** Type: Lookup, RequiredLevel: None, Target: account */
|
|
57
|
-
public static readonly AccountId: string = "{{entityName}}_accountid";
|
|
58
|
-
|
|
59
|
-
/** Type: Money, RequiredLevel: None */
|
|
60
|
-
public static readonly Amount: string = "{{entityName}}_amount";
|
|
61
|
-
|
|
62
|
-
/** Type: Boolean, RequiredLevel: None */
|
|
63
|
-
public static readonly IsActive: string = "{{entityName}}_isactive";
|
|
64
|
-
|
|
65
|
-
// Option Set Values - Update these with your actual option set values
|
|
66
|
-
public static readonly PriorityOptions = {
|
|
67
|
-
Low: 1,
|
|
68
|
-
Medium: 2,
|
|
69
|
-
High: 3,
|
|
70
|
-
Critical: 4
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
public static readonly StateCodeOptions = {
|
|
74
|
-
Active: 0,
|
|
75
|
-
Inactive: 1
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
public static readonly StatusCodeOptions = {
|
|
79
|
-
Active: 1,
|
|
80
|
-
Inactive: 2
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// Field display names for UI
|
|
84
|
-
public static readonly FieldDisplayNames = {
|
|
85
|
-
[this.PrimaryNameAttribute]: "Name",
|
|
86
|
-
[this.Description]: "Description",
|
|
87
|
-
[this.DueDate]: "Due Date",
|
|
88
|
-
[this.Priority]: "Priority",
|
|
89
|
-
[this.ContactId]: "Contact",
|
|
90
|
-
[this.AccountId]: "Account",
|
|
91
|
-
[this.Amount]: "Amount",
|
|
92
|
-
[this.IsActive]: "Is Active",
|
|
93
|
-
[this.CreatedOn]: "Created On",
|
|
94
|
-
[this.ModifiedOn]: "Modified On",
|
|
95
|
-
[this.CreatedBy]: "Created By",
|
|
96
|
-
[this.ModifiedBy]: "Modified By"
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// Required fields
|
|
100
|
-
public static readonly RequiredFields = [
|
|
101
|
-
this.PrimaryNameAttribute
|
|
102
|
-
];
|
|
103
|
-
|
|
104
|
-
// Fields for list view
|
|
105
|
-
public static readonly ListViewColumns = [
|
|
106
|
-
this.PrimaryNameAttribute,
|
|
107
|
-
this.Description,
|
|
108
|
-
this.Priority,
|
|
109
|
-
this.DueDate,
|
|
110
|
-
this.CreatedOn
|
|
111
|
-
];
|
|
112
|
-
|
|
113
|
-
// Fields for form view
|
|
114
|
-
public static readonly FormFields = [
|
|
115
|
-
this.PrimaryNameAttribute,
|
|
116
|
-
this.Description,
|
|
117
|
-
this.Priority,
|
|
118
|
-
this.DueDate,
|
|
119
|
-
this.ContactId,
|
|
120
|
-
this.AccountId,
|
|
121
|
-
this.Amount,
|
|
122
|
-
this.IsActive
|
|
123
|
-
];
|
|
124
|
-
}
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
/* {{displayName}} Form Component Styles */
|
|
2
|
-
/* Generated by Entity Generator */
|
|
3
|
-
/* Replace 'sample-entity' with your actual entity name during template processing */
|
|
4
|
-
|
|
5
|
-
.sample-entity-form {
|
|
6
|
-
padding: 24px 0;
|
|
7
|
-
max-width: 600px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.sample-entity-form-section {
|
|
11
|
-
margin-bottom: 24px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.sample-entity-form-section-title {
|
|
15
|
-
font-size: 16px;
|
|
16
|
-
font-weight: 600;
|
|
17
|
-
color: #323130;
|
|
18
|
-
margin: 0 0 16px 0;
|
|
19
|
-
border-bottom: 1px solid #edebe9;
|
|
20
|
-
padding-bottom: 8px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.sample-entity-form-field {
|
|
24
|
-
margin-bottom: 16px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.sample-entity-form-errors {
|
|
28
|
-
margin: 0;
|
|
29
|
-
padding: 0;
|
|
30
|
-
list-style: none;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.sample-entity-form-errors li {
|
|
34
|
-
margin: 4px 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Field-specific styling */
|
|
38
|
-
.sample-entity-form .ms-TextField {
|
|
39
|
-
width: 100%;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.sample-entity-form .ms-TextField-fieldGroup {
|
|
43
|
-
border-radius: 2px;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.sample-entity-form .ms-TextField-field {
|
|
47
|
-
padding: 8px 12px;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.sample-entity-form .ms-TextField-field:focus {
|
|
52
|
-
border-color: #0078d4;
|
|
53
|
-
box-shadow: 0 0 0 1px #0078d4;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/* Dropdown styling */
|
|
57
|
-
.sample-entity-form .ms-Dropdown {
|
|
58
|
-
width: 100%;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.sample-entity-form .ms-Dropdown-title {
|
|
62
|
-
padding: 8px 12px;
|
|
63
|
-
font-size: 14px;
|
|
64
|
-
border-radius: 2px;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.sample-entity-form .ms-Dropdown-title:focus {
|
|
68
|
-
border-color: #0078d4;
|
|
69
|
-
box-shadow: 0 0 0 1px #0078d4;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* DatePicker styling */
|
|
73
|
-
.sample-entity-form .ms-DatePicker {
|
|
74
|
-
width: 100%;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.sample-entity-form .ms-DatePicker-input {
|
|
78
|
-
width: 100%;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.sample-entity-form .ms-DatePicker-input .ms-TextField-field {
|
|
82
|
-
padding: 8px 12px;
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* Checkbox styling */
|
|
87
|
-
.sample-entity-form .ms-Checkbox {
|
|
88
|
-
margin-top: 8px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.sample-entity-form .ms-Checkbox-label {
|
|
92
|
-
font-size: 14px;
|
|
93
|
-
color: #323130;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.sample-entity-form .ms-Checkbox-checkbox {
|
|
97
|
-
border-radius: 2px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.sample-entity-form .ms-Checkbox-checkbox:checked {
|
|
101
|
-
background-color: #0078d4;
|
|
102
|
-
border-color: #0078d4;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/* Button styling */
|
|
106
|
-
.sample-entity-form .ms-Button {
|
|
107
|
-
min-width: 80px;
|
|
108
|
-
height: 32px;
|
|
109
|
-
border-radius: 2px;
|
|
110
|
-
font-size: 14px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.sample-entity-form .ms-Button--primary {
|
|
114
|
-
background-color: #0078d4;
|
|
115
|
-
border-color: #0078d4;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.sample-entity-form .ms-Button--primary:hover {
|
|
119
|
-
background-color: #106ebe;
|
|
120
|
-
border-color: #106ebe;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.sample-entity-form .ms-Button--default {
|
|
124
|
-
background-color: #ffffff;
|
|
125
|
-
border-color: #8a8886;
|
|
126
|
-
color: #323130;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.sample-entity-form .ms-Button--default:hover {
|
|
130
|
-
background-color: #f3f2f1;
|
|
131
|
-
border-color: #8a8886;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* Required field indicators */
|
|
135
|
-
.sample-entity-form .ms-Label .ms-Label-required {
|
|
136
|
-
color: #d13438;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* Error states */
|
|
140
|
-
.sample-entity-form .ms-TextField--hasError .ms-TextField-fieldGroup {
|
|
141
|
-
border-color: #d13438;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.sample-entity-form .ms-TextField--hasError .ms-TextField-field:focus {
|
|
145
|
-
border-color: #d13438;
|
|
146
|
-
box-shadow: 0 0 0 1px #d13438;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.sample-entity-form .ms-Dropdown--hasError .ms-Dropdown-title {
|
|
150
|
-
border-color: #d13438;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/* Disabled states */
|
|
154
|
-
.sample-entity-form .ms-TextField--disabled .ms-TextField-field {
|
|
155
|
-
background-color: #f3f2f1;
|
|
156
|
-
color: #a19f9d;
|
|
157
|
-
cursor: not-allowed;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.sample-entity-form .ms-Dropdown--disabled .ms-Dropdown-title {
|
|
161
|
-
background-color: #f3f2f1;
|
|
162
|
-
color: #a19f9d;
|
|
163
|
-
cursor: not-allowed;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.sample-entity-form .ms-Checkbox--disabled .ms-Checkbox-label {
|
|
167
|
-
color: #a19f9d;
|
|
168
|
-
cursor: not-allowed;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.sample-entity-form .ms-Button:disabled {
|
|
172
|
-
background-color: #f3f2f1;
|
|
173
|
-
border-color: #c8c6c4;
|
|
174
|
-
color: #a19f9d;
|
|
175
|
-
cursor: not-allowed;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* Responsive design */
|
|
179
|
-
@media (max-width: 768px) {
|
|
180
|
-
.sample-entity-form {
|
|
181
|
-
padding: 16px 0;
|
|
182
|
-
max-width: 100%;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.sample-entity-form-section-title {
|
|
186
|
-
font-size: 14px;
|
|
187
|
-
margin-bottom: 12px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.sample-entity-form-field {
|
|
191
|
-
margin-bottom: 12px;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.sample-entity-form .ms-TextField-field,
|
|
195
|
-
.sample-entity-form .ms-Dropdown-title,
|
|
196
|
-
.sample-entity-form .ms-DatePicker-input .ms-TextField-field {
|
|
197
|
-
padding: 6px 10px;
|
|
198
|
-
font-size: 13px;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/* Focus management */
|
|
203
|
-
.sample-entity-form .ms-TextField-field:focus,
|
|
204
|
-
.sample-entity-form .ms-Dropdown-title:focus,
|
|
205
|
-
.sample-entity-form .ms-DatePicker-input .ms-TextField-field:focus {
|
|
206
|
-
outline: none;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* High contrast mode support */
|
|
210
|
-
@media (prefers-contrast: high) {
|
|
211
|
-
.sample-entity-form .ms-TextField-fieldGroup,
|
|
212
|
-
.sample-entity-form .ms-Dropdown-title {
|
|
213
|
-
border-width: 2px;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.sample-entity-form .ms-Button {
|
|
217
|
-
border-width: 2px;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/* Print styles */
|
|
222
|
-
@media print {
|
|
223
|
-
.sample-entity-form .ms-Button {
|
|
224
|
-
display: none;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.sample-entity-form {
|
|
228
|
-
padding: 0;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.sample-entity-form-section-title {
|
|
232
|
-
font-size: 14px;
|
|
233
|
-
font-weight: bold;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/* Animation for section transitions */
|
|
238
|
-
.sample-entity-form-section {
|
|
239
|
-
transition: opacity 0.2s ease-in-out;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.sample-entity-form-section.loading {
|
|
243
|
-
opacity: 0.6;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/* Custom styling for money fields */
|
|
247
|
-
.sample-entity-form .money-field .ms-TextField-prefix {
|
|
248
|
-
background-color: #f3f2f1;
|
|
249
|
-
border-right: 1px solid #edebe9;
|
|
250
|
-
color: #605e5c;
|
|
251
|
-
font-weight: 600;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
/* Custom styling for multiline text fields */
|
|
255
|
-
.sample-entity-form .ms-TextField--multiline .ms-TextField-field {
|
|
256
|
-
min-height: 80px;
|
|
257
|
-
resize: vertical;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/* Loading state for buttons */
|
|
261
|
-
.sample-entity-form .ms-Button.loading {
|
|
262
|
-
position: relative;
|
|
263
|
-
color: transparent;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.sample-entity-form .ms-Button.loading::after {
|
|
267
|
-
content: '';
|
|
268
|
-
position: absolute;
|
|
269
|
-
top: 50%;
|
|
270
|
-
left: 50%;
|
|
271
|
-
width: 16px;
|
|
272
|
-
height: 16px;
|
|
273
|
-
margin: -8px 0 0 -8px;
|
|
274
|
-
border: 2px solid #ffffff;
|
|
275
|
-
border-radius: 50%;
|
|
276
|
-
border-top-color: transparent;
|
|
277
|
-
animation: button-loading-spin 1s linear infinite;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
@keyframes button-loading-spin {
|
|
281
|
-
0% { transform: rotate(0deg); }
|
|
282
|
-
100% { transform: rotate(360deg); }
|
|
283
|
-
}
|