Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cf41a57
Showing
9 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
'presets': [ | ||
'es2015', | ||
'stage-0', | ||
'stage-1', | ||
'stage-2', | ||
'stage-3' | ||
], | ||
'plugins': ['transform-runtime', 'transform-decorators-legacy'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea/ | ||
build/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v5.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Blockchain of Things Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
identifier=com.blockchainofthings.PawExtensions.UrlPathParamDynValue | ||
extensions_dir=$(HOME)/Library/Containers/com.luckymarmot.Paw/Data/Library/Application Support/com.luckymarmot.Paw/Extensions/ | ||
|
||
build: | ||
npm run build | ||
cp README.md LICENSE ./build/$(identifier)/ | ||
|
||
clean: | ||
rm -Rf ./build/ | ||
|
||
install: clean build | ||
mkdir -p "$(extensions_dir)$(identifier)/" | ||
cp -r ./build/$(identifier)/* "$(extensions_dir)$(identifier)/" | ||
|
||
test: | ||
npm test | ||
|
||
archive: build | ||
cd ./build/; zip -r UrlPathParamDynValue.zip "$(identifier)/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# URL Path Parameter Paw Extension | ||
|
||
This is a Dynamic Value Paw extension that can be used to add parameters to the URL path. | ||
|
||
## Use | ||
|
||
Just add the Dynamic Value to the URL, specify a name for the parameter and its value. The value you enter | ||
is automatically URL-encoded, and the name of the parameter is shown on the URL input field instead of the actual value, which | ||
makes the URL more readable and clean. It also helps for an easier identification of the different parameters that are found | ||
in the URL. | ||
|
||
## Development | ||
|
||
### Prerequisites | ||
|
||
```shell | ||
nvm install | ||
nvm use | ||
npm install | ||
``` | ||
|
||
### Build | ||
|
||
```shell | ||
npm run build | ||
``` | ||
|
||
### Install | ||
|
||
```shell | ||
make install | ||
``` | ||
|
||
### Test | ||
|
||
```shell | ||
npm test | ||
``` | ||
|
||
## License | ||
|
||
This Paw Extension is released under the [MIT License](LICENSE). Feel free to fork, and modify! | ||
|
||
Copyright © 2017 Blockchain of Things Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "UrlPathParamDynValue", | ||
"version": "1.0.0", | ||
"main": "src/UrlPathParamDynValue.js", | ||
"license": "MIT", | ||
"homepage": "https://github.com/blockchainofthings/Paw-UrlPathParamDynValue", | ||
"dependencies": { | ||
"babel-plugin-transform-flow-strip-types": "6.3.15", | ||
"babel-polyfill": "6.3.14", | ||
"babel-runtime": "6.3.19", | ||
"immutable": "3.7.6" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "6.4.0", | ||
"babel-loader": "6.2.0", | ||
"babel-plugin-rewire": "1.0.0-beta-3", | ||
"babel-plugin-transform-decorators": "6.3.13", | ||
"babel-plugin-transform-decorators-legacy": "1.3.2", | ||
"babel-plugin-transform-runtime": "6.3.13", | ||
"babel-preset-es2015": "6.3.13", | ||
"babel-preset-stage-0": "6.3.13", | ||
"babel-preset-stage-1": "6.3.13", | ||
"babel-preset-stage-2": "6.3.13", | ||
"babel-preset-stage-3": "6.3.13", | ||
"babel-register": "6.3.13", | ||
"chai": "3.4.1", | ||
"mocha": "2.3.4", | ||
"path": "0.12.7", | ||
"webpack": "1.12.9" | ||
}, | ||
"scripts": { | ||
"build": "rm -rf dist/ && BUILD_ENV=build ./node_modules/.bin/webpack --bail --display-error-details", | ||
"test": "exit 0" | ||
}, | ||
"options": { | ||
"mocha": "./node_modules/.bin/mocha --require mocha --compilers js:babel-register --reporter spec" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/blockchainofthings/Paw-UrlPathParamDynValue.git" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Created by claudio on 25/02/17. | ||
*/ | ||
|
||
@registerDynamicValueClass | ||
class UrlPathParamDynValue { | ||
|
||
static identifier = 'com.blockchainofthings.PawExtensions.UrlPathParamDynValue'; | ||
static title = 'URL Path Parameter'; | ||
static inputs = [ | ||
DynamicValueInput('paramName', 'Parameter Name', "String"), | ||
DynamicValueInput('paramValue', 'Value', "String") | ||
]; | ||
|
||
evaluate(context) { | ||
return encodeURIComponent(this.paramValue); | ||
} | ||
|
||
title(context) { | ||
return 'Param'; | ||
} | ||
|
||
text(context) { | ||
return this.paramName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import webpack from 'webpack'; | ||
import path from 'path'; | ||
|
||
const name = 'UrlPathParamDynValue'; | ||
|
||
const production = process.env.NODE_ENV === 'production'; | ||
|
||
const config = { | ||
target: 'web', | ||
entry: [ | ||
'immutable', | ||
'./src/UrlPathParamDynValue.js' | ||
], | ||
output:{ | ||
path: path.join(__dirname, | ||
'./build/com.blockchainofthings.PawExtensions.UrlPathParamDynValue'), | ||
pathInfo: true, | ||
publicPath: '/build/', | ||
filename: name+'.js' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
loader: 'babel-loader', | ||
include: [ | ||
path.resolve(__dirname, 'src') | ||
], | ||
test: /\.jsx?$/ | ||
} | ||
] | ||
} | ||
}; | ||
|
||
module.exports = config; |