sr-npm 1.7.840 → 1.7.842
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 +0 -2
- package/eslint.config.mjs +1 -1
- package/package.json +1 -1
- package/pages/homePage.js +0 -1
- package/pages/index.js +1 -1
- package/pages/masterPage.js +6 -14
- package/backend/http-functions.js +0 -23
package/backend/index.js
CHANGED
package/eslint.config.mjs
CHANGED
package/package.json
CHANGED
package/pages/homePage.js
CHANGED
package/pages/index.js
CHANGED
package/pages/masterPage.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
async function getApiKeys() {
|
|
4
|
-
const response = await fetch('/_functions/getApiKeys');
|
|
5
|
-
if (!response.ok) {
|
|
6
|
-
console.error('Failed to fetch API key@$#@$#@$#@#$s');
|
|
7
|
-
throw new Error('Failed to fetch API keys, response: ', response);
|
|
8
|
-
}
|
|
9
|
-
return await response.json();
|
|
10
|
-
}
|
|
1
|
+
const { getApiKeys } = require('../backend/secretsData');
|
|
2
|
+
const { TEMPLATE_TYPE } = require('../backend/collectionConsts');
|
|
11
3
|
|
|
12
4
|
async function masterPageOnReady(_$w) {
|
|
13
|
-
|
|
5
|
+
({ companyId, templateType } = await getApiKeys());
|
|
14
6
|
console.log("companyId: ", companyId);
|
|
15
7
|
console.log("templateType: ", templateType);
|
|
16
8
|
if(templateType===TEMPLATE_TYPE.EXTERNAL){
|
|
@@ -19,8 +11,8 @@ async function masterPageOnReady(_$w) {
|
|
|
19
11
|
else{
|
|
20
12
|
console.log("templateType is internal");
|
|
21
13
|
}
|
|
22
|
-
}
|
|
14
|
+
}
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
module.exports = {
|
|
25
17
|
masterPageOnReady,
|
|
26
|
-
};
|
|
18
|
+
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const { getApiKeys } = require('./secretsData');
|
|
2
|
-
const { ok, badRequest } = require('wix-http-functions');
|
|
3
|
-
|
|
4
|
-
export async function get_getApiKeys(request) {
|
|
5
|
-
try {
|
|
6
|
-
const data = await getApiKeys();
|
|
7
|
-
return ok({
|
|
8
|
-
body: data,
|
|
9
|
-
headers: {
|
|
10
|
-
"Content-Type": "application/json"
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
} catch (error) {
|
|
14
|
-
console.error('Error in get_getApiKeys:', error);
|
|
15
|
-
return badRequest({
|
|
16
|
-
body: { error: error.message },
|
|
17
|
-
headers: {
|
|
18
|
-
"Content-Type": "application/json"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|