@balena/pinejs 19.7.1 → 19.7.2-build-esm-ce2a147ed7533c40f456b27f17ac4e559a0f9da8-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/.pinejs-cache.json +1 -1
- package/.versionbot/CHANGELOG.yml +21 -1
- package/CHANGELOG.md +5 -0
- package/{Gruntfile.ts → Gruntfile.cts} +9 -22
- package/VERSION +1 -1
- 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.ts → browser.cts} +1 -1
- package/build/{config.ts → config.cts} +5 -1
- package/build/{module.ts → module.cts} +1 -1
- package/build/{server.ts → server.cts} +1 -1
- package/out/bin/abstract-sql-compiler.js +17 -19
- package/out/bin/abstract-sql-compiler.js.map +1 -1
- package/out/bin/odata-compiler.js +19 -21
- package/out/bin/odata-compiler.js.map +1 -1
- package/out/bin/sbvr-compiler.js +19 -54
- package/out/bin/sbvr-compiler.js.map +1 -1
- package/out/bin/utils.d.ts +3 -3
- package/out/bin/utils.js +16 -53
- package/out/bin/utils.js.map +1 -1
- package/out/config-loader/config-loader.d.ts +6 -6
- package/out/config-loader/config-loader.js +23 -63
- 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 +24 -66
- 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 +5 -42
- 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 +37 -83
- 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 +8 -11
- 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 +20 -60
- package/out/migrator/async.js.map +1 -1
- package/out/migrator/migrations.js +1 -2
- package/out/migrator/sync.d.ts +6 -6
- package/out/migrator/sync.js +20 -61
- package/out/migrator/sync.js.map +1 -1
- package/out/migrator/utils.d.ts +4 -4
- package/out/migrator/utils.js +42 -97
- package/out/migrator/utils.js.map +1 -1
- package/out/odata-metadata/odata-metadata-generator.js +7 -14
- 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 +4 -41
- package/out/passport-pinejs/mount-login-router.js.map +1 -1
- package/out/passport-pinejs/passport-pinejs.d.ts +1 -1
- package/out/passport-pinejs/passport-pinejs.js +11 -46
- 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 +11 -48
- package/out/pinejs-session-store/pinejs-session-store.js.map +1 -1
- package/out/sbvr-api/abstract-sql.d.ts +2 -2
- package/out/sbvr-api/abstract-sql.js +22 -65
- package/out/sbvr-api/abstract-sql.js.map +1 -1
- package/out/sbvr-api/cached-compile.js +8 -15
- package/out/sbvr-api/cached-compile.js.map +1 -1
- package/out/sbvr-api/common-types.js +1 -2
- package/out/sbvr-api/control-flow.d.ts +1 -1
- package/out/sbvr-api/control-flow.js +12 -25
- package/out/sbvr-api/control-flow.js.map +1 -1
- package/out/sbvr-api/dev.js +1 -2
- package/out/sbvr-api/errors.d.ts +1 -1
- package/out/sbvr-api/errors.js +47 -95
- 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 +1 -2
- package/out/sbvr-api/hooks.d.ts +4 -4
- package/out/sbvr-api/hooks.js +23 -35
- 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 +19 -29
- package/out/sbvr-api/odata-response.js.map +1 -1
- package/out/sbvr-api/permissions.d.ts +8 -8
- package/out/sbvr-api/permissions.js +106 -159
- package/out/sbvr-api/permissions.js.map +1 -1
- package/out/sbvr-api/sbvr-utils.d.ts +38 -16
- package/out/sbvr-api/sbvr-utils.js +222 -285
- 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 +10 -17
- package/out/sbvr-api/translations.js.map +1 -1
- package/out/sbvr-api/uri-parser.d.ts +6 -6
- package/out/sbvr-api/uri-parser.js +39 -84
- package/out/sbvr-api/uri-parser.js.map +1 -1
- package/out/sbvr-api/user.js +1 -2
- package/out/server-glue/global-ext.d.ts +0 -3
- package/out/server-glue/module.d.ts +15 -15
- package/out/server-glue/module.js +20 -59
- package/out/server-glue/module.js.map +1 -1
- package/out/server-glue/sbvr-loader.d.ts +2 -1
- package/out/server-glue/sbvr-loader.js +4 -11
- 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 +17 -59
- package/out/server-glue/server.js.map +1 -1
- package/out/tasks/common.d.ts +1 -1
- package/out/tasks/common.js +3 -9
- package/out/tasks/common.js.map +1 -1
- package/out/tasks/index.d.ts +8 -8
- package/out/tasks/index.js +25 -63
- package/out/tasks/index.js.map +1 -1
- package/out/tasks/tasks.js +1 -2
- package/out/tasks/worker.d.ts +3 -3
- package/out/tasks/worker.js +14 -51
- 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 +1 -5
- 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 +17 -24
- 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 +2 -18
- package/out/webresource-handler/handlers/index.js.map +1 -1
- package/out/webresource-handler/index.d.ts +1 -1
- package/out/webresource-handler/index.js +35 -85
- package/out/webresource-handler/index.js.map +1 -1
- package/package.json +10 -10
- 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 +20 -15
- package/src/config-loader/config-loader.ts +11 -11
- package/src/config-loader/env.ts +3 -3
- package/src/data-server/sbvr-server.ts +4 -4
- package/src/database-layer/db.ts +18 -11
- 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 +3 -2
- package/src/passport-pinejs/mount-login-router.ts +3 -3
- package/src/passport-pinejs/passport-pinejs.ts +3 -3
- package/src/pinejs-session-store/pinejs-session-store.ts +4 -4
- package/src/sbvr-api/abstract-sql.ts +5 -5
- package/src/sbvr-api/cached-compile.ts +1 -1
- 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 +8 -4
- package/src/sbvr-api/permissions.ts +17 -17
- package/src/sbvr-api/sbvr-utils.ts +37 -31
- package/src/sbvr-api/translations.ts +1 -1
- package/src/sbvr-api/uri-parser.ts +9 -9
- package/src/server-glue/global-ext.d.ts +0 -3
- package/src/server-glue/module.ts +19 -19
- package/src/server-glue/sbvr-loader.ts +15 -27
- package/src/server-glue/server.ts +13 -24
- 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 +5 -1
- package/src/webresource-handler/handlers/S3Handler.ts +1 -1
- package/src/webresource-handler/handlers/index.ts +2 -2
- package/src/webresource-handler/index.ts +8 -8
- package/tsconfig.dev.json +4 -2
- package/tsconfig.json +1 -1
- package/typings/lf-to-abstract-sql.d.ts +2 -2
- package/typings/memoizee.d.ts +1 -1
@@ -1,3 +1,15 @@
|
|
1
|
+
- commits:
|
2
|
+
- subject: Convert to ESM
|
3
|
+
hash: ce2a147ed7533c40f456b27f17ac4e559a0f9da8
|
4
|
+
body: ""
|
5
|
+
footer:
|
6
|
+
Change-type: patch
|
7
|
+
change-type: patch
|
8
|
+
author: Pagan Gazzard
|
9
|
+
nested: []
|
10
|
+
version: 19.7.2
|
11
|
+
title: ""
|
12
|
+
date: 2024-12-30T17:58:42.550Z
|
1
13
|
- commits:
|
2
14
|
- subject: Use/export explicit functions for loading SBVR files
|
3
15
|
hash: c47a755613fec8293547c7cfb34cc9e707a7c703
|
@@ -43,7 +55,7 @@
|
|
43
55
|
nested: []
|
44
56
|
version: 19.7.1
|
45
57
|
title: ""
|
46
|
-
date: 2024-12-
|
58
|
+
date: 2024-12-30T14:24:28.696Z
|
47
59
|
- commits:
|
48
60
|
- subject: Add convert serial option to generate-types command
|
49
61
|
hash: 13e62a4a1a9671ded893cb7d7945d6fe55a2fa8c
|
@@ -2045,6 +2057,7 @@
|
|
2045
2057
|
|
2046
2058
|
|
2047
2059
|
|
2060
|
+
|
2048
2061
|
|
2049
2062
|
|
2050
2063
|
As balena-lint
|
@@ -2086,6 +2099,7 @@
|
|
2086
2099
|
|
2087
2100
|
|
2088
2101
|
|
2102
|
+
|
2089
2103
|
|
2090
2104
|
|
2091
2105
|
As engine and npm is
|
@@ -2142,6 +2156,7 @@
|
|
2142
2156
|
|
2143
2157
|
|
2144
2158
|
|
2159
|
+
|
2145
2160
|
|
2146
2161
|
|
2147
2162
|
Ensure that the
|
@@ -2261,6 +2276,7 @@
|
|
2261
2276
|
|
2262
2277
|
|
2263
2278
|
|
2279
|
+
|
2264
2280
|
|
2265
2281
|
|
2266
2282
|
This also deprecates
|
@@ -2308,6 +2324,7 @@
|
|
2308
2324
|
|
2309
2325
|
|
2310
2326
|
|
2327
|
+
|
2311
2328
|
|
2312
2329
|
|
2313
2330
|
It can in fact be a
|
@@ -2356,6 +2373,7 @@
|
|
2356
2373
|
|
2357
2374
|
|
2358
2375
|
|
2376
|
+
|
2359
2377
|
|
2360
2378
|
|
2361
2379
|
We know what type
|
@@ -2409,6 +2427,7 @@
|
|
2409
2427
|
|
2410
2428
|
|
2411
2429
|
|
2430
|
+
|
2412
2431
|
|
2413
2432
|
|
2414
2433
|
Update
|
@@ -2573,6 +2592,7 @@
|
|
2573
2592
|
|
2574
2593
|
|
2575
2594
|
|
2595
|
+
|
2576
2596
|
|
2577
2597
|
|
2578
2598
|
This also deprecates
|
package/CHANGELOG.md
CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file
|
|
4
4
|
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
# v19.7.2
|
8
|
+
## (2024-12-30)
|
9
|
+
|
10
|
+
* Convert to ESM [Pagan Gazzard]
|
11
|
+
|
7
12
|
# v19.7.1
|
8
13
|
## (2024-12-30)
|
9
14
|
|
@@ -3,9 +3,9 @@ import type { WebpackPluginInstance } from 'webpack';
|
|
3
3
|
|
4
4
|
import _ from 'lodash';
|
5
5
|
import TerserPlugin from 'terser-webpack-plugin';
|
6
|
-
import browserConfig from './build/browser';
|
7
|
-
import moduleConfig from './build/module';
|
8
|
-
import serverConfig from './build/server';
|
6
|
+
import browserConfig from './build/browser.cts';
|
7
|
+
import moduleConfig from './build/module.cts';
|
8
|
+
import serverConfig from './build/server.cts';
|
9
9
|
|
10
10
|
const serverConfigs = {
|
11
11
|
browser: browserConfig,
|
@@ -110,30 +110,18 @@ export = (grunt: typeof Grunt) => {
|
|
110
110
|
return renames;
|
111
111
|
})(),
|
112
112
|
|
113
|
-
replace: {
|
114
|
-
|
113
|
+
replace: _.mapValues(serverConfigs, (_config, task) => {
|
114
|
+
return {
|
115
115
|
src: 'out/pine.js',
|
116
116
|
overwrite: true,
|
117
117
|
replacements: [
|
118
118
|
{
|
119
|
-
from: /
|
120
|
-
to: '
|
119
|
+
from: /sourceMappingURL=pine.js.map/g,
|
120
|
+
to: `sourceMappingURL=pine-${task}-<%= grunt.option('version') %>.js.map`,
|
121
121
|
},
|
122
122
|
],
|
123
|
-
}
|
124
|
-
|
125
|
-
return {
|
126
|
-
src: 'out/pine.js',
|
127
|
-
overwrite: true,
|
128
|
-
replacements: [
|
129
|
-
{
|
130
|
-
from: /sourceMappingURL=pine.js.map/g,
|
131
|
-
to: `sourceMappingURL=pine-${task}-<%= grunt.option('version') %>.js.map`,
|
132
|
-
},
|
133
|
-
],
|
134
|
-
};
|
135
|
-
}),
|
136
|
-
},
|
123
|
+
};
|
124
|
+
}),
|
137
125
|
|
138
126
|
webpack: serverConfigs,
|
139
127
|
|
@@ -167,7 +155,6 @@ export = (grunt: typeof Grunt) => {
|
|
167
155
|
'webpack:' + task,
|
168
156
|
'gitinfo:describe',
|
169
157
|
'version',
|
170
|
-
'replace:pine.js',
|
171
158
|
`replace:${task}`,
|
172
159
|
`concat:${task}`,
|
173
160
|
`rename:${task}`,
|
package/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
19.7.
|
1
|
+
19.7.2
|
@@ -1,2 +1,2 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
|
2
|
+
import '../out/bin/abstract-sql-compiler.js';
|
package/bin/odata-compiler.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
|
2
|
+
import '../out/bin/odata-compiler.js';
|
package/bin/sbvr-compiler.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
|
2
|
+
import '../out/bin/sbvr-compiler.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as webpack from 'webpack';
|
2
2
|
import type { Configuration } from 'webpack';
|
3
|
-
import sharedConfig from './config';
|
3
|
+
import sharedConfig from './config.cts';
|
4
4
|
|
5
5
|
if (typeof sharedConfig.externals !== 'object') {
|
6
6
|
throw new Error('Expected externals to be an object');
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { RequiredField } from '../src/sbvr-api/common-types';
|
1
|
+
import type { RequiredField } from '../src/sbvr-api/common-types.js' with { 'resolution-mode': 'import' };
|
2
2
|
|
3
3
|
import * as path from 'path';
|
4
4
|
import * as webpack from 'webpack';
|
@@ -46,6 +46,10 @@ const config: RequiredField<
|
|
46
46
|
},
|
47
47
|
resolve: {
|
48
48
|
extensions: ['.js', '.ts'],
|
49
|
+
extensionAlias: {
|
50
|
+
'.js': ['.ts', '.js'],
|
51
|
+
'.mjs': ['.mts', '.mjs'],
|
52
|
+
},
|
49
53
|
},
|
50
54
|
plugins: [new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 })],
|
51
55
|
module: {
|
@@ -1,34 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const utils_1 = require("./utils");
|
4
|
-
const commander_1 = require("commander");
|
1
|
+
import { getAbstractSqlModelFromFile, version, writeAll, writeSqlModel, } from './utils.js';
|
2
|
+
import { program } from 'commander';
|
5
3
|
const runCompile = async (inputFile, outputFile) => {
|
6
4
|
const { generateSqlModel } = await import('../sbvr-api/sbvr-utils.js');
|
7
|
-
const abstractSql =
|
8
|
-
const sqlModel = generateSqlModel(abstractSql,
|
9
|
-
|
5
|
+
const abstractSql = await getAbstractSqlModelFromFile(inputFile, program.opts().model);
|
6
|
+
const sqlModel = generateSqlModel(abstractSql, program.opts().engine);
|
7
|
+
writeSqlModel(sqlModel, outputFile);
|
10
8
|
};
|
11
9
|
const generateTypes = async (inputFile, options) => {
|
12
10
|
const { abstractSqlToTypescriptTypes } = await import('@balena/abstract-sql-to-typescript/generate');
|
13
|
-
const abstractSql =
|
11
|
+
const abstractSql = await getAbstractSqlModelFromFile(inputFile, program.opts().model);
|
14
12
|
const types = abstractSqlToTypescriptTypes(abstractSql, {
|
15
13
|
convertSerialToInteger: options.convertSerialToInteger,
|
16
14
|
});
|
17
|
-
|
15
|
+
writeAll(types, options.outputFile);
|
18
16
|
};
|
19
|
-
|
20
|
-
.version(
|
17
|
+
program
|
18
|
+
.version(version)
|
21
19
|
.option('-e, --engine <engine>', 'The target database engine (postgres|websql|mysql), default: postgres', /postgres|websql|mysql/, 'postgres')
|
22
20
|
.option('-m, --model <model-name>', 'The target model for config files with multiple models, default: first model');
|
23
|
-
|
21
|
+
program
|
24
22
|
.command('compile <input-file> [output-file]')
|
25
23
|
.description('compile the input AbstractSql model into SQL')
|
26
24
|
.action(runCompile);
|
27
|
-
|
25
|
+
program
|
28
26
|
.command('compile-schema <input-file> [output-file]')
|
29
27
|
.description('compile the input AbstractSql model into SQL')
|
30
28
|
.action(runCompile);
|
31
|
-
|
29
|
+
program
|
32
30
|
.command('generate-types <input-file> [output-file]')
|
33
31
|
.description('generate typescript types from the input AbstractSql')
|
34
32
|
.option('--convert-serial-to-integer', 'Convert serials to integers')
|
@@ -38,13 +36,13 @@ commander_1.program
|
|
38
36
|
convertSerialToInteger: opts.convertSerialToInteger,
|
39
37
|
});
|
40
38
|
});
|
41
|
-
|
39
|
+
program
|
42
40
|
.command('help')
|
43
41
|
.description('print the help')
|
44
|
-
.action(() =>
|
45
|
-
|
42
|
+
.action(() => program.help());
|
43
|
+
program.arguments('<input-file> [output-file]').action(runCompile);
|
46
44
|
if (process.argv.length === 2) {
|
47
|
-
|
45
|
+
program.help();
|
48
46
|
}
|
49
|
-
void
|
47
|
+
void program.parseAsync(process.argv);
|
50
48
|
//# sourceMappingURL=abstract-sql-compiler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"abstract-sql-compiler.js","sourceRoot":"","sources":["../../src/bin/abstract-sql-compiler.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"abstract-sql-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AO,CAAC,oCAAoC,CAAC;KAC7C,WAAW,CAAC,8CAA8C,CAAC;KAC3D,MAAM,CAAC,UAAU,CAAC,CAAC;AAErB,OAAO;KACL,OAAO,CAAC,2CAA2C,CAAC;KACpD,WAAW,CAAC,8CAA8C,CAAC;KAC3D,MAAM,CAAC,UAAU,CAAC,CAAC;AAErB,OAAO;KACL,OAAO,CAAC,2CAA2C,CAAC;KACpD,WAAW,CAAC,sDAAsD,CAAC;KACnE,MAAM,CAAC,6BAA6B,EAAE,6BAA6B,CAAC;KACpE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE;IAC7C,MAAM,aAAa,CAAC,SAAS,EAAE;QAC9B,UAAU;QACV,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;KACnD,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEJ,OAAO;KACL,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,gBAAgB,CAAC;KAC7B,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/B,OAAO,CAAC,SAAS,CAAC,4BAA4B,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAEnE,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IAC/B,OAAO,CAAC,IAAI,EAAE,CAAC;AAChB,CAAC;AAED,KAAK,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
@@ -1,13 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const utils_1 = require("./utils");
|
4
|
-
const commander_1 = require("commander");
|
1
|
+
import { getAbstractSqlModelFromFile, version, writeAll } from './utils.js';
|
2
|
+
import { program } from 'commander';
|
5
3
|
const generateAbstractSqlQuery = async (abstractSqlModel, odata) => {
|
6
4
|
const { memoizedParseOdata, translateUri } = await import('../sbvr-api/uri-parser.js');
|
7
5
|
const odataAST = memoizedParseOdata(odata);
|
8
6
|
const vocabulary = '';
|
9
7
|
return translateUri({
|
10
|
-
engine:
|
8
|
+
engine: program.opts().engine,
|
11
9
|
method: 'GET',
|
12
10
|
url: odata,
|
13
11
|
resourceName: odataAST.tree.resource,
|
@@ -25,12 +23,12 @@ const parseOData = async (odata, outputFile) => {
|
|
25
23
|
const { memoizedParseOdata } = await import('../sbvr-api/uri-parser.js');
|
26
24
|
const result = memoizedParseOdata(odata);
|
27
25
|
const json = JSON.stringify(result, null, 2);
|
28
|
-
|
26
|
+
writeAll(json, outputFile);
|
29
27
|
};
|
30
28
|
const translateOData = async (modelFile, odata, outputFile) => {
|
31
|
-
const request = await generateAbstractSqlQuery(
|
29
|
+
const request = await generateAbstractSqlQuery(await getAbstractSqlModelFromFile(modelFile, program.opts().model), odata);
|
32
30
|
const json = JSON.stringify(request.abstractSqlQuery, null, 2);
|
33
|
-
|
31
|
+
writeAll(json, outputFile);
|
34
32
|
};
|
35
33
|
const formatSqlQuery = (sqlQuery) => {
|
36
34
|
if (Array.isArray(sqlQuery)) {
|
@@ -44,43 +42,43 @@ Bindings: ${JSON.stringify(sqlQuery.bindings, null, 2)}
|
|
44
42
|
}
|
45
43
|
};
|
46
44
|
const compileOData = async (modelFile, odata, outputFile) => {
|
47
|
-
const translatedRequest = await generateAbstractSqlQuery(
|
45
|
+
const translatedRequest = await generateAbstractSqlQuery(await getAbstractSqlModelFromFile(modelFile, program.opts().model), odata);
|
48
46
|
const { compileRequest } = await import('../sbvr-api/abstract-sql.js');
|
49
47
|
const compiledRequest = compileRequest(translatedRequest);
|
50
48
|
let output;
|
51
|
-
if (
|
49
|
+
if (program.opts().json) {
|
52
50
|
output = JSON.stringify(compiledRequest.sqlQuery, null, 2);
|
53
51
|
}
|
54
52
|
else {
|
55
53
|
output = formatSqlQuery(compiledRequest.sqlQuery);
|
56
54
|
}
|
57
|
-
|
55
|
+
writeAll(output, outputFile);
|
58
56
|
};
|
59
|
-
|
60
|
-
.version(
|
57
|
+
program
|
58
|
+
.version(version)
|
61
59
|
.option('-e, --engine <engine>', 'The target database engine (postgres|websql|mysql), default: postgres', /postgres|websql|mysql/, 'postgres')
|
62
60
|
.option('--json', 'Force json output, default: false');
|
63
|
-
|
61
|
+
program
|
64
62
|
.command('parse <input-url> [output-file]')
|
65
63
|
.description('parse the input OData URL into OData AST')
|
66
64
|
.action(parseOData);
|
67
|
-
|
65
|
+
program
|
68
66
|
.command('translate <model-file> <input-url> [output-file]')
|
69
67
|
.description('translate the input OData URL into abstract SQL')
|
70
68
|
.option('-m, --model <model-name>', 'The target model for config files with multiple models, default: first model')
|
71
69
|
.action(translateOData);
|
72
|
-
|
70
|
+
program
|
73
71
|
.command('compile <model-file> <input-url> [output-file]')
|
74
72
|
.description('compile the input OData URL into SQL')
|
75
73
|
.option('-m, --model <model-name>', 'The target model for config files with multiple models, default: first model')
|
76
74
|
.action(compileOData);
|
77
|
-
|
75
|
+
program
|
78
76
|
.command('help')
|
79
77
|
.description('print the help')
|
80
|
-
.action(() =>
|
81
|
-
|
78
|
+
.action(() => program.help());
|
79
|
+
program.arguments('<sbvr-file> <input-url> [output-file]').action(compileOData);
|
82
80
|
if (process.argv.length === 2) {
|
83
|
-
|
81
|
+
program.help();
|
84
82
|
}
|
85
|
-
void
|
83
|
+
void program.parseAsync(process.argv);
|
86
84
|
//# sourceMappingURL=odata-compiler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"odata-compiler.js","sourceRoot":"","sources":["../../src/bin/odata-compiler.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"odata-compiler.js","sourceRoot":"","sources":["../../src/bin/odata-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,wBAAwB,GAAG,KAAK,EACrC,gBAAkC,EAClC,KAAa,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B,CAAC,CAAC;AAEF,OAAO;KACL,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CACN,uBAAuB,EACvB,uEAAuE,EACvE,uBAAuB,EACvB,UAAU,CACV;KACA,MAAM,CAAC,QAAQ,EAAE,mCAAmC,CAAC,CAAC;AAExD,OAAO;KACL,OAAO,CAAC,iCAAiC,CAAC;KAC1C,WAAW,CAAC,0CAA0C,CAAC;KACvD,MAAM,CAAC,UAAU,CAAC,CAAC;AAErB,OAAO;KACL,OAAO,CAAC,kDAAkD,CAAC;KAC3D,WAAW,CAAC,iDAAiD,CAAC;KAC9D,MAAM,CACN,0BAA0B,EAC1B,8EAA8E,CAC9E;KACA,MAAM,CAAC,cAAc,CAAC,CAAC;AAEzB,OAAO;KACL,OAAO,CAAC,gDAAgD,CAAC;KACzD,WAAW,CAAC,sCAAsC,CAAC;KACnD,MAAM,CACN,0BAA0B,EAC1B,8EAA8E,CAC9E;KACA,MAAM,CAAC,YAAY,CAAC,CAAC;AAEvB,OAAO;KACL,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,gBAAgB,CAAC;KAC7B,MAAM,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAE/B,OAAO,CAAC,SAAS,CAAC,uCAAuC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAEhF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IAC/B,OAAO,CAAC,IAAI,EAAE,CAAC;AAChB,CAAC;AAED,KAAK,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/out/bin/sbvr-compiler.js
CHANGED
@@ -1,48 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
19
|
-
var ownKeys = function(o) {
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
-
var ar = [];
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
-
return ar;
|
24
|
-
};
|
25
|
-
return ownKeys(o);
|
26
|
-
};
|
27
|
-
return function (mod) {
|
28
|
-
if (mod && mod.__esModule) return mod;
|
29
|
-
var result = {};
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
-
__setModuleDefault(result, mod);
|
32
|
-
return result;
|
33
|
-
};
|
34
|
-
})();
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
36
|
-
const utils_1 = require("./utils");
|
37
|
-
const commander_1 = require("commander");
|
38
|
-
const fs = __importStar(require("fs"));
|
1
|
+
import { version, writeAll, writeSqlModel } from './utils.js';
|
2
|
+
import { program } from 'commander';
|
3
|
+
import fs from 'fs';
|
39
4
|
const getSE = (inputFile) => fs.readFileSync(inputFile, 'utf8');
|
40
5
|
const parse = async (inputFile, outputFile) => {
|
41
6
|
const { generateLfModel } = await import('../sbvr-api/sbvr-utils.js');
|
42
7
|
const seModel = getSE(inputFile);
|
43
8
|
const result = generateLfModel(seModel);
|
44
9
|
const json = JSON.stringify(result, null, 2);
|
45
|
-
|
10
|
+
writeAll(json, outputFile);
|
46
11
|
};
|
47
12
|
const transform = async (inputFile, outputFile) => {
|
48
13
|
const { generateLfModel, generateAbstractSqlModel } = await import('../sbvr-api/sbvr-utils.js');
|
@@ -50,13 +15,13 @@ const transform = async (inputFile, outputFile) => {
|
|
50
15
|
const lfModel = generateLfModel(seModel);
|
51
16
|
const result = generateAbstractSqlModel(lfModel);
|
52
17
|
const json = JSON.stringify(result, null, 2);
|
53
|
-
|
18
|
+
writeAll(json, outputFile);
|
54
19
|
};
|
55
20
|
const runCompile = async (inputFile, outputFile) => {
|
56
21
|
const { generateModels } = await import('../sbvr-api/sbvr-utils.js');
|
57
22
|
const seModel = getSE(inputFile);
|
58
|
-
const models = generateModels({ apiRoot: 'sbvr-compiler', modelText: seModel },
|
59
|
-
|
23
|
+
const models = generateModels({ apiRoot: 'sbvr-compiler', modelText: seModel }, program.opts().engine);
|
24
|
+
writeSqlModel(models.sql, outputFile);
|
60
25
|
};
|
61
26
|
const generateTypes = async (inputFile, outputFile) => {
|
62
27
|
const { generateLfModel, generateAbstractSqlModel } = await import('../sbvr-api/sbvr-utils.js');
|
@@ -65,34 +30,34 @@ const generateTypes = async (inputFile, outputFile) => {
|
|
65
30
|
const abstractSql = generateAbstractSqlModel(lfModel);
|
66
31
|
const { abstractSqlToTypescriptTypes } = await import('@balena/abstract-sql-to-typescript/generate');
|
67
32
|
const types = abstractSqlToTypescriptTypes(abstractSql);
|
68
|
-
|
33
|
+
writeAll(types, outputFile);
|
69
34
|
};
|
70
|
-
|
71
|
-
.version(
|
35
|
+
program
|
36
|
+
.version(version)
|
72
37
|
.option('-e, --engine <engine>', 'The target database engine (postgres|websql|mysql), default: postgres', /postgres|websql|mysql/, 'postgres');
|
73
|
-
|
38
|
+
program
|
74
39
|
.command('parse <input-file> [output-file]')
|
75
40
|
.description('parse the input SBVR file into LF')
|
76
41
|
.action(parse);
|
77
|
-
|
42
|
+
program
|
78
43
|
.command('transform <input-file> [output-file]')
|
79
44
|
.description('transform the input SBVR file into abstract SQL')
|
80
45
|
.action(transform);
|
81
|
-
|
46
|
+
program
|
82
47
|
.command('compile <input-file> [output-file]')
|
83
48
|
.description('compile the input SBVR file into SQL')
|
84
49
|
.action(runCompile);
|
85
|
-
|
50
|
+
program
|
86
51
|
.command('generate-types <input-file> [output-file]')
|
87
52
|
.description('generate typescript types from the input SBVR')
|
88
53
|
.action(generateTypes);
|
89
|
-
|
54
|
+
program
|
90
55
|
.command('help')
|
91
56
|
.description('print the help')
|
92
|
-
.action(() =>
|
93
|
-
|
57
|
+
.action(() => program.help());
|
58
|
+
program.arguments('<input-file> [output-file]').action(runCompile);
|
94
59
|
if (process.argv.length === 2) {
|
95
|
-
|
60
|
+
program.help();
|
96
61
|
}
|
97
|
-
void
|
62
|
+
void program.parseAsync(process.argv);
|
98
63
|
//# sourceMappingURL=sbvr-compiler.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sbvr-compiler.js","sourceRoot":"","sources":["../../src/bin/sbvr-compiler.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"sbvr-compiler.js","sourceRoot":"","sources":["../../src/bin/sbvr-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,KAAK,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAExE,MAAM,KAAK,GAAG,KAAK,EAAE,SAAiB,EAAE,UAAmB,EAAE,EAAE;IAC9D,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC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,OAAO,CAAC,IAAI,EAAE,CAAC;AAChB,CAAC;AAED,KAAK,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/out/bin/utils.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { SqlModel } from '@balena/abstract-sql-compiler';
|
2
2
|
import type { AbstractSqlModel } from '@balena/abstract-sql-compiler';
|
3
|
-
import '../server-glue/sbvr-loader';
|
4
|
-
export { version } from '../config-loader/env';
|
3
|
+
import '../server-glue/sbvr-loader.js';
|
4
|
+
export { version } from '../config-loader/env.js';
|
5
5
|
export declare const writeAll: (output: string, outputFile?: string) => void;
|
6
6
|
export declare const writeSqlModel: (sqlModel: SqlModel, outputFile?: string) => void;
|
7
|
-
export declare const getAbstractSqlModelFromFile: (modelFile: string, modelName: string | undefined) => AbstractSqlModel
|
7
|
+
export declare const getAbstractSqlModelFromFile: (modelFile: string, modelName: string | undefined) => Promise<AbstractSqlModel>;
|