js-dos 7.2.7 → 7.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -13
- package/dist/js-dos.css +80 -8
- package/dist/js-dos.js +2 -2
- package/dist/js-dos.js.map +1 -1
- package/dist/types/src/backend/{jj → v7}/latency.d.ts +0 -0
- package/dist/types/src/backend/v7/v7-config.d.ts +12 -4
- package/dist/types/src/components/action-save-or-exit.d.ts +2 -0
- package/dist/types/src/components/sidebar/token/token-add-time.d.ts +2 -0
- package/dist/types/src/components/sidebar/token/token-select.d.ts +2 -0
- package/dist/types/src/components/sidebar/token/token.d.ts +15 -0
- package/dist/types/src/icons.d.ts +3 -0
- package/dist/types/src/player-app.d.ts +3 -4
- package/dist/types/src/request.d.ts +1 -0
- package/dist/wdosbox.js +2 -2
- package/dist/wdosbox.js.symbols +3128 -3132
- package/dist/wdosbox.wasm +0 -0
- package/examples/digger/index.html +2 -1
- package/package.json +2 -2
- package/.github/workflows/codeql-analysis.yml +0 -70
- package/.github/workflows/yarn-gulp.yml +0 -30
- package/dist/types/src/backend/jj/jj-config.d.ts +0 -6
- package/dist/types/src/components/action-exit.d.ts +0 -2
- package/dist/types/src/components/sidebar/active-token.d.ts +0 -2
- package/dist/types/src/components/sidebar/create-token.d.ts +0 -2
- package/v7-services/.env +0 -6
- package/v7-services/ok.yaml +0 -24
- package/v7-services/package.json +0 -17
- package/v7-services/redeploy-ok.sh +0 -25
- package/v7-services/serverless.yml +0 -140
- package/v7-services/src/networking/day.ts +0 -5
- package/v7-services/src/networking/get-free-token.ts +0 -33
- package/v7-services/src/networking/get-token-cost.ts +0 -31
- package/v7-services/src/networking/get-token-info.ts +0 -16
- package/v7-services/src/networking/ipx/put-ipx-ip.ts +0 -20
- package/v7-services/src/networking/ipx/start-ipx.ts +0 -16
- package/v7-services/src/networking/ipx/stop-ipx.ts +0 -19
- package/v7-services/src/networking/limits.ts +0 -3
- package/v7-services/src/networking/token.ts +0 -238
- package/v7-services/src/ok.ts +0 -7
- package/v7-services/src/personal-acl.ts +0 -33
- package/v7-services/src/personal-put.ts +0 -35
- package/v7-services/src/personal.ts +0 -18
- package/v7-services/src/responses.ts +0 -28
- package/v7-services/src/user.ts +0 -3
- package/v7-services/yarn.lock +0 -4400
- package/yarn-error.log +0 -6344
package/dist/wdosbox.wasm
CHANGED
|
Binary file
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
// bundleUrl = "https://cdn.dos.zone/original/2X/a/ac888d1660aa253f0ed53bd6c962c894125aaa19.jsdos"; // wolf 3d
|
|
29
29
|
// bundleUrl = "https://cdn.dos.zone/custom/dos/homm_2.jsdos"; // heroes of might and magic 2
|
|
30
30
|
// bundleUrl = "https://doszone-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/2X/6/60b165c86771eadf24cb2f81aef4656b85d167a6.jsdos"; // transport tycoon deluxe
|
|
31
|
-
|
|
31
|
+
bundleUrl = "doom_coop.jsdos";
|
|
32
32
|
let clientId = null;
|
|
33
33
|
emulators.pathPrefix = "/dist/";
|
|
34
34
|
Dos(document.getElementById("jsdos"), {
|
|
35
35
|
hardware: window.hardware,
|
|
36
|
+
withExperimentalApi: true,
|
|
36
37
|
clientId: (userGesture) => {
|
|
37
38
|
if (!userGesture) {
|
|
38
39
|
return Promise.resolve(clientId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "js-dos",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.3",
|
|
4
4
|
"description": "Easiest API to run dos programs in browser",
|
|
5
5
|
"main": "dist/js-dos.js",
|
|
6
6
|
"types": "dist/types/src/player.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"browserify": "^17.0.0",
|
|
49
49
|
"core-js": "^3.17.1",
|
|
50
50
|
"del": "^5.1.0",
|
|
51
|
-
"emulators": "^0.72.
|
|
51
|
+
"emulators": "^0.72.5",
|
|
52
52
|
"emulators-ui": "^0.72.9",
|
|
53
53
|
"eslint": "^7.32.0",
|
|
54
54
|
"eslint-config-google": "^0.14.0",
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
-
# to commit it to your repository.
|
|
3
|
-
#
|
|
4
|
-
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
-
# or to provide custom queries or build logic.
|
|
6
|
-
#
|
|
7
|
-
# ******** NOTE ********
|
|
8
|
-
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
-
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
-
# supported CodeQL languages.
|
|
11
|
-
#
|
|
12
|
-
name: "CodeQL"
|
|
13
|
-
|
|
14
|
-
on:
|
|
15
|
-
push:
|
|
16
|
-
branches: [ 7.xx ]
|
|
17
|
-
pull_request:
|
|
18
|
-
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [ 7.xx ]
|
|
20
|
-
schedule:
|
|
21
|
-
- cron: '33 3 * * 6'
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
analyze:
|
|
25
|
-
name: Analyze
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
permissions:
|
|
28
|
-
actions: read
|
|
29
|
-
contents: read
|
|
30
|
-
security-events: write
|
|
31
|
-
|
|
32
|
-
strategy:
|
|
33
|
-
fail-fast: false
|
|
34
|
-
matrix:
|
|
35
|
-
language: [ 'typescript' ]
|
|
36
|
-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
|
38
|
-
|
|
39
|
-
steps:
|
|
40
|
-
- name: Checkout repository
|
|
41
|
-
uses: actions/checkout@v2
|
|
42
|
-
|
|
43
|
-
# Initializes the CodeQL tools for scanning.
|
|
44
|
-
- name: Initialize CodeQL
|
|
45
|
-
uses: github/codeql-action/init@v1
|
|
46
|
-
with:
|
|
47
|
-
languages: ${{ matrix.language }}
|
|
48
|
-
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
-
# By default, queries listed here will override any specified in a config file.
|
|
50
|
-
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
51
|
-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
52
|
-
|
|
53
|
-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
54
|
-
# If this step fails, then you should remove it and run the build manually (see below)
|
|
55
|
-
- name: Autobuild
|
|
56
|
-
uses: github/codeql-action/autobuild@v1
|
|
57
|
-
|
|
58
|
-
# ℹ️ Command-line programs to run using the OS shell.
|
|
59
|
-
# 📚 https://git.io/JvXDl
|
|
60
|
-
|
|
61
|
-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
62
|
-
# and modify them (or add more) to build your code if your project
|
|
63
|
-
# uses a compiled language
|
|
64
|
-
|
|
65
|
-
#- run: |
|
|
66
|
-
# make bootstrap
|
|
67
|
-
# make release
|
|
68
|
-
|
|
69
|
-
- name: Perform CodeQL Analysis
|
|
70
|
-
uses: github/codeql-action/analyze@v1
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
name: Build
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ 7.xx ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ 7.xx ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
strategy:
|
|
14
|
-
matrix:
|
|
15
|
-
node-version: [12.x, 14.x, 16.x]
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v2
|
|
19
|
-
|
|
20
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
21
|
-
uses: actions/setup-node@v1
|
|
22
|
-
with:
|
|
23
|
-
node-version: ${{ matrix.node-version }}
|
|
24
|
-
|
|
25
|
-
- name: Build
|
|
26
|
-
run: |
|
|
27
|
-
npm install -g yarn
|
|
28
|
-
yarn
|
|
29
|
-
yarn run eslint . --ext ts --max-warnings 0
|
|
30
|
-
yarn run gulp
|
package/v7-services/.env
DELETED
package/v7-services/ok.yaml
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
service: jsdos-ok
|
|
2
|
-
|
|
3
|
-
package:
|
|
4
|
-
exclude:
|
|
5
|
-
- 'node_modules/**'
|
|
6
|
-
|
|
7
|
-
provider:
|
|
8
|
-
name: aws
|
|
9
|
-
runtime: nodejs14.x
|
|
10
|
-
memorySize: 128
|
|
11
|
-
versionFunctions: false
|
|
12
|
-
|
|
13
|
-
functions:
|
|
14
|
-
ok:
|
|
15
|
-
handler: src/ok.ok
|
|
16
|
-
name: jsdos-ok
|
|
17
|
-
events:
|
|
18
|
-
- http:
|
|
19
|
-
path: /ok
|
|
20
|
-
method: get
|
|
21
|
-
cors: true
|
|
22
|
-
|
|
23
|
-
plugins:
|
|
24
|
-
- serverless-plugin-typescript
|
package/v7-services/package.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "js-dos-v7-services",
|
|
3
|
-
"description": "",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"license": "GPL-2.0",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"nanoid": "^3.1.30"
|
|
8
|
-
},
|
|
9
|
-
"devDependencies": {
|
|
10
|
-
"@types/aws-lambda": "^8.10.88",
|
|
11
|
-
"@types/node": "^14.6.4",
|
|
12
|
-
"aws-sdk": "^2.1048.0",
|
|
13
|
-
"serverless": "^2.69.1",
|
|
14
|
-
"serverless-plugin-typescript": "^2.1.0",
|
|
15
|
-
"typescript": "^4.5.4"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -ex
|
|
4
|
-
|
|
5
|
-
yarn run sls deploy -c ok.yaml --verbose --region us-east-1
|
|
6
|
-
yarn run sls deploy -c ok.yaml --verbose --region us-east-2
|
|
7
|
-
yarn run sls deploy -c ok.yaml --verbose --region us-west-1
|
|
8
|
-
yarn run sls deploy -c ok.yaml --verbose --region us-west-2
|
|
9
|
-
yarn run sls deploy -c ok.yaml --verbose --region eu-central-1
|
|
10
|
-
yarn run sls deploy -c ok.yaml --verbose --region eu-west-1
|
|
11
|
-
yarn run sls deploy -c ok.yaml --verbose --region eu-west-2
|
|
12
|
-
yarn run sls deploy -c ok.yaml --verbose --region eu-south-1
|
|
13
|
-
yarn run sls deploy -c ok.yaml --verbose --region eu-west-3
|
|
14
|
-
yarn run sls deploy -c ok.yaml --verbose --region eu-north-1
|
|
15
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-east-1
|
|
16
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-south-1
|
|
17
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-northeast-3
|
|
18
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-northeast-2
|
|
19
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-southeast-1
|
|
20
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-southeast-2
|
|
21
|
-
yarn run sls deploy -c ok.yaml --verbose --region ap-northeast-1
|
|
22
|
-
yarn run sls deploy -c ok.yaml --verbose --region ca-central-1
|
|
23
|
-
yarn run sls deploy -c ok.yaml --verbose --region me-south-1
|
|
24
|
-
yarn run sls deploy -c ok.yaml --verbose --region sa-east-1
|
|
25
|
-
yarn run sls deploy -c ok.yaml --verbose --region af-south-1
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
org: caiiiycuk
|
|
2
|
-
app: jsdos-backend
|
|
3
|
-
service: jsdos-v7
|
|
4
|
-
|
|
5
|
-
provider:
|
|
6
|
-
name: aws
|
|
7
|
-
runtime: nodejs14.x
|
|
8
|
-
region: eu-central-1
|
|
9
|
-
memorySize: 256
|
|
10
|
-
versionFunctions: false
|
|
11
|
-
environment:
|
|
12
|
-
NETWORKING_TABLE: "v2_r1_dznetworking"
|
|
13
|
-
PUT_CURL: "jjs-putCurl"
|
|
14
|
-
RUN_INSTANCE: "jjs-runInstanceV2"
|
|
15
|
-
iamRoleStatements:
|
|
16
|
-
- Effect: Allow
|
|
17
|
-
Action:
|
|
18
|
-
- s3:ListBucket
|
|
19
|
-
Resource:
|
|
20
|
-
- "arn:aws:s3:::doszone-uploads"
|
|
21
|
-
- Effect: Allow
|
|
22
|
-
Action:
|
|
23
|
-
- s3:Get*
|
|
24
|
-
- s3:Put*
|
|
25
|
-
Resource:
|
|
26
|
-
- "arn:aws:s3:::doszone-uploads/*"
|
|
27
|
-
- Effect: Allow
|
|
28
|
-
Action:
|
|
29
|
-
- lambda:InvokeFunction
|
|
30
|
-
Resource:
|
|
31
|
-
- "arn:aws:lambda:${opt:region, self:provider.region}:*:function:${self:provider.environment.PUT_CURL}"
|
|
32
|
-
- "arn:aws:lambda:${opt:region, self:provider.region}:*:function:${self:provider.environment.RUN_INSTANCE}"
|
|
33
|
-
- Effect: Allow
|
|
34
|
-
Action:
|
|
35
|
-
- dynamodb:Query
|
|
36
|
-
- dynamodb:Scan
|
|
37
|
-
- dynamodb:GetItem
|
|
38
|
-
- dynamodb:PutItem
|
|
39
|
-
- dynamodb:UpdateItem
|
|
40
|
-
- dynamodb:DeleteItem
|
|
41
|
-
Resource:
|
|
42
|
-
- "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.NETWORKING_TABLE}"
|
|
43
|
-
|
|
44
|
-
functions:
|
|
45
|
-
getTokenCost:
|
|
46
|
-
handler: src/networking/get-token-cost.getTokenCost
|
|
47
|
-
name: jsdos-getTokenCost
|
|
48
|
-
events:
|
|
49
|
-
- http:
|
|
50
|
-
path: /token/cost/get
|
|
51
|
-
method: get
|
|
52
|
-
cors: true
|
|
53
|
-
getFreeToken:
|
|
54
|
-
handler: src/networking/get-free-token.getFreeToken
|
|
55
|
-
name: jsdos-getFreeToken
|
|
56
|
-
events:
|
|
57
|
-
- http:
|
|
58
|
-
path: /token/free/get
|
|
59
|
-
method: get
|
|
60
|
-
cors: true
|
|
61
|
-
getTokenInfo:
|
|
62
|
-
handler: src/networking/get-token-info.getTokenInfo
|
|
63
|
-
name: jsdos-getTokenInfo
|
|
64
|
-
events:
|
|
65
|
-
- http:
|
|
66
|
-
path: /token/info/get
|
|
67
|
-
method: get
|
|
68
|
-
cors: true
|
|
69
|
-
startIpx:
|
|
70
|
-
handler: src/networking/ipx/start-ipx.startIpx
|
|
71
|
-
name: jsdos-startIpx
|
|
72
|
-
events:
|
|
73
|
-
- http:
|
|
74
|
-
path: /token/ipx/start
|
|
75
|
-
method: get
|
|
76
|
-
cors: true
|
|
77
|
-
putIpxIp:
|
|
78
|
-
handler: src/networking/ipx/put-ipx-ip.putIpxIp
|
|
79
|
-
name: jsdos-putIpxIp
|
|
80
|
-
events:
|
|
81
|
-
- http:
|
|
82
|
-
path: /token/ipx/ip/put
|
|
83
|
-
method: put
|
|
84
|
-
cors: true
|
|
85
|
-
stopIpx:
|
|
86
|
-
handler: src/networking/ipx/stop-ipx.stopIpx
|
|
87
|
-
name: jsdos-stopIpx
|
|
88
|
-
events:
|
|
89
|
-
- http:
|
|
90
|
-
path: /token/ipx/stop
|
|
91
|
-
method: post
|
|
92
|
-
cors: true
|
|
93
|
-
personalPut:
|
|
94
|
-
handler: src/personal-put.personalPut
|
|
95
|
-
name: jsdos-personalPut
|
|
96
|
-
events:
|
|
97
|
-
- http:
|
|
98
|
-
path: /personal/put
|
|
99
|
-
method: post
|
|
100
|
-
cors: true
|
|
101
|
-
personalAcl:
|
|
102
|
-
handler: src/personal-acl.personalAcl
|
|
103
|
-
name: jsdos-personalAcl
|
|
104
|
-
events:
|
|
105
|
-
- http:
|
|
106
|
-
path: /personal/acl
|
|
107
|
-
method: post
|
|
108
|
-
cors: true
|
|
109
|
-
|
|
110
|
-
resources:
|
|
111
|
-
Resources:
|
|
112
|
-
dznetworking:
|
|
113
|
-
Type: 'AWS::DynamoDB::Table'
|
|
114
|
-
DeletionPolicy: Retain
|
|
115
|
-
Properties:
|
|
116
|
-
AttributeDefinitions:
|
|
117
|
-
-
|
|
118
|
-
AttributeName: key
|
|
119
|
-
AttributeType: S
|
|
120
|
-
-
|
|
121
|
-
AttributeName: day
|
|
122
|
-
AttributeType: N
|
|
123
|
-
KeySchema:
|
|
124
|
-
-
|
|
125
|
-
AttributeName: key
|
|
126
|
-
KeyType: HASH
|
|
127
|
-
GlobalSecondaryIndexes:
|
|
128
|
-
-
|
|
129
|
-
IndexName: day
|
|
130
|
-
KeySchema:
|
|
131
|
-
-
|
|
132
|
-
AttributeName: day
|
|
133
|
-
KeyType: HASH
|
|
134
|
-
Projection:
|
|
135
|
-
ProjectionType: ALL
|
|
136
|
-
TableName: ${self:provider.environment.NETWORKING_TABLE}
|
|
137
|
-
BillingMode: PAY_PER_REQUEST
|
|
138
|
-
|
|
139
|
-
plugins:
|
|
140
|
-
- serverless-plugin-typescript
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { error, badRequest, success } from "../responses";
|
|
2
|
-
import { getDayOrigin } from "./day";
|
|
3
|
-
import { freeTierSoftLimit, freeTierHardLimit } from "./limits";
|
|
4
|
-
import { createFreeToken, getFreeTierHardCount, getFreeTierSoftCount } from "./token";
|
|
5
|
-
|
|
6
|
-
export const getFreeToken = async (event: any) => {
|
|
7
|
-
const namespace = event.queryStringParameters?.namespace;
|
|
8
|
-
const id = event.queryStringParameters?.id;
|
|
9
|
-
const region = event.queryStringParameters?.region;
|
|
10
|
-
const day = getDayOrigin();
|
|
11
|
-
|
|
12
|
-
if (!namespace || !id || !region) {
|
|
13
|
-
return badRequest();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const softCount = await getFreeTierSoftCount(namespace, id, day);
|
|
17
|
-
if (softCount >= freeTierSoftLimit) {
|
|
18
|
-
return error("free-soft-limit");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const hardCount = await getFreeTierHardCount(day);
|
|
22
|
-
if (hardCount >= freeTierHardLimit) {
|
|
23
|
-
return error("free-hard-limit");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
try {
|
|
27
|
-
return success({
|
|
28
|
-
token: await createFreeToken(namespace, id, day, region),
|
|
29
|
-
});
|
|
30
|
-
} catch (e) {
|
|
31
|
-
return error(e.message);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { error, badRequest, success } from "../responses";
|
|
2
|
-
import { getDayOrigin } from "./day";
|
|
3
|
-
import { freeTierSoftLimit, freeTierSec, freeTierHardLimit } from "./limits";
|
|
4
|
-
import { getFreeTierHardCount, getFreeTierSoftCount } from "./token";
|
|
5
|
-
|
|
6
|
-
export const getTokenCost = async (event: any) => {
|
|
7
|
-
const namespace = event.queryStringParameters?.namespace;
|
|
8
|
-
const id = event.queryStringParameters?.id;
|
|
9
|
-
const durationSec = Number.parseInt(event.queryStringParameters?.durationSec);
|
|
10
|
-
const day = getDayOrigin();
|
|
11
|
-
|
|
12
|
-
if (!namespace || !id || !durationSec || isNaN(durationSec)) {
|
|
13
|
-
return badRequest();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (freeTierSec !== durationSec) {
|
|
17
|
-
return error("30-min-required");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (await getFreeTierSoftCount(namespace, id, day) >= freeTierSoftLimit) {
|
|
21
|
-
return error("free-soft-limit");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (await getFreeTierHardCount(day) >= freeTierHardLimit) {
|
|
25
|
-
return error("free-hard-limit");
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return success({
|
|
29
|
-
cost: 0,
|
|
30
|
-
});
|
|
31
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { badRequest, error, success } from "../responses";
|
|
2
|
-
import { getToken } from "./token";
|
|
3
|
-
|
|
4
|
-
export const getTokenInfo = async (event: any) => {
|
|
5
|
-
const token = event.queryStringParameters?.token;
|
|
6
|
-
|
|
7
|
-
if (!token) {
|
|
8
|
-
return badRequest();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
return success(await getToken(token));
|
|
13
|
-
} catch (e) {
|
|
14
|
-
return error(e.message);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { error, badRequest, success } from "../../responses";
|
|
2
|
-
import { putIp } from "../token";
|
|
3
|
-
|
|
4
|
-
export const putIpxIp = async (event: any) => {
|
|
5
|
-
const token = event.queryStringParameters?.token;
|
|
6
|
-
const arn = event.queryStringParameters?.arn;
|
|
7
|
-
const ip = event.queryStringParameters.ip;
|
|
8
|
-
|
|
9
|
-
if (!token || !arn || !ip) {
|
|
10
|
-
return badRequest();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
await putIp(token, arn, ip, "ipx");
|
|
15
|
-
return success({});
|
|
16
|
-
} catch (e) {
|
|
17
|
-
console.error("Can't update ipx ip", e);
|
|
18
|
-
return error(e.message);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { error, badRequest, success } from "../../responses";
|
|
2
|
-
import { newTask } from "../token";
|
|
3
|
-
|
|
4
|
-
export const startIpx = async (event: any) => {
|
|
5
|
-
const token = event.queryStringParameters?.token;
|
|
6
|
-
if (!token) {
|
|
7
|
-
return badRequest();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
return success({ arn: await newTask(token, "ipx") });
|
|
12
|
-
} catch (e) {
|
|
13
|
-
console.error("Can't start ipx-server", e);
|
|
14
|
-
return error(e.message);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { error, badRequest, success } from "../../responses";
|
|
2
|
-
import { stopTask } from "../token";
|
|
3
|
-
|
|
4
|
-
export const stopIpx = async (event: any) => {
|
|
5
|
-
const token = event.queryStringParameters?.token;
|
|
6
|
-
const arn = event.queryStringParameters?.arn;
|
|
7
|
-
|
|
8
|
-
if (!token || !arn) {
|
|
9
|
-
return badRequest();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
await stopTask(token, arn, "ipx");
|
|
14
|
-
return success({});
|
|
15
|
-
} catch (e) {
|
|
16
|
-
console.error("Can't update ipx ip", e);
|
|
17
|
-
return error(e.message);
|
|
18
|
-
}
|
|
19
|
-
};
|