@lowdefy/api 4.0.0-alpha.6 → 4.0.0-alpha.7

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.
@@ -12,10 +12,12 @@
12
12
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
- */ // TODO: strip auth prop from page before we send it to the client
16
- async function getPageConfig({ authorize , readConfigFile }, { pageId }) {
15
+ */ async function getPageConfig({ authorize , readConfigFile }, { pageId }) {
17
16
  const pageConfig = await readConfigFile(`pages/${pageId}/${pageId}.json`);
18
- if (pageConfig && authorize(pageConfig)) return pageConfig;
17
+ if (pageConfig && authorize(pageConfig)) {
18
+ delete pageConfig.auth;
19
+ return pageConfig;
20
+ }
19
21
  return null;
20
22
  }
21
23
  export default getPageConfig;
@@ -18,6 +18,8 @@ function testContext({ config ={} , connections ={} , headers ={} , host ='host'
18
18
  error: ()=>{},
19
19
  info: ()=>{},
20
20
  warn: ()=>{}
21
+ } , operators ={
22
+ _test: ()=>'test'
21
23
  } , readConfigFile , roles , secrets ={} , setHeader , user , protocol ='https' , } = {}) {
22
24
  const authenticated = user && !!user.sub;
23
25
  return {
@@ -31,6 +33,7 @@ function testContext({ config ={} , connections ={} , headers ={} , host ='host'
31
33
  headers,
32
34
  host,
33
35
  logger,
36
+ operators,
34
37
  protocol,
35
38
  readConfigFile,
36
39
  secrets,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/api",
3
- "version": "4.0.0-alpha.6",
3
+ "version": "4.0.0-alpha.7",
4
4
  "licence": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -38,23 +38,25 @@
38
38
  "clean": "rm -rf dist",
39
39
  "prepare": "yarn build",
40
40
  "swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
41
- "test": "jest --coverage"
41
+ "test": "yarn node --experimental-vm-modules $(yarn bin jest)"
42
42
  },
43
43
  "dependencies": {
44
- "@lowdefy/ajv": "4.0.0-alpha.6",
45
- "@lowdefy/helpers": "4.0.0-alpha.6",
46
- "@lowdefy/node-utils": "4.0.0-alpha.6",
47
- "@lowdefy/nunjucks": "4.0.0-alpha.6",
48
- "@lowdefy/operators": "4.0.0-alpha.6"
44
+ "@lowdefy/ajv": "4.0.0-alpha.7",
45
+ "@lowdefy/helpers": "4.0.0-alpha.7",
46
+ "@lowdefy/node-utils": "4.0.0-alpha.7",
47
+ "@lowdefy/nunjucks": "4.0.0-alpha.7",
48
+ "@lowdefy/operators": "4.0.0-alpha.7"
49
49
  },
50
50
  "devDependencies": {
51
+ "@jest/globals": "27.5.1",
52
+ "@lowdefy/operators-js": "4.0.0-alpha.7",
51
53
  "@swc/cli": "0.1.55",
52
- "@swc/core": "1.2.130",
54
+ "@swc/core": "1.2.135",
53
55
  "@swc/jest": "0.2.17",
54
- "jest": "27.3.1"
56
+ "jest": "27.5.1"
55
57
  },
56
58
  "publishConfig": {
57
59
  "access": "public"
58
60
  },
59
- "gitHead": "2530e31af795b6a3c75ac8f72c8dbe0ab5d1251b"
61
+ "gitHead": "52ec14639d00de910cf9b8ab25bf933ca891cff5"
60
62
  }