@balena/pinejs 19.7.2-build-esm-36f468424324d7ef7578ae401fc681c9f8f63e03-3 → 19.7.2-build-update-deps-a909ee054f395de407ec4e1275fd0f5b7514fe29-1
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/.versionbot/CHANGELOG.yml +3 -3
- package/CHANGELOG.md +1 -1
- package/{Gruntfile.cts → Gruntfile.ts} +22 -9
- package/bin/abstract-sql-compiler.js +1 -1
- package/bin/odata-compiler.js +1 -1
- package/bin/sbvr-compiler.js +1 -1
- package/build/{browser.cts → browser.ts} +1 -1
- package/build/{config.cts → config.ts} +1 -5
- package/build/{module.cts → module.ts} +1 -1
- package/build/{server.cts → server.ts} +1 -1
- package/out/bin/abstract-sql-compiler.js +19 -17
- package/out/bin/abstract-sql-compiler.js.map +1 -1
- package/out/bin/odata-compiler.js +21 -19
- package/out/bin/odata-compiler.js.map +1 -1
- package/out/bin/sbvr-compiler.js +54 -19
- package/out/bin/sbvr-compiler.js.map +1 -1
- package/out/bin/utils.d.ts +3 -3
- package/out/bin/utils.js +53 -21
- package/out/bin/utils.js.map +1 -1
- package/out/config-loader/config-loader.d.ts +7 -7
- package/out/config-loader/config-loader.js +63 -23
- package/out/config-loader/config-loader.js.map +1 -1
- package/out/config-loader/env.d.ts +1 -1
- package/out/config-loader/env.js +66 -24
- package/out/config-loader/env.js.map +1 -1
- package/out/data-server/sbvr-server.d.ts +3 -3
- package/out/data-server/sbvr-server.js +42 -5
- package/out/data-server/sbvr-server.js.map +1 -1
- package/out/database-layer/db.d.ts +3 -3
- package/out/database-layer/db.js +83 -37
- package/out/database-layer/db.js.map +1 -1
- package/out/express-emulator/express.js.map +1 -1
- package/out/extended-sbvr-parser/extended-sbvr-parser.js +11 -8
- package/out/extended-sbvr-parser/extended-sbvr-parser.js.map +1 -1
- package/out/http-transactions/transactions.d.ts +2 -2
- package/out/http-transactions/transactions.js +4 -4
- package/out/http-transactions/transactions.js.map +1 -1
- package/out/migrator/async.d.ts +2 -2
- package/out/migrator/async.js +60 -20
- package/out/migrator/async.js.map +1 -1
- package/out/migrator/migrations.js +2 -1
- package/out/migrator/sync.d.ts +6 -6
- package/out/migrator/sync.js +61 -20
- package/out/migrator/sync.js.map +1 -1
- package/out/migrator/utils.d.ts +4 -4
- package/out/migrator/utils.js +97 -42
- package/out/migrator/utils.js.map +1 -1
- package/out/odata-metadata/odata-metadata-generator.js +14 -7
- package/out/odata-metadata/odata-metadata-generator.js.map +1 -1
- package/out/passport-pinejs/mount-login-router.d.ts +1 -1
- package/out/passport-pinejs/mount-login-router.js +41 -4
- package/out/passport-pinejs/mount-login-router.js.map +1 -1
- package/out/passport-pinejs/passport-pinejs.d.ts +3 -3
- package/out/passport-pinejs/passport-pinejs.js +46 -11
- package/out/passport-pinejs/passport-pinejs.js.map +1 -1
- package/out/pinejs-session-store/pinejs-session-store.d.ts +1 -1
- package/out/pinejs-session-store/pinejs-session-store.js +48 -11
- package/out/pinejs-session-store/pinejs-session-store.js.map +1 -1
- package/out/sbvr-api/abstract-sql.d.ts +3 -3
- package/out/sbvr-api/abstract-sql.js +65 -22
- package/out/sbvr-api/abstract-sql.js.map +1 -1
- package/out/sbvr-api/cached-compile.js +15 -8
- package/out/sbvr-api/cached-compile.js.map +1 -1
- package/out/sbvr-api/common-types.js +2 -1
- package/out/sbvr-api/control-flow.d.ts +1 -1
- package/out/sbvr-api/control-flow.js +25 -12
- package/out/sbvr-api/control-flow.js.map +1 -1
- package/out/sbvr-api/dev.js +2 -1
- package/out/sbvr-api/errors.d.ts +1 -1
- package/out/sbvr-api/errors.js +95 -47
- package/out/sbvr-api/errors.js.map +1 -1
- package/out/sbvr-api/express-extension.d.ts +2 -2
- package/out/sbvr-api/express-extension.js +2 -1
- package/out/sbvr-api/hooks.d.ts +4 -4
- package/out/sbvr-api/hooks.js +35 -23
- package/out/sbvr-api/hooks.js.map +1 -1
- package/out/sbvr-api/odata-response.d.ts +2 -2
- package/out/sbvr-api/odata-response.js +29 -19
- package/out/sbvr-api/odata-response.js.map +1 -1
- package/out/sbvr-api/permissions.d.ts +9 -9
- package/out/sbvr-api/permissions.js +159 -106
- package/out/sbvr-api/permissions.js.map +1 -1
- package/out/sbvr-api/sbvr-utils.d.ts +18 -40
- package/out/sbvr-api/sbvr-utils.js +285 -222
- package/out/sbvr-api/sbvr-utils.js.map +1 -1
- package/out/sbvr-api/translations.d.ts +1 -1
- package/out/sbvr-api/translations.js +17 -10
- package/out/sbvr-api/translations.js.map +1 -1
- package/out/sbvr-api/uri-parser.d.ts +7 -7
- package/out/sbvr-api/uri-parser.js +84 -39
- package/out/sbvr-api/uri-parser.js.map +1 -1
- package/out/sbvr-api/user.js +2 -1
- package/out/server-glue/global-ext.d.ts +3 -0
- package/out/server-glue/module.d.ts +16 -16
- package/out/server-glue/module.js +59 -20
- package/out/server-glue/module.js.map +1 -1
- package/out/server-glue/sbvr-loader.d.ts +1 -2
- package/out/server-glue/sbvr-loader.js +11 -4
- package/out/server-glue/sbvr-loader.js.map +1 -1
- package/out/server-glue/server.d.ts +2 -2
- package/out/server-glue/server.js +59 -17
- package/out/server-glue/server.js.map +1 -1
- package/out/tasks/common.d.ts +1 -1
- package/out/tasks/common.js +9 -3
- package/out/tasks/common.js.map +1 -1
- package/out/tasks/index.d.ts +8 -8
- package/out/tasks/index.js +63 -25
- package/out/tasks/index.js.map +1 -1
- package/out/tasks/tasks.js +2 -1
- package/out/tasks/worker.d.ts +3 -3
- package/out/tasks/worker.js +51 -14
- package/out/tasks/worker.js.map +1 -1
- package/out/webresource-handler/handlers/NoopHandler.d.ts +1 -1
- package/out/webresource-handler/handlers/NoopHandler.js +5 -1
- package/out/webresource-handler/handlers/NoopHandler.js.map +1 -1
- package/out/webresource-handler/handlers/S3Handler.d.ts +1 -1
- package/out/webresource-handler/handlers/S3Handler.js +24 -17
- package/out/webresource-handler/handlers/S3Handler.js.map +1 -1
- package/out/webresource-handler/handlers/index.d.ts +2 -2
- package/out/webresource-handler/handlers/index.js +18 -2
- package/out/webresource-handler/handlers/index.js.map +1 -1
- package/out/webresource-handler/index.d.ts +3 -3
- package/out/webresource-handler/index.js +85 -35
- package/out/webresource-handler/index.js.map +1 -1
- package/package.json +33 -33
- package/src/bin/abstract-sql-compiler.ts +3 -3
- package/src/bin/odata-compiler.ts +3 -3
- package/src/bin/sbvr-compiler.ts +2 -2
- package/src/bin/utils.ts +15 -23
- package/src/config-loader/config-loader.ts +12 -12
- package/src/config-loader/env.ts +3 -3
- package/src/data-server/sbvr-server.ts +4 -4
- package/src/database-layer/db.ts +11 -18
- package/src/extended-sbvr-parser/extended-sbvr-parser.ts +5 -5
- package/src/http-transactions/transactions.js +4 -4
- package/src/migrator/async.ts +5 -5
- package/src/migrator/sync.ts +8 -8
- package/src/migrator/utils.ts +7 -7
- package/src/odata-metadata/odata-metadata-generator.ts +2 -3
- package/src/passport-pinejs/mount-login-router.ts +3 -3
- package/src/passport-pinejs/passport-pinejs.ts +6 -6
- package/src/pinejs-session-store/pinejs-session-store.ts +4 -4
- package/src/sbvr-api/abstract-sql.ts +6 -6
- package/src/sbvr-api/cached-compile.ts +2 -2
- package/src/sbvr-api/control-flow.ts +1 -1
- package/src/sbvr-api/errors.ts +1 -1
- package/src/sbvr-api/express-extension.ts +2 -2
- package/src/sbvr-api/hooks.ts +5 -5
- package/src/sbvr-api/odata-response.ts +4 -8
- package/src/sbvr-api/permissions.ts +19 -19
- package/src/sbvr-api/sbvr-utils.ts +33 -39
- package/src/sbvr-api/translations.ts +1 -1
- package/src/sbvr-api/uri-parser.ts +10 -10
- package/src/server-glue/global-ext.d.ts +3 -0
- package/src/server-glue/module.ts +20 -20
- package/src/server-glue/sbvr-loader.ts +27 -15
- package/src/server-glue/server.ts +24 -13
- package/src/tasks/common.ts +1 -1
- package/src/tasks/index.ts +14 -14
- package/src/tasks/worker.ts +8 -8
- package/src/webresource-handler/handlers/NoopHandler.ts +1 -5
- package/src/webresource-handler/handlers/S3Handler.ts +1 -1
- package/src/webresource-handler/handlers/index.ts +2 -2
- package/src/webresource-handler/index.ts +10 -10
- package/tsconfig.dev.json +2 -4
- package/tsconfig.json +1 -1
- package/typings/lf-to-abstract-sql.d.ts +2 -2
- package/typings/memoizee.d.ts +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webresource-handler/index.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACN,kBAAkB,EAClB,kBAAkB,GAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,cAAc,qBAAqB,CAAC;AAqBpC,MAAM,OAAO,gBAAiB,SAAQ,UAAU;CAAG;AAEnD,MAAM,OAAO,qBAAsB,SAAQ,gBAAgB;IAC1D,IAAI,GAAG,uBAAuB,CAAC;IAC/B,YAAY,OAAe;QAC1B,KAAK,CAAC,mCAAmC,OAAO,SAAS,CAAC,CAAC;IAC5D,CAAC;CACD;AAMD,MAAM,SAAS,GAAG,CAAC,KAAc,EAAW,EAAE;IAC7C,IAAI,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC;IAC3C,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAEF,IAAI,4BAA4D,CAAC;AACjE,MAAM,CAAC,MAAM,uBAAuB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-
"main": "out/server-glue/module
|
5
|
-
"type": "
|
3
|
+
"version": "19.7.2-build-update-deps-a909ee054f395de407ec4e1275fd0f5b7514fe29-1",
|
4
|
+
"main": "out/server-glue/module",
|
5
|
+
"type": "commonjs",
|
6
6
|
"repository": "git@github.com:balena-io/pinejs.git",
|
7
7
|
"license": "Apache-2.0",
|
8
8
|
"bin": {
|
@@ -13,17 +13,17 @@
|
|
13
13
|
"scripts": {
|
14
14
|
"prepublish": "require-npm4-to-publish",
|
15
15
|
"prepare": "node -e \"try { (await import('husky')).default() } catch (e) { if (e.code !== 'ERR_MODULE_NOT_FOUND') throw e }\" --input-type module && npm run build",
|
16
|
-
"build": "grunt
|
17
|
-
"webpack-browser": "grunt
|
18
|
-
"webpack-module": "grunt
|
19
|
-
"webpack-server": "grunt
|
16
|
+
"build": "grunt build",
|
17
|
+
"webpack-browser": "grunt browser",
|
18
|
+
"webpack-module": "grunt module",
|
19
|
+
"webpack-server": "grunt server",
|
20
20
|
"webpack-build": "npm run webpack-browser && npm run webpack-module && npm run webpack-server",
|
21
|
-
"lint": "balena-lint -t tsconfig.dev.json -e js -e ts src build typings Gruntfile.
|
21
|
+
"lint": "balena-lint -t tsconfig.dev.json -e js -e ts src build typings Gruntfile.ts && npx tsc --project tsconfig.dev.json --noEmit",
|
22
22
|
"test": "npm run lint && npm run build && npm run webpack-build && npm run test:compose && npm run test:generated-types",
|
23
23
|
"test:compose": "trap 'docker compose -f docker-compose.npm-test.yml down ; echo Stopped ; exit 0' INT; docker compose -f docker-compose.npm-test.yml up -d && sleep 2 && DATABASE_URL=postgres://docker:docker@localhost:5431/postgres PINEJS_WEBRESOURCE_MAXFILESIZE=1000000000 S3_ENDPOINT=http://localhost:43680 S3_ACCESS_KEY=USERNAME S3_SECRET_KEY=PASSWORD S3_STORAGE_ADAPTER_BUCKET=balena-pine-web-resources S3_REGION=us-east-1 PINEJS_QUEUE_CONCURRENCY=1 TZ=UTC npm run mocha",
|
24
24
|
"test:generated-types": "npm run generate-types && git diff --exit-code ./src/sbvr-api/user.ts ./src/migrator/migrations.ts ./src/sbvr-api/dev.ts",
|
25
25
|
"mocha": "TS_NODE_FILES=true mocha",
|
26
|
-
"lint-fix": "balena-lint -t tsconfig.dev.json -e js -e ts --fix src test build typings Gruntfile.
|
26
|
+
"lint-fix": "balena-lint -t tsconfig.dev.json -e js -e ts --fix src test build typings Gruntfile.ts",
|
27
27
|
"generate-types": "node ./bin/sbvr-compiler.js generate-types ./src/sbvr-api/user.sbvr ./src/sbvr-api/user.ts && node ./bin/sbvr-compiler.js generate-types ./src/migrator/migrations.sbvr ./src/migrator/migrations.ts && node ./bin/sbvr-compiler.js generate-types ./src/sbvr-api/dev.sbvr ./src/sbvr-api/dev.ts && node ./bin/sbvr-compiler.js generate-types ./src/tasks/tasks.sbvr ./src/tasks/tasks.ts && balena-lint -t tsconfig.dev.json --fix ./src/sbvr-api/user.ts ./src/migrator/migrations.ts ./src/sbvr-api/dev.ts"
|
28
28
|
},
|
29
29
|
"dependencies": {
|
@@ -32,22 +32,22 @@
|
|
32
32
|
"@balena/env-parsing": "^1.2.0",
|
33
33
|
"@balena/lf-to-abstract-sql": "^5.0.3",
|
34
34
|
"@balena/odata-parser": "^3.1.2",
|
35
|
-
"@balena/odata-to-abstract-sql": "^7.0.
|
35
|
+
"@balena/odata-to-abstract-sql": "^7.0.1",
|
36
36
|
"@balena/sbvr-parser": "^1.4.6",
|
37
37
|
"@balena/sbvr-types": "^9.1.0",
|
38
38
|
"@types/body-parser": "^1.19.5",
|
39
39
|
"@types/compression": "^1.7.5",
|
40
|
-
"@types/cookie-parser": "^1.4.
|
40
|
+
"@types/cookie-parser": "^1.4.8",
|
41
41
|
"@types/deep-freeze": "^0.1.5",
|
42
42
|
"@types/express": "^4.17.21",
|
43
|
-
"@types/express-session": "^1.18.
|
44
|
-
"@types/lodash": "^4.17.
|
43
|
+
"@types/express-session": "^1.18.1",
|
44
|
+
"@types/lodash": "^4.17.13",
|
45
45
|
"@types/memoizee": "^0.4.11",
|
46
|
-
"@types/method-override": "^0.0
|
46
|
+
"@types/method-override": "^3.0.0",
|
47
47
|
"@types/multer": "^1.4.12",
|
48
48
|
"@types/mysql": "^2.15.26",
|
49
|
-
"@types/node": "^20.
|
50
|
-
"@types/passport": "^1.0.
|
49
|
+
"@types/node": "^20.17.11",
|
50
|
+
"@types/passport": "^1.0.17",
|
51
51
|
"@types/passport-local": "^1.0.38",
|
52
52
|
"@types/passport-strategy": "^0.2.38",
|
53
53
|
"@types/pg": "^8.11.10",
|
@@ -63,17 +63,17 @@
|
|
63
63
|
"json-schema-to-ts": "3.1.1",
|
64
64
|
"lodash": "^4.17.21",
|
65
65
|
"memoizee": "^0.4.17",
|
66
|
-
"pinejs-client-core": "^8.1.
|
66
|
+
"pinejs-client-core": "^8.1.2",
|
67
67
|
"randomstring": "^1.3.0",
|
68
68
|
"typed-error": "^3.2.2"
|
69
69
|
},
|
70
70
|
"devDependencies": {
|
71
71
|
"@balena/lint": "^8.2.8",
|
72
|
-
"@faker-js/faker": "^9.0
|
72
|
+
"@faker-js/faker": "^9.3.0",
|
73
73
|
"@types/busboy": "^1.5.4",
|
74
74
|
"@types/chai": "^4.3.20",
|
75
75
|
"@types/grunt": "^0.4.31",
|
76
|
-
"@types/mocha": "^10.0.
|
76
|
+
"@types/mocha": "^10.0.10",
|
77
77
|
"@types/on-finished": "^2.3.4",
|
78
78
|
"@types/request": "^2.48.12",
|
79
79
|
"@types/supertest": "^6.0.2",
|
@@ -91,37 +91,37 @@
|
|
91
91
|
"grunt-text-replace": "^0.4.0",
|
92
92
|
"grunt-ts": "^6.0.0-beta.22",
|
93
93
|
"grunt-webpack": "^7.0.0",
|
94
|
-
"husky": "^9.1.
|
95
|
-
"lint-staged": "^15.
|
94
|
+
"husky": "^9.1.7",
|
95
|
+
"lint-staged": "^15.3.0",
|
96
96
|
"load-grunt-tasks": "^5.1.0",
|
97
|
-
"mocha": "^
|
97
|
+
"mocha": "^11.0.1",
|
98
98
|
"on-finished": "^2.4.1",
|
99
99
|
"pinejs-client-supertest": "^3.0.1",
|
100
100
|
"raw-loader": "^4.0.2",
|
101
101
|
"request": "^2.88.2",
|
102
102
|
"require-npm4-to-publish": "^1.0.0",
|
103
103
|
"supertest": "^7.0.0",
|
104
|
-
"terser-webpack-plugin": "^5.3.
|
104
|
+
"terser-webpack-plugin": "^5.3.11",
|
105
105
|
"ts-loader": "^9.5.1",
|
106
106
|
"ts-node": "^10.9.2",
|
107
107
|
"typescript": "^5.7.2",
|
108
|
-
"webpack": "^5.
|
109
|
-
"webpack-dev-server": "^5.
|
108
|
+
"webpack": "^5.97.1",
|
109
|
+
"webpack-dev-server": "^5.2.0"
|
110
110
|
},
|
111
111
|
"optionalDependencies": {
|
112
|
-
"@aws-sdk/client-s3": "^3.
|
113
|
-
"@aws-sdk/lib-storage": "^3.
|
114
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
112
|
+
"@aws-sdk/client-s3": "^3.717.0",
|
113
|
+
"@aws-sdk/lib-storage": "^3.717.0",
|
114
|
+
"@aws-sdk/s3-request-presigner": "^3.717.0",
|
115
115
|
"bcrypt": "^5.1.1",
|
116
116
|
"body-parser": "^1.20.3",
|
117
|
-
"compression": "^1.7.
|
117
|
+
"compression": "^1.7.5",
|
118
118
|
"cookie-parser": "^1.4.7",
|
119
|
-
"express": "^4.21.
|
119
|
+
"express": "^4.21.2",
|
120
120
|
"method-override": "^3.0.0",
|
121
121
|
"mysql": "^2.18.1",
|
122
122
|
"passport": "^0.7.0",
|
123
123
|
"passport-local": "^1.0.0",
|
124
|
-
"pg": "^8.13.
|
124
|
+
"pg": "^8.13.1",
|
125
125
|
"pg-connection-string": "^2.7.0",
|
126
126
|
"serve-static": "^1.16.2"
|
127
127
|
},
|
@@ -141,12 +141,12 @@
|
|
141
141
|
"extension": [
|
142
142
|
".test.ts"
|
143
143
|
],
|
144
|
-
"
|
144
|
+
"require": "ts-node/register/transpile-only",
|
145
145
|
"exit": true,
|
146
146
|
"timeout": 60000,
|
147
147
|
"recursive": true
|
148
148
|
},
|
149
149
|
"versionist": {
|
150
|
-
"publishedAt": "2025-01-
|
150
|
+
"publishedAt": "2025-01-02T16:35:56.859Z"
|
151
151
|
}
|
152
152
|
}
|
@@ -3,13 +3,13 @@ import {
|
|
3
3
|
version,
|
4
4
|
writeAll,
|
5
5
|
writeSqlModel,
|
6
|
-
} from './utils
|
6
|
+
} from './utils';
|
7
7
|
|
8
8
|
import { program } from 'commander';
|
9
9
|
|
10
10
|
const runCompile = async (inputFile: string, outputFile?: string) => {
|
11
11
|
const { generateSqlModel } = await import('../sbvr-api/sbvr-utils.js');
|
12
|
-
const abstractSql =
|
12
|
+
const abstractSql = getAbstractSqlModelFromFile(
|
13
13
|
inputFile,
|
14
14
|
program.opts().model,
|
15
15
|
);
|
@@ -28,7 +28,7 @@ const generateTypes = async (
|
|
28
28
|
const { abstractSqlToTypescriptTypes } = await import(
|
29
29
|
'@balena/abstract-sql-to-typescript/generate'
|
30
30
|
);
|
31
|
-
const abstractSql =
|
31
|
+
const abstractSql = getAbstractSqlModelFromFile(
|
32
32
|
inputFile,
|
33
33
|
program.opts().model,
|
34
34
|
);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getAbstractSqlModelFromFile, version, writeAll } from './utils
|
1
|
+
import { getAbstractSqlModelFromFile, version, writeAll } from './utils';
|
2
2
|
import type {
|
3
3
|
AbstractSqlModel,
|
4
4
|
SqlResult,
|
@@ -44,7 +44,7 @@ const translateOData = async (
|
|
44
44
|
outputFile?: string,
|
45
45
|
) => {
|
46
46
|
const request = await generateAbstractSqlQuery(
|
47
|
-
|
47
|
+
getAbstractSqlModelFromFile(modelFile, program.opts().model),
|
48
48
|
odata,
|
49
49
|
);
|
50
50
|
const json = JSON.stringify(request.abstractSqlQuery, null, 2);
|
@@ -68,7 +68,7 @@ const compileOData = async (
|
|
68
68
|
outputFile?: string,
|
69
69
|
) => {
|
70
70
|
const translatedRequest = await generateAbstractSqlQuery(
|
71
|
-
|
71
|
+
getAbstractSqlModelFromFile(modelFile, program.opts().model),
|
72
72
|
odata,
|
73
73
|
);
|
74
74
|
const { compileRequest } = await import('../sbvr-api/abstract-sql.js');
|
package/src/bin/sbvr-compiler.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { version, writeAll, writeSqlModel } from './utils
|
1
|
+
import { version, writeAll, writeSqlModel } from './utils';
|
2
2
|
import { program } from 'commander';
|
3
|
-
import fs from 'fs';
|
3
|
+
import * as fs from 'fs';
|
4
4
|
|
5
5
|
const getSE = (inputFile: string) => fs.readFileSync(inputFile, 'utf8');
|
6
6
|
|
package/src/bin/utils.ts
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
process.env.PINEJS_CACHE_FILE =
|
2
|
-
process.env.PINEJS_CACHE_FILE ||
|
3
|
-
fileURLToPath(new URL('.pinejs-cache.json', import.meta.url));
|
2
|
+
process.env.PINEJS_CACHE_FILE || __dirname + '/.pinejs-cache.json';
|
4
3
|
|
5
4
|
import type { SqlModel } from '@balena/abstract-sql-compiler';
|
6
|
-
import type { Config, Model } from '../config-loader/config-loader
|
5
|
+
import type { Config, Model } from '../config-loader/config-loader';
|
6
|
+
import type * as SbvrUtils from '../sbvr-api/sbvr-utils';
|
7
7
|
import type { AbstractSqlModel } from '@balena/abstract-sql-compiler';
|
8
8
|
|
9
|
-
import fs from 'fs';
|
10
|
-
import path from 'path';
|
11
|
-
import '../server-glue/sbvr-loader
|
12
|
-
import { fileURLToPath } from 'url';
|
13
|
-
import { loadSBVR } from '../server-glue/sbvr-loader.js';
|
9
|
+
import * as fs from 'fs';
|
10
|
+
import * as path from 'path';
|
11
|
+
import '../server-glue/sbvr-loader';
|
14
12
|
|
15
|
-
export { version } from '../config-loader/env
|
13
|
+
export { version } from '../config-loader/env';
|
16
14
|
|
17
15
|
export const writeAll = (output: string, outputFile?: string): void => {
|
18
16
|
if (outputFile) {
|
@@ -70,21 +68,15 @@ const getConfigModel = (
|
|
70
68
|
return fileContents;
|
71
69
|
};
|
72
70
|
|
73
|
-
export const getAbstractSqlModelFromFile =
|
71
|
+
export const getAbstractSqlModelFromFile = (
|
74
72
|
modelFile: string,
|
75
73
|
modelName: string | undefined,
|
76
|
-
):
|
74
|
+
): AbstractSqlModel => {
|
77
75
|
let fileContents: string | Model | AbstractSqlModel | Config;
|
78
76
|
try {
|
79
|
-
fileContents =
|
77
|
+
fileContents = require(path.resolve(modelFile));
|
80
78
|
} catch {
|
81
|
-
fileContents =
|
82
|
-
try {
|
83
|
-
// Try to parse the file as JSON
|
84
|
-
fileContents = JSON.parse(fileContents);
|
85
|
-
} catch {
|
86
|
-
// Ignore error as it's likely just a text sbvr file
|
87
|
-
}
|
79
|
+
fileContents = fs.readFileSync(require.resolve(modelFile), 'utf8');
|
88
80
|
}
|
89
81
|
let seModel: string;
|
90
82
|
if (fileContents == null) {
|
@@ -102,16 +94,16 @@ export const getAbstractSqlModelFromFile = async (
|
|
102
94
|
} else if ('modelText' in configModel && configModel.modelText != null) {
|
103
95
|
seModel = configModel.modelText;
|
104
96
|
} else if ('modelFile' in configModel && configModel.modelFile != null) {
|
105
|
-
seModel =
|
97
|
+
seModel = fs.readFileSync(require.resolve(configModel.modelFile), 'utf8');
|
106
98
|
} else {
|
107
99
|
throw new Error('Unrecognized config file');
|
108
100
|
}
|
109
101
|
} else {
|
110
102
|
throw new Error('Unrecognized config file');
|
111
103
|
}
|
112
|
-
const { generateLfModel, generateAbstractSqlModel } =
|
113
|
-
|
114
|
-
|
104
|
+
const { generateLfModel, generateAbstractSqlModel } =
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
106
|
+
require('../sbvr-api/sbvr-utils') as typeof SbvrUtils;
|
115
107
|
let lfModel;
|
116
108
|
try {
|
117
109
|
lfModel = generateLfModel(seModel);
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import type Express from 'express';
|
1
|
+
import type * as Express from 'express';
|
2
2
|
import type {
|
3
3
|
AbstractSqlModel,
|
4
4
|
Definition,
|
5
5
|
} from '@balena/abstract-sql-compiler';
|
6
|
-
import type { Database } from '../database-layer/db
|
6
|
+
import type { Database } from '../database-layer/db';
|
7
7
|
import type {
|
8
8
|
AnyObject,
|
9
9
|
Dictionary,
|
10
10
|
RequiredField,
|
11
11
|
Resolvable,
|
12
|
-
} from '../sbvr-api/common-types
|
12
|
+
} from '../sbvr-api/common-types';
|
13
13
|
|
14
14
|
import {
|
15
15
|
type Migration,
|
@@ -18,23 +18,23 @@ import {
|
|
18
18
|
MigrationCategories,
|
19
19
|
isSyncMigration,
|
20
20
|
isAsyncMigration,
|
21
|
-
} from '../migrator/utils
|
21
|
+
} from '../migrator/utils';
|
22
22
|
|
23
|
-
import fs from 'fs';
|
23
|
+
import * as fs from 'fs';
|
24
24
|
import _ from 'lodash';
|
25
|
-
import path from 'path';
|
25
|
+
import * as path from 'path';
|
26
26
|
|
27
|
-
import * as sbvrUtils from '../sbvr-api/sbvr-utils
|
27
|
+
import * as sbvrUtils from '../sbvr-api/sbvr-utils';
|
28
28
|
|
29
|
-
import * as permissions from '../sbvr-api/permissions
|
29
|
+
import * as permissions from '../sbvr-api/permissions';
|
30
30
|
import {
|
31
31
|
getDefaultHandler,
|
32
32
|
getUploaderMiddlware,
|
33
33
|
type WebResourceHandler,
|
34
34
|
setupUploadHooks,
|
35
35
|
setupWebresourceHandler,
|
36
|
-
} from '../webresource-handler
|
37
|
-
import type { AliasValidNodeType } from '../sbvr-api/translations
|
36
|
+
} from '../webresource-handler';
|
37
|
+
import type { AliasValidNodeType } from '../sbvr-api/translations';
|
38
38
|
|
39
39
|
export type SetupFunction = (
|
40
40
|
app: Express.Application,
|
@@ -256,7 +256,7 @@ export const setup = (app: Express.Application) => {
|
|
256
256
|
let customCode: SetupFunction;
|
257
257
|
if (typeof model.customServerCode === 'string') {
|
258
258
|
try {
|
259
|
-
customCode = (
|
259
|
+
customCode = nodeRequire(model.customServerCode).setup;
|
260
260
|
} catch (e: any) {
|
261
261
|
e.message = `Error loading custom server code: '${e.message}'`;
|
262
262
|
throw e;
|
@@ -291,7 +291,7 @@ export const setup = (app: Express.Application) => {
|
|
291
291
|
let root: string;
|
292
292
|
let configObj: Config;
|
293
293
|
if (config == null) {
|
294
|
-
root = path.resolve(process.argv[2]) ||
|
294
|
+
root = path.resolve(process.argv[2]) || __dirname;
|
295
295
|
configObj = await loadConfigFile(path.join(root, 'config.json'));
|
296
296
|
} else if (typeof config === 'string') {
|
297
297
|
root = path.dirname(config);
|
package/src/config-loader/env.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import
|
1
|
+
import * as fs from 'fs';
|
2
2
|
export const { version } = JSON.parse(
|
3
|
-
|
3
|
+
fs.readFileSync(require.resolve('../../package.json'), 'utf8'),
|
4
4
|
);
|
5
5
|
|
6
6
|
const { PINEJS_DEBUG } = process.env;
|
@@ -56,7 +56,7 @@ export const cache = {
|
|
56
56
|
|
57
57
|
import { boolVar, intVar } from '@balena/env-parsing';
|
58
58
|
import memoize from 'memoizee';
|
59
|
-
import memoizeWeak from 'memoizee/weak
|
59
|
+
import memoizeWeak from 'memoizee/weak';
|
60
60
|
export const createCache = <T extends (...args: any[]) => any>(
|
61
61
|
cacheName: keyof typeof cache,
|
62
62
|
fn: T,
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import * as permissions from '../sbvr-api/permissions
|
2
|
-
import type { Resolvable } from '../sbvr-api/common-types
|
1
|
+
import * as permissions from '../sbvr-api/permissions';
|
2
|
+
import type { Resolvable } from '../sbvr-api/common-types';
|
3
3
|
import type { Handler } from 'express';
|
4
|
-
import type { Config, SetupFunction } from '../config-loader/config-loader
|
5
|
-
import type { Tx } from '../database-layer/db
|
4
|
+
import type { Config, SetupFunction } from '../config-loader/config-loader';
|
5
|
+
import type { Tx } from '../database-layer/db';
|
6
6
|
|
7
7
|
const uiModel = `\
|
8
8
|
Vocabulary: ui
|
package/src/database-layer/db.ts
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
/// <references types="websql"/>
|
2
|
-
import type Mysql from 'mysql';
|
3
|
-
import type Pg from 'pg';
|
4
|
-
import type PgConnectionString from 'pg-connection-string';
|
5
|
-
import type { Dictionary, Resolvable } from '../sbvr-api/common-types
|
2
|
+
import type * as Mysql from 'mysql';
|
3
|
+
import type * as Pg from 'pg';
|
4
|
+
import type * as PgConnectionString from 'pg-connection-string';
|
5
|
+
import type { Dictionary, Resolvable } from '../sbvr-api/common-types';
|
6
6
|
|
7
7
|
import { Engines } from '@balena/abstract-sql-compiler';
|
8
8
|
import { EventEmitter } from 'eventemitter3';
|
9
9
|
import _ from 'lodash';
|
10
10
|
import { TypedError } from 'typed-error';
|
11
|
-
import * as env from '../config-loader/env
|
12
|
-
import { fromCallback, timeout } from '../sbvr-api/control-flow
|
11
|
+
import * as env from '../config-loader/env';
|
12
|
+
import { fromCallback, timeout } from '../sbvr-api/control-flow';
|
13
13
|
|
14
14
|
export const metrics = new EventEmitter();
|
15
15
|
|
@@ -487,10 +487,8 @@ const createTransaction = (createFunc: CreateTransactionFn): TransactionFn => {
|
|
487
487
|
};
|
488
488
|
|
489
489
|
let maybePg: typeof Pg | undefined;
|
490
|
-
let maybePgConnectionString: typeof PgConnectionString | undefined;
|
491
490
|
try {
|
492
|
-
maybePg = (
|
493
|
-
maybePgConnectionString = (await import('pg-connection-string')).default;
|
491
|
+
maybePg = require('pg');
|
494
492
|
} catch {
|
495
493
|
// Ignore errors
|
496
494
|
}
|
@@ -545,15 +543,10 @@ if (maybePg != null) {
|
|
545
543
|
let pool: Pg.Pool;
|
546
544
|
let replica: Pg.Pool;
|
547
545
|
if (typeof connectString === 'string') {
|
548
|
-
|
549
|
-
|
550
|
-
'pg-connection-string is required for string connection strings',
|
551
|
-
);
|
552
|
-
}
|
546
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
547
|
+
const pgConnectionString: typeof PgConnectionString = require('pg-connection-string');
|
553
548
|
// We have to cast because of the use of null vs undefined
|
554
|
-
const config =
|
555
|
-
connectString,
|
556
|
-
) as Pg.PoolConfig;
|
549
|
+
const config = pgConnectionString.parse(connectString) as Pg.PoolConfig;
|
557
550
|
pool = initPool(config);
|
558
551
|
} else {
|
559
552
|
const config = connectString;
|
@@ -735,7 +728,7 @@ if (maybePg != null) {
|
|
735
728
|
|
736
729
|
let maybeMysql: typeof Mysql | undefined;
|
737
730
|
try {
|
738
|
-
maybeMysql = (
|
731
|
+
maybeMysql = require('mysql');
|
739
732
|
} catch {
|
740
733
|
// Ignore errors
|
741
734
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { SBVRParser } from '@balena/sbvr-parser';
|
2
|
-
import {
|
3
|
-
import
|
4
|
-
import { version } from '../config-loader/env
|
2
|
+
import { requireSBVR } from '../server-glue/sbvr-loader';
|
3
|
+
import { version as sbvrParserVersion } from '@balena/sbvr-parser/package.json';
|
4
|
+
import { version } from '../config-loader/env';
|
5
5
|
|
6
|
-
const Types =
|
6
|
+
const Types = requireSBVR('@balena/sbvr-types/Type.sbvr', require);
|
7
7
|
|
8
8
|
export const ExtendedSBVRParser = SBVRParser._extend({
|
9
9
|
initialize() {
|
@@ -13,5 +13,5 @@ export const ExtendedSBVRParser = SBVRParser._extend({
|
|
13
13
|
this.AddBuiltInVocab(Types);
|
14
14
|
return this;
|
15
15
|
},
|
16
|
-
version:
|
16
|
+
version: sbvrParserVersion + '+' + version,
|
17
17
|
});
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { odataNameToSqlName } from '@balena/odata-to-abstract-sql';
|
2
|
-
import {
|
3
|
-
const transactionModel =
|
2
|
+
import { requireSBVR } from '../server-glue/sbvr-loader';
|
3
|
+
const transactionModel = requireSBVR('./transaction.sbvr', require);
|
4
4
|
|
5
|
-
/** @type {import('../config-loader/config-loader
|
5
|
+
/** @type {import('../config-loader/config-loader').Config} */
|
6
6
|
export const config = {
|
7
7
|
models: [
|
8
8
|
{
|
@@ -53,7 +53,7 @@ ADD COLUMN IF NOT EXISTS "modified at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT N
|
|
53
53
|
/** @type {(modelName: string) => void} */
|
54
54
|
export let addModelHooks;
|
55
55
|
|
56
|
-
/** @type { import('../config-loader/config-loader
|
56
|
+
/** @type { import('../config-loader/config-loader').SetupFunction } */
|
57
57
|
export function setup(app, sbvrUtils) {
|
58
58
|
addModelHooks = (modelName) => {
|
59
59
|
// TODO: Add checks on POST/PATCH requests as well.
|
package/src/migrator/async.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import type { Tx } from '../database-layer/db
|
2
|
-
import type { Model } from '../config-loader/config-loader
|
1
|
+
import type { Tx } from '../database-layer/db';
|
2
|
+
import type { Model } from '../config-loader/config-loader';
|
3
3
|
|
4
4
|
import _ from 'lodash';
|
5
|
-
import * as sbvrUtils from '../sbvr-api/sbvr-utils
|
5
|
+
import * as sbvrUtils from '../sbvr-api/sbvr-utils';
|
6
6
|
|
7
7
|
type ApiRootModel = Model & { apiRoot: string };
|
8
8
|
|
@@ -24,8 +24,8 @@ import {
|
|
24
24
|
filterAndSortPendingMigrations,
|
25
25
|
type MigrationStatus,
|
26
26
|
type BaseAsyncMigration,
|
27
|
-
} from './utils
|
28
|
-
import { booleanToEnabledString } from '../config-loader/env
|
27
|
+
} from './utils';
|
28
|
+
import { booleanToEnabledString } from '../config-loader/env';
|
29
29
|
|
30
30
|
export const run = async (tx: Tx, model: ApiRootModel): Promise<void> => {
|
31
31
|
const { migrations } = model;
|
package/src/migrator/sync.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type MigrationsModel from './migrations
|
1
|
+
import type MigrationsModel from './migrations';
|
2
2
|
import {
|
3
3
|
type MigrationTuple,
|
4
4
|
MigrationError,
|
@@ -9,15 +9,15 @@ import {
|
|
9
9
|
type RunnableMigrations,
|
10
10
|
filterAndSortPendingMigrations,
|
11
11
|
getRunnableSyncMigrations,
|
12
|
-
} from './utils
|
13
|
-
import type { Tx } from '../database-layer/db
|
14
|
-
import type { Config, Model } from '../config-loader/config-loader
|
12
|
+
} from './utils';
|
13
|
+
import type { Tx } from '../database-layer/db';
|
14
|
+
import type { Config, Model } from '../config-loader/config-loader';
|
15
15
|
|
16
16
|
import _ from 'lodash';
|
17
|
-
import * as sbvrUtils from '../sbvr-api/sbvr-utils
|
18
|
-
import {
|
17
|
+
import * as sbvrUtils from '../sbvr-api/sbvr-utils';
|
18
|
+
import { requireSBVR } from '../server-glue/sbvr-loader';
|
19
19
|
|
20
|
-
const migrationsModel =
|
20
|
+
const migrationsModel = requireSBVR('./migrations.sbvr', require);
|
21
21
|
|
22
22
|
type ApiRootModel = Model & { apiRoot: string };
|
23
23
|
|
@@ -137,7 +137,7 @@ const executeMigration = async (
|
|
137
137
|
}
|
138
138
|
};
|
139
139
|
|
140
|
-
declare module '../sbvr-api/sbvr-utils
|
140
|
+
declare module '../sbvr-api/sbvr-utils' {
|
141
141
|
export interface API {
|
142
142
|
[migrationModelConfig.apiRoot]: PinejsClient<MigrationsModel>;
|
143
143
|
}
|
package/src/migrator/utils.ts
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
import type { Result, Tx } from '../database-layer/db
|
2
|
-
import type { Resolvable } from '../sbvr-api/common-types
|
1
|
+
import type { Result, Tx } from '../database-layer/db';
|
2
|
+
import type { Resolvable } from '../sbvr-api/common-types';
|
3
3
|
|
4
4
|
import { createHash } from 'crypto';
|
5
5
|
import { Engines } from '@balena/abstract-sql-compiler';
|
6
6
|
import _ from 'lodash';
|
7
7
|
import { TypedError } from 'typed-error';
|
8
|
-
import { migrator as migratorEnv } from '../config-loader/env
|
9
|
-
export { migrator as migratorEnv } from '../config-loader/env
|
10
|
-
import { PINEJS_ADVISORY_LOCK } from '../config-loader/env
|
11
|
-
import { delay } from '../sbvr-api/control-flow
|
8
|
+
import { migrator as migratorEnv } from '../config-loader/env';
|
9
|
+
export { migrator as migratorEnv } from '../config-loader/env';
|
10
|
+
import { PINEJS_ADVISORY_LOCK } from '../config-loader/env';
|
11
|
+
import { delay } from '../sbvr-api/control-flow';
|
12
12
|
|
13
|
-
import * as sbvrUtils from '../sbvr-api/sbvr-utils
|
13
|
+
import * as sbvrUtils from '../sbvr-api/sbvr-utils';
|
14
14
|
export enum MigrationCategories {
|
15
15
|
'sync' = 'sync',
|
16
16
|
'async' = 'async',
|
@@ -3,9 +3,8 @@ import type {
|
|
3
3
|
AbstractSqlTable,
|
4
4
|
} from '@balena/abstract-sql-compiler';
|
5
5
|
|
6
|
-
import
|
7
|
-
import {
|
8
|
-
import { version } from '../config-loader/env.js';
|
6
|
+
import sbvrTypes, { type SbvrType } from '@balena/sbvr-types';
|
7
|
+
import { version } from '../config-loader/env';
|
9
8
|
|
10
9
|
const getResourceName = (resourceName: string): string =>
|
11
10
|
resourceName
|