Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump dependencies #16

Merged
merged 17 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Serverless deploy to ${{ matrix.region }}
uses: serverless/github-action@v2
uses: serverless/github-action@v3
with:
args: deploy --region ${{ matrix.region }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Serverless deploy to ${{ matrix.region }}
uses: serverless/github-action@v2
uses: serverless/github-action@v3
with:
args: deploy --region ${{ matrix.region }}
env:
Expand Down
25 changes: 24 additions & 1 deletion admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import * as serverless from 'serverless-http'
import * as express from 'express'
import * as logger from 'log-aws-lambda'
import AWS = require('aws-sdk')
import { getDevicesOfUser, getUserRecord } from './db'
import { getDevicesOfUser, getThingsOfUser, getUserRecord } from './db'
import { proactivelyRediscoverAllDevices } from './helper'
import { publish } from './mqtt'
import { switchToPlan } from './subscription'
import { PlanName } from './Plan'

logger()

Expand Down Expand Up @@ -277,6 +280,26 @@ app.post('/thing/:thingName/rediscover', async function (req, res) {
}
})

app.post('/user/:userId/restartThings', async function (req, res) {
try {
const thingIds = await getThingsOfUser(req.params.userId)
for (const thingId of thingIds) {
await publish(`vsh/${thingId}/service`, {
operation: 'restart',
})
}
res.send({ result: 'ok', thingIds })
} catch (err) {
console.log(err)
res.status(500).send(err.message)
}
})

app.post('/user/:userId/switchToPlan/:planName', async function (req, res) {
await switchToPlan(req.params.userId, req.params.planName as PlanName)
res.send({ result: 'ok' })
})

app.post('/thing/:thingName/blockUser', async function (req, res) {
res.status(500).send('not yet implemented')
})
Expand Down
2 changes: 1 addition & 1 deletion backendApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from './subscription'

const stripe = new Stripe(process.env.STRIPE_API_KEY, {
apiVersion: '2022-08-01',
apiVersion: '2023-08-16',
})

interface AuthenticatedRequest extends express.Request {
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,34 @@
},
"dependencies": {
"@gomomento/sdk": "^0.15.0",
"@types/semver": "^7.3.12",
"ask-sdk": "^2.12.1",
"aws-sdk": "^2.1209.0",
"aws4": "^1.10.1",
"axios": "^0.27.2",
"@types/semver": "^7.5.3",
"ask-sdk": "^2.14.0",
"aws-sdk": "^2.1468.0",
"aws4": "^1.12.0",
"axios": "^1.5.1",
"cors": "^2.8.5",
"dayjs": "^1.11.5",
"express": "^4.18.1",
"js-base64": "^3.7.2",
"jsonwebtoken": "^8.5.1",
"dayjs": "^1.11.10",
"express": "^4.18.2",
"js-base64": "^3.7.5",
"jsonwebtoken": "^9.0.2",
"log": "^6.3.1",
"log-aws-lambda": "^5.0.0",
"semver": "^7.3.7",
"serverless-http": "^2.5.0",
"source-map-support": "^0.5.10",
"stripe": "^10.8.0",
"uuid": "^8.3.0"
"semver": "^7.5.4",
"serverless-http": "^3.2.0",
"source-map-support": "^0.5.21",
"stripe": "^13.8.0",
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/cors": "^2.8.12",
"@types/express": "^4.17.13",
"@types/jsonwebtoken": "^8.5.9",
"@types/log": "^6.3.0",
"@types/node": "^15.14.9",
"@types/cors": "^2.8.14",
"@types/express": "^4.17.18",
"@types/jsonwebtoken": "^9.0.3",
"@types/log": "^6.3.1",
"@types/node": "^20.8.2",
"serverless-alexa-skills": "^0.1.0",
"serverless-plugin-select": "^2.0.0-rc.1",
"serverless-plugin-select": "2.0.0-rc.1",
"serverless-webpack": "^5.13.0",
"ts-loader": "^5.3.3",
"ts-loader": "^9.4.4",
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
Expand Down
Loading