Skip to content

Commit 8ad16a4

Browse files
author
Ankit Saini
authored
Merge branch 'develop' into feature/rHttr
2 parents 63f8508 + 2d5b608 commit 8ad16a4

24 files changed

+4460
-2
lines changed

codegens/r-rcurl/.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
.DS_Store
2+
# Logs
3+
logs
4+
*.log
5+
npm-debug.log*
6+
yarn-debug.log*
7+
yarn-error.log*
8+
9+
# Coverage directory used by tools like istanbul
10+
.coverage
11+
12+
# node-waf configuration
13+
.lock-wscript
14+
15+
16+
# Dependency directories
17+
node_modules/
18+
jspm_packages/
19+
20+
# Typescript v1 declaration files
21+
typings/
22+
23+
# Optional npm cache directory
24+
.npm
25+
26+
# Optional eslint cache
27+
.eslintcache
28+
29+
# Optional REPL history
30+
.node_repl_history
31+
32+
# Output of 'npm pack'
33+
*.tgz
34+
35+
# Yarn Integrity file
36+
.yarn-integrity
37+
38+
# dotenv environment variables file
39+
.env
40+
41+
out/
42+
43+
test/unit/fixtures/snippet.r

codegens/r-rcurl/.npmignore

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
### NPM Specific: Disregard recursive project files
2+
### ===============================================
3+
/.editorconfig
4+
/.gitmodules
5+
/test
6+
7+
### Borrowed from .gitignore
8+
### ========================
9+
10+
# Logs
11+
logs
12+
*.log
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Prevent IDE stuff
24+
.idea
25+
.vscode
26+
*.sublime-*
27+
28+
# Directory for instrumented libs generated by jscoverage/JSCover
29+
lib-cov
30+
31+
# Coverage directory used by tools like istanbul
32+
.coverage
33+
34+
# nyc test coverage
35+
.nyc_output
36+
37+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
38+
.grunt
39+
40+
# Bower dependency directory (https://bower.io/)
41+
bower_components
42+
43+
# node-waf configuration
44+
.lock-wscript
45+
46+
# Compiled binary addons (http://nodejs.org/api/addons.html)
47+
build/Release
48+
49+
# Dependency directories
50+
node_modules/
51+
jspm_packages/
52+
53+
# Typescript v1 declaration files
54+
typings/
55+
56+
# Optional npm cache directory
57+
.npm
58+
59+
# Optional eslint cache
60+
.eslintcache
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
74+
snippet.swift
75+
76+
out/

codegens/r-rcurl/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
> Converts Postman-SDK Request into code snippet for R - Rcurl.
3+
4+
#### Prerequisites
5+
To run Code-Gen, ensure that you have NodeJS >= v8. A copy of the NodeJS installable can be downloaded from https://nodejs.org/en/download/package-manager.
6+
7+
## Using the Module
8+
The module will expose an object which will have property `convert` which is the function for converting the Postman-SDK request to R-RCurl code snippet.
9+
10+
### convert function
11+
Convert function takes three parameters
12+
13+
* `request` - Postman-SDK Request Object
14+
15+
* `options` - options is an object which hsa following properties
16+
* `indentType` - String denoting type of indentation for code snippet. eg: 'Space', 'Tab'
17+
* `indentCount` - The number of indentation characters to add per code level
18+
* `trimRequestBody` - Whether or not request body fields should be trimmed
19+
* `followRedirect` : Boolean denoting whether to redirect a request (default: true)
20+
* `ignoreWarnings` : Add code to ignore R warnings (default: false)
21+
22+
* `callback` - callback function with first parameter as error and second parameter as string for code snippet
23+
24+
##### Example:
25+
```js
26+
var request = new sdk.Request('www.google.com'), //using postman sdk to create request
27+
options = {
28+
indentCount: 3,
29+
indentType: 'Space',
30+
requestTimeout: 200,
31+
trimRequestBody: true
32+
};
33+
convert(request, options, function(error, snippet) {
34+
if (error) {
35+
// handle error
36+
}
37+
// handle snippet
38+
});
39+
```
40+
### Guidelines for using generated snippet
41+
42+
* Since Postman-SDK Request object doesn't provide complete path of the file, it needs to be manually inserted in case of uploading a file.
43+
44+
* This module doesn't support cookies.

codegens/r-rcurl/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./lib');

codegens/r-rcurl/lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
convert: require('./rRcurl').convert,
3+
getOptions: require('./rRcurl').getOptions
4+
};

0 commit comments

Comments
 (0)