@pbvision/fastify-firestore-service 0.0.50
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/LICENSE +204 -0
- package/README.md +187 -0
- package/docs/api.md +706 -0
- package/docs/build.sh +24 -0
- package/docs/jsdoc.config.json +22 -0
- package/package.json +93 -0
- package/src/api/api.js +852 -0
- package/src/api/db-api.js +109 -0
- package/src/api/exception.js +344 -0
- package/src/api/response.js +8 -0
- package/src/component-registrar.js +27 -0
- package/src/fetch-wrapper.js +30 -0
- package/src/index.js +13 -0
- package/src/make-app.js +223 -0
- package/src/make-logger.js +27 -0
- package/src/plugins/compress.js +28 -0
- package/src/plugins/content-parser.js +21 -0
- package/src/plugins/cookie.js +17 -0
- package/src/plugins/error-handler.js +180 -0
- package/src/plugins/health-check.js +19 -0
- package/src/plugins/latency-tracker.js +34 -0
- package/src/plugins/sentry-rate-limit.js +37 -0
- package/src/plugins/swagger.js +50 -0
- package/test/base-test.js +203 -0
- package/test/environment.js +3 -0
package/docs/build.sh
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
cd "`dirname \"$0\"`"
|
|
3
|
+
script_path="`pwd`"
|
|
4
|
+
|
|
5
|
+
cd ..
|
|
6
|
+
embed-markdown # Update .md files before embedding the .md files into docs
|
|
7
|
+
|
|
8
|
+
cd "$script_path"
|
|
9
|
+
rm -rf generated
|
|
10
|
+
|
|
11
|
+
npx jsdoc --configure jsdoc.config.json --destination generated/libs/api --readme api.md ../src/api
|
|
12
|
+
npx jsdoc --configure jsdoc.config.json ../src/plugins `find ../src -type f -not -name index.js`
|
|
13
|
+
|
|
14
|
+
sed -e "s/docs\\/api[.]md/libs\\/api\\/index.html/g" generated/index.html > generated/tmp
|
|
15
|
+
mv generated/tmp generated/index.html
|
|
16
|
+
|
|
17
|
+
if [ "$GITHUB_SHA" = "" ]; then
|
|
18
|
+
gitHash=`git rev-parse HEAD`
|
|
19
|
+
else
|
|
20
|
+
gitHash=$GITHUB_SHA
|
|
21
|
+
fi
|
|
22
|
+
newLine="Generated from <a href=\"https:\\/\\/github.com\\/pbv-public\\/fastify-firestore-service\\/tree\\/$gitHash\">$gitHash<\\/a><\\/article>"
|
|
23
|
+
cat ./generated/index.html | sed -e "s/[<][/]article[>]/$newLine/g" > tmp
|
|
24
|
+
mv tmp ./generated/index.html
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tags": {
|
|
3
|
+
"allowUnknownTags": true
|
|
4
|
+
},
|
|
5
|
+
"templates": {
|
|
6
|
+
"cleverLinks": false,
|
|
7
|
+
"monospaceLinks": false,
|
|
8
|
+
"default": {
|
|
9
|
+
"outputSourceFiles": true
|
|
10
|
+
},
|
|
11
|
+
"useCollapsibles": true,
|
|
12
|
+
"name": "Fastify Firestore Service Guide"
|
|
13
|
+
},
|
|
14
|
+
"opts": {
|
|
15
|
+
"access": "protected,public,undefined",
|
|
16
|
+
"encoding": "utf8",
|
|
17
|
+
"destination": "generated",
|
|
18
|
+
"template": "../node_modules/tui-jsdoc-template",
|
|
19
|
+
"recurse": true,
|
|
20
|
+
"readme": "../README.md"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pbvision/fastify-firestore-service",
|
|
3
|
+
"version": "0.0.50",
|
|
4
|
+
"description": "Web Framework using Fastify and Firestore ORM",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20"
|
|
9
|
+
},
|
|
10
|
+
"exports": "./src/index.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build-doc": "./docs/build.sh",
|
|
13
|
+
"debug": "GCLOUD_PROJECT=localhost-emulator INDEBUGGER=1 ./node_modules/nodemon/bin/nodemon.js --no-lazy --legacy-watch --watch ./src --watch ./examples --watch ./test --inspect=9229 --experimental-vm-modules ./node_modules/jest/bin/jest.js --coverage --config=./jest.config.json --runInBand",
|
|
14
|
+
"setup": "yarn install --frozen-lockfile && pip install -r requirements.txt",
|
|
15
|
+
"start-local-db": "./node_modules/@pbvision/firestore-orm/scripts/start-local-db.sh",
|
|
16
|
+
"test": "yarn -s start-local-db && yarn -s test-without-starting-db",
|
|
17
|
+
"test-without-starting-db": "GCLOUD_PROJECT=localhost-emulator node --experimental-vm-modules ./node_modules/jest/bin/jest.js --config=./jest.config.json --coverage"
|
|
18
|
+
},
|
|
19
|
+
"contributors": [
|
|
20
|
+
"David Underhill",
|
|
21
|
+
"Yu Guan",
|
|
22
|
+
"Solaman Huq",
|
|
23
|
+
"Shimul Bhowmik"
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/pbv-public/fastify-firestore-service.git"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"registry": "https://registry.npmjs.org"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"src/**",
|
|
34
|
+
"!src/app.js",
|
|
35
|
+
"docs/**",
|
|
36
|
+
"test/environment.js",
|
|
37
|
+
"test/base-test.js"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@fastify/compress": "^6.1.1",
|
|
41
|
+
"@fastify/cookie": "^9.2.0",
|
|
42
|
+
"@fastify/static": "^6.12",
|
|
43
|
+
"@fastify/swagger": "^8.1.0",
|
|
44
|
+
"@fastify/swagger-ui": "^2.0.1",
|
|
45
|
+
"@pbvision/firestore-orm": "^0.0.22",
|
|
46
|
+
"@sentry/node": "^7.91.0",
|
|
47
|
+
"fastify": "^4.10.0",
|
|
48
|
+
"fastify-plugin": "^4.5.1",
|
|
49
|
+
"node-fetch": "^3.3.2",
|
|
50
|
+
"ua-parser-js": "^1.0.37",
|
|
51
|
+
"word-wrap": "^1.2.3"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@babel/core": "^7.17.12",
|
|
55
|
+
"@babel/eslint-parser": "^7.17.0",
|
|
56
|
+
"@babel/plugin-transform-class-properties": "^7.12.1",
|
|
57
|
+
"@babel/preset-env": "^7.17.12",
|
|
58
|
+
"@pbvision/jest-unit-test": "^0.2.3",
|
|
59
|
+
"babel-loader": "^9.1.3",
|
|
60
|
+
"eslint": "^8.22.0",
|
|
61
|
+
"eslint-config-standard": "17.1.0",
|
|
62
|
+
"eslint-import-resolver-webpack": "^0.13.8",
|
|
63
|
+
"eslint-plugin-import": "^2.22.0",
|
|
64
|
+
"eslint-plugin-n": "^16.6.2",
|
|
65
|
+
"eslint-plugin-node": "^11.1.0",
|
|
66
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
67
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
68
|
+
"firebase-tools": "^13.5.2",
|
|
69
|
+
"jest": "^29.7.0",
|
|
70
|
+
"jsdoc": "3.6.11",
|
|
71
|
+
"license-webpack-plugin": "^4.0.2",
|
|
72
|
+
"nodemon": "^3.0.2",
|
|
73
|
+
"standard": "^17.1.0",
|
|
74
|
+
"superagent": "^8",
|
|
75
|
+
"superagent-defaults": "^0.1.14",
|
|
76
|
+
"supertest": "^6.3.3",
|
|
77
|
+
"tui-jsdoc-template": "^1.2.2",
|
|
78
|
+
"webpack": "^5.13.0",
|
|
79
|
+
"webpack-cli": "^5.1.4"
|
|
80
|
+
},
|
|
81
|
+
"standard": {
|
|
82
|
+
"envs": [
|
|
83
|
+
"jest"
|
|
84
|
+
],
|
|
85
|
+
"globals": [
|
|
86
|
+
"fail"
|
|
87
|
+
],
|
|
88
|
+
"ignore": [
|
|
89
|
+
"**/node_modules/**"
|
|
90
|
+
],
|
|
91
|
+
"parser": "@babel/eslint-parser"
|
|
92
|
+
}
|
|
93
|
+
}
|