@lowdefy/server-dev 0.0.0-experimental-20231123124425 → 0.0.0-experimental-20240115131502

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.
@@ -0,0 +1,40 @@
1
+ /*
2
+ Copyright (C) 2023 Lowdefy, Inc
3
+ Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
4
+
5
+ Change Date: 2027-10-09
6
+
7
+ On the date above, in accordance with the Business Source License, use
8
+ of this software will be governed by the Apache License, Version 2.0.
9
+ */
10
+ import { keygenValidateLicense } from '@lowdefy/node-utils';
11
+
12
+ const config = {
13
+ dev: {
14
+ accountId: 'bf35f4ae-53a8-45c6-9eed-2d1fc9f53bd6',
15
+ productId: '4254760d-e760-4932-bb96-ba767e6ae780',
16
+ publicKey: 'MCowBQYDK2VwAyEAN27y1DiHiEDYFbNGjgfFdWygxrVSetq6rApWq3psJZI=',
17
+ },
18
+ prod: {
19
+ accountId: '63b3d4e4-39e1-4ccc-8c58-6b8f97ddf4fa',
20
+ productId: 'd19a5af0-4147-4a65-8b6d-0706d7804bc1',
21
+ publicKey: 'MCowBQYDK2VwAyEAFPoseE3gi+YsJziigc1kFKOkdUIBiUMd9RZujTh23Fc=',
22
+ },
23
+ };
24
+
25
+ let license;
26
+
27
+ async function validateLicense() {
28
+ if (license) {
29
+ // Check cached license every 24 hours
30
+ if (license?.timestamp?.valueOf?.() > Date.now() - 1000 * 60 * 60 * 24) {
31
+ return license;
32
+ }
33
+ }
34
+ license = await keygenValidateLicense({
35
+ config: config[process.env.LOWDEFY_LICENSE_ENV ?? 'prod'],
36
+ });
37
+ return license;
38
+ }
39
+
40
+ export default validateLicense;
@@ -43,20 +43,25 @@ async function getContext() {
43
43
  },
44
44
  directories: {
45
45
  build: path.resolve(process.cwd(), './build'),
46
- config: path.resolve(argv.configDirectory || env.LOWDEFY_DIRECTORY_CONFIG || process.cwd()),
46
+ config: path.resolve(argv.configDirectory ?? env.LOWDEFY_DIRECTORY_CONFIG ?? process.cwd()),
47
47
  server: process.cwd(),
48
48
  },
49
49
  logger: createLogger({ level: env.LOWDEFY_LOG_LEVEL }),
50
50
  options: {
51
- port: argv.port || env.PORT || 3000,
52
- refResolver: argv.refResolver || env.LOWDEFY_BUILD_REF_RESOLVER,
51
+ port: argv.port ?? env.PORT ?? 3000,
52
+ refResolver: argv.refResolver ?? env.LOWDEFY_BUILD_REF_RESOLVER,
53
53
  watch:
54
- argv.watch || env.LOWDEFY_SERVER_DEV_WATCH ? JSON.parse(env.LOWDEFY_SERVER_DEV_WATCH) : [],
54
+ argv.watch ?? env.LOWDEFY_SERVER_DEV_WATCH ? JSON.parse(env.LOWDEFY_SERVER_DEV_WATCH) : [],
55
55
  watchIgnore:
56
- argv.watchIgnore || env.LOWDEFY_SERVER_DEV_WATCH_IGNORE
56
+ argv.watchIgnore ?? env.LOWDEFY_SERVER_DEV_WATCH_IGNORE
57
57
  ? JSON.parse(env.LOWDEFY_SERVER_DEV_WATCH_IGNORE)
58
58
  : [],
59
59
  },
60
+ license: {
61
+ entitlements: env.LOWDEFY_LICENSE_ENTITLEMENTS
62
+ ? JSON.parse(env.LOWDEFY_LICENSE_ENTITLEMENTS)
63
+ : [],
64
+ },
60
65
  version: env.npm_package_version,
61
66
  };
62
67
 
@@ -17,13 +17,14 @@
17
17
  import build from '@lowdefy/build';
18
18
  import createCustomPluginTypesMap from '../utils/createCustomPluginTypesMap.mjs';
19
19
 
