Skip to content

Commit d9eb657

Browse files
github-actions[bot]DobruniaCopilotneSpecc
authored
Update prod (#533)
* chore: Update license to BUSL-1.1 in package.json and add license section in README.md * Bump version up to 1.1.39 * chore: Bump version to 1.1.39 in package.json * chore(devops): add Morgan request logger middleware for HTTP logging (#535) * Initial plan * Add morgan request logger middleware Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> * Bump version up to 1.1.40 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix Docker build failure after Morgan logger was added (#537) * Initial plan * Fix Docker build by installing devDependencies in builder stage Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> * Bump version up to 1.1.41 * Move @types/morgan to production dependencies instead of Dockerfile changes Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Dobrunia Kostrigin <48620984+Dobrunia@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: neSpecc <3684889+neSpecc@users.noreply.github.com>
1 parent 56fa64d commit d9eb657

File tree

5 files changed

+159
-8
lines changed

5 files changed

+159
-8
lines changed

LICENSE

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
Business Source License 1.1
2+
3+
Parameters
4+
5+
Licensor: CodeX (Hawk)
6+
Licensed Work: hawk.api.nodejs (https://github.com/codex-team/hawk.api.nodejs)
7+
The Licensed Work is © 2025 CodeX
8+
Additional Use Grant: Self-hosted use for own/internal needs and research/evaluation is permitted.
9+
Using this code to provide a competing error-tracking SaaS or commercial
10+
hosted service without the Licensor’s prior permission is prohibited.
11+
12+
Change Date: 2030-01-01
13+
14+
Change License: AGPL-3.0
15+
16+
-------------------------------------------------------------------------------
17+
18+
License text copyright © 2024 MariaDB plc, All Rights Reserved.
19+
“Business Source License” is a trademark of MariaDB plc.
20+
21+
Terms
22+
23+
The Licensor hereby grants you the right to copy, modify, create derivative
24+
works, redistribute, and make non-production use of the Licensed Work. The
25+
Licensor may make an Additional Use Grant, above, permitting limited
26+
production use.
27+
28+
Effective on the Change Date, or the fourth anniversary of the first publicly
29+
available distribution of a specific version of the Licensed Work under this
30+
License, whichever comes first, the Licensor hereby grants you rights under
31+
the terms of the Change License, and the rights granted in the paragraph
32+
above terminate.
33+
34+
If your use of the Licensed Work does not comply with the requirements
35+
currently in effect as described in this License, you must purchase a
36+
commercial license from the Licensor, its affiliated entities, or authorized
37+
resellers, or you must refrain from using the Licensed Work.
38+
39+
All copies of the original and modified Licensed Work, and derivative works
40+
of the Licensed Work, are subject to this License. This License applies
41+
separately for each version of the Licensed Work and the Change Date may vary
42+
for each version of the Licensed Work released by Licensor.
43+
44+
You must conspicuously display this License on each original or modified copy
45+
of the Licensed Work. If you receive the Licensed Work in original or
46+
modified form from a third party, the terms and conditions set forth in this
47+
License apply to your use of that work.
48+
49+
Any use of the Licensed Work in violation of this License will automatically
50+
terminate your rights under this License for the current and all other
51+
versions of the Licensed Work.
52+
53+
This License does not grant you any right in any trademark or logo of
54+
Licensor or its affiliates (provided that you may use a trademark or logo of
55+
Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY
56+
APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR
57+
HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING
58+
(WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
59+
PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to
60+
use this License’s text to license your works, and to refer to it using the
61+
trademark “Business Source License”, as long as you comply with the Covenants
62+
of Licensor below.
63+
64+
Covenants of Licensor
65+
66+
In consideration of the right to use this License’s text and the “Business
67+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
68+
other recipients of the licensed work to be provided by Licensor:
69+
70+
1. To specify as the Change License the GPL Version 2.0 or any later version,
71+
or a license that is compatible with GPL Version 2.0 or a later version,
72+
where “compatible” means that software provided under the Change License can
73+
be included in a program with software provided under GPL Version 2.0 or a
74+
later version. Licensor may specify additional Change Licenses without
75+
limitation.
76+
77+
2. To either: (a) specify an additional grant of rights to use that does not
78+
impose any additional restriction on the right granted in this License, as
79+
the Additional Use Grant; or (b) insert the text “None”.
80+
81+
3. To specify a Change Date not later than the fourth anniversary of the first
82+
publicly available distribution of a specific version of the Licensed Work
83+
under this License.
84+
85+
4. Not to modify this License in any other way.
86+
87+
Notice
88+
89+
The Business Source License (this document, or the “License”) is not an Open
90+
Source license. However, the Licensed Work will eventually be made available
91+
under an Open Source License, as stated in this License.
92+
93+
For more information on the use of the Business Source License for MariaDB
94+
products, please visit the MariaDB Business Source License FAQ.
95+
For more information on the use of the Business Source License generally,
96+
please visit the Adopting and Developing Business Source License FAQ.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Hawk API
22

3+
![License](https://img.shields.io/badge/license-BSL--1.1-orange)
4+
35
## Start API
46
For deployment (both in production and in development), you can use Docker.
57
See Docker instructions [here](DOCKER.md).
@@ -29,3 +31,8 @@ You can view API Schema visualization in `/voyager` page in your browser. To see
2931

3032
Run `yarn migrations:up` command to apply migration revisions or
3133
`yarn migrations:down` to rollback the last revision.
34+
35+
## License
36+
37+
Source code is available under **Business Source License 1.1 (BSL 1.1)**.
38+
See [`LICENSE`](./LICENSE) for terms, including:

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "hawk.api",
3-
"version": "1.1.38",
3+
"version": "1.1.41",
44
"main": "index.ts",
5-
"license": "UNLICENSED",
5+
"license": "BUSL-1.1",
66
"scripts": {
77
"dev": "ts-node-dev --no-notify index.ts",
88
"start": "node index.ts",
@@ -49,6 +49,7 @@
4949
"@types/lodash.mergewith": "^4.6.9",
5050
"@types/mime-types": "^2.1.0",
5151
"@types/mongodb": "^3.6.20",
52+
"@types/morgan": "^1.9.10",
5253
"@types/node": "^16.11.46",
5354
"@types/node-fetch": "^2.5.4",
5455
"@types/safe-regex": "^1.1.6",
@@ -78,6 +79,7 @@
7879
"migrate-mongo": "^7.0.1",
7980
"mime-types": "^2.1.25",
8081
"mongodb": "^3.7.3",
82+
"morgan": "^1.10.1",
8183
"safe-regex": "^2.1.0",
8284
"ts-node-dev": "^2.0.0",
8385
"uuid": "^8.3.2"

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import PlansFactory from './models/plansFactory';
2626
import BusinessOperationsFactory from './models/businessOperationsFactory';
2727
import schema from './schema';
2828
import { graphqlUploadExpress } from 'graphql-upload';
29+
import morgan from 'morgan';
2930

3031
/**
3132
* Option to enable playground
@@ -77,6 +78,14 @@ class HawkAPI {
7778
res.setHeader('Access-Control-Allow-Headers', 'Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers');
7879
next();
7980
});
81+
82+
/**
83+
* Setup request logger.
84+
* Uses 'combined' format in production for Apache-style logging,
85+
* and 'dev' format in development for colored, concise output.
86+
*/
87+
this.app.use(morgan(process.env.NODE_ENV === 'production' ? 'combined' : 'dev'));
88+
8089
this.app.use(express.json());
8190
this.app.use(bodyParser.urlencoded({ extended: false }));
8291
this.app.use('/static', express.static(`./static`));

yarn.lock

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,13 @@
11241124
"@types/bson" "*"
11251125
"@types/node" "*"
11261126

1127+
"@types/morgan@^1.9.10":
1128+
version "1.9.10"
1129+
resolved "https://registry.yarnpkg.com/@types/morgan/-/morgan-1.9.10.tgz#725c15d95a5e6150237524cd713bc2d68f9edf1a"
1130+
integrity sha512-sS4A1zheMvsADRVfT0lYbJ4S9lmsey8Zo2F7cnbYjWHP67Q0AwMYuuzLlkIM2N8gAbb9cubhIVFwcIN2XyYCkA==
1131+
dependencies:
1132+
"@types/node" "*"
1133+
11271134
"@types/ms@*":
11281135
version "0.7.31"
11291136
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
@@ -1762,6 +1769,13 @@ base@^0.11.1:
17621769
mixin-deep "^1.2.0"
17631770
pascalcase "^0.1.1"
17641771

1772+
basic-auth@~2.0.1:
1773+
version "2.0.1"
1774+
resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a"
1775+
integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==
1776+
dependencies:
1777+
safe-buffer "5.1.2"
1778+
17651779
binary-extensions@^2.0.0:
17661780
version "2.2.0"
17671781
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
@@ -2443,7 +2457,7 @@ denque@^1.4.1:
24432457
resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.1.tgz#07f670e29c9a78f8faecb2566a1e2c11929c5cbf"
24442458
integrity sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==
24452459

2446-
depd@2.0.0:
2460+
depd@2.0.0, depd@~2.0.0:
24472461
version "2.0.0"
24482462
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
24492463
integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==
@@ -4999,6 +5013,17 @@ mongodb@^3.7.3:
49995013
optionalDependencies:
50005014
saslprep "^1.0.0"
50015015

5016+
morgan@^1.10.1:
5017+
version "1.10.1"
5018+
resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.1.tgz#4e02e6a4465a48e26af540191593955d17f61570"
5019+
integrity sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==
5020+
dependencies:
5021+
basic-auth "~2.0.1"
5022+
debug "2.6.9"
5023+
depd "~2.0.0"
5024+
on-finished "~2.3.0"
5025+
on-headers "~1.1.0"
5026+
50025027
ms@2.0.0:
50035028
version "2.0.0"
50045029
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -5252,6 +5277,18 @@ on-finished@2.4.1:
52525277
dependencies:
52535278
ee-first "1.1.1"
52545279

5280+
on-finished@~2.3.0:
5281+
version "2.3.0"
5282+
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
5283+
integrity sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==
5284+
dependencies:
5285+
ee-first "1.1.1"
5286+
5287+
on-headers@~1.1.0:
5288+
version "1.1.0"
5289+
resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.1.0.tgz#59da4f91c45f5f989c6e4bcedc5a3b0aed70ff65"
5290+
integrity sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==
5291+
52555292
once@^1.3.0, once@^1.3.1, once@^1.4.0:
52565293
version "1.4.0"
52575294
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -5830,16 +5867,16 @@ rxjs@^6.6.0:
58305867
dependencies:
58315868
tslib "^1.9.0"
58325869

5870+
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1, safe-buffer@~5.1.2:
5871+
version "5.1.2"
5872+
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
5873+
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
5874+
58335875
safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
58345876
version "5.2.1"
58355877
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
58365878
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
58375879

5838-
safe-buffer@~5.1.0, safe-buffer@~5.1.1, safe-buffer@~5.1.2:
5839-
version "5.1.2"
5840-
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
5841-
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
5842-
58435880
safe-regex@^1.1.0:
58445881
version "1.1.0"
58455882
resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"

0 commit comments

Comments
 (0)