Skip to content

Commit 5accfbe

Browse files
authored
Merge pull request #18 from DocRaptor/hosted_documents
v2.0.0 - Hosted documents
2 parents ecd921d + f07ac33 commit 5accfbe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4208
-2196
lines changed

.gitignore

Lines changed: 190 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,194 @@
1-
.DS_Store
1+
# Ref: https://gist.github.com/kmorcinek/2710267
2+
# Download this file using PowerShell v3 under Windows with the following comand
3+
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
4+
5+
# User-specific files
6+
*.suo
7+
*.user
8+
*.sln.docstates
9+
./nuget
10+
11+
# Build results
12+
13+
[Dd]ebug/
14+
[Rr]elease/
15+
x64/
16+
build/
17+
[Bb]in/
18+
[Oo]bj/
19+
20+
# NuGet Packages
21+
*.nupkg
22+
# The packages folder can be ignored because of Package Restore
23+
**/packages/*
24+
# except build/, which is used as an MSBuild target.
25+
!**/packages/build/
26+
# Uncomment if necessary however generally it will be regenerated when needed
27+
#!**/packages/repositories.config
28+
29+
# MSTest test Results
30+
[Tt]est[Rr]esult*/
31+
[Bb]uild[Ll]og.*
32+
33+
*_i.c
34+
*_p.c
35+
*.ilk
36+
*.meta
37+
*.obj
38+
*.pch
39+
*.pdb
40+
*.pgc
41+
*.pgd
42+
*.rsp
43+
*.sbr
44+
*.tlb
45+
*.tli
46+
*.tlh
47+
*.tmp
48+
*.tmp_proj
49+
*.log
50+
*.vspscc
51+
*.vssscc
52+
.builds
53+
*.pidb
54+
*.log
55+
*.scc
56+
57+
# OS generated files #
58+
.DS_Store*
59+
ehthumbs.db
60+
Icon?
61+
Thumbs.db
62+
63+
# Visual C++ cache files
64+
ipch/
65+
*.aps
66+
*.ncb
67+
*.opensdf
68+
*.sdf
69+
*.cachefile
70+
71+
# Visual Studio profiler
72+
*.psess
73+
*.vsp
74+
*.vspx
75+
76+
# Guidance Automation Toolkit
77+
*.gpState
78+
79+
# ReSharper is a .NET coding add-in
80+
_ReSharper*/
81+
*.[Rr]e[Ss]harper
82+
83+
# TeamCity is a build add-in
84+
_TeamCity*
85+
86+
# DotCover is a Code Coverage Tool
87+
*.dotCover
88+
89+
# NCrunch
90+
*.ncrunch*
91+
.*crunch*.local.xml
92+
93+
# Installshield output folder
94+
[Ee]xpress/
95+
96+
# DocProject is a documentation generator add-in
97+
DocProject/buildhelp/
98+
DocProject/Help/*.HxT
99+
DocProject/Help/*.HxC
100+
DocProject/Help/*.hhc
101+
DocProject/Help/*.hhk
102+
DocProject/Help/*.hhp
103+
DocProject/Help/Html2
104+
DocProject/Help/html
105+
106+
# Click-Once directory
107+
publish/
108+
109+
# Publish Web Output
110+
*.Publish.xml
111+
112+
# Windows Azure Build Output
113+
csx
114+
*.build.csdef
115+
116+
# Windows Store app package directory
117+
AppPackages/
118+
119+
# Others
120+
sql/
121+
*.Cache
122+
ClientBin/
123+
[Ss]tyle[Cc]op.*
124+
~$*
125+
*~
126+
*.dbmdl
127+
*.[Pp]ublish.xml
128+
*.pfx
129+
*.publishsettings
130+
modulesbin/
131+
tempbin/
132+
133+
# EPiServer Site file (VPP)
134+
AppData/
135+
136+
# RIA/Silverlight projects
137+
Generated_Code/
138+
139+
# Backup & report files from converting an old project file to a newer
140+
# Visual Studio version. Backup files are not needed, because we have git ;-)
141+
_UpgradeReport_Files/
142+
Backup*/
143+
UpgradeLog*.XML
144+
UpgradeLog*.htm
145+
146+
# vim
147+
*.txt~
148+
*.swp
149+
*.swo
150+
151+
# svn
152+
.svn
153+
154+
# SQL Server files
155+
**/App_Data/*.mdf
156+
**/App_Data/*.ldf
157+
**/App_Data/*.sdf
158+
159+
160+
#LightSwitch generated files
161+
GeneratedArtifacts/
162+
_Pvt_Extensions/
163+
ModelManifest.xml
164+
165+
# =========================
166+
# Windows detritus
167+
# =========================
168+
169+
# Windows image file caches
2170
Thumbs.db
171+
ehthumbs.db
172+
173+
# Folder config file
174+
Desktop.ini
175+
176+
# Recycle Bin used on file shares
177+
$RECYCLE.BIN/
178+
179+
# Mac desktop service store files
180+
.DS_Store
181+
182+
# SASS Compiler cache
183+
.sass-cache
184+
185+
# Visual Studio 2014 CTP
186+
**/*.sln.ide
187+
188+
3189
swagger-codegen
190+
.docraptor_key
4191
bin/
5192
*.mdb
6-
/vendor/Newtonsoft*
7-
/vendor/RestSharp*
193+
git_push.sh
194+
.travis.yml

