milesight-powermeter-api 0.0.2-0

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/.eslintrc.js ADDED
@@ -0,0 +1,25 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ parserOptions: {
4
+ project: 'tsconfig.json',
5
+ tsconfigRootDir: __dirname,
6
+ sourceType: 'module',
7
+ },
8
+ plugins: ['@typescript-eslint/eslint-plugin'],
9
+ extends: [
10
+ 'plugin:@typescript-eslint/recommended',
11
+ 'plugin:prettier/recommended',
12
+ ],
13
+ root: true,
14
+ env: {
15
+ node: true,
16
+ jest: true,
17
+ },
18
+ ignorePatterns: ['.eslintrc.js'],
19
+ rules: {
20
+ '@typescript-eslint/interface-name-prefix': 'off',
21
+ '@typescript-eslint/explicit-function-return-type': 'off',
22
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
23
+ '@typescript-eslint/no-explicit-any': 'off',
24
+ },
25
+ };
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v20.15.0
package/.prettierrc ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "arrowParens": "always",
5
+ "tabWidth": 4,
6
+ "bracketSpacing": true,
7
+ "semi": true,
8
+ "printWidth": 80,
9
+ "sortKeys": true
10
+ }
package/Dockerfile ADDED
@@ -0,0 +1,11 @@
1
+ FROM node:20.15.0
2
+ ARG NPM_TOKEN
3
+ ENV NPM_TOKEN=${NPM_TOKEN}
4
+ WORKDIR /atka
5
+ COPY . /atka/milesight-powermeter-api
6
+ WORKDIR /atka/milesight-powermeter-api
7
+ RUN NPM_TOKEN=${NPM_TOKEN} npm ci
8
+ RUN npm run build:ci
9
+
10
+ EXPOSE 9060
11
+ CMD [ "node", "dist/main.js"]
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ <p align="center">
2
+ <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3
+ </p>
4
+
5
+ [circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6
+ [circleci-url]: https://circleci.com/gh/nestjs/nest
7
+
8
+ <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11
+ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12
+ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13
+ <a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14
+ <a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
15
+ <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
16
+ <a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
17
+ <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
18
+ <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
19
+ <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
20
+ <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
21
+ </p>
22
+ <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
23
+ [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
24
+
25
+ ## Description
26
+
27
+ [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
28
+
29
+ ## Project setup
30
+
31
+ ```bash
32
+ $ npm install
33
+ ```
34
+
35
+ ## Compile and run the project
36
+
37
+ ```bash
38
+ # development
39
+ $ npm run start
40
+
41
+ # watch mode
42
+ $ npm run start:dev
43
+
44
+ # production mode
45
+ $ npm run start:prod
46
+ ```
47
+
48
+ ## Run tests
49
+
50
+ ```bash
51
+ # unit tests
52
+ $ npm run test
53
+
54
+ # e2e tests
55
+ $ npm run test:e2e
56
+
57
+ # test coverage
58
+ $ npm run test:cov
59
+ ```
60
+
61
+ ## Resources
62
+
63
+ Check out a few resources that may come in handy when working with NestJS:
64
+
65
+ - Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
66
+ - For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
67
+ - To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
68
+ - Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
69
+ - Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
70
+ - To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
71
+ - Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
72
+
73
+ ## Support
74
+
75
+ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
76
+
77
+ ## Stay in touch
78
+
79
+ - Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
80
+ - Website - [https://nestjs.com](https://nestjs.com/)
81
+ - Twitter - [@nestframework](https://twitter.com/nestframework)
82
+
83
+ ## License
84
+
85
+ Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
@@ -0,0 +1,121 @@
1
+ image: node:20.15.0
2
+ options:
3
+ max-time: 10
4
+
5
+ definitions:
6
+ steps:
7
+ - step: &install-deps
8
+ name: Prepare node_modules
9
+ script:
10
+ - npm ci
11
+ - DT=$(date -u +"%Y%m%d%H%M%S")
12
+ - echo "export DT=$DT" > timestamp.sh
13
+ artifacts:
14
+ - timestamp.sh
15
+ - node_modules/**
16
+ - step: &switch-to-stable-deps
17
+ name: Install stable packages
18
+ script:
19
+ - git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
20
+ - npm i @coinspect/therma-action-rule-decoder@stable --save-exact
21
+ - git commit -am '[ci-auto-commit] Install stable dependencies [skip ci]' && git push || true
22
+ artifacts:
23
+ - node_modules/**
24
+ - step: &install-latest-deps
25
+ name: Install latest versions for specific packages
26
+ script:
27
+ - git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
28
+ - npm i @coinspect/therma-action-rule-decoder@latest
29
+ - git commit -am '[ci-auto-commit] Install latest dependencies [skip ci]' && git push || true
30
+ artifacts:
31
+ - node_modules/**
32
+ - step: &unit-tests
33
+ name: "Sir Testalot (Unit) Approval"
34
+ script:
35
+ - npm run test
36
+ - step: &mrlinty
37
+ name: Mr Linty Approval
38
+ script:
39
+ - npm run lint
40
+ - step: &publish-package-tag
41
+ name: Publish the release on npm
42
+ script:
43
+ - npm publish --tag stable
44
+ - step: &publish-package-prerelease
45
+ name: Publish the release on npm
46
+ script:
47
+ - git remote set-url origin ${BITBUCKET_GIT_SSH_ORIGIN}
48
+ - npm version prerelease -m "Update version number to %s [skip ci]" && git push
49
+ - npm publish
50
+ - step: &build-app
51
+ name: "Bob the Builder (tsc)"
52
+ script:
53
+ - npm run build
54
+ artifacts:
55
+ - "dist/**"
56
+ - step: &build-container
57
+ name: Build container
58
+ services:
59
+ - docker
60
+ script:
61
+ - source scripts/setup-env.sh
62
+ - ./scripts/setup-docker.sh
63
+ - npm run build:kube:ci -- $BUILD_TAG $BUILD_NAME
64
+ pipelines:
65
+ default:
66
+ - step: *install-deps
67
+ - step: *build-app
68
+ - parallel:
69
+ - step: *mrlinty
70
+ - step: *unit-tests
71
+ branches:
72
+ develop:
73
+ - step: *install-deps
74
+ - step: *build-app
75
+ - parallel:
76
+ - step: *mrlinty
77
+ - step: *unit-tests
78
+ - step: *publish-package-prerelease
79
+ - step:
80
+ <<: *build-container
81
+ deployment: test
82
+ release/*:
83
+ - step: *install-deps
84
+ - step: *switch-to-stable-deps
85
+ - step: *build-app
86
+ - parallel:
87
+ - step: *mrlinty
88
+ - step: *unit-tests
89
+ - step:
90
+ <<: *build-container
91
+ deployment: staging
92
+ tags:
93
+ "*":
94
+ - step: *install-deps
95
+ - step: *build-app
96
+ - parallel:
97
+ - step: *mrlinty
98
+ - step: *unit-tests
99
+ - step:
100
+ <<: *build-container
101
+ deployment: production
102
+ trigger: manual
103
+ - step: *publish-package-tag
104
+
105
+ custom:
106
+ force-deploy:
107
+ - step: *install-deps
108
+ - step: *build-app
109
+ - parallel:
110
+ - step: *mrlinty
111
+ - step: *unit-tests
112
+ - step:
113
+ <<: *build-container
114
+ deployment: test
115
+ update-dependencies-to-latest:
116
+ - step: *install-deps
117
+ - step: *install-latest-deps
118
+ - step: *publish-package-prerelease
119
+ - step:
120
+ <<: *build-container
121
+ deployment: test
package/nest-cli.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/nest-cli",
3
+ "collection": "@nestjs/schematics",
4
+ "sourceRoot": "src",
5
+ "compilerOptions": {
6
+ "deleteOutDir": true
7
+ }
8
+ }