Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepsinn committed Dec 13, 2019
1 parent 011364f commit a4244a6
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 33 deletions.
59 changes: 30 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@

scripts/quantimodo_v1_skds\.zip
silex-PHP-server-generated/
slim-server-generated/
*.zip

slim-server-generated\.zip

silex-PHP-server-generated/SwaggerServer/


/.idea/*
!/.idea/dictionaries/
!/.idea/dictionaries/*

node_modules/
sdks-unzipped/

sdk-repos/
*.exe
swagger/example-post-bodies/
swagger/example-response-bodies/

npm-debug\.log
responses/*.json
codegen/
oax/
swagger-ui/
/swagger-codegen-cli*

scripts/quantimodo_v1_skds\.zip
silex-PHP-server-generated/
slim-server-generated/
*.zip

slim-server-generated\.zip

silex-PHP-server-generated/SwaggerServer/


/.idea/*
!/.idea/dictionaries/
!/.idea/dictionaries/*

node_modules/
sdks-unzipped/

sdk-repos/
*.exe
swagger/example-post-bodies/
swagger/example-response-bodies/

npm-debug\.log
responses/*.json
codegen/
oax/
swagger-ui/
/swagger-codegen-cli*
tmp
32 changes: 28 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,14 @@ function getZipPathForLanguage(language) {
return path.resolve(sdksZippedRelativePath + '/' + getSdkNameForLanguage(language) + '.zip');
}
function writeToFile(filePath, stringContents, callback) {
var mkdirp = require('mkdirp');
var fs = require('fs');
var getDirName = require('path').dirname;
logDebug("Writing to " + filePath);
if(typeof stringContents !== "string"){stringContents = JSON.stringify(stringContents);}
return fs.writeFile(filePath, stringContents, {}, callback);
mkdirp(getDirName(filePath), function (err) {
if(typeof stringContents !== "string"){stringContents = JSON.stringify(stringContents);}
return fs.writeFile(filePath, stringContents, {}, callback);
});
}
function getSdkNameForLanguage(languageName) {
return 'quantimodo-sdk-' + languageName;
Expand Down Expand Up @@ -876,7 +881,7 @@ gulp.task('JS-SDK-UPDATE', function(callback){
});
});
function downloadAndExtractJavascriptClient(language, cb){
let jsSdkFolder = getRepoRelativePathForSdkLanguage('javascript');
let jsSdkFolder = getRepoRelativePathForSdkLanguage(language);
let clientFolder = jsSdkFolder+'/' + language + '-client';
const rimraf = require('rimraf')
rimraf(clientFolder, function(){
Expand Down Expand Up @@ -925,7 +930,7 @@ function executeSynchronously(cmd, catchExceptions, cb){
function generateLocally(language, options){
executeSynchronously(`java -jar ${jar} generate -i swagger/swagger.json -l ${language} -o sdks-unzipped/${language} ${options}`)
}
gulp.task('js-node-angular-react-typescript', function(cb){
gulp.task('_typescript', function(cb){
downloadAndExtractJavascriptClient('typescript-node', function(){
downloadAndExtractJavascriptClient('typescript-angular', function(){
downloadAndExtractJavascriptClient('typescript-angularjs', function(){
Expand All @@ -934,4 +939,23 @@ gulp.task('js-node-angular-react-typescript', function(cb){
});
});
//return downloadSdk('typescript-node', true);
});
gulp.task('_typescript-fetch', function(cb){
downloadAndExtractJavascriptClient('typescript-fetch', cb);
});

gulp.task('upload-file', function(cb){
var tsClient = require('./sdk-repos/quantimodo-sdk-typescript-fetch/typescript-fetch-client');
var time = Math.floor(Date.now() / 1000);
var filePath = "./tmp/test-files/"+time
writeToFile(filePath, time, function(){
var data = fs.readFileSync(filePath);
var config = new tsClient.Configuration({accessToken: "demo"});
var FileApi = new tsClient.FileApi(config);
FileApi.postFile(data, "note", {accessToke: "demo"}).then(function(res){
FileApi.getFile(1, time, "demo",{accessToke: "demo"}).then(function(res){
console.log(res)
})
})
});
});
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
url = document.location.origin + "/api/docs/swagger/swagger.json?access_token=demo";
}
if(window.location.host === "docs.quantimo.do"){url = "https://docs.quantimo.do/swagger/swagger.json?access_token=demo"}
if(window.location.host === "dev-docs.quantimo.do"){url = "https://dev-docs.quantimo.do/swagger/swagger.json?access_token=demo"}
window.ui = SwaggerUIBundle({
url: url,
dom_id: '#swagger-ui',
Expand Down
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"gulp-ignore": "latest",
"gulp-rename": "latest",
"gulp-unzip": "latest",
"mkdirp": "^0.5.1",
"portable-fetch": "^3.0.0",
"q": "^1.4.1",
"quantimodo": "5.11.111615",
"request-promise": "latest",
Expand Down

0 comments on commit a4244a6

Please sign in to comment.