sr-npm 1.7.834 → 1.7.836

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/backend/index.js CHANGED
@@ -5,4 +5,6 @@ module.exports = {
5
5
  ...require('./consts'),
6
6
  ...require('./data'),
7
7
  ...require('./careersMultiBoxesPageIds'),
8
+ ...require('./secretsData'),
9
+ ...require('./collectionConsts'),
8
10
  };
@@ -4,7 +4,7 @@ const { items: wixData } = require('@wix/data');
4
4
  const { COLLECTIONS,TOKEN_NAME } = require('./collectionConsts');
5
5
 
6
6
  const getSecretValue = auth.elevate(secrets.getSecretValue);
7
-
7
+ const elevatedQuery = auth.elevate(wixData.query);
8
8
 
9
9
  async function retrieveSecretVal(tokenName)
10
10
  {
@@ -20,7 +20,7 @@ const getSecretValue = auth.elevate(secrets.getSecretValue);
20
20
  }
21
21
 
22
22
  async function getTokenFromCMS(tokenName) {
23
- const result = await wixData.query(COLLECTIONS.SECRET_MANAGER_MIRROR).eq('tokenName',tokenName).find();
23
+ const result = await elevatedQuery(COLLECTIONS.SECRET_MANAGER_MIRROR).eq('tokenName',tokenName).find();
24
24
  if (result.items.length > 0) {
25
25
  return result.items[0].value;
26
26
  } else {
@@ -28,7 +28,7 @@ const getSecretValue = auth.elevate(secrets.getSecretValue);
28
28
  }
29
29
  }
30
30
  async function getTemplateTypeFromCMS() {
31
- const result = await wixData.query(COLLECTIONS.TEMPLATE_TYPE).limit(1).find();
31
+ const result = await elevatedQuery(COLLECTIONS.TEMPLATE_TYPE).limit(1).find();
32
32
  if (result.items.length > 0) {
33
33
  return result.items[0].templateType;
34
34
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.834",
3
+ "version": "1.7.836",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,18 +1,16 @@
1
- const { getApiKeys } = require('../backend/secretsData');
2
- const { TEMPLATE_TYPE } = require('../backend/collectionConsts');
1
+ import { getApiKeys } from 'backend';
2
+ import { TEMPLATE_TYPE } from 'backend';
3
+
3
4
  async function masterPageOnReady(_$w) {
4
- ({ companyId, templateType } = await getApiKeys());
5
+ const { companyId, templateType } = await getApiKeys();
5
6
  console.log("companyId: ", companyId);
6
7
  console.log("templateType: ", templateType);
7
8
  if(templateType===TEMPLATE_TYPE.EXTERNAL){
8
9
  console.log("templateType is external");
9
10
  }
10
11
  else{
11
-
12
12
  console.log("templateType is internal");
13
13
  }
14
-
15
-
16
14
  }
17
15
 
18
16
  module.exports = {