Code Monkey home page Code Monkey logo

raml-javascript-generator's People

Contributors

blakeembrey avatar brentm5 avatar greenkeeper[bot] avatar jstoiko avatar mlopezluque avatar mulecalle avatar nachoesmite avatar nestor-diaz avatar svc-scm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raml-javascript-generator's Issues

Support OAuth 1.0

We need to support OAuth 1.0 clients in the JavaScript generator. That means a promise-based reusable OAuth 1.0 library like https://github.com/mulesoft/js-client-oauth2. There also needs to be associated documentation generated in the JavaScript client README.

  • Create OAuth 1.0 client library
  • Integrate OAuth 1.0 with RAML settings and generated client
  • Support OAuth 1.0 access tokens (users)
  • Add dynamically generated documentation to README

Migrated from mulesoft-labs/raml-client-generator#5.

Inconsistent behaviour between node and browser environments

Hi there, thanks for your work on this awesome library. I'm successfully instantiating the client in the Chrome, but I've noticed two inconsistencies between the generated client in node and browser environments.

TypeError: client.request is not a function

try to make a request (e.g. client.resources.Resource.get()), I'm getting an error saying client.request is not a function.
**
I don't get this error in node however.**

It turns out in the browser, the request property on client is an Object and there is a request method on that object (which is the method needed in this instance). My temporary solution is to change line 70 of the generated client's index.js to:

return client.request.request(reqOpts)

When providing headers, the key 'content-type' header is case sensitive in browser

For example, when I call in the browser: client.resources.Resource.post({ foo: bar }, {headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}), my Content-Type header doesn't get sent and I get an error from my server. However, using content-type (lowercase) sends the correct header.

However, both uppercase/lowercase works fine in node.

An in-range update of @commitlint/cli is breaking the build 🚨

The devDependency @commitlint/cli was updated from 7.1.2 to 7.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@commitlint/cli is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @commitlint/prompt is breaking the build 🚨

The devDependency @commitlint/prompt was updated from 7.1.2 to 7.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@commitlint/prompt is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

client.js.hbs

this file has

Client.prototype.request = popsicle
Client.prototype.form = Client.form = popsicle.form
Client.prototype.version  = {{{stringify version}}}

Maybe first line should be
Client.prototype.request = popsicle.request or similar?

Typescript d.ts generation

I'm using raml-javascript-generator to generate resources on my client side that is written in Typescript.
What is missing is the type safety on raml client resources.
Generate an extra d.ts file the describe client should be enough and probably a trivial task.

An in-range update of eslint-plugin-import is breaking the build 🚨

The devDependency eslint-plugin-import was updated from 2.16.0 to 2.17.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-import is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 61 commits.

  • 0499050 bump to v2.17.0
  • f479635 [webpack] v0.11.1
  • 8a4226d Merge pull request #1320 from bradzacher/export-ts-namespaces
  • 988e12b fix(export): Support typescript namespaces
  • 70c3679 [docs] make rule names consistent
  • 6ab25ea [Tests] skip a TS test in eslint < 4
  • 405900e [Tests] fix tests from #1319
  • 2098797 [fix] export: false positives for typescript type + value export
  • 70a59fe [fix] Fix overwriting of dynamic import() CallExpression
  • e4850df [ExportMap] fix condition for checking if block comment
  • 918567d [fix] namespace: add check for null ExportMap
  • 2d21c4c Merge pull request #1297 from echenley/ech/fix-isBuiltIn-local-aliases
  • 0ff1c83 [dev deps] lock typescript to ~, since it doesn’t follow semver
  • 40bf40a [*] [deps] update resolve
  • 28dd614 Merge pull request #1304 from bradennapier/feature/typescript-export-type

There are 61 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Global "header"s wiped on "extend"

Global headers provided on client init do not work.
Reason: Every function call uses something like
{code}
var options = extend({ body: body, headers: {} }, opts)
{code}
i.e. forcefully defines a "headers" attribute. On the used "xtend" version of extend this is therefore overriding any global options set:
{code}
var options = extend({}, client._options, opts)
{code}

Resolution: Use version of "extend" supporting recursive extension.

URL parameters do not use "string" but "object" notation

Function call for REST URL like "/foo/{foo}" are documented as "client.foo({foo})" - which I would interpret as String value for the parameter.

Implementation shows a wrapper object is assumed:
client.foo({foo : "value"})
to add the value to URL (via "template" function).

2 Options:

  • Improve readme.MD and stick to object - though I believe this is not common-sense as URLs only support plain text strings
  • Do not use "template" but directly use provided value.

Update README

Lets put some more content.. a lot more in the README. I dont have a good idea of what this project does, why you would use it, examples of how to use it, etc. The README is the place for this sort of stuff (or at least links to examples, etc). The current README leaves a lot to be desired as to the purpose and use of this project.

Ability to work with client certificates

Right now in the request method the cert, key, and ca attribues are not copied.
In general it would be good to have control of the entitre options object, for agent setting proxies, etc. Let me know if u want to take care of it yourself or a via pull request

