Merge branch 'master' into feature/add-grid-to-standard-components
This commit is contained in:
commit
420c94dd00
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "0.1.25",
|
"version": "0.2.0",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/builder",
|
"name": "@budibase/builder",
|
||||||
"version": "0.1.25",
|
"version": "0.2.0",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "^1.41.0",
|
"@budibase/bbui": "^1.41.0",
|
||||||
"@budibase/client": "^0.1.25",
|
"@budibase/client": "^0.2.0",
|
||||||
"@budibase/colorpicker": "^1.0.1",
|
"@budibase/colorpicker": "^1.0.1",
|
||||||
"@fortawesome/fontawesome-free": "^5.14.0",
|
"@fortawesome/fontawesome-free": "^5.14.0",
|
||||||
"@sentry/browser": "5.19.1",
|
"@sentry/browser": "5.19.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "budibase",
|
"name": "budibase",
|
||||||
"version": "0.1.25",
|
"version": "0.2.0",
|
||||||
"description": "Budibase CLI",
|
"description": "Budibase CLI",
|
||||||
"repository": "https://github.com/Budibase/Budibase",
|
"repository": "https://github.com/Budibase/Budibase",
|
||||||
"homepage": "https://www.budibase.com",
|
"homepage": "https://www.budibase.com",
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/server": "^0.1.25",
|
"@budibase/server": "^0.2.0",
|
||||||
"@inquirer/password": "^0.0.6-alpha.0",
|
"@inquirer/password": "^0.0.6-alpha.0",
|
||||||
"chalk": "^2.4.2",
|
"chalk": "^2.4.2",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "0.1.25",
|
"version": "0.2.0",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"main": "dist/budibase-client.js",
|
"main": "dist/budibase-client.js",
|
||||||
"module": "dist/budibase-client.esm.mjs",
|
"module": "dist/budibase-client.esm.mjs",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"version": "0.1.25",
|
"version": "0.2.0",
|
||||||
"description": "Budibase Web Server",
|
"description": "Budibase Web Server",
|
||||||
"main": "src/electron.js",
|
"main": "src/electron.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
"author": "Michael Shanks",
|
"author": "Michael Shanks",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/client": "^0.1.25",
|
"@budibase/client": "^0.2.0",
|
||||||
"@koa/router": "^8.0.0",
|
"@koa/router": "^8.0.0",
|
||||||
"@sendgrid/mail": "^7.1.1",
|
"@sendgrid/mail": "^7.1.1",
|
||||||
"@sentry/node": "^5.19.2",
|
"@sentry/node": "^5.19.2",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const { join } = require("../../utilities/sanitisedPath")
|
const { join } = require("../../utilities/centralPath")
|
||||||
const readline = require("readline")
|
const readline = require("readline")
|
||||||
const { budibaseAppsDir } = require("../../utilities/budibaseDir")
|
const { budibaseAppsDir } = require("../../utilities/budibaseDir")
|
||||||
const ENV_FILE_PATH = "/.env"
|
const ENV_FILE_PATH = "/.env"
|
||||||
|
|
|
@ -8,7 +8,7 @@ const { budibaseAppsDir } = require("../../utilities/budibaseDir")
|
||||||
const sqrl = require("squirrelly")
|
const sqrl = require("squirrelly")
|
||||||
const setBuilderToken = require("../../utilities/builder/setBuilderToken")
|
const setBuilderToken = require("../../utilities/builder/setBuilderToken")
|
||||||
const fs = require("fs-extra")
|
const fs = require("fs-extra")
|
||||||
const { join, resolve } = require("../../utilities/sanitisedPath")
|
const { join, resolve } = require("../../utilities/centralPath")
|
||||||
const { promisify } = require("util")
|
const { promisify } = require("util")
|
||||||
const chmodr = require("chmodr")
|
const chmodr = require("chmodr")
|
||||||
const { generateAppID, getAppParams } = require("../../db/utils")
|
const { generateAppID, getAppParams } = require("../../db/utils")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const CouchDB = require("../../db")
|
const CouchDB = require("../../db")
|
||||||
const ClientDb = require("../../db/clientDb")
|
const ClientDb = require("../../db/clientDb")
|
||||||
const { resolve, join } = require("../../utilities/sanitisedPath")
|
const { resolve, join } = require("../../utilities/centralPath")
|
||||||
const {
|
const {
|
||||||
budibaseTempDir,
|
budibaseTempDir,
|
||||||
budibaseAppsDir,
|
budibaseAppsDir,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const { join } = require("../../../utilities/sanitisedPath")
|
const { join } = require("../../../utilities/centralPath")
|
||||||
const AWS = require("aws-sdk")
|
const AWS = require("aws-sdk")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const { budibaseAppsDir } = require("../../../utilities/budibaseDir")
|
const { budibaseAppsDir } = require("../../../utilities/budibaseDir")
|
||||||
|
|
|
@ -3,7 +3,7 @@ const CouchDB = require("../../db")
|
||||||
const client = require("../../db/clientDb")
|
const client = require("../../db/clientDb")
|
||||||
const newid = require("../../db/newid")
|
const newid = require("../../db/newid")
|
||||||
const { createLinkView } = require("../../db/linkedRecords")
|
const { createLinkView } = require("../../db/linkedRecords")
|
||||||
const { join } = require("../../utilities/sanitisedPath")
|
const { join } = require("../../utilities/centralPath")
|
||||||
const { downloadTemplate } = require("../../utilities/templates")
|
const { downloadTemplate } = require("../../utilities/templates")
|
||||||
|
|
||||||
exports.create = async function(ctx) {
|
exports.create = async function(ctx) {
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
const CouchDB = require("../../db")
|
const CouchDB = require("../../db")
|
||||||
const validateJs = require("validate.js")
|
const validateJs = require("validate.js")
|
||||||
const linkRecords = require("../../db/linkedRecords")
|
const linkRecords = require("../../db/linkedRecords")
|
||||||
const { getRecordParams, generateRecordID } = require("../../db/utils")
|
const {
|
||||||
|
getRecordParams,
|
||||||
|
generateRecordID,
|
||||||
|
DocumentTypes,
|
||||||
|
SEPARATOR,
|
||||||
|
} = require("../../db/utils")
|
||||||
const { cloneDeep } = require("lodash")
|
const { cloneDeep } = require("lodash")
|
||||||
|
|
||||||
const MODEL_VIEW_BEGINS_WITH = "all_model:"
|
const MODEL_VIEW_BEGINS_WITH = `all${SEPARATOR}${DocumentTypes.MODEL}${SEPARATOR}`
|
||||||
|
|
||||||
validateJs.extend(validateJs.validators.datetime, {
|
validateJs.extend(validateJs.validators.datetime, {
|
||||||
parse: function (value) {
|
parse: function (value) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const send = require("koa-send")
|
const send = require("koa-send")
|
||||||
const { resolve, join } = require("../../utilities/sanitisedPath")
|
const { resolve, join } = require("../../utilities/centralPath")
|
||||||
const jwt = require("jsonwebtoken")
|
const jwt = require("jsonwebtoken")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const fs = require("fs-extra")
|
const fs = require("fs-extra")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const CouchDB = require("../../../db")
|
const CouchDB = require("../../../db")
|
||||||
const viewTemplate = require("./viewBuilder")
|
const viewTemplate = require("./viewBuilder")
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const { join } = require("../../../utilities/sanitisedPath")
|
const { join } = require("../../../utilities/centralPath")
|
||||||
const os = require("os")
|
const os = require("os")
|
||||||
const exporters = require("./exporters")
|
const exporters = require("./exporters")
|
||||||
const { fetchView } = require("../record")
|
const { fetchView } = require("../record")
|
||||||
|
|
|
@ -6,7 +6,7 @@ const createUser = require("./steps/createUser")
|
||||||
const environment = require("../environment")
|
const environment = require("../environment")
|
||||||
const download = require("download")
|
const download = require("download")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const { join } = require("../utilities/sanitisedPath")
|
const { join } = require("../utilities/centralPath")
|
||||||
const os = require("os")
|
const os = require("os")
|
||||||
const fs = require("fs")
|
const fs = require("fs")
|
||||||
const Sentry = require("@sentry/node")
|
const Sentry = require("@sentry/node")
|
||||||
|
|
|
@ -2,7 +2,6 @@ const PouchDB = require("pouchdb")
|
||||||
const replicationStream = require("pouchdb-replication-stream")
|
const replicationStream = require("pouchdb-replication-stream")
|
||||||
const allDbs = require("pouchdb-all-dbs")
|
const allDbs = require("pouchdb-all-dbs")
|
||||||
const { budibaseAppsDir } = require("../utilities/budibaseDir")
|
const { budibaseAppsDir } = require("../utilities/budibaseDir")
|
||||||
const { sanitise } = require("../utilities/sanitisedPath")
|
|
||||||
const env = require("../environment")
|
const env = require("../environment")
|
||||||
|
|
||||||
const COUCH_DB_URL = env.COUCH_DB_URL || `leveldb://${budibaseAppsDir()}/.data/`
|
const COUCH_DB_URL = env.COUCH_DB_URL || `leveldb://${budibaseAppsDir()}/.data/`
|
||||||
|
@ -27,10 +26,4 @@ const Pouch = PouchDB.defaults(POUCH_DB_DEFAULTS)
|
||||||
|
|
||||||
allDbs(Pouch)
|
allDbs(Pouch)
|
||||||
|
|
||||||
function PouchWrapper(instance) {
|
module.exports = Pouch
|
||||||
Pouch.apply(this, [sanitise(instance)])
|
|
||||||
}
|
|
||||||
|
|
||||||
PouchWrapper.prototype = Object.create(Pouch.prototype)
|
|
||||||
|
|
||||||
module.exports = PouchWrapper
|
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
const newid = require("./newid")
|
const newid = require("./newid")
|
||||||
|
|
||||||
|
const UNICODE_MAX = "\ufff0"
|
||||||
|
const SEPARATOR = "_"
|
||||||
|
|
||||||
const DocumentTypes = {
|
const DocumentTypes = {
|
||||||
MODEL: "model",
|
MODEL: "mo",
|
||||||
RECORD: "record",
|
RECORD: "re",
|
||||||
USER: "user",
|
USER: "us",
|
||||||
AUTOMATION: "automation",
|
AUTOMATION: "au",
|
||||||
LINK: "link",
|
LINK: "li",
|
||||||
APP: "app",
|
APP: "app",
|
||||||
ACCESS_LEVEL: "accesslevel",
|
ACCESS_LEVEL: "ac",
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.DocumentTypes = DocumentTypes
|
exports.DocumentTypes = DocumentTypes
|
||||||
|
exports.SEPARATOR = SEPARATOR
|
||||||
const UNICODE_MAX = "\ufff0"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If creating DB allDocs/query params with only a single top level ID this can be used, this
|
* If creating DB allDocs/query params with only a single top level ID this can be used, this
|
||||||
|
@ -32,8 +34,8 @@ function getDocParams(docType, docId = null, otherProps = {}) {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...otherProps,
|
...otherProps,
|
||||||
startkey: `${docType}:${docId}`,
|
startkey: `${docType}${SEPARATOR}${docId}`,
|
||||||
endkey: `${docType}:${docId}${UNICODE_MAX}`,
|
endkey: `${docType}${SEPARATOR}${docId}${UNICODE_MAX}`,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +51,7 @@ exports.getModelParams = (modelId = null, otherProps = {}) => {
|
||||||
* @returns {string} The new model ID which the model doc can be stored under.
|
* @returns {string} The new model ID which the model doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateModelID = () => {
|
exports.generateModelID = () => {
|
||||||
return `${DocumentTypes.MODEL}:${newid()}`
|
return `${DocumentTypes.MODEL}${SEPARATOR}${newid()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,7 +66,10 @@ exports.getRecordParams = (modelId, recordId = null, otherProps = {}) => {
|
||||||
if (modelId == null) {
|
if (modelId == null) {
|
||||||
throw "Cannot build params for records without a model ID"
|
throw "Cannot build params for records without a model ID"
|
||||||
}
|
}
|
||||||
const endOfKey = recordId == null ? `${modelId}:` : `${modelId}:${recordId}`
|
const endOfKey =
|
||||||
|
recordId == null
|
||||||
|
? `${modelId}${SEPARATOR}`
|
||||||
|
: `${modelId}${SEPARATOR}${recordId}`
|
||||||
return getDocParams(DocumentTypes.RECORD, endOfKey, otherProps)
|
return getDocParams(DocumentTypes.RECORD, endOfKey, otherProps)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +79,7 @@ exports.getRecordParams = (modelId, recordId = null, otherProps = {}) => {
|
||||||
* @returns {string} The new ID which a record doc can be stored under.
|
* @returns {string} The new ID which a record doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateRecordID = modelId => {
|
exports.generateRecordID = modelId => {
|
||||||
return `${DocumentTypes.RECORD}:${modelId}:${newid()}`
|
return `${DocumentTypes.RECORD}${SEPARATOR}${modelId}${SEPARATOR}${newid()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +95,7 @@ exports.getUserParams = (username = null, otherProps = {}) => {
|
||||||
* @returns {string} The new user ID which the user doc can be stored under.
|
* @returns {string} The new user ID which the user doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateUserID = username => {
|
exports.generateUserID = username => {
|
||||||
return `${DocumentTypes.USER}:${username}`
|
return `${DocumentTypes.USER}${SEPARATOR}${username}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,7 +110,7 @@ exports.getAutomationParams = (automationId = null, otherProps = {}) => {
|
||||||
* @returns {string} The new automation ID which the automation doc can be stored under.
|
* @returns {string} The new automation ID which the automation doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateAutomationID = () => {
|
exports.generateAutomationID = () => {
|
||||||
return `${DocumentTypes.AUTOMATION}:${newid()}`
|
return `${DocumentTypes.AUTOMATION}${SEPARATOR}${newid()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +123,7 @@ exports.generateAutomationID = () => {
|
||||||
* @returns {string} The new link doc ID which the automation doc can be stored under.
|
* @returns {string} The new link doc ID which the automation doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateLinkID = (modelId1, modelId2, recordId1, recordId2) => {
|
exports.generateLinkID = (modelId1, modelId2, recordId1, recordId2) => {
|
||||||
return `${DocumentTypes.AUTOMATION}:${modelId1}:${modelId2}:${recordId1}:${recordId2}`
|
return `${DocumentTypes.AUTOMATION}${SEPARATOR}${modelId1}${SEPARATOR}${modelId2}${SEPARATOR}${recordId1}${SEPARATOR}${recordId2}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,7 +131,7 @@ exports.generateLinkID = (modelId1, modelId2, recordId1, recordId2) => {
|
||||||
* @returns {string} The new app ID which the app doc can be stored under.
|
* @returns {string} The new app ID which the app doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateAppID = () => {
|
exports.generateAppID = () => {
|
||||||
return `${DocumentTypes.APP}:${newid()}`
|
return `${DocumentTypes.APP}${SEPARATOR}${newid()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -141,7 +146,7 @@ exports.getAppParams = (appId = null, otherProps = {}) => {
|
||||||
* @returns {string} The new access level ID which the access level doc can be stored under.
|
* @returns {string} The new access level ID which the access level doc can be stored under.
|
||||||
*/
|
*/
|
||||||
exports.generateAccessLevelID = () => {
|
exports.generateAccessLevelID = () => {
|
||||||
return `${DocumentTypes.ACCESS_LEVEL}:${newid()}`
|
return `${DocumentTypes.ACCESS_LEVEL}${SEPARATOR}${newid()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { app, BrowserWindow, shell, dialog } = require("electron")
|
const { app, BrowserWindow, shell, dialog } = require("electron")
|
||||||
const { join } = require("./utilities/sanitisedPath")
|
const { join } = require("./utilities/centralPath")
|
||||||
const isDev = require("electron-is-dev")
|
const isDev = require("electron-is-dev")
|
||||||
const { autoUpdater } = require("electron-updater")
|
const { autoUpdater } = require("electron-updater")
|
||||||
const unhandled = require("electron-unhandled")
|
const unhandled = require("electron-unhandled")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { resolve, join } = require("./utilities/sanitisedPath")
|
const { resolve, join } = require("./utilities/centralPath")
|
||||||
const { homedir } = require("os")
|
const { homedir } = require("os")
|
||||||
const { app } = require("electron")
|
const { app } = require("electron")
|
||||||
const fixPath = require("fix-path")
|
const fixPath = require("fix-path")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const { join } = require("./sanitisedPath")
|
const { join } = require("./centralPath")
|
||||||
const { homedir, tmpdir } = require("os")
|
const { homedir, tmpdir } = require("os")
|
||||||
const env = require("../environment")
|
const env = require("../environment")
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ const {
|
||||||
readFile,
|
readFile,
|
||||||
writeJSON,
|
writeJSON,
|
||||||
} = require("fs-extra")
|
} = require("fs-extra")
|
||||||
const { join, resolve } = require("../sanitisedPath")
|
const { join, resolve } = require("../centralPath")
|
||||||
const sqrl = require("squirrelly")
|
const sqrl = require("squirrelly")
|
||||||
const { convertCssToFiles } = require("./convertCssToFiles")
|
const { convertCssToFiles } = require("./convertCssToFiles")
|
||||||
const publicPath = require("./publicPath")
|
const publicPath = require("./publicPath")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const crypto = require("crypto")
|
const crypto = require("crypto")
|
||||||
const { ensureDir, emptyDir, writeFile } = require("fs-extra")
|
const { ensureDir, emptyDir, writeFile } = require("fs-extra")
|
||||||
const { join } = require("../sanitisedPath")
|
const { join } = require("../centralPath")
|
||||||
|
|
||||||
module.exports.convertCssToFiles = async (publicPagePath, pkg) => {
|
module.exports.convertCssToFiles = async (publicPagePath, pkg) => {
|
||||||
const cssDir = join(publicPagePath, "css")
|
const cssDir = join(publicPagePath, "css")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { readJSON, readdir } = require("fs-extra")
|
const { readJSON, readdir } = require("fs-extra")
|
||||||
const { join } = require("../sanitisedPath")
|
const { join } = require("../centralPath")
|
||||||
|
|
||||||
module.exports = async appPath => {
|
module.exports = async appPath => {
|
||||||
const pages = {}
|
const pages = {}
|
||||||
|
|
|
@ -8,7 +8,7 @@ const {
|
||||||
unlink,
|
unlink,
|
||||||
rmdir,
|
rmdir,
|
||||||
} = require("fs-extra")
|
} = require("fs-extra")
|
||||||
const { join, resolve } = require("../sanitisedPath")
|
const { join, resolve } = require("../centralPath")
|
||||||
const { dirname } = require("path")
|
const { dirname } = require("path")
|
||||||
const env = require("../../environment")
|
const env = require("../../environment")
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const { appPackageFolder } = require("../createAppPackage")
|
const { appPackageFolder } = require("../createAppPackage")
|
||||||
const { readJSON, readdir, stat } = require("fs-extra")
|
const { readJSON, readdir, stat } = require("fs-extra")
|
||||||
const { join } = require("../sanitisedPath")
|
const { join } = require("../centralPath")
|
||||||
const { keyBy } = require("lodash/fp")
|
const { keyBy } = require("lodash/fp")
|
||||||
|
|
||||||
module.exports = async (config, appname, pagename) => {
|
module.exports = async (config, appname, pagename) => {
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
const { join } = require("../sanitisedPath")
|
const { join } = require("../centralPath")
|
||||||
|
|
||||||
module.exports = (appPath, pageName) => join(appPath, "public", pageName)
|
module.exports = (appPath, pageName) => join(appPath, "public", pageName)
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
const path = require("path")
|
||||||
|
|
||||||
|
// this simply runs all of our path join and resolve functions through
|
||||||
|
// a central location incase we need to add some protection to file paths
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exactly the same as path.join
|
||||||
|
* @param args Any number of string arguments to add to a path
|
||||||
|
* @returns {string} The final path ready to use
|
||||||
|
*/
|
||||||
|
exports.join = function(...args) {
|
||||||
|
return path.join(...args)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exactly the same as path.resolve
|
||||||
|
* @param args Any number of string arguments to add to a path
|
||||||
|
* @returns {string} The final path ready to use
|
||||||
|
*/
|
||||||
|
exports.resolve = function(...args) {
|
||||||
|
return path.resolve(...args)
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
const { resolve } = require("./sanitisedPath")
|
const { resolve } = require("./centralPath")
|
||||||
const { cwd } = require("process")
|
const { cwd } = require("process")
|
||||||
const stream = require("stream")
|
const stream = require("stream")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const { exists, readFile, writeFile, ensureDir } = require("fs-extra")
|
const { exists, readFile, writeFile, ensureDir } = require("fs-extra")
|
||||||
const { join, resolve } = require("./sanitisedPath")
|
const { join, resolve } = require("./centralPath")
|
||||||
const Sqrl = require("squirrelly")
|
const Sqrl = require("squirrelly")
|
||||||
const uuid = require("uuid")
|
const uuid = require("uuid")
|
||||||
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
const path = require("path")
|
|
||||||
|
|
||||||
const regex = new RegExp(/:(?![\\/])/g)
|
|
||||||
|
|
||||||
function sanitiseArgs(args) {
|
|
||||||
let sanitised = []
|
|
||||||
for (let arg of args) {
|
|
||||||
sanitised.push(arg.replace(regex, ""))
|
|
||||||
}
|
|
||||||
return sanitised
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exactly the same as path.join but creates a sanitised path.
|
|
||||||
* @param args Any number of string arguments to add to a path
|
|
||||||
* @returns {string} The final path ready to use
|
|
||||||
*/
|
|
||||||
exports.join = function(...args) {
|
|
||||||
return path.join(...sanitiseArgs(args))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Exactly the same as path.resolve but creates a sanitised path.
|
|
||||||
* @param args Any number of string arguments to add to a path
|
|
||||||
* @returns {string} The final path ready to use
|
|
||||||
*/
|
|
||||||
exports.resolve = function(...args) {
|
|
||||||
return path.resolve(...sanitiseArgs(args))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sanitise a single string
|
|
||||||
* @param string input string to sanitise
|
|
||||||
* @returns {string} the final sanitised string
|
|
||||||
*/
|
|
||||||
exports.sanitise = function(string) {
|
|
||||||
return sanitiseArgs([string])[0]
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
const fs = require("fs-extra")
|
const fs = require("fs-extra")
|
||||||
const { join } = require("./sanitisedPath")
|
const { join } = require("./centralPath")
|
||||||
const os = require("os")
|
const os = require("os")
|
||||||
const fetch = require("node-fetch")
|
const fetch = require("node-fetch")
|
||||||
const stream = require("stream")
|
const stream = require("stream")
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"dev:builder": "rollup -cw"
|
"dev:builder": "rollup -cw"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@budibase/client": "^0.1.25",
|
"@budibase/client": "^0.2.0",
|
||||||
"@rollup/plugin-commonjs": "^11.1.0",
|
"@rollup/plugin-commonjs": "^11.1.0",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"rollup": "^2.11.2",
|
"rollup": "^2.11.2",
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"svelte"
|
"svelte"
|
||||||
],
|
],
|
||||||
"version": "0.1.25",
|
"version": "0.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691",
|
"gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPrettyName(record) {
|
function getPrettyName(record) {
|
||||||
return record[linkedModel?.primaryDisplay || "_id"]
|
return record[(linkedModel && linkedModel.primaryDisplay) || "_id"]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue