@loomcore/api 0.1.75 → 0.1.77

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.
Files changed (22) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +77 -77
  3. package/dist/__tests__/postgres-test-migrations/postgres-test-schema.js +290 -239
  4. package/dist/__tests__/postgres.test-database.js +8 -8
  5. package/dist/databases/migrations/migration-runner.js +21 -21
  6. package/dist/databases/operations/__tests__/models/client-report.model.d.ts +25 -0
  7. package/dist/databases/operations/__tests__/models/client-report.model.js +3 -1
  8. package/dist/databases/operations/__tests__/models/policy.model.d.ts +32 -0
  9. package/dist/databases/operations/__tests__/models/policy.model.js +10 -0
  10. package/dist/databases/postgres/commands/postgres-batch-update.command.js +7 -7
  11. package/dist/databases/postgres/commands/postgres-create-many.command.js +4 -4
  12. package/dist/databases/postgres/commands/postgres-create.command.js +4 -4
  13. package/dist/databases/postgres/commands/postgres-full-update-by-id.command.js +13 -13
  14. package/dist/databases/postgres/commands/postgres-partial-update-by-id.command.js +7 -7
  15. package/dist/databases/postgres/commands/postgres-update.command.js +7 -7
  16. package/dist/databases/postgres/migrations/postgres-initial-schema.js +197 -197
  17. package/dist/databases/postgres/postgres.database.js +17 -17
  18. package/dist/databases/postgres/utils/build-join-clauses.js +277 -24
  19. package/dist/databases/postgres/utils/build-select-clause.js +38 -7
  20. package/dist/databases/postgres/utils/does-table-exist.util.js +4 -4
  21. package/dist/databases/postgres/utils/transform-join-results.js +102 -6
  22. package/package.json +92 -92
