@lowdefy/server 4.0.0-alpha.4 → 4.0.0-alpha.5

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/next.config.js CHANGED
@@ -1,11 +1,10 @@
1
1
  const withLess = require('next-with-less');
2
+ const appConfig = require('./build/app.json');
2
3
 
3
4
  module.exports = withLess({
4
5
  lessLoaderOptions: {
5
6
  lessOptions: {
6
- modifyVars: {
7
- 'primary-color': '#9900FF',
8
- },
7
+ modifyVars: appConfig.styles.lessVariables,
9
8
  },
10
9
  },
11
10
  reactStrictMode: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/server",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.5",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -31,7 +31,6 @@
31
31
  ".eslintrc.yaml"
32
32
  ],
33
33
  "scripts": {
34
- "build": "lowdefy-build && next build",
35
34
  "build:lowdefy": "lowdefy-build",
36
35
  "build:next": "next build",
37
36
  "dev": "next dev",
@@ -40,14 +39,12 @@
40
39
  "next": "next"
41
40
  },
42
41
  "dependencies": {
43
- "@lowdefy/api": "4.0.0-alpha.4",
44
- "@lowdefy/block-utils": "4.0.0-alpha.4",
45
- "@lowdefy/blocks-antd": "4.0.0-alpha.4",
46
- "@lowdefy/blocks-basic": "4.0.0-alpha.4",
47
- "@lowdefy/connection-axios-http": "4.0.0-alpha.4",
48
- "@lowdefy/engine": "4.0.0-alpha.4",
49
- "@lowdefy/helpers": "4.0.0-alpha.4",
50
- "@lowdefy/layout": "4.0.0-alpha.4",
42
+ "@lowdefy/api": "4.0.0-alpha.5",
43
+ "@lowdefy/block-utils": "4.0.0-alpha.5",
44
+ "@lowdefy/engine": "4.0.0-alpha.5",
45
+ "@lowdefy/helpers": "4.0.0-alpha.5",
46
+ "@lowdefy/layout": "4.0.0-alpha.5",
47
+ "@lowdefy/operators-js": "4.0.0-alpha.5",
51
48
  "next": "12.0.3",
52
49
  "next-auth": "4.0.0-beta.6",
53
50
  "react": "18.0.0-alpha-327d5c484-20211106",
@@ -55,7 +52,7 @@
55
52
  "react-icons": "4.3.1"
56
53
  },
57
54
  "devDependencies": {
58
- "@lowdefy/build": "4.0.0-alpha.4",
55
+ "@lowdefy/build": "4.0.0-alpha.5",
59
56
  "@next/eslint-plugin-next": "12.0.4",
60
57
  "less": "4.1.2",
61
58
  "less-loader": "10.2.0",
@@ -64,5 +61,5 @@
64
61
  "publishConfig": {
65
62
  "access": "public"
66
63
  },
67
- "gitHead": "537d166ba3f6e017b8a61c2a7e5c12fd0a48bf67"
64
+ "gitHead": "995fcdb020927f3cdc626fc99c15a2e4137bd962"
68
65
  }
@@ -18,6 +18,7 @@ import React from 'react';
18
18
 
19
19
  import callRequest from '../utils/callRequest.js';
20
20
  import blockComponents from '../../build/plugins/blocks.js';
21
+ import operators from '../../build/plugins/operatorsClient.js';
21
22
  import components from './components.js';
22
23
 
23
24
  const LowdefyContext = ({ children }) => {
@@ -27,6 +28,7 @@ const LowdefyContext = ({ children }) => {
27
28
  callRequest,
28
29
  components,
29
30
  document,
31
+ operators,
30
32
  updaters: {},
31
33
  window,
32
34
  displayMessage: ({ content }) => {
@@ -20,7 +20,8 @@ import Page from '../components/Page.js';
20
20
 
21
21
  export async function getServerSideProps(context) {
22
22
  const { pageId } = context.params;
23
- const apiContext = await createApiContext({ buildDirectory: './.lowdefy/build' });
23
+ // TODO: get the right api context options
24
+ const apiContext = await createApiContext({ buildDirectory: './build' });
24
25
 
25
26
  // TODO: Maybe we can only get rootConfig once?
26
27
  // We can't do getServerSideProps on _app :(
@@ -16,18 +16,21 @@
16
16
 
17
17
  import { callRequest, createApiContext } from '@lowdefy/api';
18
18
  import connections from '../../../../../build/plugins/connections.js';
19
+ import operators from '../../../../../build/plugins/operatorsServer.js';
19
20
 
20
21
  export default async function handler(req, res) {
21
22
  try {
22
23
  if (req.method !== 'POST') {
23
24
  throw new Error('Only POST requests are supported.');
24
25
  }
26
+ // TODO: configure API context
25
27
  const apiContext = await createApiContext({
26
- buildDirectory: './.lowdefy/build',
28
+ buildDirectory: './build',
27
29
  connections,
28
- // TODO
30
+ // TODO: use a logger like pino
29
31
  logger: console,
30
- // TODO
32
+ operators,
33
+ // TODO: get secrets
31
34
  secrets: {},
32
35
  });
33
36
  const { pageId, requestId } = req.query;
@@ -19,8 +19,9 @@ import { createApiContext, getHome, getPageConfig, getRootConfig } from '@lowdef
19
19
  import Page from '../components/Page.js';
20
20
 
21
21
  export async function getServerSideProps() {
22
- const apiContext = await createApiContext({ buildDirectory: './.lowdefy/build' });
22
+ const apiContext = await createApiContext({ buildDirectory: './build' });
23
23
  const home = await getHome(apiContext);
24
+ console.log(home);
24
25
  if (home.configured === false) {
25
26
  return {
26
27
  redirect: {