Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 4e29599

Browse files
committed
Initial commit for a release
0 parents  commit 4e29599

File tree

12 files changed

+861
-0
lines changed

12 files changed

+861
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.project
2+
.vscode
3+
node_modules
4+
npm-debug.log
5+
test/playground

.jshintrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"esnext": true,
3+
"node": true,
4+
"browser": true,
5+
"bitwise": false,
6+
"camelcase": false,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"indent": 2,
11+
"latedef": true,
12+
"noarg": true,
13+
"quotmark": "single",
14+
"undef": true,
15+
"unused": true,
16+
"newcap": false,
17+
"mocha": true,
18+
"globals": {
19+
20+
}
21+
}

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js: stable
3+
script:
4+
- npm test

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Guide for Contributors
2+
3+
The Advanced REST client is open and we encourage the community to contribute in the project. However, it is very important to follow couple of simple rules when you create an issue report or send a pull request.
4+
5+
## Issue reporting
6+
**If this is feature request**, please provide a clear description of the feature. I've created a [document][87714bdc] that may help you fill up a feature request. But basically you should answer this questions:
7+
8+
- Who will benefit from this feature? _("Someone who is trying to...")_
9+
- What's the use cases (when the feature will be used)? _("When the HTTP response is...")_
10+
- What the user gain by having this feature? _("I should be able to see...")_
11+
12+
An overview of the feature would be nice as well.
13+
14+
**When you're filling a bug report**, please be as much specific as you can and:
15+
16+
- A clear description of the bug, logs if available and your expectations. You're welcome to use following template:
17+
```markdown
18+
The send button causes the app to close itself.
19+
20+
## Expected outcome
21+
The app is not closing itself when I try to send a request.
22+
23+
## Actual outcome
24+
After click it is working for couple of second and the it closes itself.
25+
26+
# Versions
27+
App: 1.2.3 (check it in app's about page)
28+
Chrome: Stable (or) 47.0.111.111 (check it in Chrome's about page)
29+
30+
# Steps to reproduce
31+
1. Turn off CodeMirror
32+
2. Set method to "PUT"
33+
3. Use "raw" tab for both payload and headers
34+
4. Paste following data into the headers field: ...
35+
5. Paste following data into the payload field: ...
36+
6. Run the request.
37+
```
38+
39+
## Submitting Pull Requests
40+
**While developing**, be sure that you follow the [design guidelines] for ARC.
41+
42+
**Before creating a pull request**, fill up `changelog.md` file inside the elements folder. It is the best way of keeping track of change reasons. Try be very specific and put there only essential information about the changes.
43+
44+
Then a good idea is to test your code. See testing paragraph in the dev-start file. It will save all of us a lot of trouble.
45+
46+
Please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with ARC authors and community before diving into a pull request.
47+
48+
When submitting pull requests, please provide:
49+
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax:
50+
51+
```markdown
52+
(For a single issue)
53+
Fixes #20
54+
55+
(For multiple issues)
56+
Fixes #32, #40
57+
```
58+
Github automatically close the issues after merging it to the master. So please, keep the format.
59+
60+
2. **A succinct description of the design** used to fix any related issues. For example:
61+
62+
```markdown
63+
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
64+
```
65+
66+
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
67+
68+
If a proposed change contains multiple commits, please [squash commits](http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change.
69+
70+
_Part of this document has been copied from Polymer repository. Thanks guys!_
71+
72+
73+
[87714bdc]: https://docs.google.com/document/d/10OPWl9Hagk6Oz--VUztQBTOpm3QP2Vv__PrH3zZ7wFQ/edit?usp=sharing "Feature request file"
74+
[Design guidelines]: <https://github.com/jarrodek/ChromeRestClient/wiki/design>

LICENSE.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
Apache License, Version 2.0
2+
3+
4+
Apache License
5+
Version 2.0,
6+
January 2004
7+
8+
http://www.apache.org/licenses/
9+
10+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11+
12+
1. Definitions.
13+
14+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
15+
16+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
17+
18+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
19+
20+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
21+
22+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
23+
24+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
25+
26+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
27+
28+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
29+
30+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
31+
32+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
33+
34+
2. Grant of Copyright License.
35+
36+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
37+
38+
3. Grant of Patent License.
39+
40+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
41+
42+
4. Redistribution.
43+
44+
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
45+
46+
You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
47+
48+
5. Submission of Contributions.
49+
50+
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
51+
52+
6. Trademarks.
53+
54+
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
55+
56+
7. Disclaimer of Warranty.
57+
58+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
59+
60+
8. Limitation of Liability.
61+
62+
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
63+
64+
9. Accepting Warranty or Additional Liability.
65+
66+
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
67+
68+
## Commercial or non open source license
69+
# Creative Commons Attribution 4.0 International
70+
71+
> Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
72+
73+
## Using Creative Commons Public Licenses
74+
75+
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
76+
77+
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
78+
79+
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# api-console-dependency-manager
2+
3+
https://travis-ci.org/advanced-rest-client/api-console-dependency-manager.svg?branch=master
4+
5+
A npm module to detect and install Mulesoft's API console dependencies.
6+
7+
This module is mainly used in the [api-console-builder](https://github.com/mulesoft-labs/api-console-builder).
8+
9+
## API
10+
11+
Shorthand functions:
12+
13+
- `installDependencies(workingDir, logger, opts)` -> `new DependendenciesManager#installDependencies(workingDir, logger, opts)`
14+
15+
The module exposes 2 classes:
16+
17+
- [DependendenciesManager](lib/dependencies.js)
18+
- [DependenciesOptions](lib/dependencies-options.js)
19+
20+
### Example
21+
22+
```javascript
23+
const consoleDependencies = require('api-console-dependency-manager');
24+
25+
consoleDependencies.installDependencies('./build/', console, {
26+
verbose: true,
27+
parser: true,
28+
app: true
29+
})
30+
.then(() => console.log('Dependencies are now installed'))
31+
.catch(cause => console.error(cause));
32+
```
33+
34+
equivalent to
35+
36+
```javascript
37+
const {DependendenciesManager, DependenciesOptions} = require('api-console-github-resolver');
38+
39+
const options = new DependenciesOptions({
40+
verbose: true,
41+
parser: true,
42+
app: true
43+
});
44+
const workingDir = './build/';
45+
const logger = console; // Winston or other with console like interface
46+
const manager = new DependendenciesManager(workingDir, logger, options);
47+
manager.installDependencies()
48+
.then(() => console.log('Dependencies are now installed'))
49+
.catch(cause => console.error(cause));
50+
```
51+
52+
### DependenciesOptions
53+
54+
| Property | Type | Default | Description |
55+
| -------- | -------- | -------- | -------- |
56+
| `verbose` | `Boolean` | `false` | Prints verbose output while installing dependencies. This is used to build install command for bower which is printing console output by default. |
57+
| `parser` | `Boolean` | `false` | If set it installs RAML javascript parser with the enhancer. |
58+
| `app` | `Boolean` | `false` | If set it installs `app-route` element to support standalone application architecture of the API console. |
59+
60+
### DependendenciesManager
61+
62+
#### Constructor
63+
64+
##### Arguments
65+
66+
| Property | Type | Description |
67+
| -------- | -------- | -------- |
68+
| `workingDir` | `String` | Path to a working directory where the console is processed. Usually it's where the bower.json file is. |
69+
| `logger` | `Object` | Any logger with the interface compatible with platform's `console` object. |
70+
| `options` | `Object` or `DependenciesOptions` | Build options passed to the module. |
71+
72+
#### `installDependencies()`
73+
74+
Installs dependencies in the `workingDir`.
75+
76+
##### Return <Promise>
77+
78+
Resolved promise when operation is completed.

lib/dependencies-options.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
'use strict';
2+
/**
3+
* Copyright (C) Mulesoft.
4+
* Shared under Apache 2.0 license
5+
*
6+
* @author Pawel Psztyc <pawel.psztyc@mulesoft.com>
7+
*/
8+
/**
9+
* Options object for the DependendenciesManager class.
10+
*/
11+
class DependenciesOptions {
12+
constructor(opts) {
13+
opts = opts || {};
14+
/**
15+
* Prints verbose output while installing dependencies.
16+
* This is used to build install command for bower which is printing
17+
* console output by default.
18+
* @type {Boolean}
19+
*/
20+
this.verbose = typeof opts.verbose === 'boolean' ? opts.verbose : false;
21+
/**
22+
* If set it installs RAML javascript parser with the enhancer.
23+
* @type {Boolean}
24+
*/
25+
this.parser = typeof opts.parser === 'boolean' ? opts.parser : false;
26+
/**
27+
* If set it installs `app-route` element to support standalone application
28+
* architecture of the API console.
29+
* @type {Boolean}
30+
*/
31+
this.app = typeof opts.app === 'boolean' ? opts.app : false;
32+
}
33+
}
34+
exports.DependenciesOptions = DependenciesOptions;

0 commit comments

Comments
 (0)