@mongoosejs/studio 0.0.51 → 0.0.53
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/netlify.js +1 -0
- package/frontend/index.js +3 -1
- package/frontend/public/app.js +5 -5
- package/package.json +1 -1
package/backend/netlify.js
CHANGED
|
@@ -5,6 +5,7 @@ const { toNetlifyFunction } = require('extrovert');
|
|
|
5
5
|
|
|
6
6
|
module.exports = function netlify(options) {
|
|
7
7
|
const backend = Backend();
|
|
8
|
+
const mothershipUrl = options?._mothershipUrl || 'https://mongoose-js.netlify.app/.netlify/functions';
|
|
8
9
|
|
|
9
10
|
return toNetlifyFunction(async function wrappedNetlifyFunction(params) {
|
|
10
11
|
const actionName = params?.action;
|
package/frontend/index.js
CHANGED
|
@@ -4,6 +4,8 @@ const { execSync, exec } = require('child_process');
|
|
|
4
4
|
const webpack = require('webpack');
|
|
5
5
|
|
|
6
6
|
module.exports = async function frontend(apiUrl, isLambda, options, workspace) {
|
|
7
|
+
const mothershipUrl = options?._mothershipUrl || 'https://mongoose-js.netlify.app/.netlify/functions';
|
|
8
|
+
|
|
7
9
|
if (workspace == null && options?.apiKey) {
|
|
8
10
|
({ workspace } = await fetch(`${mothershipUrl}/getWorkspace`, {
|
|
9
11
|
method: 'POST',
|
|
@@ -40,7 +42,7 @@ module.exports = async function frontend(apiUrl, isLambda, options, workspace) {
|
|
|
40
42
|
}
|
|
41
43
|
if (options?.apiKey) {
|
|
42
44
|
config.plugins.push(new webpack.DefinePlugin({
|
|
43
|
-
config__mothershipUrl: `'${options?._mothershipUrl}'`
|
|
45
|
+
config__mothershipUrl: options?._mothershipUrl ? `'${options?._mothershipUrl}'` : '\'https://mongoose-js.netlify.app/.netlify/functions\''
|
|
44
46
|
}));
|
|
45
47
|
} else {
|
|
46
48
|
config.plugins.push(new webpack.DefinePlugin({
|
package/frontend/public/app.js
CHANGED
|
@@ -1863,10 +1863,10 @@ module.exports = app => app.component('models', {
|
|
|
1863
1863
|
|
|
1864
1864
|
const axios = __webpack_require__(/*! axios */ "./node_modules/axios/dist/browser/axios.cjs");
|
|
1865
1865
|
const client = axios.create({
|
|
1866
|
-
baseURL: '
|
|
1866
|
+
baseURL: ''
|
|
1867
1867
|
});
|
|
1868
1868
|
|
|
1869
|
-
client.hasAPIKey = !!'
|
|
1869
|
+
client.hasAPIKey = !!'';
|
|
1870
1870
|
|
|
1871
1871
|
client.interceptors.request.use(req => {
|
|
1872
1872
|
const accessToken = window.localStorage.getItem('_mongooseStudioAccessToken') || null;
|
|
@@ -1882,11 +1882,11 @@ exports.githubLogin = function githubLogin() {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
|
|
1884
1884
|
exports.github = function github(code) {
|
|
1885
|
-
return client.post('/github', { code, workspaceId: {
|
|
1885
|
+
return client.post('/github', { code, workspaceId: {}._id }).then(res => res.data);
|
|
1886
1886
|
};
|
|
1887
1887
|
|
|
1888
1888
|
exports.me = function me() {
|
|
1889
|
-
return client.post('/me', { workspaceId: {
|
|
1889
|
+
return client.post('/me', { workspaceId: {}._id }).then(res => res.data);
|
|
1890
1890
|
};
|
|
1891
1891
|
|
|
1892
1892
|
exports.hasAPIKey = client.hasAPIKey;
|
|
@@ -2024,7 +2024,7 @@ module.exports = app => app.component('splash', {
|
|
|
2024
2024
|
data: () => ({ error: null }),
|
|
2025
2025
|
computed: {
|
|
2026
2026
|
workspaceName() {
|
|
2027
|
-
return {
|
|
2027
|
+
return {}.name;
|
|
2028
2028
|
}
|
|
2029
2029
|
},
|
|
2030
2030
|
async mounted() {
|