Skip to content

Commit

Permalink
Add new files and update existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-preiskorn committed Jan 13, 2024
1 parent dcf6fc6 commit 59c110d
Show file tree
Hide file tree
Showing 32 changed files with 22,582 additions and 15,792 deletions.
12 changes: 9 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"modules": true
}
},
"rules": {
"semi": [
Expand All @@ -22,12 +26,14 @@
},
"env": {
"es2020": true,
"es6": true,
"jest": true,
"jest/globals": true,
"mocha": true,
"mongo": true,
"es6": true,
"node": true
"node": true,
"commonjs": true,
"jasmine": true
},
"overrides": [
{
Expand Down
17 changes: 17 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Node.js dependencies:
node_modules/
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "3d-inventory-mongo-api" # See documentation for possible values
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "monthly" # Check for updates every month
19 changes: 19 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Configure GitHub Pages"

on: [push] # This workflow will run whenever code is pushed to the repository

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run your action
id: my_step # Give the step an id
uses: ./
with:
static_site_generator: "nuxt"
token: ${{ secrets.GITHUB_TOKEN }}
enablement: "false"
- name: Use outputs
run: echo "The base URL is ${{ steps.my_step.outputs.base_url }}"
51 changes: 0 additions & 51 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
- name: Use Node.js 21.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 21.x
- name: Get npm cache directory
id: npm-cache
run: |
Expand All @@ -22,9 +22,9 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm install, build, and test
- name: npm install and test
run: |
npm ci
npm run build --if-present
npm install
npm run test --if-present
env:
CI: true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ node_modules/
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
gcs/d-inventory-406007-f0b2acc85b03.json
gcs/d-inventory-406007-7f3cc8e7a8f3.json
gcs/d-inventory-406007-b220e292572a.json
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

. "$(dirname "$0")/_/husky.sh"

# npx lint-staged
npx lint-staged
npm --no-git-tag-version version patch
51 changes: 45 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,46 @@
# mongodb
version: '3'

export MONGODB_VERSION=6.0-ubi8
podman pull mongodb/mongodb-community-server
podman run --name mongodb -d mongodb/mongodb-community-server:$MONGODB_VERSION
podman run -d -it -p 27017:27017
podman run --name mongodb -d -p 27017:27017 -v $(pwd)/data:/data/db mongodb/mongodb-community-server:$MONGODB_VERSION
services:
nodejs:
build:
context: .
dockerfile: Dockerfile
image: nodejs
container_name: nodejs
restart: unless-stopped
env_file: .env
environment:
- MONGO_USERNAME=$MONGO_USERNAME
- MONGO_PASSWORD=$MONGO_PASSWORD
- MONGO_HOSTNAME=db
- MONGO_PORT=$MONGO_PORT
- MONGO_DB=$MONGO_DB
ports:
- "80:8080"
volumes:
- .:/home/node/app
- node_modules:/home/node/app/node_modules
networks:
- app-network
command: ./wait-for.sh db:27017 -- /home/node/app/node_modules/.bin/nodemon app.js

db:
image: mongo:4.1.8-xenial
container_name: db
restart: unless-stopped
env_file: .env
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
volumes:
- dbdata:/data/db
networks:
- app-network

networks:
app-network:
driver: bridge

volumes:
dbdata:
node_modules:
56 changes: 32 additions & 24 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@ info:
license:
name: Apache 2.0
url: "https://www.apache.org/licenses/LICENSE-2.0.html"
version: 0.0.6
version: 0.0.7
externalDocs:
description: "https://ultimasolution.pl/3d-inventory-mongo-api"
url: "https://ultimasolution.pl/3d-inventory-mongo-api"
servers:
- url: "http://localhost:8080"
description: localhost
- url: "https://virtserver.swaggerhub.com/karol-preiskorn/3d-inventory-rest-api/0.0.6"
description: SwaggerHub
- url: "https://virtserver.swaggerhub.com/karol-preiskorn/3d-inventory-rest-api/0.0.7"
description: Google Cloud
- url: "https://d-inventory-406007.lm.r.appspot.com/0.0.7"
description: Google Cloud API
tags:
- name: logs
description: Operation on Logs
Expand Down Expand Up @@ -660,8 +662,8 @@ paths:
put:
tags:
- connections
summary: Update new connection beetween two devices
description: Create connection beetween two devices. Two id and attributes from attributes.
summary: Update new connection between two devices
description: Create connection between two devices. Two id and attributes from attributes.
operationId: connectionPUT
requestBody:
content:
Expand Down Expand Up @@ -696,8 +698,8 @@ paths:
post:
tags:
- connections
summary: Create new connection beetween two devices
description: Create connection beetween two devices. Two id and attributes from attributes.
summary: Create new connection between two devices
description: Create connection between two devices. Two id and attributes from attributes.
operationId: connectionPOST
requestBody:
content:
Expand Down Expand Up @@ -733,13 +735,13 @@ paths:
tags:
- connections
summary: Delete connection
description: Delete connection beetween two devices. Two id and attributes from attributes.
description: Delete connection between two devices. Two id and attributes from attributes.
operationId: connectionDELETE
responses:
"200":
description: Ok
"404":
description: Not found connection to detete
description: Not found connection to delete
content:
application/json:
schema:
Expand Down Expand Up @@ -875,8 +877,8 @@ paths:
put:
tags:
- attributes
summary: Update new Attributes beetween two devices
description: Create Attributes beetween two devices. Two id and attributes from attributes.
summary: Update new Attributes between two devices
description: Create Attributes between two devices. Two id and attributes from attributes.
operationId: attributesPut
requestBody:
content:
Expand Down Expand Up @@ -935,8 +937,8 @@ paths:
delete:
tags:
- attributes
summary: Update new Attributes beetween two devices
description: Create Attributes beetween two devices. Two id and attributes from attributes.
summary: Update new Attributes between two devices
description: Create Attributes between two devices. Two id and attributes from attributes.
operationId: attributesDelete
responses:
"200":
Expand Down Expand Up @@ -1039,7 +1041,7 @@ paths:
tags:
- attributeDictionary
summary: Get information about devices attributes types.
description: Dictionary attributes types for device and models. Store information about extra parmaeters.
description: Dictionary attributes types for device and models. Store information about extra parameters.
operationId: attributeDictionaryGet
responses:
"200":
Expand Down Expand Up @@ -1069,7 +1071,7 @@ paths:
tags:
- attributeDictionary
summary: Update new attributeDictionary
description: Create attribute-dictionary beetween two devices. Two id and attributes from attributes.
description: Create attribute-dictionary between two devices. Two id and attributes from attributes.
operationId: attributeDictionaryPut
requestBody:
content:
Expand Down Expand Up @@ -1129,7 +1131,7 @@ paths:
tags:
- attributeDictionary
summary: Delete all attributeDictionary
description: Create Attributes beetween two devices. Two id and attributes from attributes.
description: Create Attributes between two devices. Two id and attributes from attributes.
operationId: attributeDictionaryDelete
responses:
"200":
Expand Down Expand Up @@ -1725,6 +1727,12 @@ components:
email:
type: string
format: email
example: support@company.co.uk
pattern: >-
^(?:[\w\-+!#$%&'*/=?^`|{}~]+(?:\.[\w\-+!#$%&'*/=?^`|{}~]+)*)@(?:(?:[A-Za-z0-9](?:[\w\-]{0,61}[A-Za-z0-9])?)(?:\.(?:[A-Za-z0-9](?:[\w\-]{0,61}[A-Za-z0-9])?))*\.[A-Za-z]{2,})$
minLength: 6
maxLength: 320
x-42c-format: o:email
password:
type: string
minLength: 8
Expand Down Expand Up @@ -1759,7 +1767,7 @@ components:
name:
type: string
address:
$ref: "#/components/schemas/FloorAdress"
$ref: "#/components/schemas/FloorAddress"
array:
$ref: "#/components/schemas/FloorArray"
description: Floor object
Expand All @@ -1772,7 +1780,7 @@ components:
country: Papua New Guinea
postcode: 05649-8267
dimension:
description: "Koss, Powlowski and Sipes - leverage out-of-the-box schemas dasd"
description: "Koss, Powlowski and Sipes - leverage out-of-the-box schemas"
x: 54
y: 58
h: 6
Expand Down Expand Up @@ -1999,13 +2007,13 @@ components:
type: array
description: List of attributes
example:
- _id: 653e10ecd6025afb66017c65
deviceId: 6566ed4ace63d42b25fbba19
- _id: "653e10ecd6025afb66017c65"
deviceId: "6566ed4ace63d42b25fbba19"
modelId: ""
connectionId: ""
attributeDictionaryId: 6566ed4ace63d42b25fbba19
attributeDictionaryId: "6566ed4ace63d42b25fbba19"
value: "2"
- _id: 1234erdsfdasdasdasd17c65
- _id: "1234erdsfdasdasdasd17c65"
deviceId: "6566ed4ace63d42b25fbba19"
modelId: "6566ed4ace63d42b25fbba19"
connectionId: ""
Expand Down Expand Up @@ -2203,7 +2211,7 @@ components:
message: Message in log
items:
$ref: "#/components/schemas/Log"
FloorAdress:
FloorAddress:
type: object
properties:
street:
Expand Down Expand Up @@ -2276,7 +2284,7 @@ components:
$ref: "#/components/schemas/Error"
"502":
description:
Bad getway. The server got an invalid response while working as a gateway to get the response needed to
Bad getaway. The server got an invalid response while working as a gateway to get the response needed to
handle the request.
content:
application/json:
Expand Down
Loading

0 comments on commit 59c110d

Please sign in to comment.