Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Early-bound types generator for CDS/Dataverse

License

NotificationsYou must be signed in to change notification settings

ralphwest1/dataverse-gen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creates early bound TypeScript interfaces to work withdataverse-ify.For more information see thedataverse-ify project

Usage

  1. Add authentication for your Microsoft Dataverse Environment:
    ~$ npx dataverse-auth [environment]
    E.g.
    ~$ npx dataverse-auth contosoorg.crm.dynamics.com

  2. Initialise dataverse-ify to create .dataverse-gen.json config file:
    ~$ npx dataverse-gen init

  3. At any time, you can re-generate the early bound types using:
    ~$ npx dataverse-gen

.dataverse-gen.json

The configuration for dataverse-gen is stored in the.dataverse-gen.json file. You can edit this manually if you want rather than usenpx dataverse-gen init. This is the only file that is needed to runnpx dataverse-gen.

The standard templates use references to the dataverse-ify types, and so unless you edit the templates (see below) you will need to install these types using:

npm install --save dataverse-ify

Custom Templates

If you wanted to just generate Attributeenum constants and stop there, you can easily customise the scripts to suit your needs by using:

npx dataverse-gen eject

This will create a step of templates ready to customise in the_templates folder. Once you have made your updates, just runnpx dataverse-gen again. The templates use the awesomeejs project. E.g.

// Attribute constantsexportconstenum<%-locals.SchemaName%>Attributes{<%locals.Properties&&locals.Properties.forEach(function(property){_%><%-property.SchemaName%>="<%- property.Name %>",<%})_%>}

If you wanted to revert back to the standard templates, just delete the_templates folder

Installing Globally

If you would rather install dataverse-gen globally you can use:
~$ npm install -g dataverse-gen dataverse-auth

This will then allow you to simply use:
~$ dataverse-auth
~$ dataverse-gen

For more information see thedataverse-ify project

Notes:

  1. Files differ by case only. If you get an error from the imports in the generated types, it is likely that your file names have the wrong case. dataverse-gen will remember re-use the file name if it exsts when generating - even if the casing is different. The solution is to completely remove all your generated files and regenerated them to get the correct casing.

About

Early-bound types generator for CDS/Dataverse

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript95.8%
  • JavaScript2.4%
  • EJS1.8%

[8]ページ先頭

©2009-2025 Movatter.jp