let reqOpts = {
url: baseUri.replace(//$/, '') + template(path, options.uriParameters),
json: !Buffer.isBuffer(options.body),
method,
headers,
formData: options.formData,
body: options.body,
qs: options.query,
options: options.options,
resolveWithFullResponse: true
};

An in-range update of watchify is breaking the build 🚨

The devDependency watchify was updated from 3.11.0 to 3.11.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

watchify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 8 commits.

  • c3fe218 3.11.1
  • e90101b Merge pull request #362 from digipost/upgrade-deps
  • d163b4f upgrade dependencies: fix errors from npm audit
  • 1917270 Merge pull request #351 from menzow/feature/update-docs
  • d232754 Merge pull request #357 from Kamil93/patch-1
  • d924e9b Update readme.markdown
  • 9ea8a65 Support for working with transforms
  • 8147bc5 Add troubleshooting information for silenced errors

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 5.13.0 to 5.14.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v5.14.0
  • 85a04b3 Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980) (Scott Stern)
  • 0c02932 Upgrade: [email protected] (#11401) (Ilya Volodin)
  • 104ae88 Docs: Update governance doc with reviewers status (#11399) (Nicholas C. Zakas)
  • ab8ac6a Fix: Support boundary spread elements in sort-keys (#11158) (Jakub Rożek)
  • a23d197 New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243) (richie3366)
  • e25e7aa Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374) (Pig Fang)
  • a1f7c44 Docs: fix space-before-blocks correct code for "classes": "never" (#11391) (PoziWorld)
  • 14f58a2 Docs: fix grammar in object-curly-spacing docs (#11389) (PoziWorld)
  • d3e9a27 Docs: fix grammar in “those who says” (#11390) (PoziWorld)
  • ea8e804 Docs: Add note about support for object spread (fixes #11136) (#11395) (Steven Thomas)
  • 95aa3fd Docs: Update README team and sponsors (ESLint Jenkins)
  • 51c4972 Update: Behavior of --init (fixes #11105) (#11332) (Nicholas C. Zakas)
  • ad7a380 Docs: Update README team and sponsors (ESLint Jenkins)
  • 550de1e Update: use default keyword in JSON schema (fixes #9929) (#11288) (Pig Fang)
  • 983c520 Update: Use 'readonly' and 'writable' for globals (fixes #11359) (#11384) (Nicholas C. Zakas)
  • f1d3a7e Upgrade: some deps (fixes #11372) (#11373) (薛定谔的猫)
  • 3e0c417 Docs: Fix grammar in “there’s nothing prevent you” (#11385) (PoziWorld)
  • de988bc Docs: Fix grammar: Spacing improve -> Spacing improves (#11386) (PoziWorld)
  • 1309dfd Revert "Build: fix test failure on Node 11 (#11100)" (#11375) (薛定谔的猫)
  • 1e56897 Docs: “the function actually use”: use -> uses (#11380) (PoziWorld)
  • 5a71bc9 Docs: Update README team and sponsors (ESLint Jenkins)
  • 82a58ce Docs: Update README team and sponsors (ESLint Jenkins)
  • 546d355 Docs: Update README with latest sponsors/team data (#11378) (Nicholas C. Zakas)
  • c0df9fe Docs: ... is not an operator (#11232) (Felix Kling)
  • 7ecfdef Docs: update typescript parser (refs #11368) (#11369) (薛定谔的猫)
  • 3c90dd7 Update: remove prefer-spread autofix (fixes #11330) (#11365) (薛定谔的猫)
  • 5eb3121 Update: add fixer for prefer-destructuring (fixes #11151) (#11301) (golopot)
  • 173eb38 Docs: Clarify ecmaVersion doesn't imply globals (refs #9812) (#11364) (Keith Maxwell)
  • 84ce72f Fix: Remove extraneous linefeeds in one-var fixer (fixes #10741) (#10955) (st-sloth)
  • 389362a Docs: clarify motivation for no-prototype-builtins (#11356) (Teddy Katz)
  • 533d240 Update: no-shadow-restricted-names lets unassigned vars shadow undefined (#11341) (Teddy Katz)
  • d0e823a Update: Make --init run js config files through linter (fixes #9947) (#11337) (Brian Kurek)
  • 92fc2f4 Fix: CircularJSON dependency warning (fixes #11052) (#11314) (Terry)
  • 4dd19a3 Docs: mention 'prefer-spread' in docs of 'no-useless-call' (#11348) (Klaus Meinhardt)
  • 4fd83d5 Docs: fix a misleading example in one-var (#11350) (薛定谔的猫)
  • 9441ce7 Chore: update incorrect tests to fix build failing (#11354) (薛定谔的猫)
Commits

The new version differs by 38 commits.

  • af9688b 5.14.0
  • 0ce3ac7 Build: changelog update for 5.14.0
  • 85a04b3 Fix: adds conditional for separateRequires in one-var (fixes #10179) (#10980)
  • 0c02932 Upgrade: [email protected] (#11401)
  • 104ae88 Docs: Update governance doc with reviewers status (#11399)
  • ab8ac6a Fix: Support boundary spread elements in sort-keys (#11158)
  • a23d197 New: add allowSingleLineBlocks opt. to padded-blocks rule (fixes #7145) (#11243)
  • e25e7aa Fix: comma-spacing ignore comma before closing paren (fixes #11295) (#11374)
  • a1f7c44 Docs: fix space-before-blocks correct code for "classes": "never" (#11391)
  • 14f58a2 Docs: fix grammar in object-curly-spacing docs (#11389)
  • d3e9a27 Docs: fix grammar in “those who says” (#11390)
  • ea8e804 Docs: Add note about support for object spread (fixes #11136) (#11395)
  • 95aa3fd Docs: Update README team and sponsors
  • 51c4972 Update: Behavior of --init (fixes #11105) (#11332)
  • ad7a380 Docs: Update README team and sponsors

There are 38 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @commitlint/config-angular is breaking the build 🚨

The devDependency @commitlint/config-angular was updated from 7.1.2 to 7.3.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@commitlint/config-angular is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

camel-case is a dev dependency

If you npm install raml-javascript-generator and try to use it you get the following traceback:

module.js:338
    throw err;
          ^
Error: Cannot find module 'camel-case'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (c:\Users\wfaust\Desktop\Development_git\specs\node_modules\raml-javascript-generator\lib\helpers\request-snippet.js:1:79)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

This is because the fix for #4 did not add camel-case to the dependencies in package.json.

Schema object generation

Probably is more related to Typescript than Javascript, but what about schema objects generation?
Actually I'm doing this task in java whit jaxrs generator (based on json schema used in raml).
I would like do to the same on client side.
Have you got any idea, how to achieve this extending this generator?

An in-range update of @types/node is breaking the build 🚨

The dependency @types/node was updated from 10.9.4 to 10.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/node is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of browserify is breaking the build 🚨

The devDependency browserify was updated from 16.2.2 to 16.2.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

browserify is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v16.2.3

add empty stub for the inspector builtin module.

#1854

change the "browser" field link to the browser-field-spec repo instead of the old gist.

#1845

Commits

The new version differs by 5 commits.

  • cfd3af2 16.2.3
  • ae01d90 Merge pull request #1854 from mohd-akram/add-inspector-builtin
  • b1e61aa Add inspector builtin
  • 4190ed5 Merge pull request #1845 from farzonl/patch-1
  • 32d0a05 fix ReadME link.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Invalid Greenkeeper configuration file

We have detected a problem with your Greenkeeper config file 🚨

Greenkeeper currently can’t work with your greenkeeper.json config file because it is invalid. We found the following issue:

  1. The package path src/templates/package.json.ts in the group default must end with package.json.

Please correct this and commit the fix to your default branch (usually master). Greenkeeper will pick up your changes and try again. If in doubt, please consult the config documentation.

Here’s an example of a valid greenkeeper.json:

{
  groups: {
    frontend: {
      packages: [
        'webapp/package.json',
        'cms/package.json',
        'analytics/package.json'
      ]
    },
    build: {
      packages: [
        'package.json'
      ]
    }
  },
  ignore: [
    'standard',
    'eslint'
  ]
}

This files tells Greenkeeper to handle all dependency updates in two groups. All files in the frontend group will receive updates together, in one issue or PR, and the root-level package.json in the build group will be treated separately. In addition, Greenkeeper will never send updates for the standard and eslint packages.

🤖 🌴

An in-range update of tslint-config-airbnb is breaking the build 🚨

The devDependency tslint-config-airbnb was updated from 5.11.0 to 5.11.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

tslint-config-airbnb is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

require('raml-javascript-generator') fails on windows

Hi,

I have done npm install raml-javascript-generator, however, when I attempt to actually require in the library in a script, it is failing:

This:

jsGen = require('raml-javascript-generator');
var output = jsGen.client("raw.raml");

Fails with this:

C:\devel\raml-generator-test
λ node .\index.js
module.js:341
    throw err;
    ^

Error: Cannot find module 'raml-javascript-generator'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\devel\raml-generator-test\index.js:1:71)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)

require('raml-javascript-generator/dist') appears to work (followed by other errors), but it not what the readme says, so seems incorrect.

Any help would be appreciated.

Unset "this._client" if no param-free context

In case the RAML file ONLY has URLs with URL parameters (i.e. "/foo/{foo}") the generator is only spitting out in constructor.
{code}
setprototypeof(client, this)
{code}
but NO specific mappings like
{code}
this.bazz = new Resource5(client, '/bazz')
setprototypeof(client, this)
{code}

However, this causes this._client to be never set as the "client" created here is never injected.

Workaround:
Add setter in constructor:
{code}
this._client=client;
setprototypeof(client, this)
{code}

Generated documentation is broken for URLs with hyphens

I have a URL /parse-order in my API. For this URL the following documentation is generated:

resources.parse-order

var resource = client.resources.parse-order;

However the actual code that is generated uses camelCase, so the documentation should instead read:

var resource = client.resources.parseOrder;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.