.swagger-codegen-ignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Swagger Codegen Ignore
2+
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
24+
25+
README.md
26+
CHANGELOG.md
27+
.gitignore
28+
LICENSE

.swagger-codegen/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.14

.swagger-revision

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
62fbcb9e8bec4a40569e51c7f316af85806628ee
1+
v2.4.14

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### 2.0.0 [July 31, 2020]
2+
* add support for hosted documents
3+
* upgrade to latest swagger 2.4.14
4+
* **BREAKING CHANGE**: renamed AsyncDocStatus to DocStatus
5+
* **BREAKING CHANGE**: constructor argument casing
6+
17
### 1.1.1 [June 7, 2017]
28
* Update RestSharp Dependency to 105.2.3
39

DocRaptor.nuspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<metadata>
44
<id>DocRaptor</id>
55
<title>DocRaptor</title>
6-
<version>1.1.1</version>
6+
<version>2.0.0</version>
77
<authors>Expected Behavior</authors>
88
<owners>Expected Behavior</owners>
99
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
@@ -14,7 +14,8 @@
1414
<tags>DocRaptor, API, HTML, PDF, XLS, XLSX </tags>
1515
<dependencies>
1616
<dependency id="RestSharp" version="105.2.3" />
17-
<dependency id="Newtonsoft.Json" version="8.0.2" />
17+
<dependency id="Newtonsoft.Json" version="10.0.3" />
18+
<dependency id="JsonSubTypes" version="1.2.0" />
1819
</dependencies>
1920
</metadata>
2021
<files>

DocRaptor.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio 2012
3+
VisualStudioVersion = 12.0.0.0
4+
MinimumVisualStudioVersion = 10.0.0.1
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocRaptor", "src\DocRaptor\DocRaptor.csproj", "{CFD94733-F020-45EE-B121-AA0CA516F4FD}"
6+
EndProject
7+
Global
8+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|Any CPU = Debug|Any CPU
10+
Release|Any CPU = Release|Any CPU
11+
EndGlobalSection
12+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13+
{CFD94733-F020-45EE-B121-AA0CA516F4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14+
{CFD94733-F020-45EE-B121-AA0CA516F4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
15+
{CFD94733-F020-45EE-B121-AA0CA516F4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
{CFD94733-F020-45EE-B121-AA0CA516F4FD}.Release|Any CPU.Build.0 = Release|Any CPU
17+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
GlobalSection(SolutionProperties) = preSolution
23+
HideSolutionNode = FALSE
24+
EndGlobalSection
25+
EndGlobal

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This is a DLL and NuGet package for using [DocRaptor API](https://docraptor.com/
99
## Dependencies
1010
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 105.2.3 or later
1111
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
12+
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later
1213

1314

1415
## Installation
@@ -44,15 +45,15 @@ class Example {
4445
DocApi docraptor = new DocApi();
4546

4647
Doc doc = new Doc(
47-
Test: true, // test documents are free but watermarked
48-
DocumentContent: "<html><body>Hello World</body></html>", // supply content directly
49-
// DocumentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
50-
Name: "docraptor-csharp.pdf", // help you find a document later
51-
DocumentType: Doc.DocumentTypeEnum.Pdf // pdf or xls or xlsx
52-
// Javascript: true, // enable JavaScript processing
53-
// PrinceOptions: new PrinceOptions(
54-
// Media: "screen", // use screen styles instead of print styles
55-
// Baseurl: "http://hello.com" // pretend URL when using document_content
48+
test: true, // test documents are free but watermarked
49+
documentContent: "<html><body>Hello World</body></html>", // supply content directly
50+
// documentUrl: "http://docraptor.com/examples/invoice.html", // or use a url
51+
name: "docraptor-csharp.pdf", // help you find a document later
52+
documentType: Doc.DocumentTypeEnum.Pdf // pdf or xls or xlsx
53+
// Javascript: true, // enable javaScript processing
54+
// princeOptions: new PrinceOptions(
55+
// media: "screen", // use screen styles instead of print styles
56+
// baseurl: "http://hello.com" // pretend URL when using document_content
5657
// )
5758
);
5859

@@ -81,9 +82,7 @@ Stuck? We're experts at using DocRaptor so please [email us](mailto:support@docr
8182

8283
The majority of the code in this repo is generated using swagger-codegen on [docraptor.yaml](docraptor.yaml). You can modify this file and regenerate the client using `script/generate_language csharp`.
8384

84-
The generated client needed a few fixes
85-
- https://github.com/swagger-api/swagger-codegen/issues/2368
86-
- https://github.com/swagger-api/swagger-codegen/issues/2367
85+
Don't let swagger downgrade RestSharp to 105.1.0; it will try.
8786

8887

8988
## Release Process

build.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:: Generated by: https://github.com/swagger-api/swagger-codegen.git
2+
::
3+
4+
@echo off
5+
6+
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
7+
8+
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')"
9+
.\nuget.exe install src\DocRaptor\packages.config -o packages
10+
11+
if not exist ".\bin" mkdir bin
12+
13+
copy packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll bin\Newtonsoft.Json.dll
14+
copy packages\JsonSubTypes.1.2.0\lib\net45\JsonSubTypes.dll bin\JsonSubTypes.dll
15+
copy packages\RestSharp.105.2.3\lib\net45\RestSharp.dll bin\RestSharp.dll
16+
%CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll /target:library /out:bin\DocRaptor.dll /recurse:src\DocRaptor\*.cs /doc:bin\DocRaptor.xml
17+

0 commit comments

Comments
 (0)