20
- function lowdefyBuild({ directories, logger, options }) {
20
+ function lowdefyBuild({ directories, logger, options, license }) {
21
21
  return async () => {
22
22
  logger.info({ print: 'spin' }, 'Building config...');
23
23
  const customTypesMap = await createCustomPluginTypesMap({ directories, logger });
24
24
  await build({
25
25
  customTypesMap,
26
26
  directories,
27
+ entitlements: license.entitlements,
27
28
  logger,
28
29
  refResolver: options.refResolver,
29
30
  stage: 'dev',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20231123124425",
3
+ "version": "0.0.0-experimental-20240115131502",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -36,32 +36,33 @@
36
36
  ".npmrc"
37
37
  ],
38
38
  "dependencies": {
39
- "@lowdefy/actions-core": "0.0.0-experimental-20231123124425",
40
- "@lowdefy/api": "0.0.0-experimental-20231123124425",
41
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20231123124425",
42
- "@lowdefy/blocks-antd": "0.0.0-experimental-20231123124425",
43
- "@lowdefy/blocks-basic": "0.0.0-experimental-20231123124425",
44
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20231123124425",
45
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20231123124425",
46
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20231123124425",
47
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20231123124425",
48
- "@lowdefy/blocks-qr": "0.0.0-experimental-20231123124425",
49
- "@lowdefy/build": "0.0.0-experimental-20231123124425",
50
- "@lowdefy/client": "0.0.0-experimental-20231123124425",
51
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20231123124425",
52
- "@lowdefy/engine": "0.0.0-experimental-20231123124425",
53
- "@lowdefy/helpers": "0.0.0-experimental-20231123124425",
54
- "@lowdefy/layout": "0.0.0-experimental-20231123124425",
55
- "@lowdefy/node-utils": "0.0.0-experimental-20231123124425",
56
- "@lowdefy/operators-change-case": "0.0.0-experimental-20231123124425",
57
- "@lowdefy/operators-diff": "0.0.0-experimental-20231123124425",
58
- "@lowdefy/operators-js": "0.0.0-experimental-20231123124425",
59
- "@lowdefy/operators-moment": "0.0.0-experimental-20231123124425",
60
- "@lowdefy/operators-mql": "0.0.0-experimental-20231123124425",
61
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20231123124425",
62
- "@lowdefy/operators-uuid": "0.0.0-experimental-20231123124425",
63
- "@lowdefy/operators-yaml": "0.0.0-experimental-20231123124425",
64
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20231123124425",
39
+ "@lowdefy/actions-core": "0.0.0-experimental-20240115131502",
40
+ "@lowdefy/api": "0.0.0-experimental-20240115131502",
41
+ "@lowdefy/block-utils": "0.0.0-experimental-20240115131502",
42
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20240115131502",
43
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20240115131502",
44
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20240115131502",
45
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20240115131502",
46
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20240115131502",
47
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20240115131502",
48
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20240115131502",
49
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20240115131502",
50
+ "@lowdefy/build": "0.0.0-experimental-20240115131502",
51
+ "@lowdefy/client": "0.0.0-experimental-20240115131502",
52
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20240115131502",
53
+ "@lowdefy/engine": "0.0.0-experimental-20240115131502",
54
+ "@lowdefy/helpers": "0.0.0-experimental-20240115131502",
55
+ "@lowdefy/layout": "0.0.0-experimental-20240115131502",
56
+ "@lowdefy/node-utils": "0.0.0-experimental-20240115131502",
57
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20240115131502",
58
+ "@lowdefy/operators-diff": "0.0.0-experimental-20240115131502",
59
+ "@lowdefy/operators-js": "0.0.0-experimental-20240115131502",
60
+ "@lowdefy/operators-moment": "0.0.0-experimental-20240115131502",
61
+ "@lowdefy/operators-mql": "0.0.0-experimental-20240115131502",
62
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20240115131502",
63
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20240115131502",
64
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20240115131502",
65
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20240115131502",
65
66
  "chokidar": "3.5.3",
66
67
  "dotenv": "16.3.1",
67
68
  "next": "13.5.4",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server-dev",
3
- "version": "0.0.0-experimental-20231123124425",
3
+ "version": "0.0.0-experimental-20240115131502",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -42,32 +42,33 @@
42
42
  "next": "next"
43
43
  },
44
44
  "dependencies": {
45
- "@lowdefy/actions-core": "0.0.0-experimental-20231123124425",
46
- "@lowdefy/api": "0.0.0-experimental-20231123124425",
47
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20231123124425",
48
- "@lowdefy/blocks-antd": "0.0.0-experimental-20231123124425",
49
- "@lowdefy/blocks-basic": "0.0.0-experimental-20231123124425",
50
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20231123124425",
51
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20231123124425",
52
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20231123124425",
53
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20231123124425",
54
- "@lowdefy/blocks-qr": "0.0.0-experimental-20231123124425",
55
- "@lowdefy/build": "0.0.0-experimental-20231123124425",
56
- "@lowdefy/client": "0.0.0-experimental-20231123124425",
57
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20231123124425",
58
- "@lowdefy/engine": "0.0.0-experimental-20231123124425",
59
- "@lowdefy/helpers": "0.0.0-experimental-20231123124425",
60
- "@lowdefy/layout": "0.0.0-experimental-20231123124425",
61
- "@lowdefy/node-utils": "0.0.0-experimental-20231123124425",
62
- "@lowdefy/operators-change-case": "0.0.0-experimental-20231123124425",
63
- "@lowdefy/operators-diff": "0.0.0-experimental-20231123124425",
64
- "@lowdefy/operators-js": "0.0.0-experimental-20231123124425",
65
- "@lowdefy/operators-moment": "0.0.0-experimental-20231123124425",
66
- "@lowdefy/operators-mql": "0.0.0-experimental-20231123124425",
67
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20231123124425",
68
- "@lowdefy/operators-uuid": "0.0.0-experimental-20231123124425",
69
- "@lowdefy/operators-yaml": "0.0.0-experimental-20231123124425",
70
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20231123124425",
45
+ "@lowdefy/actions-core": "0.0.0-experimental-20240115131502",
46
+ "@lowdefy/api": "0.0.0-experimental-20240115131502",
47
+ "@lowdefy/block-utils": "0.0.0-experimental-20240115131502",
48
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20240115131502",
49
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20240115131502",
50
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20240115131502",
51
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20240115131502",
52
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20240115131502",
53
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20240115131502",
54
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20240115131502",
55
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20240115131502",
56
+ "@lowdefy/build": "0.0.0-experimental-20240115131502",
57
+ "@lowdefy/client": "0.0.0-experimental-20240115131502",
58
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20240115131502",
59
+ "@lowdefy/engine": "0.0.0-experimental-20240115131502",
60
+ "@lowdefy/helpers": "0.0.0-experimental-20240115131502",
61
+ "@lowdefy/layout": "0.0.0-experimental-20240115131502",
62
+ "@lowdefy/node-utils": "0.0.0-experimental-20240115131502",
63
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20240115131502",
64
+ "@lowdefy/operators-diff": "0.0.0-experimental-20240115131502",
65
+ "@lowdefy/operators-js": "0.0.0-experimental-20240115131502",
66
+ "@lowdefy/operators-moment": "0.0.0-experimental-20240115131502",
67
+ "@lowdefy/operators-mql": "0.0.0-experimental-20240115131502",
68
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20240115131502",
69
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20240115131502",
70
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20240115131502",
71
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20240115131502",
71
72
  "chokidar": "3.5.3",
72
73
  "dotenv": "16.3.1",
73
74
  "next": "13.5.4",
@@ -0,0 +1,22 @@
1
+ /*
2
+ Copyright (C) 2023 Lowdefy, Inc
3
+ Use of this software is governed by the Business Source License included in the LICENSE file and at www.mariadb.com/bsl11.
4
+
5
+ Change Date: 2027-10-09
6
+
7
+ On the date above, in accordance with the Business Source License, use
8
+ of this software will be governed by the Apache License, Version 2.0.
9
+ */
10
+ import apiWrapper from '../../lib/server/apiWrapper.js';
11
+ import validateLicense from '../../lib/server/validateLicense.js';
12
+
13
+ async function handler({ req, res }) {
14
+ if (req.method !== 'GET') {
15
+ throw new Error('Only GET requests are supported.');
16
+ }
17
+
18
+ const license = await validateLicense();
19
+ return res.status(200).json(license);
20
+ }
21
+
22
+ export default apiWrapper(handler);