Skip to content

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
test: add deploy to ci
  • Loading branch information
chatter committed Apr 24, 2019
1 parent 81c7147 commit a91198f
Show file tree
Hide file tree
Showing 9 changed files with 810 additions and 940 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Build directory
build/

# Coverage directory
coverage/

# Dependency directories
node_modules/

Expand Down
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
sudo: false

language: node_js

node_js:
- 6.17.1
- 8.16.0
- 10.15.3

cache:
yarn: true
directories:
- node_modules

before_install:
- yarn global add codecov

script:
- make build
- make lint
- make test

after_success:
- codecov

deploy:
provider: releases
api_key:
secure: R3xTpPkfLkADVedjjaBng9HCr61DVthXeAmI73TBon1orKhFYKdnmucrAbI2NJvdk3yohC8fu7diHrt2qk3KD0UfkPoFwdWFauPfPcv0+TDHY2jr80F3NdjIqz9ENwJcvawD8wX5+G5FMTfcAnGDTZY/x2vkthAXm8K98LrEa9t9F+5psHx+IlJ0Nbc5FdW20lzWm/Bzh8EXh1/mTXAtwW0HyKy7zKn3vdMsd/mXDldKNsrhJRFRhgzWRlONXXdKJGk4V0aFAl+K4iNFPMAI39e7Pd165TN60BKh+CvhQSFX/X2dDg0cRJfgyJ/Tp6DH88iR9G/N31VNwKLdlYRlSQRDxMStf/kaKGRtZb+9OQA7+p4+l3QkdZjE+pTB1+4gcYuxnNt02miXZlb+iY4GFCVBNlRAp3eT6l56vD69fa2URHnvduscFzHV8ngVNbXY24vc8z7QQjJlfeHgZ04OlMoZyfO8M5/N4ONAHxMRebK79q+ZWOE8GW7Dui1yDUdrEJVEJpgxVIX2XkCoImq1yTatyBYMg2y9dQFXbak96Y0Gh4RPkIlDBVn4DBt04DOs7SXRab/nT5YYsCsn3eSRF+vJF3HDo9+DIo3JjVjRuSzUJKgcIgfxqGY6AaUDBl6VLy78o7Yjz5DsoUlLp6Nsri/NSyltuXHaTBmkpIPP0pY=
file: build/AzureSASDynamicValue.zip
on:
tags: true
all_branches: true
repo: chatter/Paw-AzureSASDynamicValue
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ identifier=com.chatter.PawExtensions.AzureSASDynamicValue
extensions_dir=$(HOME)/Library/Containers/com.luckymarmot.Paw/Data/Library/Application Support/com.luckymarmot.Paw/Extensions/

build:
yarn install && yarn run build
yarn && yarn run build
cp README.md LICENSE ./build/$(identifier)/

clean:
Expand All @@ -12,6 +12,9 @@ install: clean build
mkdir -p "$(extensions_dir)$(identifier)/"
cp -r ./build/$(identifier)/* "$(extensions_dir)$(identifier)/"

lint:
yarn lint

test:
yarn test

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[![Build Status](https://travis-ci.org/chatter/Paw-AzureSASDynamicValue.svg?branch=master)](https://travis-ci.org/chatter/Paw-AzureSASDynamicValue)
[![codecov](https://codecov.io/gh/chatter/Paw-AzureSASDynamicValue/branch/master/graph/badge.svg)](https://codecov.io/gh/chatter/Paw-AzureSASDynamicValue)
[![Dependency Status](https://david-dm.org/chatter/Paw-AzureSASDynamicValue.svg)](https://david-dm.org/chatter/Paw-AzureSASDynamicValue)
[![devDependencies Status](https://david-dm.org/chatter/Paw-AzureSASDynamicValue/dev-status.svg)](https://david-dm.org/chatter/Paw-AzureSASDynamicValue?type=dev)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square&label=License)](/LICENSE.md)

# Paw-AzureSASDynamicValue

A dynamic value extension to generate a Shared Access Signature authorization
Expand Down
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"author": "Curtis Hatter <[email protected]>",
"license": "MIT",
"private": true,
"engine": {
"node": ">=6.11.5"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/plugin-proposal-class-properties": "^7.4.0",
Expand All @@ -28,15 +31,21 @@
"crypto-js": "^3.1.9-1"
},
"babel": {
"presets": ["@babel/preset-env", "@babel/typescript"],
"plugins": ["@babel/plugin-proposal-class-properties"]
"presets": [
"@babel/preset-env",
"@babel/typescript"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
},
"prettier": {
"semi": false,
"singleQuote": true
},
"scripts": {
"build": "rm -rf build/ && yarn webpack --bail --display-error-details",
"test": "jest"
"lint": "tslint --project .",
"test": "jest --coverage"
}
}
4 changes: 2 additions & 2 deletions src/AzureSASDynamicValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export const AzureSASDynamicValue: DynamicValue = class
*
* TODO: type context
*/
public title = (context: any): string => 'ABC'
public title = (context: any): string => AzureSASDynamicValue.title

/**
* The text to show in the Dynamic Value Tokens
*
* TODO: type context
*/
public text = (context: any): string => 'DEF'
public text = (context: any): string => AzureSASDynamicValue.title

/**
* Evaluates the result of the Dynamic Value evaluation.
Expand Down
10 changes: 9 additions & 1 deletion src/__tests__/AzureSASDynamicValue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ describe('AzureSASDynamicValue', () => {
extension.keyValue = 'test-keyvalue'
})

it('should return static title for title()', () => {
expect(extension.title()).toEqual(AzureSASDynamicValue.title)
})

it('should return static title for text()', () => {
expect(extension.text()).toEqual(AzureSASDynamicValue.title)
})

it('should generate a valid sr', () => {
const token = extension.evaluate(context)
expect(token).toMatch(new RegExp(context.getCurrentRequest().url))
Expand All @@ -26,7 +34,7 @@ describe('AzureSASDynamicValue', () => {
it('should generate a valid se', () => {
const token = extension.evaluate(context)
const now = Math.floor(Date.now() / 1000) + 86400
expect(token).toMatch(new RegExp(`(?<=&se)=${now}(?=&skn)`))
expect(token).toMatch(new RegExp(`&se=${now}&skn`))
})

it('should generate a valid skn', () => {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"outDir": "./dist",
"noImplicitAny": true,
"noImplicitThis": true,
"sourceMap": true,
"strictNullChecks": true,
"esModuleInterop": true,
"noUnusedLocals": true
Expand Down
Loading

0 comments on commit a91198f

Please sign in to comment.