package/package.json CHANGED
@@ -1,92 +1,92 @@
1
- {
2
- "name": "@loomcore/api",
3
- "version": "0.1.75",
4
- "private": false,
5
- "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
- "scripts": {
7
- "clean": "rm -rf dist",
8
- "tsc": "tsc --project tsconfig.prod.json",
9
- "build": "npm-run-all -s clean tsc",
10
- "add": "git add .",
11
- "commit": "git commit -m \"Updates\"",
12
- "patch": "npm version patch",
13
- "push": "git push",
14
- "publishMe": "npm publish --access public",
15
- "pub": "npm-run-all -s add commit patch build push publishMe",
16
- "update-lib-versions": "npx --yes npm-check-updates -u -f @loomcore/common",
17
- "install-updated-libs": "npm i @loomcore/common",
18
- "update-libs": "npm-run-all -s update-lib-versions install-updated-libs",
19
- "typecheck": "tsc",
20
- "test": "npm-run-all -s test:postgres test:mongodb",
21
- "test:postgres": "cross-env NODE_ENV=test TEST_DATABASE=postgres vitest run",
22
- "test:postgres:real": "cross-env NODE_ENV=test TEST_DATABASE=postgres USE_REAL_POSTGRES=true vitest run",
23
- "test:mongodb": "cross-env NODE_ENV=test TEST_DATABASE=mongodb vitest run",
24
- "test:ci": "npm-run-all -s test:ci:postgres test:ci:mongodb",
25
- "test:ci:postgres": "cross-env NODE_ENV=test TEST_DATABASE=postgres vitest run --reporter=json --outputFile=test-results-postgres.json",
26
- "test:ci:mongodb": "cross-env NODE_ENV=test TEST_DATABASE=mongodb vitest run --reporter=json --outputFile=test-results-mongodb.json",
27
- "test:watch": "cross-env NODE_ENV=test vitest",
28
- "coverage": "npm-run-all -s coverage:postgres coverage:mongodb",
29
- "coverage:postgres": "cross-env NODE_ENV=test TEST_DATABASE=postgres vitest run --coverage",
30
- "coverage:mongodb": "cross-env NODE_ENV=test TEST_DATABASE=mongodb vitest run --coverage",
31
- "test:db:start": "docker-compose -f docker-compose.test.yml up -d",
32
- "test:db:stop": "docker-compose -f docker-compose.test.yml down",
33
- "test:db:logs": "docker-compose -f docker-compose.test.yml logs -f"
34
- },
35
- "author": "Tim Hardy",
36
- "license": "Apache 2.0",
37
- "main": "dist/index.js",
38
- "type": "module",
39
- "types": "dist/index.d.ts",
40
- "files": [
41
- "dist/**/*"
42
- ],
43
- "exports": {
44
- "./__tests__": "./dist/__tests__/index.js",
45
- "./config": "./dist/config/index.js",
46
- "./controllers": "./dist/controllers/index.js",
47
- "./databases": "./dist/databases/index.js",
48
- "./errors": "./dist/errors/index.js",
49
- "./middleware": "./dist/middleware/index.js",
50
- "./models": "./dist/models/index.js",
51
- "./services": "./dist/services/index.js",
52
- "./utils": "./dist/utils/index.js"
53
- },
54
- "dependencies": {
55
- "jsonwebtoken": "^9.0.2",
56
- "node-mailjet": "^6.0.8",
57
- "qs": "^6.14.1"
58
- },
59
- "peerDependencies": {
60
- "@loomcore/common": "^0.0.43",
61
- "@sinclair/typebox": "0.34.33",
62
- "cookie-parser": "^1.4.6",
63
- "cors": "^2.8.5",
64
- "express": "^5.1.0",
65
- "lodash": "^4.17.21",
66
- "moment": "^2.30.1",
67
- "mongodb": "^6.16.0",
68
- "pg": "^8.15.6",
69
- "rxjs": "^7.8.0",
70
- "umzug": "^3.8.2"
71
- },
72
- "devDependencies": {
73
- "@types/cookie-parser": "^1.4.7",
74
- "@types/cors": "^2.8.18",
75
- "@types/express": "^5.0.1",
76
- "@types/jsonwebtoken": "^9.0.9",
77
- "@types/lodash": "^4.17.13",
78
- "@types/pg": "^8.15.6",
79
- "@types/qs": "^6.14.0",
80
- "@types/supertest": "^6.0.3",
81
- "@vitest/coverage-v8": "^3.0.9",
82
- "cross-env": "^7.0.3",
83
- "mongodb-memory-server": "^9.3.0",
84
- "npm-run-all": "^4.1.5",
85
- "pg-mem": "^3.0.8",
86
- "rxjs": "^7.8.0",
87
- "supertest": "^7.1.0",
88
- "typescript": "^5.8.3",
89
- "vite": "^6.2.5",
90
- "vitest": "^3.0.9"
91
- }
92
- }
1
+ {
2
+ "name": "@loomcore/api",
3
+ "version": "0.1.77",
4
+ "private": false,
5
+ "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
+ "scripts": {
7
+ "clean": "rm -rf dist",
8
+ "tsc": "tsc --project tsconfig.prod.json",
9
+ "build": "npm-run-all -s clean tsc",
10
+ "add": "git add .",
11
+ "commit": "git commit -m \"Updates\"",
12
+ "patch": "npm version patch",
13
+ "push": "git push",
14
+ "publishMe": "npm publish --access public",
15
+ "pub": "npm-run-all -s add commit patch build push publishMe",
16
+ "update-lib-versions": "npx --yes npm-check-updates -u -f @loomcore/common",
17
+ "install-updated-libs": "npm i @loomcore/common",
18
+ "update-libs": "npm-run-all -s update-lib-versions install-updated-libs",
19
+ "typecheck": "tsc",
20
+ "test": "npm-run-all -s test:postgres test:mongodb",
21
+ "test:postgres": "cross-env NODE_ENV=test TEST_DATABASE=postgres vitest run",
22
+ "test:postgres:real": "cross-env NODE_ENV=test TEST_DATABASE=postgres USE_REAL_POSTGRES=true vitest run",
23
+ "test:mongodb": "cross-env NODE_ENV=test TEST_DATABASE=mongodb vitest run",
24
+ "test:ci": "npm-run-all -s test:ci:postgres test:ci:mongodb",
25
+ "test:ci:postgres": "cross-env NODE_ENV=test TEST_DATABASE=postgres vitest run --reporter=json --outputFile=test-results-postgres.json",
26
+ "test:ci:mongodb": "cross-env NODE_ENV=test TEST_DATABASE=mongodb vitest run --reporter=json --outputFile=test-results-mongodb.json",
27
+ "test:watch": "cross-env NODE_ENV=test vitest",
28
+ "coverage": "npm-run-all -s coverage:postgres coverage:mongodb",
29
+ "coverage:postgres": "cross-env NODE_ENV=test TEST_DATABASE=postgres vitest run --coverage",
30
+ "coverage:mongodb": "cross-env NODE_ENV=test TEST_DATABASE=mongodb vitest run --coverage",
31
+ "test:db:start": "docker-compose -f docker-compose.test.yml up -d",
32
+ "test:db:stop": "docker-compose -f docker-compose.test.yml down",
33
+ "test:db:logs": "docker-compose -f docker-compose.test.yml logs -f"
34
+ },
35
+ "author": "Tim Hardy",
36
+ "license": "Apache 2.0",
37
+ "main": "dist/index.js",
38
+ "type": "module",
39
+ "types": "dist/index.d.ts",
40
+ "files": [
41
+ "dist/**/*"
42
+ ],
43
+ "exports": {
44
+ "./__tests__": "./dist/__tests__/index.js",
45
+ "./config": "./dist/config/index.js",
46
+ "./controllers": "./dist/controllers/index.js",
47
+ "./databases": "./dist/databases/index.js",
48
+ "./errors": "./dist/errors/index.js",
49
+ "./middleware": "./dist/middleware/index.js",
50
+ "./models": "./dist/models/index.js",
51
+ "./services": "./dist/services/index.js",
52
+ "./utils": "./dist/utils/index.js"
53
+ },
54
+ "dependencies": {
55
+ "jsonwebtoken": "^9.0.2",
56
+ "node-mailjet": "^6.0.8",
57
+ "qs": "^6.14.1"
58
+ },
59
+ "peerDependencies": {
60
+ "@loomcore/common": "^0.0.43",
61
+ "@sinclair/typebox": "0.34.33",
62
+ "cookie-parser": "^1.4.6",
63
+ "cors": "^2.8.5",
64
+ "express": "^5.1.0",
65
+ "lodash": "^4.17.21",
66
+ "moment": "^2.30.1",
67
+ "mongodb": "^6.16.0",
68
+ "pg": "^8.15.6",
69
+ "rxjs": "^7.8.0",
70
+ "umzug": "^3.8.2"
71
+ },
72
+ "devDependencies": {
73
+ "@types/cookie-parser": "^1.4.7",
74
+ "@types/cors": "^2.8.18",
75
+ "@types/express": "^5.0.1",
76
+ "@types/jsonwebtoken": "^9.0.9",
77
+ "@types/lodash": "^4.17.13",
78
+ "@types/pg": "^8.15.6",
79
+ "@types/qs": "^6.14.0",
80
+ "@types/supertest": "^6.0.3",
81
+ "@vitest/coverage-v8": "^3.0.9",
82
+ "cross-env": "^7.0.3",
83
+ "mongodb-memory-server": "^9.3.0",
84
+ "npm-run-all": "^4.1.5",
85
+ "pg-mem": "^3.0.8",
86
+ "rxjs": "^7.8.0",
87
+ "supertest": "^7.1.0",
88
+ "typescript": "^5.8.3",
89
+ "vite": "^6.2.5",
90
+ "vitest": "^3.0.9"
91
+ }
92
+ }