Skip to content

Commit 75f13e9

Browse files
author
Greg DeCarlo
committed
initial code commit
1 parent 18d5224 commit 75f13e9

23 files changed

+2408
-286
lines changed

.gitignore

Lines changed: 1 addition & 285 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
*.userosscache
1010
*.sln.docstates
1111

12-
# User-specific files (MonoDevelop/Xamarin Studio)
13-
*.userprefs
14-
1512
# Build results
1613
[Dd]ebug/
1714
[Dd]ebugPublic/
@@ -26,157 +23,10 @@ bld/
2623

2724
# Visual Studio 2015/2017 cache/options directory
2825
.vs/
29-
# Uncomment if you have tasks that create the project's static files in wwwroot
30-
#wwwroot/
3126

3227
# Visual Studio 2017 auto generated files
3328
Generated\ Files/
3429

35-
# MSTest test Results
36-
[Tt]est[Rr]esult*/
37-
[Bb]uild[Ll]og.*
38-
39-
# NUNIT
40-
*.VisualState.xml
41-
TestResult.xml
42-
43-
# Build Results of an ATL Project
44-
[Dd]ebugPS/
45-
[Rr]eleasePS/
46-
dlldata.c
47-
48-
# Benchmark Results
49-
BenchmarkDotNet.Artifacts/
50-
51-
# .NET Core
52-
project.lock.json
53-
project.fragment.lock.json
54-
artifacts/
55-
**/Properties/launchSettings.json
56-
57-
# StyleCop
58-
StyleCopReport.xml
59-
60-
# Files built by Visual Studio
61-
*_i.c
62-
*_p.c
63-
*_i.h
64-
*.ilk
65-
*.meta
66-
*.obj
67-
*.iobj
68-
*.pch
69-
*.pdb
70-
*.ipdb
71-
*.pgc
72-
*.pgd
73-
*.rsp
74-
*.sbr
75-
*.tlb
76-
*.tli
77-
*.tlh
78-
*.tmp
79-
*.tmp_proj
80-
*.log
81-
*.vspscc
82-
*.vssscc
83-
.builds
84-
*.pidb
85-
*.svclog
86-
*.scc
87-
88-
# Chutzpah Test files
89-
_Chutzpah*
90-
91-
# Visual C++ cache files
92-
ipch/
93-
*.aps
94-
*.ncb
95-
*.opendb
96-
*.opensdf
97-
*.sdf
98-
*.cachefile
99-
*.VC.db
100-
*.VC.VC.opendb
101-
102-
# Visual Studio profiler
103-
*.psess
104-
*.vsp
105-
*.vspx
106-
*.sap
107-
108-
# Visual Studio Trace Files
109-
*.e2e
110-
111-
# TFS 2012 Local Workspace
112-
$tf/
113-
114-
# Guidance Automation Toolkit
115-
*.gpState
116-
117-
# ReSharper is a .NET coding add-in
118-
_ReSharper*/
119-
*.[Rr]e[Ss]harper
120-
*.DotSettings.user
121-
122-
# JustCode is a .NET coding add-in
123-
.JustCode
124-
125-
# TeamCity is a build add-in
126-
_TeamCity*
127-
128-
# DotCover is a Code Coverage Tool
129-
*.dotCover
130-
131-
# AxoCover is a Code Coverage Tool
132-
.axoCover/*
133-
!.axoCover/settings.json
134-
135-
# Visual Studio code coverage results
136-
*.coverage
137-
*.coveragexml
138-
139-
# NCrunch
140-
_NCrunch_*
141-
.*crunch*.local.xml
142-
nCrunchTemp_*
143-
144-
# MightyMoose
145-
*.mm.*
146-
AutoTest.Net/
147-
148-
# Web workbench (sass)
149-
.sass-cache/
150-
151-
# Installshield output folder
152-
[Ee]xpress/
153-
154-
# DocProject is a documentation generator add-in
155-
DocProject/buildhelp/
156-
DocProject/Help/*.HxT
157-
DocProject/Help/*.HxC
158-
DocProject/Help/*.hhc
159-
DocProject/Help/*.hhk
160-
DocProject/Help/*.hhp
161-
DocProject/Help/Html2
162-
DocProject/Help/html
163-
164-
# Click-Once directory
165-
publish/
166-
167-
# Publish Web Output
168-
*.[Pp]ublish.xml
169-
*.azurePubxml
170-
# Note: Comment the next line if you want to checkin your web deploy settings,
171-
# but database connection strings (with potential passwords) will be unencrypted
172-
*.pubxml
173-
*.publishproj
174-
175-
# Microsoft Azure Web App publish settings. Comment the next line if you want to
176-
# checkin your Azure Web App publish settings, but sensitive information contained
177-
# in these scripts will be unencrypted
178-
PublishScripts/
179-
18030
# NuGet Packages
18131
*.nupkg
18232
# The packages folder can be ignored because of Package Restore
@@ -189,142 +39,8 @@ PublishScripts/
18939
*.nuget.props
19040
*.nuget.targets
19141

192-
# Microsoft Azure Build Output
193-
csx/
194-
*.build.csdef
195-
196-
# Microsoft Azure Emulator
197-
ecf/
198-
rcf/
199-
200-
# Windows Store app package directories and files
201-
AppPackages/
202-
BundleArtifacts/
203-
Package.StoreAssociation.xml
204-
_pkginfo.txt
205-
*.appx
206-
20742
# Visual Studio cache files
20843
# files ending in .cache can be ignored
20944
*.[Cc]ache
21045
# but keep track of directories ending in .cache
211-
!*.[Cc]ache/
212-
213-
# Others
214-
ClientBin/
215-
~$*
216-
*~
217-
*.dbmdl
218-
*.dbproj.schemaview
219-
*.jfm
220-
*.pfx
221-
*.publishsettings
222-
orleans.codegen.cs
223-
224-
# Including strong name files can present a security risk
225-
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
226-
#*.snk
227-
228-
# Since there are multiple workflows, uncomment next line to ignore bower_components
229-
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
230-
#bower_components/
231-
232-
# RIA/Silverlight projects
233-
Generated_Code/
234-
235-
# Backup & report files from converting an old project file
236-
# to a newer Visual Studio version. Backup files are not needed,
237-
# because we have git ;-)
238-
_UpgradeReport_Files/
239-
Backup*/
240-
UpgradeLog*.XML
241-
UpgradeLog*.htm
242-
ServiceFabricBackup/
243-
*.rptproj.bak
244-
245-
# SQL Server files
246-
*.mdf
247-
*.ldf
248-
*.ndf
249-
250-
# Business Intelligence projects
251-
*.rdl.data
252-
*.bim.layout
253-
*.bim_*.settings
254-
*.rptproj.rsuser
255-
256-
# Microsoft Fakes
257-
FakesAssemblies/
258-
259-
# GhostDoc plugin setting file
260-
*.GhostDoc.xml
261-
262-
# Node.js Tools for Visual Studio
263-
.ntvs_analysis.dat
264-
node_modules/
265-
266-
# Visual Studio 6 build log
267-
*.plg
268-
269-
# Visual Studio 6 workspace options file
270-
*.opt
271-
272-
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
273-
*.vbw
274-
275-
# Visual Studio LightSwitch build output
276-
**/*.HTMLClient/GeneratedArtifacts
277-
**/*.DesktopClient/GeneratedArtifacts
278-
**/*.DesktopClient/ModelManifest.xml
279-
**/*.Server/GeneratedArtifacts
280-
**/*.Server/ModelManifest.xml
281-
_Pvt_Extensions
282-
283-
# Paket dependency manager
284-
.paket/paket.exe
285-
paket-files/
286-
287-
# FAKE - F# Make
288-
.fake/
289-
290-
# JetBrains Rider
291-
.idea/
292-
*.sln.iml
293-
294-
# CodeRush
295-
.cr/
296-
297-
# Python Tools for Visual Studio (PTVS)
298-
__pycache__/
299-
*.pyc
300-
301-
# Cake - Uncomment if you are using it
302-
# tools/**
303-
# !tools/packages.config
304-
305-
# Tabs Studio
306-
*.tss
307-
308-
# Telerik's JustMock configuration file
309-
*.jmconfig
310-
311-
# BizTalk build output
312-
*.btp.cs
313-
*.btm.cs
314-
*.odx.cs
315-
*.xsd.cs
316-
317-
# OpenCover UI analysis results
318-
OpenCover/
319-
320-
# Azure Stream Analytics local run output
321-
ASALocalRun/
322-
323-
# MSBuild Binary and Structured Log
324-
*.binlog
325-
326-
# NVidia Nsight GPU debugger configuration file
327-
*.nvuser
328-
329-
# MFractors (Xamarin productivity tool) working folder
330-
.mfractor/
46+
!*.[Cc]ache/

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1-
# more-xrm
1+
# more-xrm
2+
3+
Create more applications using the Microsoft Dynamics Xrm platform. more-xrm enables querying the dynamics data model from any application.
4+
5+
## Example
6+
7+
`
8+
export async function DynamicsClientSample() {
9+
const dynamicsClient = dynamics();
10+
11+
const allAccounts = await dynamicsClient.batch()
12+
.requestAllUrls(['accounts'])
13+
.execute();
14+
15+
await dynamicsClient.save('accounts', { name: 'test' }, allAccounts[0].accountid);
16+
17+
const xrmAccounts = await dynamicsClient.fetch(
18+
query('account').path('accounts')
19+
.where('name', QueryOperator.Contains, 'xrm')
20+
.orderBy('name')
21+
.select('name')
22+
);
23+
24+
return <Grid data={xrmAccounts} />;
25+
}
26+
`
27+
28+
## Interfaces
29+
30+
`
31+
export interface Dynamics {
32+
batch(): DynamicsBatch;
33+
fetch<T>(query: Query, maxRowCount?: number): Promise<T[]>;
34+
save(entitySetName: string, data: any, id?: string): Promise<string>;
35+
}
36+
37+
export interface DynamicsBatch {
38+
execute(): Promise<any[]>;
39+
request(query: Query, maxRowCount?: number): DynamicsBatch;
40+
requestAll(queries: Query[]): DynamicsBatch;
41+
requestAllUrls(urls: string[]): DynamicsBatch;
42+
saveEntity(entitySetName: string, data: any, id?: string): DynamicsBatch & {
43+
createRelatedEntity(entitySetName: string, data: any, navigationPropertyName: string): void
44+
};
45+
}
46+
47+
export interface Query {
48+
alias(attributeName: string, alias: string): Query;
49+
path(entityPath: string): Query;
50+
select(...attributeNames: string[]): Query;
51+
where(attributeName: string, operator: QueryOperator, ...values: any[]): Query;
52+
whereAny(any: (or: (attributeName: string, operator: QueryOperator, ...values: any[]) => void) => void): Query;
53+
orderBy(attributeName: string, isDescendingOrder?: boolean): Query;
54+
join(entityName: string, fromAttribute: string, toAttribute?: string, alias?: string, isOuterJoin?: boolean): Query;
55+
}
56+
`
57+
58+
## Functions
59+
60+
`
61+
function dynamics(accessToken?: string): Dynamics
62+
63+
function dynamicsQuery<T>(query: Query, maxRowCount?: number, headers?: any): Promise<T[]>;
64+
function dynamicsQueryUrl<T>(dynamicsEntitySetUrl: string, query: Query, maxRowCount?: number, headers?: any): Promise<T[]>;
65+
function dynamicsRequest<T>(dynamicsEntitySetUrl: string, headers?: any): Promise<T>;
66+
function dynamicsSave(entitySetName: string, data: any, id?: string, headers?: any): Promise<string>;
67+
68+
function dynamicsBatch(headers?: any): DynamicsBatch;
69+
function dynamicsBatchRequest<T = any>(...url: string[]): Promise<T[]>;
70+
function dynamicsBatchQuery<T = any>(...query: Query[]): Promise<T[]>;
71+
72+
function query(entityName: string, ...attributeNames: string[]): Query;
73+
function GetQueryXml(query: Query, maxRowCount?: number, format?: boolean): string;
74+
`

0 commit comments

Comments
 (0)