1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00

initialise cli started

This commit is contained in:
Michael Shanks 2020-04-24 09:56:39 +01:00
commit 663a231f3e
34 changed files with 3637 additions and 366 deletions

View file

@ -27,6 +27,7 @@
"fs-extra": "^8.1.0",
"inquirer": "^7.0.0",
"lodash": "^4.17.15",
"squirrelly": "7",
"yargs": "^14.2.0"
},
"gitHead": "b1f4f90927d9e494e513220ef060af28d2d42455"

View file

@ -1,33 +1,33 @@
const handler = require("./initHandler")
module.exports = {
command: "init [dir] [config] [username] [password]",
command: "init [dir] [database] [clientId] [couchDbConnectionString]",
desc: "Initialise Budibase. Run this first to setup your local Budibase",
builder: yargs => {
yargs.positional("dir", {
type: "string",
describe:
"your apps directory - directory will be created if it does not exist",
default: ".",
default: "~/budibase",
alias: "d",
})
yargs.positional("config", {
yargs.positional("database", {
type: "string",
describe: "config template file to use - optional, defaults to config.js",
describe: "database to use usually couch for dev",
alias: "db",
default: "pouch",
choices: ["pouch", "couch"],
})
yargs.positional("clientId", {
type: "string",
describe: "used to determine the name of the global databse",
alias: "c",
default: "dev",
choices: ["dev", "contributors"],
default: "new",
})
yargs.positional("username", {
yargs.positional("couchDbConnectionString", {
type: "string",
describe: "username for admin interface",
alias: "u",
default: "",
})
yargs.positional("password", {
type: "string",
describe: "password for admin interface",
alias: "p",
describe: "connection string for couch db, format: https://username:password@localhost:5984",
alias: "x",
default: "",
})
},

View file

@ -1,11 +1,10 @@
const inquirer = require("inquirer")
const { mkdir, exists, copy } = require("fs-extra")
const { mkdir, exists, readFile, writeFile } = require("fs-extra")
const chalk = require("chalk")
const { serverFileName, getAppContext } = require("../../common")
const passwordQuestion = require("@inquirer/password")
const createMasterDb = require("@budibase/server/initialise/createMasterDb")
const createClientDb = require("@budibase/server/db/createClientDb")
const { resolve } = require("path")
const localDatastore = require("@budibase/datastores/datastores/local")
var Sqrl = require("squirrelly")
module.exports = opts => {
run(opts)
@ -14,10 +13,10 @@ module.exports = opts => {
const run = async opts => {
try {
await prompts(opts)
await createClientDatabse(opts)
await createDevConfig(opts)
await createAppsDir(opts)
await createDataFolder(opts)
await initialiseDatabase(opts)
console.log(chalk.green("Budibase successfully initialised."))
} catch (error) {
console.error(`Error initialising Budibase: ${error.message}`)
@ -28,33 +27,35 @@ const prompts = async opts => {
const questions = [
{
type: "input",
name: "username",
message: "Username for Admin: ",
name: "couchDbConnectionString",
message: "CouchDB Connection String (e.g. https://user:password@localhost:5984): ",
validate: function(value) {
return !!value || "Please enter a username"
return !!value || "Please enter connection string"
},
},
]
if (!opts.username) {
if (!opts.couchDbConnectionString) {
const answers = await inquirer.prompt(questions)
opts.username = answers.username
opts.couchDbConnectionString = answers.couchDbConnectionString
}
}
const createClientDatabse = async opts => {
if (opts.clientId === "new") {
const existing = await CouchDb._add_dbs()
let i = 0
let isExisting = true
while (isExisting) {
i += 1
clientId = i.toString()
isExisting = existing.includes(`client-${clientId}`)
}
}
if (!opts.password) {
const password = await passwordQuestion({
message: "Password for Admin: ",
mask: "*",
})
const passwordConfirm = await passwordQuestion({
message: "Confirm Password: ",
mask: "*",
})
if (password !== passwordConfirm) throw new Error("Passwords do not match!")
opts.password = password
}
opts.clientId = await createClientDb(opts.clientId)
}
const createAppsDir = async opts => {
@ -75,24 +76,24 @@ const createDataFolder = async opts => {
}
const createDevConfig = async opts => {
const configTemplateFile = `config.${opts.config}.js`
const destConfigFile = "./config.js"
if (await exists(destConfigFile)) {
console.log(
chalk.yellow(
"Config file already exists (config.js) - keeping your existing config"
)
)
} else {
const srcConfig = serverFileName(configTemplateFile)
await copy(srcConfig, destConfigFile)
let createConfig = !(await exists(destConfigFile))
if (!createConfig) {
const answers = await inquirer.prompt([
{
type: "input",
name: "overwrite",
message: "config.js already exists - overwrite? (N/y)",
},
])
createConfig = ["Y", "y", "yes"].includes(answers.overwrite)
}
if (createConfig) {
const template = await readFile(serverFileName("config.js.template"))
const config = Sqrl.Render(template, opts)
await writeFile(destConfigFile, config)
}
opts.configJson = require(resolve("./config.js"))()
}
const initialiseDatabase = async opts => {
const appContext = await getAppContext({ masterIsCreated: false })
await createMasterDb(appContext, localDatastore, opts.username, opts.password)
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/common/compileCode.js"],"names":["compileCode","code","func","safeCode","trimmed","trim","endsWith","substring","length","e","message"],"mappings":"wGAAA;AACA;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAAAC,IAAI,EAAI;AACjC,MAAIC,IAAJ;AACA,MAAIC,QAAJ;;AAEA,MAAI,kBAAS,SAAT,EAAoBF,IAApB,CAAJ,EAA+B;AAC7BE,IAAAA,QAAQ,GAAGF,IAAX;AACD,GAFD,MAEO;AACL,QAAIG,OAAO,GAAGH,IAAI,CAACI,IAAL,EAAd;AACAD,IAAAA,OAAO,GAAGA,OAAO,CAACE,QAAR,CAAiB,GAAjB;AACNF,IAAAA,OAAO,CAACG,SAAR,CAAkB,CAAlB,EAAqBH,OAAO,CAACI,MAAR,GAAiB,CAAtC,CADM;AAENJ,IAAAA,OAFJ;AAGAD,IAAAA,QAAQ,qBAAcC,OAAd,MAAR;AACD;;AAED,MAAI;AACFF,IAAAA,IAAI,GAAG,+BAAMC,QAAN,CAAP;AACD,GAFD,CAEE,OAAOM,CAAP,EAAU;AACVA,IAAAA,CAAC,CAACC,OAAF,oCAAsCT,IAAtC,gBAAgDQ,CAAC,CAACC,OAAlD;AACA,UAAMD,CAAN;AACD;;AAED,SAAOP,IAAP;AACD,CAtBM,C","sourcesContent":["import { compileCode as cCode } from \"@nx-js/compiler-util\"\r\nimport { includes } from \"lodash/fp\"\r\n\r\nexport const compileCode = code => {\r\n let func\r\n let safeCode\r\n\r\n if (includes(\"return \")(code)) {\r\n safeCode = code\r\n } else {\r\n let trimmed = code.trim()\r\n trimmed = trimmed.endsWith(\";\")\r\n ? trimmed.substring(0, trimmed.length - 1)\r\n : trimmed\r\n safeCode = `return (${trimmed})`\r\n }\r\n\r\n try {\r\n func = cCode(safeCode)\r\n } catch (e) {\r\n e.message = `Error compiling code : ${code} : ${e.message}`\r\n throw e\r\n }\r\n\r\n return func\r\n}\r\n"],"file":"compileCode.js"}
{"version":3,"sources":["../../src/common/compileCode.js"],"names":["compileCode","code","func","safeCode","trimmed","trim","endsWith","substring","length","e","message"],"mappings":"wGAAA;AACA;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc,CAAAC,IAAI,EAAI;AACjC,MAAIC,IAAJ;AACA,MAAIC,QAAJ;;AAEA,MAAI,kBAAS,SAAT,EAAoBF,IAApB,CAAJ,EAA+B;AAC7BE,IAAAA,QAAQ,GAAGF,IAAX;AACD,GAFD,MAEO;AACL,QAAIG,OAAO,GAAGH,IAAI,CAACI,IAAL,EAAd;AACAD,IAAAA,OAAO,GAAGA,OAAO,CAACE,QAAR,CAAiB,GAAjB;AACNF,IAAAA,OAAO,CAACG,SAAR,CAAkB,CAAlB,EAAqBH,OAAO,CAACI,MAAR,GAAiB,CAAtC,CADM;AAENJ,IAAAA,OAFJ;AAGAD,IAAAA,QAAQ,qBAAcC,OAAd,MAAR;AACD;;AAED,MAAI;AACFF,IAAAA,IAAI,GAAG,+BAAMC,QAAN,CAAP;AACD,GAFD,CAEE,OAAOM,CAAP,EAAU;AACVA,IAAAA,CAAC,CAACC,OAAF,oCAAsCT,IAAtC,gBAAgDQ,CAAC,CAACC,OAAlD;AACA,UAAMD,CAAN;AACD;;AAED,SAAOP,IAAP;AACD,CAtBM,C","sourcesContent":["import { compileCode as cCode } from \"@nx-js/compiler-util\"\nimport { includes } from \"lodash/fp\"\n\nexport const compileCode = code => {\n let func\n let safeCode\n\n if (includes(\"return \")(code)) {\n safeCode = code\n } else {\n let trimmed = code.trim()\n trimmed = trimmed.endsWith(\";\")\n ? trimmed.substring(0, trimmed.length - 1)\n : trimmed\n safeCode = `return (${trimmed})`\n }\n\n try {\n func = cCode(safeCode)\n } catch (e) {\n e.message = `Error compiling code : ${code} : ${e.message}`\n throw e\n }\n\n return func\n}\n"],"file":"compileCode.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/common/errors.js"],"names":["BadRequestError","message","httpStatusCode","Error","UnauthorisedError","ForbiddenError","NotFoundError","ConflictError"],"mappings":"i9CAAaA,e;AACX,2BAAYC,OAAZ,EAAqB;AACnB,8BAAMA,OAAN;AACA,UAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,yEAJkCC,K;;;AAOxBC,iB;AACX,6BAAYH,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,2EAJoCC,K;;;AAO1BE,c;AACX,0BAAYJ,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,wEAJiCC,K;;;AAOvBG,a;AACX,yBAAYL,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,uEAJgCC,K;;;AAOtBI,a;AACX,yBAAYN,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,uEAJgCC,K","sourcesContent":["export class BadRequestError extends Error {\r\n constructor(message) {\r\n super(message)\r\n this.httpStatusCode = 400\r\n }\r\n}\r\n\r\nexport class UnauthorisedError extends Error {\r\n constructor(message) {\r\n super(message)\r\n this.httpStatusCode = 401\r\n }\r\n}\r\n\r\nexport class ForbiddenError extends Error {\r\n constructor(message) {\r\n super(message)\r\n this.httpStatusCode = 403\r\n }\r\n}\r\n\r\nexport class NotFoundError extends Error {\r\n constructor(message) {\r\n super(message)\r\n this.httpStatusCode = 404\r\n }\r\n}\r\n\r\nexport class ConflictError extends Error {\r\n constructor(message) {\r\n super(message)\r\n this.httpStatusCode = 409\r\n }\r\n}\r\n"],"file":"errors.js"}
{"version":3,"sources":["../../src/common/errors.js"],"names":["BadRequestError","message","httpStatusCode","Error","UnauthorisedError","ForbiddenError","NotFoundError","ConflictError"],"mappings":"i9CAAaA,e;AACX,2BAAYC,OAAZ,EAAqB;AACnB,8BAAMA,OAAN;AACA,UAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,yEAJkCC,K;;;AAOxBC,iB;AACX,6BAAYH,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,2EAJoCC,K;;;AAO1BE,c;AACX,0BAAYJ,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,wEAJiCC,K;;;AAOvBG,a;AACX,yBAAYL,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,uEAJgCC,K;;;AAOtBI,a;AACX,yBAAYN,OAAZ,EAAqB;AACnB,gCAAMA,OAAN;AACA,WAAKC,cAAL,GAAsB,GAAtB,CAFmB;AAGpB,G,uEAJgCC,K","sourcesContent":["export class BadRequestError extends Error {\n constructor(message) {\n super(message)\n this.httpStatusCode = 400\n }\n}\n\nexport class UnauthorisedError extends Error {\n constructor(message) {\n super(message)\n this.httpStatusCode = 401\n }\n}\n\nexport class ForbiddenError extends Error {\n constructor(message) {\n super(message)\n this.httpStatusCode = 403\n }\n}\n\nexport class NotFoundError extends Error {\n constructor(message) {\n super(message)\n this.httpStatusCode = 404\n }\n}\n\nexport class ConflictError extends Error {\n constructor(message) {\n super(message)\n this.httpStatusCode = 409\n }\n}\n"],"file":"errors.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/common/eventAggregator.js"],"names":["publish","handlers","eventName","context","handler","subscribe","push","createEventAggregator","eventAggregator"],"mappings":"iZAAA,+B;;AAEA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAAAC,QAAQ,6HAAI,iBAAOC,SAAP,oLAAkBC,OAAlB,2DAA4B,EAA5B;AACrB,2BAAID,SAAJ,EAAeD,QAAf,CADqB;;AAGJA,cAAAA,QAAQ,CAACC,SAAD,CAHJ,sGAGfE,OAHe;AAIlBA,gBAAAA,OAAO,CAACF,SAAD,EAAYC,OAAZ,CAJW,gTAAJ,mEAAxB;;;;AAQA,IAAME,SAAS,GAAG,SAAZA,SAAY,CAAAJ,QAAQ,UAAI,UAACC,SAAD,EAAYE,OAAZ,EAAwB;AACpD,QAAI,CAAC,aAAIF,SAAJ,EAAeD,QAAf,CAAL,EAA+B;AAC7BA,MAAAA,QAAQ,CAACC,SAAD,CAAR,GAAsB,EAAtB;AACD;AACDD,IAAAA,QAAQ,CAACC,SAAD,CAAR,CAAoBI,IAApB,CAAyBF,OAAzB;AACD,GALyB,EAA1B;;AAOO,IAAMG,qBAAqB,GAAG,SAAxBA,qBAAwB,GAAM;AACzC,MAAMN,QAAQ,GAAG,EAAjB;AACA,MAAMO,eAAe,GAAG;AACtBR,IAAAA,OAAO,EAAEA,OAAO,CAACC,QAAD,CADM;AAEtBI,IAAAA,SAAS,EAAEA,SAAS,CAACJ,QAAD,CAFE,EAAxB;;AAIA,SAAOO,eAAP;AACD,CAPM,C;;AASQD,qB","sourcesContent":["import { has } from \"lodash/fp\"\r\n\r\nconst publish = handlers => async (eventName, context = {}) => {\r\n if (!has(eventName)(handlers)) return\r\n\r\n for (const handler of handlers[eventName]) {\r\n await handler(eventName, context)\r\n }\r\n}\r\n\r\nconst subscribe = handlers => (eventName, handler) => {\r\n if (!has(eventName)(handlers)) {\r\n handlers[eventName] = []\r\n }\r\n handlers[eventName].push(handler)\r\n}\r\n\r\nexport const createEventAggregator = () => {\r\n const handlers = {}\r\n const eventAggregator = {\r\n publish: publish(handlers),\r\n subscribe: subscribe(handlers),\r\n }\r\n return eventAggregator\r\n}\r\n\r\nexport default createEventAggregator\r\n"],"file":"eventAggregator.js"}
{"version":3,"sources":["../../src/common/eventAggregator.js"],"names":["publish","handlers","eventName","context","handler","subscribe","push","createEventAggregator","eventAggregator"],"mappings":"iZAAA,+B;;AAEA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAAAC,QAAQ,6HAAI,iBAAOC,SAAP,oLAAkBC,OAAlB,2DAA4B,EAA5B;AACrB,2BAAID,SAAJ,EAAeD,QAAf,CADqB;;AAGJA,cAAAA,QAAQ,CAACC,SAAD,CAHJ,sGAGfE,OAHe;AAIlBA,gBAAAA,OAAO,CAACF,SAAD,EAAYC,OAAZ,CAJW,gTAAJ,mEAAxB;;;;AAQA,IAAME,SAAS,GAAG,SAAZA,SAAY,CAAAJ,QAAQ,UAAI,UAACC,SAAD,EAAYE,OAAZ,EAAwB;AACpD,QAAI,CAAC,aAAIF,SAAJ,EAAeD,QAAf,CAAL,EAA+B;AAC7BA,MAAAA,QAAQ,CAACC,SAAD,CAAR,GAAsB,EAAtB;AACD;AACDD,IAAAA,QAAQ,CAACC,SAAD,CAAR,CAAoBI,IAApB,CAAyBF,OAAzB;AACD,GALyB,EAA1B;;AAOO,IAAMG,qBAAqB,GAAG,SAAxBA,qBAAwB,GAAM;AACzC,MAAMN,QAAQ,GAAG,EAAjB;AACA,MAAMO,eAAe,GAAG;AACtBR,IAAAA,OAAO,EAAEA,OAAO,CAACC,QAAD,CADM;AAEtBI,IAAAA,SAAS,EAAEA,SAAS,CAACJ,QAAD,CAFE,EAAxB;;AAIA,SAAOO,eAAP;AACD,CAPM,C;;AASQD,qB","sourcesContent":["import { has } from \"lodash/fp\"\n\nconst publish = handlers => async (eventName, context = {}) => {\n if (!has(eventName)(handlers)) return\n\n for (const handler of handlers[eventName]) {\n await handler(eventName, context)\n }\n}\n\nconst subscribe = handlers => (eventName, handler) => {\n if (!has(eventName)(handlers)) {\n handlers[eventName] = []\n }\n handlers[eventName].push(handler)\n}\n\nexport const createEventAggregator = () => {\n const handlers = {}\n const eventAggregator = {\n publish: publish(handlers),\n subscribe: subscribe(handlers),\n }\n return eventAggregator\n}\n\nexport default createEventAggregator\n"],"file":"eventAggregator.js"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/common/validationCommon.js"],"names":["stringNotEmpty","s","trim","length","makerule","field","error","isValid","validationError","rule","item","applyRuleSet","ruleSet","itemToValidate","applyRule","isSomething","itemTovalidate"],"mappings":"wXAAA;AACA,gC;;AAEO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,CAAC,UAAI,wBAAYA,CAAZ,KAAkBA,CAAC,CAACC,IAAF,GAASC,MAAT,GAAkB,CAAxC,EAAxB,C;;AAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAQC,KAAR,EAAeC,OAAf,UAA4B,EAAEF,KAAK,EAALA,KAAF,EAASC,KAAK,EAALA,KAAT,EAAgBC,OAAO,EAAPA,OAAhB,EAA5B,EAAjB,C;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,IAAP,4BAAsBD,IAAtB,IAA4BC,IAAI,EAAJA,IAA5B,KAAxB,C;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAAAC,OAAO,UAAI,UAAAC,cAAc;AACnD,oBAAED,OAAF,EAAW,CAAC,aAAIE,SAAS,CAACD,cAAD,CAAb,CAAD,EAAiC,gBAAOE,kBAAP,CAAjC,CAAX,CADmD,GAAlB,EAA5B,C;;AAGA,IAAMD,SAAS,GAAG,SAAZA,SAAY,CAAAE,cAAc,UAAI,UAAAP,IAAI;AAC7CA,MAAAA,IAAI,CAACF,OAAL,CAAaS,cAAb,IAA+B,IAA/B,GAAsCR,eAAe,CAACC,IAAD,EAAOO,cAAP,CADR,GAAR,EAAhC,C","sourcesContent":["import { filter, map } from \"lodash/fp\"\r\nimport { $, isSomething } from \"./index\"\r\n\r\nexport const stringNotEmpty = s => isSomething(s) && s.trim().length > 0\r\n\r\nexport const makerule = (field, error, isValid) => ({ field, error, isValid })\r\n\r\nexport const validationError = (rule, item) => ({ ...rule, item })\r\n\r\nexport const applyRuleSet = ruleSet => itemToValidate =>\r\n $(ruleSet, [map(applyRule(itemToValidate)), filter(isSomething)])\r\n\r\nexport const applyRule = itemTovalidate => rule =>\r\n rule.isValid(itemTovalidate) ? null : validationError(rule, itemTovalidate)\r\n"],"file":"validationCommon.js"}
{"version":3,"sources":["../../src/common/validationCommon.js"],"names":["stringNotEmpty","s","trim","length","makerule","field","error","isValid","validationError","rule","item","applyRuleSet","ruleSet","itemToValidate","applyRule","isSomething","itemTovalidate"],"mappings":"wXAAA;AACA,gC;;AAEO,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,CAAC,UAAI,wBAAYA,CAAZ,KAAkBA,CAAC,CAACC,IAAF,GAASC,MAAT,GAAkB,CAAxC,EAAxB,C;;AAEA,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAQC,KAAR,EAAeC,OAAf,UAA4B,EAAEF,KAAK,EAALA,KAAF,EAASC,KAAK,EAALA,KAAT,EAAgBC,OAAO,EAAPA,OAAhB,EAA5B,EAAjB,C;;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,IAAP,4BAAsBD,IAAtB,IAA4BC,IAAI,EAAJA,IAA5B,KAAxB,C;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAAAC,OAAO,UAAI,UAAAC,cAAc;AACnD,oBAAED,OAAF,EAAW,CAAC,aAAIE,SAAS,CAACD,cAAD,CAAb,CAAD,EAAiC,gBAAOE,kBAAP,CAAjC,CAAX,CADmD,GAAlB,EAA5B,C;;AAGA,IAAMD,SAAS,GAAG,SAAZA,SAAY,CAAAE,cAAc,UAAI,UAAAP,IAAI;AAC7CA,MAAAA,IAAI,CAACF,OAAL,CAAaS,cAAb,IAA+B,IAA/B,GAAsCR,eAAe,CAACC,IAAD,EAAOO,cAAP,CADR,GAAR,EAAhC,C","sourcesContent":["import { filter, map } from \"lodash/fp\"\nimport { $, isSomething } from \"./index\"\n\nexport const stringNotEmpty = s => isSomething(s) && s.trim().length > 0\n\nexport const makerule = (field, error, isValid) => ({ field, error, isValid })\n\nexport const validationError = (rule, item) => ({ ...rule, item })\n\nexport const applyRuleSet = ruleSet => itemToValidate =>\n $(ruleSet, [map(applyRule(itemToValidate)), filter(isSomething)])\n\nexport const applyRule = itemTovalidate => rule =>\n rule.isValid(itemTovalidate) ? null : validationError(rule, itemTovalidate)\n"],"file":"validationCommon.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../src/index.js"],"names":[],"mappings":"kpBAAA;AACA;AACA;AACA","sourcesContent":["export { validateRecord } from \"./records/validateRecord\";\r\nexport { events } from \"./common/events\";\r\nexport { safeParseField } from \"./schema/types\";\r\nexport { default as schemaValidator } from \"./schemaValidation\";"],"file":"index.js"}
{"version":3,"sources":["../src/index.js"],"names":[],"mappings":"kpBAAA;AACA;AACA;AACA","sourcesContent":["export { validateRecord } from \"./records/validateRecord\";\nexport { events } from \"./common/events\";\nexport { safeParseField } from \"./schema/types\";\nexport { default as schemaValidator } from \"./schemaValidation\";"],"file":"index.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/records/getNewRecord.js"],"names":["getNewRecord","schema","modelName","model","findModel","record","_id","modelId","field","properties"],"mappings":"yGAAA;;AAEO,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,MAAD,EAASC,SAAT,EAAuB;AACjD,MAAMC,KAAK,GAAGF,MAAM,CAACG,SAAP,CAAiBF,SAAjB,CAAd;;AAEA,MAAMG,MAAM,GAAG;AACbC,IAAAA,GAAG,EAAE,wBADQ;AAEbC,IAAAA,OAAO,EAAEJ,KAAK,CAACG,GAFF,EAAf;;;AAKA,OAAK,IAAIE,KAAT,IAAkBL,KAAK,CAACF,MAAN,CAAaQ,UAA/B,EAA2C;AACzCJ,IAAAA,MAAM,CAACG,KAAD,CAAN,GAAgBA,KAAK,WAArB;AACD;;AAED,SAAOH,MAAP;AACD,CAbM,C","sourcesContent":["import { generate } from \"shortid\"\r\n\r\nexport const getNewRecord = (schema, modelName) => {\r\n const model = schema.findModel(modelName)\r\n\r\n const record = {\r\n _id: generate(),\r\n modelId: model._id,\r\n }\r\n\r\n for (let field in model.schema.properties) {\r\n record[field] = field.default\r\n }\r\n\r\n return record\r\n}\r\n"],"file":"getNewRecord.js"}
{"version":3,"sources":["../../src/records/getNewRecord.js"],"names":["getNewRecord","schema","modelName","model","findModel","record","_id","modelId","field","properties"],"mappings":"yGAAA;;AAEO,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,MAAD,EAASC,SAAT,EAAuB;AACjD,MAAMC,KAAK,GAAGF,MAAM,CAACG,SAAP,CAAiBF,SAAjB,CAAd;;AAEA,MAAMG,MAAM,GAAG;AACbC,IAAAA,GAAG,EAAE,wBADQ;AAEbC,IAAAA,OAAO,EAAEJ,KAAK,CAACG,GAFF,EAAf;;;AAKA,OAAK,IAAIE,KAAT,IAAkBL,KAAK,CAACF,MAAN,CAAaQ,UAA/B,EAA2C;AACzCJ,IAAAA,MAAM,CAACG,KAAD,CAAN,GAAgBA,KAAK,WAArB;AACD;;AAED,SAAOH,MAAP;AACD,CAbM,C","sourcesContent":["import { generate } from \"shortid\"\n\nexport const getNewRecord = (schema, modelName) => {\n const model = schema.findModel(modelName)\n\n const record = {\n _id: generate(),\n modelId: model._id,\n }\n\n for (let field in model.schema.properties) {\n record[field] = field.default\n }\n\n return record\n}\n"],"file":"getNewRecord.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/records/recordValidationRules.js"],"names":["getNewRecordValidationRule","invalidField","messageWhenInvalid","expressionWhenValid","commonRecordValidationRules","fieldNotEmpty","fieldName","fieldBetween","min","max","toString","fieldGreaterThan"],"mappings":"6JAAO,IAAMA,0BAA0B,GAAG,SAA7BA,0BAA6B;AACxCC,YADwC;AAExCC,kBAFwC;AAGxCC,mBAHwC;AAIpC;AACJF,MAAAA,YAAY,EAAZA,YADI;AAEJC,MAAAA,kBAAkB,EAAlBA,kBAFI;AAGJC,MAAAA,mBAAmB,EAAnBA,mBAHI,EAJoC,GAAnC,C;;;AAUA,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,aAAa,EAAE,uBAAAC,SAAS;AACtBN,MAAAA,0BAA0B;AACxBM,MAAAA,SADwB;AAErBA,MAAAA,SAFqB;AAGbA,MAAAA,SAHa,2BAGaA,SAHb,mBADJ,GADiB;;;AAQzCC,EAAAA,YAAY,EAAE,sBAACD,SAAD,EAAYE,GAAZ,EAAiBC,GAAjB;AACZT,MAAAA,0BAA0B;AACxBM,MAAAA,SADwB;AAErBA,MAAAA,SAFqB,8BAEQE,GAAG,CAACE,QAAJ,EAFR,kBAE8BD,GAAG,CAACC,QAAJ,EAF9B;AAGbJ,MAAAA,SAHa,mBAGKE,GAHL,0BAGwBF,SAHxB,mBAG0CG,GAH1C,OADd,GAR2B;;;AAezCE,EAAAA,gBAAgB,EAAE,0BAACL,SAAD,EAAYE,GAAZ,EAAiBC,GAAjB;AAChBT,MAAAA,0BAA0B;AACxBM,MAAAA,SADwB;AAErBA,MAAAA,SAFqB,mCAEaE,GAAG,CAACE,QAAJ,EAFb,kBAEmCD,GAAG,CAACC,QAAJ,EAFnC;AAGbJ,MAAAA,SAHa,mBAGKE,GAHL,QADV,GAfuB,EAApC,C","sourcesContent":["export const getNewRecordValidationRule = (\r\n invalidField,\r\n messageWhenInvalid,\r\n expressionWhenValid\r\n) => ({\r\n invalidField,\r\n messageWhenInvalid,\r\n expressionWhenValid,\r\n})\r\n\r\nexport const commonRecordValidationRules = {\r\n fieldNotEmpty: fieldName =>\r\n getNewRecordValidationRule(\r\n fieldName,\r\n `${fieldName} is empty`,\r\n `record['${fieldName}'] && record['${fieldName}'].length > 0`\r\n ),\r\n\r\n fieldBetween: (fieldName, min, max) =>\r\n getNewRecordValidationRule(\r\n fieldName,\r\n `${fieldName} must be between ${min.toString()} and ${max.toString()}`,\r\n `record['${fieldName}'] >= ${min} && record['${fieldName}'] <= ${max} `\r\n ),\r\n\r\n fieldGreaterThan: (fieldName, min, max) =>\r\n getNewRecordValidationRule(\r\n fieldName,\r\n `${fieldName} must be greater than ${min.toString()} and ${max.toString()}`,\r\n `record['${fieldName}'] >= ${min} `\r\n ),\r\n}\r\n"],"file":"recordValidationRules.js"}
{"version":3,"sources":["../../src/records/recordValidationRules.js"],"names":["getNewRecordValidationRule","invalidField","messageWhenInvalid","expressionWhenValid","commonRecordValidationRules","fieldNotEmpty","fieldName","fieldBetween","min","max","toString","fieldGreaterThan"],"mappings":"6JAAO,IAAMA,0BAA0B,GAAG,SAA7BA,0BAA6B;AACxCC,YADwC;AAExCC,kBAFwC;AAGxCC,mBAHwC;AAIpC;AACJF,MAAAA,YAAY,EAAZA,YADI;AAEJC,MAAAA,kBAAkB,EAAlBA,kBAFI;AAGJC,MAAAA,mBAAmB,EAAnBA,mBAHI,EAJoC,GAAnC,C;;;AAUA,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,aAAa,EAAE,uBAAAC,SAAS;AACtBN,MAAAA,0BAA0B;AACxBM,MAAAA,SADwB;AAErBA,MAAAA,SAFqB;AAGbA,MAAAA,SAHa,2BAGaA,SAHb,mBADJ,GADiB;;;AAQzCC,EAAAA,YAAY,EAAE,sBAACD,SAAD,EAAYE,GAAZ,EAAiBC,GAAjB;AACZT,MAAAA,0BAA0B;AACxBM,MAAAA,SADwB;AAErBA,MAAAA,SAFqB,8BAEQE,GAAG,CAACE,QAAJ,EAFR,kBAE8BD,GAAG,CAACC,QAAJ,EAF9B;AAGbJ,MAAAA,SAHa,mBAGKE,GAHL,0BAGwBF,SAHxB,mBAG0CG,GAH1C,OADd,GAR2B;;;AAezCE,EAAAA,gBAAgB,EAAE,0BAACL,SAAD,EAAYE,GAAZ,EAAiBC,GAAjB;AAChBT,MAAAA,0BAA0B;AACxBM,MAAAA,SADwB;AAErBA,MAAAA,SAFqB,mCAEaE,GAAG,CAACE,QAAJ,EAFb,kBAEmCD,GAAG,CAACC,QAAJ,EAFnC;AAGbJ,MAAAA,SAHa,mBAGKE,GAHL,QADV,GAfuB,EAApC,C","sourcesContent":["export const getNewRecordValidationRule = (\n invalidField,\n messageWhenInvalid,\n expressionWhenValid\n) => ({\n invalidField,\n messageWhenInvalid,\n expressionWhenValid,\n})\n\nexport const commonRecordValidationRules = {\n fieldNotEmpty: fieldName =>\n getNewRecordValidationRule(\n fieldName,\n `${fieldName} is empty`,\n `record['${fieldName}'] && record['${fieldName}'].length > 0`\n ),\n\n fieldBetween: (fieldName, min, max) =>\n getNewRecordValidationRule(\n fieldName,\n `${fieldName} must be between ${min.toString()} and ${max.toString()}`,\n `record['${fieldName}'] >= ${min} && record['${fieldName}'] <= ${max} `\n ),\n\n fieldGreaterThan: (fieldName, min, max) =>\n getNewRecordValidationRule(\n fieldName,\n `${fieldName} must be greater than ${min.toString()} and ${max.toString()}`,\n `record['${fieldName}'] >= ${min} `\n ),\n}\n"],"file":"recordValidationRules.js"}

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/schema/createActions.js"],"names":["createTrigger","actionName","eventName","optionsCreator","condition","createAction","name","behaviourSource","behaviourName","initialOptions"],"mappings":"iIAAO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,WAAO;AAClCC,IAAAA,UAAU,EAAE,EADsB;AAElCC,IAAAA,SAAS,EAAE,EAFuB;AAGlC;AACA;AACA;AACAC,IAAAA,cAAc,EAAE,EANkB;AAOlC;AACA;AACAC,IAAAA,SAAS,EAAE,EATuB,EAAP,EAAtB,C;;;AAYA,IAAMC,YAAY,GAAG,SAAfA,YAAe,WAAO;AACjCC,IAAAA,IAAI,EAAE,EAD2B;AAEjCC,IAAAA,eAAe,EAAE,EAFgB;AAGjC;AACAC,IAAAA,aAAa,EAAE,EAJkB;AAKjC;AACA;AACA;AACAC,IAAAA,cAAc,EAAE,EARiB,EAAP,EAArB,C","sourcesContent":["export const createTrigger = () => ({\r\n actionName: \"\",\r\n eventName: \"\",\r\n // function, has access to event context,\r\n // returns object that is used as parameter to action\r\n // only used if triggered by event\r\n optionsCreator: \"\",\r\n // action runs if true,\r\n // has access to event context\r\n condition: \"\",\r\n})\r\n\r\nexport const createAction = () => ({\r\n name: \"\",\r\n behaviourSource: \"\",\r\n // name of function in actionSource\r\n behaviourName: \"\",\r\n // parameter passed into behaviour.\r\n // any other parms passed at runtime e.g.\r\n // by trigger, or manually, will be merged into this\r\n initialOptions: {},\r\n})\r\n"],"file":"createActions.js"}
{"version":3,"sources":["../../src/schema/createActions.js"],"names":["createTrigger","actionName","eventName","optionsCreator","condition","createAction","name","behaviourSource","behaviourName","initialOptions"],"mappings":"iIAAO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,WAAO;AAClCC,IAAAA,UAAU,EAAE,EADsB;AAElCC,IAAAA,SAAS,EAAE,EAFuB;AAGlC;AACA;AACA;AACAC,IAAAA,cAAc,EAAE,EANkB;AAOlC;AACA;AACAC,IAAAA,SAAS,EAAE,EATuB,EAAP,EAAtB,C;;;AAYA,IAAMC,YAAY,GAAG,SAAfA,YAAe,WAAO;AACjCC,IAAAA,IAAI,EAAE,EAD2B;AAEjCC,IAAAA,eAAe,EAAE,EAFgB;AAGjC;AACAC,IAAAA,aAAa,EAAE,EAJkB;AAKjC;AACA;AACA;AACAC,IAAAA,cAAc,EAAE,EARiB,EAAP,EAArB,C","sourcesContent":["export const createTrigger = () => ({\n actionName: \"\",\n eventName: \"\",\n // function, has access to event context,\n // returns object that is used as parameter to action\n // only used if triggered by event\n optionsCreator: \"\",\n // action runs if true,\n // has access to event context\n condition: \"\",\n})\n\nexport const createAction = () => ({\n name: \"\",\n behaviourSource: \"\",\n // name of function in actionSource\n behaviourName: \"\",\n // parameter passed into behaviour.\n // any other parms passed at runtime e.g.\n // by trigger, or manually, will be merged into this\n initialOptions: {},\n})\n"],"file":"createActions.js"}

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/schema/fullSchema.js"],"names":["fullSchema","models","views","findModel","idOrName","find","m","id","name","toLowerCase","findView","findField","modelIdOrName","fieldName","model","fields","f","viewsForModel","modelId","filter","v"],"mappings":"uGAAO,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,MAAD,EAASC,KAAT,EAAmB;AAC3C,MAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,QAAQ;AACxBH,MAAAA,MAAM,CAACI,IAAP;AACE,gBAAAC,CAAC,UAAIA,CAAC,CAACC,EAAF,KAASH,QAAT,IAAqBE,CAAC,CAACE,IAAF,CAAOC,WAAP,OAAyBL,QAAQ,CAACK,WAAT,EAAlD,EADH,CADwB,GAA1B;;;AAKA,MAAMC,QAAQ,GAAG,SAAXA,QAAW,CAAAN,QAAQ;AACvBF,MAAAA,KAAK,CAACG,IAAN;AACE,gBAAAC,CAAC,UAAIA,CAAC,CAACC,EAAF,KAASH,QAAT,IAAqBE,CAAC,CAACE,IAAF,CAAOC,WAAP,OAAyBL,QAAQ,CAACK,WAAT,EAAlD,EADH,CADuB,GAAzB;;;AAKA,MAAME,SAAS,GAAG,SAAZA,SAAY,CAACC,aAAD,EAAgBC,SAAhB,EAA8B;AAC9C,QAAMC,KAAK,GAAGb,MAAM,CAACI,IAAP;AACZ,cAAAC,CAAC;AACCA,QAAAA,CAAC,CAACC,EAAF,KAASK,aAAT;AACAN,QAAAA,CAAC,CAACE,IAAF,CAAOC,WAAP,OAAyBG,aAAa,CAACH,WAAd,EAF1B,GADW,CAAd;;AAKA,WAAOK,KAAK,CAACC,MAAN,CAAaV,IAAb;AACL,cAAAW,CAAC,UAAIA,CAAC,CAACR,IAAF,CAAOC,WAAP,OAAyBI,SAAS,CAACJ,WAAV,EAA7B,EADI,CAAP;;AAGD,GATD;;AAWA,MAAMQ,aAAa,GAAG,SAAhBA,aAAgB,CAAAC,OAAO,UAAIhB,KAAK,CAACiB,MAAN,CAAa,UAAAC,CAAC,UAAIA,CAAC,CAACF,OAAF,KAAcA,OAAlB,EAAd,CAAJ,EAA7B;;AAEA,SAAO;AACLjB,IAAAA,MAAM,EAANA,MADK;AAELC,IAAAA,KAAK,EAALA,KAFK;AAGLC,IAAAA,SAAS,EAATA,SAHK;AAILQ,IAAAA,SAAS,EAATA,SAJK;AAKLD,IAAAA,QAAQ,EAARA,QALK;AAMLO,IAAAA,aAAa,EAAbA,aANK,EAAP;;AAQD,CAhCM,C","sourcesContent":["export const fullSchema = (models, views) => {\r\n const findModel = idOrName =>\r\n models.find(\r\n m => m.id === idOrName || m.name.toLowerCase() === idOrName.toLowerCase()\r\n )\r\n\r\n const findView = idOrName =>\r\n views.find(\r\n m => m.id === idOrName || m.name.toLowerCase() === idOrName.toLowerCase()\r\n )\r\n\r\n const findField = (modelIdOrName, fieldName) => {\r\n const model = models.find(\r\n m =>\r\n m.id === modelIdOrName ||\r\n m.name.toLowerCase() === modelIdOrName.toLowerCase()\r\n )\r\n return model.fields.find(\r\n f => f.name.toLowerCase() === fieldName.toLowerCase()\r\n )\r\n }\r\n\r\n const viewsForModel = modelId => views.filter(v => v.modelId === modelId)\r\n\r\n return {\r\n models,\r\n views,\r\n findModel,\r\n findField,\r\n findView,\r\n viewsForModel,\r\n }\r\n}\r\n"],"file":"fullSchema.js"}
{"version":3,"sources":["../../src/schema/fullSchema.js"],"names":["fullSchema","models","views","findModel","idOrName","find","m","id","name","toLowerCase","findView","findField","modelIdOrName","fieldName","model","fields","f","viewsForModel","modelId","filter","v"],"mappings":"uGAAO,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,MAAD,EAASC,KAAT,EAAmB;AAC3C,MAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,QAAQ;AACxBH,MAAAA,MAAM,CAACI,IAAP;AACE,gBAAAC,CAAC,UAAIA,CAAC,CAACC,EAAF,KAASH,QAAT,IAAqBE,CAAC,CAACE,IAAF,CAAOC,WAAP,OAAyBL,QAAQ,CAACK,WAAT,EAAlD,EADH,CADwB,GAA1B;;;AAKA,MAAMC,QAAQ,GAAG,SAAXA,QAAW,CAAAN,QAAQ;AACvBF,MAAAA,KAAK,CAACG,IAAN;AACE,gBAAAC,CAAC,UAAIA,CAAC,CAACC,EAAF,KAASH,QAAT,IAAqBE,CAAC,CAACE,IAAF,CAAOC,WAAP,OAAyBL,QAAQ,CAACK,WAAT,EAAlD,EADH,CADuB,GAAzB;;;AAKA,MAAME,SAAS,GAAG,SAAZA,SAAY,CAACC,aAAD,EAAgBC,SAAhB,EAA8B;AAC9C,QAAMC,KAAK,GAAGb,MAAM,CAACI,IAAP;AACZ,cAAAC,CAAC;AACCA,QAAAA,CAAC,CAACC,EAAF,KAASK,aAAT;AACAN,QAAAA,CAAC,CAACE,IAAF,CAAOC,WAAP,OAAyBG,aAAa,CAACH,WAAd,EAF1B,GADW,CAAd;;AAKA,WAAOK,KAAK,CAACC,MAAN,CAAaV,IAAb;AACL,cAAAW,CAAC,UAAIA,CAAC,CAACR,IAAF,CAAOC,WAAP,OAAyBI,SAAS,CAACJ,WAAV,EAA7B,EADI,CAAP;;AAGD,GATD;;AAWA,MAAMQ,aAAa,GAAG,SAAhBA,aAAgB,CAAAC,OAAO,UAAIhB,KAAK,CAACiB,MAAN,CAAa,UAAAC,CAAC,UAAIA,CAAC,CAACF,OAAF,KAAcA,OAAlB,EAAd,CAAJ,EAA7B;;AAEA,SAAO;AACLjB,IAAAA,MAAM,EAANA,MADK;AAELC,IAAAA,KAAK,EAALA,KAFK;AAGLC,IAAAA,SAAS,EAATA,SAHK;AAILQ,IAAAA,SAAS,EAATA,SAJK;AAKLD,IAAAA,QAAQ,EAARA,QALK;AAMLO,IAAAA,aAAa,EAAbA,aANK,EAAP;;AAQD,CAhCM,C","sourcesContent":["export const fullSchema = (models, views) => {\n const findModel = idOrName =>\n models.find(\n m => m.id === idOrName || m.name.toLowerCase() === idOrName.toLowerCase()\n )\n\n const findView = idOrName =>\n views.find(\n m => m.id === idOrName || m.name.toLowerCase() === idOrName.toLowerCase()\n )\n\n const findField = (modelIdOrName, fieldName) => {\n const model = models.find(\n m =>\n m.id === modelIdOrName ||\n m.name.toLowerCase() === modelIdOrName.toLowerCase()\n )\n return model.fields.find(\n f => f.name.toLowerCase() === fieldName.toLowerCase()\n )\n }\n\n const viewsForModel = modelId => views.filter(v => v.modelId === modelId)\n\n return {\n models,\n views,\n findModel,\n findField,\n findView,\n viewsForModel,\n }\n}\n"],"file":"fullSchema.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/schema/models.js"],"names":["newModel","_id","name","type","key","schema","properties","required","canDeleteModel","models","modelId","errors","model","links","fields","filter","f","typeOptions","link","push","canDelete","length"],"mappings":"8HAAA,kC;;AAEO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,WAAO;AAC7BC,IAAAA,GAAG,EAAE,wBADwB;AAE7BC,IAAAA,IAAI,EAAE,EAFuB;AAG7BC,IAAAA,IAAI,EAAE,OAHuB;AAI7BC,IAAAA,GAAG,EAAE,MAJwB;AAK7BC,IAAAA,MAAM,EAAE;AACNF,MAAAA,IAAI,EAAE,QADA;AAENG,MAAAA,UAAU,EAAE;AACVJ,QAAAA,IAAI,EAAE,EAAEC,IAAI,EAAE,QAAR,EADI,EAFN;;AAKNI,MAAAA,QAAQ,EAAE,CAAC,MAAD,CALJ,EALqB,EAAP,EAAjB;;;;AAcP;;;;;;AAMO,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,MAAD,EAASC,OAAT,EAAqB;AACjD,MAAMC,MAAM,GAAG,EAAf,CADiD;;AAG/BF,EAAAA,MAH+B,aAGjD,oDAA0B,KAAjBG,KAAiB;AACxB,UAAMC,KAAK,GAAGD,KAAK,CAACE,MAAN,CAAaC,MAAb;AACZ,gBAAAC,CAAC,UAAIA,CAAC,CAACb,IAAF,KAAW,MAAX,IAAqBa,CAAC,CAACC,WAAF,CAAcP,OAAd,KAA0BA,OAAnD,EADW,CAAd,CADwB;;;AAKPG,MAAAA,KALO,cAKxB,uDAAwB,KAAfK,IAAe;AACtBP,UAAAA,MAAM,CAACQ,IAAP;AACUP,UAAAA,KAAK,CAACV,IADhB,uDAC+DgB,IAAI,CAAChB,IADpE;;AAGD,SATuB;AAUzB,KAbgD;;AAejD,SAAO;AACLS,IAAAA,MAAM,EAANA,MADK;AAELS,IAAAA,SAAS,EAAET,MAAM,CAACU,MAAP,GAAgB,CAFtB,EAAP;;AAID,CAnBM,C","sourcesContent":["import { generate } from \"shortid\"\r\n\r\nexport const newModel = () => ({\r\n _id: generate(),\r\n name: \"\",\r\n type: \"model\",\r\n key: \"name\",\r\n schema: {\r\n type: \"object\",\r\n properties: {\r\n name: { type: \"string\" },\r\n },\r\n required: [\"name\"],\r\n },\r\n})\r\n\r\n/**\r\n *\r\n * @param {Array} models\r\n * @param {string} modelId\r\n * @returns {}\r\n */\r\nexport const canDeleteModel = (models, modelId) => {\r\n const errors = []\r\n\r\n for (let model of models) {\r\n const links = model.fields.filter(\r\n f => f.type === \"link\" && f.typeOptions.modelId === modelId\r\n )\r\n\r\n for (let link of links) {\r\n errors.push(\r\n `The \"${model.name}\" model links to this model, via field \"${link.name}\"`\r\n )\r\n }\r\n }\r\n\r\n return {\r\n errors,\r\n canDelete: errors.length > 0,\r\n }\r\n}\r\n"],"file":"models.js"}
{"version":3,"sources":["../../src/schema/models.js"],"names":["newModel","_id","name","type","key","schema","properties","required","canDeleteModel","models","modelId","errors","model","links","fields","filter","f","typeOptions","link","push","canDelete","length"],"mappings":"8HAAA,kC;;AAEO,IAAMA,QAAQ,GAAG,SAAXA,QAAW,WAAO;AAC7BC,IAAAA,GAAG,EAAE,wBADwB;AAE7BC,IAAAA,IAAI,EAAE,EAFuB;AAG7BC,IAAAA,IAAI,EAAE,OAHuB;AAI7BC,IAAAA,GAAG,EAAE,MAJwB;AAK7BC,IAAAA,MAAM,EAAE;AACNF,MAAAA,IAAI,EAAE,QADA;AAENG,MAAAA,UAAU,EAAE;AACVJ,QAAAA,IAAI,EAAE,EAAEC,IAAI,EAAE,QAAR,EADI,EAFN;;AAKNI,MAAAA,QAAQ,EAAE,CAAC,MAAD,CALJ,EALqB,EAAP,EAAjB;;;;AAcP;;;;;;AAMO,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,MAAD,EAASC,OAAT,EAAqB;AACjD,MAAMC,MAAM,GAAG,EAAf,CADiD;;AAG/BF,EAAAA,MAH+B,aAGjD,oDAA0B,KAAjBG,KAAiB;AACxB,UAAMC,KAAK,GAAGD,KAAK,CAACE,MAAN,CAAaC,MAAb;AACZ,gBAAAC,CAAC,UAAIA,CAAC,CAACb,IAAF,KAAW,MAAX,IAAqBa,CAAC,CAACC,WAAF,CAAcP,OAAd,KAA0BA,OAAnD,EADW,CAAd,CADwB;;;AAKPG,MAAAA,KALO,cAKxB,uDAAwB,KAAfK,IAAe;AACtBP,UAAAA,MAAM,CAACQ,IAAP;AACUP,UAAAA,KAAK,CAACV,IADhB,uDAC+DgB,IAAI,CAAChB,IADpE;;AAGD,SATuB;AAUzB,KAbgD;;AAejD,SAAO;AACLS,IAAAA,MAAM,EAANA,MADK;AAELS,IAAAA,SAAS,EAAET,MAAM,CAACU,MAAP,GAAgB,CAFtB,EAAP;;AAID,CAnBM,C","sourcesContent":["import { generate } from \"shortid\"\n\nexport const newModel = () => ({\n _id: generate(),\n name: \"\",\n type: \"model\",\n key: \"name\",\n schema: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n },\n required: [\"name\"],\n },\n})\n\n/**\n *\n * @param {Array} models\n * @param {string} modelId\n * @returns {}\n */\nexport const canDeleteModel = (models, modelId) => {\n const errors = []\n\n for (let model of models) {\n const links = model.fields.filter(\n f => f.type === \"link\" && f.typeOptions.modelId === modelId\n )\n\n for (let link of links) {\n errors.push(\n `The \"${model.name}\" model links to this model, via field \"${link.name}\"`\n )\n }\n }\n\n return {\n errors,\n canDelete: errors.length > 0,\n }\n}\n"],"file":"models.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../../src/schema/types/datetime.js"],"names":["isType","schema","anyOf","filter","s","type","format","length","fromSchema","toSchema"],"mappings":"uHAAe;AACbA,EAAAA,MAAM,EAAE,gBAAAC,MAAM;AACZA,MAAAA,MAAM,CAACC,KAAP;AACAD,MAAAA,MAAM,CAACC,KAAP,CAAaC,MAAb,CAAoB,UAAAC,CAAC,UAAIA,CAAC,CAACC,IAAF,KAAW,QAAX,IAAuBD,CAAC,CAACE,MAAF,KAAa,WAAxC,EAArB;AACGC,MAAAA,MADH,GACY,CAHA,GADD;;AAMbC,EAAAA,UAAU,EAAE,oBAAAP,MAAM,UAAK;AACrBI,MAAAA,IAAI,EAAE,UADe;AAErB,iBAASJ,MAAM,WAFM,EAAL,EANL;;AAUbQ,EAAAA,QAAQ,EAAE,4BAAO;AACfP,MAAAA,KAAK,EAAE,CAAC,EAAEG,IAAI,EAAE,QAAR,EAAkBC,MAAM,EAAE,WAA1B,EAAD,EAA0C,EAAE,SAAO,EAAT,EAA1C,CADQ;AAEf,iBAAS,EAFM,EAAP,EAVG;;AAcb,aAAS,4BAAO;AACdD,MAAAA,IAAI,EAAE,UADQ;AAEd,iBAAS,EAFK,EAAP,EAdI,E","sourcesContent":["export default {\r\n isType: schema =>\r\n schema.anyOf &&\r\n schema.anyOf.filter(s => s.type === \"string\" && s.format === \"date-time\")\r\n .length > 0,\r\n\r\n fromSchema: schema => ({\r\n type: \"datetime\",\r\n default: schema.default,\r\n }),\r\n toSchema: () => ({\r\n anyOf: [{ type: \"string\", format: \"date-time\" }, { const: \"\" }],\r\n default: \"\",\r\n }),\r\n default: () => ({\r\n type: \"datetime\",\r\n default: \"\",\r\n }),\r\n}\r\n"],"file":"datetime.js"}
{"version":3,"sources":["../../../src/schema/types/datetime.js"],"names":["isType","schema","anyOf","filter","s","type","format","length","fromSchema","toSchema"],"mappings":"uHAAe;AACbA,EAAAA,MAAM,EAAE,gBAAAC,MAAM;AACZA,MAAAA,MAAM,CAACC,KAAP;AACAD,MAAAA,MAAM,CAACC,KAAP,CAAaC,MAAb,CAAoB,UAAAC,CAAC,UAAIA,CAAC,CAACC,IAAF,KAAW,QAAX,IAAuBD,CAAC,CAACE,MAAF,KAAa,WAAxC,EAArB;AACGC,MAAAA,MADH,GACY,CAHA,GADD;;AAMbC,EAAAA,UAAU,EAAE,oBAAAP,MAAM,UAAK;AACrBI,MAAAA,IAAI,EAAE,UADe;AAErB,iBAASJ,MAAM,WAFM,EAAL,EANL;;AAUbQ,EAAAA,QAAQ,EAAE,4BAAO;AACfP,MAAAA,KAAK,EAAE,CAAC,EAAEG,IAAI,EAAE,QAAR,EAAkBC,MAAM,EAAE,WAA1B,EAAD,EAA0C,EAAE,SAAO,EAAT,EAA1C,CADQ;AAEf,iBAAS,EAFM,EAAP,EAVG;;AAcb,aAAS,4BAAO;AACdD,MAAAA,IAAI,EAAE,UADQ;AAEd,iBAAS,EAFK,EAAP,EAdI,E","sourcesContent":["export default {\n isType: schema =>\n schema.anyOf &&\n schema.anyOf.filter(s => s.type === \"string\" && s.format === \"date-time\")\n .length > 0,\n\n fromSchema: schema => ({\n type: \"datetime\",\n default: schema.default,\n }),\n toSchema: () => ({\n anyOf: [{ type: \"string\", format: \"date-time\" }, { const: \"\" }],\n default: \"\",\n }),\n default: () => ({\n type: \"datetime\",\n default: \"\",\n }),\n}\n"],"file":"datetime.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../../src/schema/types/index.js"],"names":["allTypes","datetime","link","number","select","text","listTypes","Object","keys","newField","name","type","field","required","fieldsToSchema","fields","filter","f","map","properties","reduce","sch","toSchema","schemaToFields","modelSchema","key","schema","isType","fromSchema","includes"],"mappings":"0SAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,QAAQ,GAAG;AACf,iCADe;AAEfC,EAAAA,QAAQ,EAARA,oBAFe;AAGfC,EAAAA,IAAI,EAAJA,gBAHe;AAIfC,EAAAA,MAAM,EAANA,kBAJe;AAKfC,EAAAA,MAAM,EAANA,kBALe;AAMfC,EAAAA,IAAI,EAAJA,gBANe,EAAjB;;;AASO,SAASC,SAAT,GAAqB;AAC1B,SAAOC,MAAM,CAACC,IAAP,CAAYR,QAAZ,CAAP;AACD;;AAEM,SAASS,QAAT,CAAkBC,IAAlB,EAAwBC,IAAxB,EAA8B;AACnC,MAAMC,KAAK,GAAGZ,QAAQ,CAACW,IAAD,CAAR,aAAd;AACAC,EAAAA,KAAK,CAACF,IAAN,GAAaA,IAAb;AACAE,EAAAA,KAAK,CAACC,QAAN,GAAiB,KAAjB;AACA,SAAOD,KAAP;AACD;;AAEM,SAASE,cAAT,CAAwBC,MAAxB,EAAgC;AACrC,MAAMF,QAAQ,GAAGE,MAAM,CAACC,MAAP,CAAc,UAAAC,CAAC,UAAIA,CAAC,CAACJ,QAAN,EAAf,EAA+BK,GAA/B,CAAmC,UAAAD,CAAC,UAAIA,CAAC,CAACP,IAAN,EAApC,CAAjB;;AAEA,SAAO;AACLC,IAAAA,IAAI,EAAE,QADD;AAELE,IAAAA,QAAQ,EAARA,QAFK;AAGLM,IAAAA,UAAU,EAAEJ,MAAM,CAACK,MAAP,CAAc,UAACC,GAAD,EAAMT,KAAN,EAAgB;AACxCS,MAAAA,GAAG,CAACT,KAAK,CAACF,IAAP,CAAH,GAAkBV,QAAQ,CAACY,KAAK,CAACD,IAAP,CAAR,CAAqBW,QAArB,CAA8BV,KAA9B,CAAlB;AACA,aAAOS,GAAP;AACD,KAHW,EAGT,EAHS,CAHP,EAAP;;AAQD;;AAEM,SAASE,cAAT,CAAwBC,WAAxB,EAAqC;AAC1C,SAAOjB,MAAM,CAACC,IAAP,CAAYgB,WAAW,CAACL,UAAxB,EAAoCD,GAApC,CAAwC,UAAAO,GAAG,EAAI;AACpD,QAAMC,MAAM,GAAGF,WAAW,CAACL,UAAZ,CAAuBM,GAAvB,CAAf;AACA,SAAK,IAAId,IAAT,IAAiBX,QAAjB,EAA2B;AACzB,UAAIA,QAAQ,CAACW,IAAD,CAAR,CAAegB,MAAf,CAAsBD,MAAtB,CAAJ,EAAmC;AACjC,YAAMd,KAAK,GAAGZ,QAAQ,CAACW,IAAD,CAAR,CAAeiB,UAAf,CAA0BF,MAA1B,CAAd;AACAd,QAAAA,KAAK,CAACC,QAAN,GAAiBW,WAAW,CAACX,QAAZ,CAAqBgB,QAArB,CAA8BJ,GAA9B,CAAjB;AACAb,QAAAA,KAAK,CAACF,IAAN,GAAae,GAAb;AACA,eAAOb,KAAP;AACD;AACF;AACF,GAVM,CAAP;AAWD","sourcesContent":["import boolean from \"./boolean\"\r\nimport datetime from \"./datetime\"\r\nimport link from \"./link\"\r\nimport number from \"./number\"\r\nimport select from \"./select\"\r\nimport text from \"./text\"\r\n\r\nconst allTypes = {\r\n boolean,\r\n datetime,\r\n link,\r\n number,\r\n select,\r\n text,\r\n}\r\n\r\nexport function listTypes() {\r\n return Object.keys(allTypes)\r\n}\r\n\r\nexport function newField(name, type) {\r\n const field = allTypes[type].default()\r\n field.name = name\r\n field.required = false\r\n return field\r\n}\r\n\r\nexport function fieldsToSchema(fields) {\r\n const required = fields.filter(f => f.required).map(f => f.name)\r\n\r\n return {\r\n type: \"object\",\r\n required,\r\n properties: fields.reduce((sch, field) => {\r\n sch[field.name] = allTypes[field.type].toSchema(field)\r\n return sch\r\n }, {}),\r\n }\r\n}\r\n\r\nexport function schemaToFields(modelSchema) {\r\n return Object.keys(modelSchema.properties).map(key => {\r\n const schema = modelSchema.properties[key]\r\n for (let type in allTypes) {\r\n if (allTypes[type].isType(schema)) {\r\n const field = allTypes[type].fromSchema(schema)\r\n field.required = modelSchema.required.includes(key)\r\n field.name = key\r\n return field\r\n }\r\n }\r\n })\r\n}\r\n"],"file":"index.js"}
{"version":3,"sources":["../../../src/schema/types/index.js"],"names":["allTypes","datetime","link","number","select","text","listTypes","Object","keys","newField","name","type","field","required","fieldsToSchema","fields","filter","f","map","properties","reduce","sch","toSchema","schemaToFields","modelSchema","key","schema","isType","fromSchema","includes"],"mappings":"0SAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,QAAQ,GAAG;AACf,iCADe;AAEfC,EAAAA,QAAQ,EAARA,oBAFe;AAGfC,EAAAA,IAAI,EAAJA,gBAHe;AAIfC,EAAAA,MAAM,EAANA,kBAJe;AAKfC,EAAAA,MAAM,EAANA,kBALe;AAMfC,EAAAA,IAAI,EAAJA,gBANe,EAAjB;;;AASO,SAASC,SAAT,GAAqB;AAC1B,SAAOC,MAAM,CAACC,IAAP,CAAYR,QAAZ,CAAP;AACD;;AAEM,SAASS,QAAT,CAAkBC,IAAlB,EAAwBC,IAAxB,EAA8B;AACnC,MAAMC,KAAK,GAAGZ,QAAQ,CAACW,IAAD,CAAR,aAAd;AACAC,EAAAA,KAAK,CAACF,IAAN,GAAaA,IAAb;AACAE,EAAAA,KAAK,CAACC,QAAN,GAAiB,KAAjB;AACA,SAAOD,KAAP;AACD;;AAEM,SAASE,cAAT,CAAwBC,MAAxB,EAAgC;AACrC,MAAMF,QAAQ,GAAGE,MAAM,CAACC,MAAP,CAAc,UAAAC,CAAC,UAAIA,CAAC,CAACJ,QAAN,EAAf,EAA+BK,GAA/B,CAAmC,UAAAD,CAAC,UAAIA,CAAC,CAACP,IAAN,EAApC,CAAjB;;AAEA,SAAO;AACLC,IAAAA,IAAI,EAAE,QADD;AAELE,IAAAA,QAAQ,EAARA,QAFK;AAGLM,IAAAA,UAAU,EAAEJ,MAAM,CAACK,MAAP,CAAc,UAACC,GAAD,EAAMT,KAAN,EAAgB;AACxCS,MAAAA,GAAG,CAACT,KAAK,CAACF,IAAP,CAAH,GAAkBV,QAAQ,CAACY,KAAK,CAACD,IAAP,CAAR,CAAqBW,QAArB,CAA8BV,KAA9B,CAAlB;AACA,aAAOS,GAAP;AACD,KAHW,EAGT,EAHS,CAHP,EAAP;;AAQD;;AAEM,SAASE,cAAT,CAAwBC,WAAxB,EAAqC;AAC1C,SAAOjB,MAAM,CAACC,IAAP,CAAYgB,WAAW,CAACL,UAAxB,EAAoCD,GAApC,CAAwC,UAAAO,GAAG,EAAI;AACpD,QAAMC,MAAM,GAAGF,WAAW,CAACL,UAAZ,CAAuBM,GAAvB,CAAf;AACA,SAAK,IAAId,IAAT,IAAiBX,QAAjB,EAA2B;AACzB,UAAIA,QAAQ,CAACW,IAAD,CAAR,CAAegB,MAAf,CAAsBD,MAAtB,CAAJ,EAAmC;AACjC,YAAMd,KAAK,GAAGZ,QAAQ,CAACW,IAAD,CAAR,CAAeiB,UAAf,CAA0BF,MAA1B,CAAd;AACAd,QAAAA,KAAK,CAACC,QAAN,GAAiBW,WAAW,CAACX,QAAZ,CAAqBgB,QAArB,CAA8BJ,GAA9B,CAAjB;AACAb,QAAAA,KAAK,CAACF,IAAN,GAAae,GAAb;AACA,eAAOb,KAAP;AACD;AACF;AACF,GAVM,CAAP;AAWD","sourcesContent":["import boolean from \"./boolean\"\nimport datetime from \"./datetime\"\nimport link from \"./link\"\nimport number from \"./number\"\nimport select from \"./select\"\nimport text from \"./text\"\n\nconst allTypes = {\n boolean,\n datetime,\n link,\n number,\n select,\n text,\n}\n\nexport function listTypes() {\n return Object.keys(allTypes)\n}\n\nexport function newField(name, type) {\n const field = allTypes[type].default()\n field.name = name\n field.required = false\n return field\n}\n\nexport function fieldsToSchema(fields) {\n const required = fields.filter(f => f.required).map(f => f.name)\n\n return {\n type: \"object\",\n required,\n properties: fields.reduce((sch, field) => {\n sch[field.name] = allTypes[field.type].toSchema(field)\n return sch\n }, {}),\n }\n}\n\nexport function schemaToFields(modelSchema) {\n return Object.keys(modelSchema.properties).map(key => {\n const schema = modelSchema.properties[key]\n for (let type in allTypes) {\n if (allTypes[type].isType(schema)) {\n const field = allTypes[type].fromSchema(schema)\n field.required = modelSchema.required.includes(key)\n field.name = key\n return field\n }\n }\n })\n}\n"],"file":"index.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../../src/schema/types/link.js"],"names":["isType","schema","type","properties","modelId","fromSchema","viewId","toSchema","field","_id","undefined","required"],"mappings":"uHAAe;AACbA,EAAAA,MAAM,EAAE,gBAAAC,MAAM,UAAIA,MAAM,CAACC,IAAP,KAAgB,QAAhB,IAA4BD,MAAM,CAACE,UAAP,CAAkBC,OAAlD,EADD;;AAGbC,EAAAA,UAAU,EAAE,oBAAAJ,MAAM,UAAK;AACrBC,MAAAA,IAAI,EAAE,MADe;AAErBE,MAAAA,OAAO,EAAEH,MAAM,CAACE,UAAP,CAAkBC,OAAlB,SAFY;AAGrBE,MAAAA,MAAM,EAAEL,MAAM,CAACE,UAAP,CAAkBG,MAAlB,SAHa;AAIrB,iBAASL,MAAM,WAJM,EAAL,EAHL;;;AAUbM,EAAAA,QAAQ,EAAE,kBAAAC,KAAK,UAAK;AAClBN,MAAAA,IAAI,EAAE,QADY;AAElBC,MAAAA,UAAU,EAAE;AACVM,QAAAA,GAAG,EAAE,EAAEP,IAAI,EAAE,QAAR,EADK;AAEVI,QAAAA,MAAM,EAAEE,KAAK,CAACF,MAAN,GAAe,EAAE,SAAOE,KAAK,CAACF,MAAf,EAAf,GAAyCI,SAFvC;AAGVN,QAAAA,OAAO,EAAEI,KAAK,CAACJ,OAAN,GAAgB,EAAE,SAAOI,KAAK,CAACJ,OAAf,EAAhB,GAA2CM,SAH1C,EAFM;;AAOlBC,MAAAA,QAAQ,EAAE,CAAC,KAAD,CAPQ;AAQlB,iBAAS,EAAEF,GAAG,EAAE,EAAP,EARS,EAAL,EAVF;;;AAqBb,aAAS,4BAAO;AACdP,MAAAA,IAAI,EAAE,MADQ;AAEdE,MAAAA,OAAO,EAAE,IAFK;AAGdE,MAAAA,MAAM,EAAE,IAHM,EAAP,EArBI,E","sourcesContent":["export default {\r\n isType: schema => schema.type === \"object\" && schema.properties.modelId,\r\n\r\n fromSchema: schema => ({\r\n type: \"link\",\r\n modelId: schema.properties.modelId.const,\r\n viewId: schema.properties.viewId.const,\r\n default: schema.default,\r\n }),\r\n\r\n toSchema: field => ({\r\n type: \"object\",\r\n properties: {\r\n _id: { type: \"string\" },\r\n viewId: field.viewId ? { const: field.viewId } : undefined,\r\n modelId: field.modelId ? { const: field.modelId } : undefined,\r\n },\r\n required: [\"_id\"],\r\n default: { _id: \"\" },\r\n }),\r\n\r\n default: () => ({\r\n type: \"link\",\r\n modelId: null,\r\n viewId: null,\r\n }),\r\n}\r\n"],"file":"link.js"}
{"version":3,"sources":["../../../src/schema/types/link.js"],"names":["isType","schema","type","properties","modelId","fromSchema","viewId","toSchema","field","_id","undefined","required"],"mappings":"uHAAe;AACbA,EAAAA,MAAM,EAAE,gBAAAC,MAAM,UAAIA,MAAM,CAACC,IAAP,KAAgB,QAAhB,IAA4BD,MAAM,CAACE,UAAP,CAAkBC,OAAlD,EADD;;AAGbC,EAAAA,UAAU,EAAE,oBAAAJ,MAAM,UAAK;AACrBC,MAAAA,IAAI,EAAE,MADe;AAErBE,MAAAA,OAAO,EAAEH,MAAM,CAACE,UAAP,CAAkBC,OAAlB,SAFY;AAGrBE,MAAAA,MAAM,EAAEL,MAAM,CAACE,UAAP,CAAkBG,MAAlB,SAHa;AAIrB,iBAASL,MAAM,WAJM,EAAL,EAHL;;;AAUbM,EAAAA,QAAQ,EAAE,kBAAAC,KAAK,UAAK;AAClBN,MAAAA,IAAI,EAAE,QADY;AAElBC,MAAAA,UAAU,EAAE;AACVM,QAAAA,GAAG,EAAE,EAAEP,IAAI,EAAE,QAAR,EADK;AAEVI,QAAAA,MAAM,EAAEE,KAAK,CAACF,MAAN,GAAe,EAAE,SAAOE,KAAK,CAACF,MAAf,EAAf,GAAyCI,SAFvC;AAGVN,QAAAA,OAAO,EAAEI,KAAK,CAACJ,OAAN,GAAgB,EAAE,SAAOI,KAAK,CAACJ,OAAf,EAAhB,GAA2CM,SAH1C,EAFM;;AAOlBC,MAAAA,QAAQ,EAAE,CAAC,KAAD,CAPQ;AAQlB,iBAAS,EAAEF,GAAG,EAAE,EAAP,EARS,EAAL,EAVF;;;AAqBb,aAAS,4BAAO;AACdP,MAAAA,IAAI,EAAE,MADQ;AAEdE,MAAAA,OAAO,EAAE,IAFK;AAGdE,MAAAA,MAAM,EAAE,IAHM,EAAP,EArBI,E","sourcesContent":["export default {\n isType: schema => schema.type === \"object\" && schema.properties.modelId,\n\n fromSchema: schema => ({\n type: \"link\",\n modelId: schema.properties.modelId.const,\n viewId: schema.properties.viewId.const,\n default: schema.default,\n }),\n\n toSchema: field => ({\n type: \"object\",\n properties: {\n _id: { type: \"string\" },\n viewId: field.viewId ? { const: field.viewId } : undefined,\n modelId: field.modelId ? { const: field.modelId } : undefined,\n },\n required: [\"_id\"],\n default: { _id: \"\" },\n }),\n\n default: () => ({\n type: \"link\",\n modelId: null,\n viewId: null,\n }),\n}\n"],"file":"link.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../../src/schema/types/number.js"],"names":["isType","schema","type","fromSchema","toSchema","field","maximum","minimum","undefined"],"mappings":"uHAAe;AACbA,EAAAA,MAAM,EAAE,gBAAAC,MAAM,UAAIA,MAAM,CAACC,IAAP,KAAgB,QAApB,EADD;AAEbC,EAAAA,UAAU,EAAE,oBAAAF,MAAM,UAAIA,MAAJ,EAFL;AAGbG,EAAAA,QAAQ,EAAE,kBAAAC,KAAK,UAAK;AAClBH,MAAAA,IAAI,EAAE,QADY;AAElBI,MAAAA,OAAO,EAAED,KAAK,CAACC,OAFG;AAGlBC,MAAAA,OAAO,EAAEF,KAAK,CAACE,OAHG;AAIlB,iBAASC,SAJS,EAAL,EAHF;;AASb,aAAS,4BAAO;AACdN,MAAAA,IAAI,EAAE,QADQ;AAEdI,MAAAA,OAAO,EAAE,IAFK;AAGdC,MAAAA,OAAO,EAAE,IAHK,EAAP,EATI,E","sourcesContent":["export default {\r\n isType: schema => schema.type === \"number\",\r\n fromSchema: schema => schema,\r\n toSchema: field => ({\r\n type: \"number\",\r\n maximum: field.maximum,\r\n minimum: field.minimum,\r\n default: undefined,\r\n }),\r\n default: () => ({\r\n type: \"number\",\r\n maximum: null,\r\n minimum: null,\r\n }),\r\n}\r\n"],"file":"number.js"}
{"version":3,"sources":["../../../src/schema/types/number.js"],"names":["isType","schema","type","fromSchema","toSchema","field","maximum","minimum","undefined"],"mappings":"uHAAe;AACbA,EAAAA,MAAM,EAAE,gBAAAC,MAAM,UAAIA,MAAM,CAACC,IAAP,KAAgB,QAApB,EADD;AAEbC,EAAAA,UAAU,EAAE,oBAAAF,MAAM,UAAIA,MAAJ,EAFL;AAGbG,EAAAA,QAAQ,EAAE,kBAAAC,KAAK,UAAK;AAClBH,MAAAA,IAAI,EAAE,QADY;AAElBI,MAAAA,OAAO,EAAED,KAAK,CAACC,OAFG;AAGlBC,MAAAA,OAAO,EAAEF,KAAK,CAACE,OAHG;AAIlB,iBAASC,SAJS,EAAL,EAHF;;AASb,aAAS,4BAAO;AACdN,MAAAA,IAAI,EAAE,QADQ;AAEdI,MAAAA,OAAO,EAAE,IAFK;AAGdC,MAAAA,OAAO,EAAE,IAHK,EAAP,EATI,E","sourcesContent":["export default {\n isType: schema => schema.type === \"number\",\n fromSchema: schema => schema,\n toSchema: field => ({\n type: \"number\",\n maximum: field.maximum,\n minimum: field.minimum,\n default: undefined,\n }),\n default: () => ({\n type: \"number\",\n maximum: null,\n minimum: null,\n }),\n}\n"],"file":"number.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/schema/views.js"],"names":["newView","modelId","id","name"],"mappings":"oGAAA;;AAEO,IAAMA,OAAO,GAAG,SAAVA,OAAU,QAACC,OAAD,uEAAW,IAAX,QAAqB;AAC1CC,IAAAA,EAAE,EAAE,wBADsC;AAE1CC,IAAAA,IAAI,EAAE,EAFoC;AAG1CF,IAAAA,OAAO,EAAPA,OAH0C,EAArB,EAAhB,C","sourcesContent":["import { generate } from \"shortid\"\r\n\r\nexport const newView = (modelId = null) => ({\r\n id: generate(),\r\n name: \"\",\r\n modelId,\r\n})\r\n"],"file":"views.js"}
{"version":3,"sources":["../../src/schema/views.js"],"names":["newView","modelId","id","name"],"mappings":"oGAAA;;AAEO,IAAMA,OAAO,GAAG,SAAVA,OAAU,QAACC,OAAD,uEAAW,IAAX,QAAqB;AAC1CC,IAAAA,EAAE,EAAE,wBADsC;AAE1CC,IAAAA,IAAI,EAAE,EAFoC;AAG1CF,IAAAA,OAAO,EAAPA,OAH0C,EAArB,EAAhB,C","sourcesContent":["import { generate } from \"shortid\"\n\nexport const newView = (modelId = null) => ({\n id: generate(),\n name: \"\",\n modelId,\n})\n"],"file":"views.js"}

View file

@ -1 +1 @@
{"version":3,"sources":["../../src/schemaValidation/index.js"],"names":["ajv","Ajv"],"mappings":"4LAAA;;AAEA,IAAMA,GAAG,GAAG,IAAIC,eAAJ,EAAZ,C;;AAEeD,G","sourcesContent":["import Ajv from \"ajv\";\r\n\r\nconst ajv = new Ajv();\r\n\r\nexport default ajv;"],"file":"index.js"}
{"version":3,"sources":["../../src/schemaValidation/index.js"],"names":["ajv","Ajv"],"mappings":"4LAAA;;AAEA,IAAMA,GAAG,GAAG,IAAIC,eAAJ,EAAZ,C;;AAEeD,G","sourcesContent":["import Ajv from \"ajv\";\n\nconst ajv = new Ajv();\n\nexport default ajv;"],"file":"index.js"}

View file

@ -1,13 +1,9 @@
module.exports = () => ({
datastore: "local",
datastoreConfig: {
rootPath: "./.data",
},
keys: ["secret1", "secret2"],
database: "pouch",
adminSecret: "",
port: 4001,
latestPackagesFolder: ".",
extraMasterPlugins: {},
dev: true,
customizeMaster: appDefinition => appDefinition,
useAppRootPath: true,
})

View file

@ -0,0 +1,19 @@
const database = "{{database}}"
const adminSecret = "{{adminSecret}}"
const cookieKey1 = "{{cookieKey1}}"
const cookieKey2 = "{{cookieKey2}}"
const clientId = "{{clientId}}"
const couchDBConnectionString = "{{couchDBConnectionString}}"
module.exports = () => ({
database,
adminSecret,
couchDBConnectionString,
clientId,
keys: [cookieKey1, cookieKey2],
port: 4001,
latestPackagesFolder: ".",
extraMasterPlugins: {},
customizeMaster: appDefinition => appDefinition,
useAppRootPath: true,
})

View file

@ -1,12 +1,12 @@
module.exports = () => ({
// the datastore type. should link to a module ...
// ../datastores/datastores/<datastore>.js
datastore: "local",
// can be couch - if you have couchdb installed, or pouch for dev
database: "couch",
// a config object passed to the datastore.databaseManager
datastoreConfig: {
rootPath: "./.data",
},
// not required if using pouch
couchDbConnectionString: "https://username:password@localhost:5984",
// a secret that is used to access admin endpoints
adminSecret: "a_big_long_secret",
// cookie signing keys,these are secret
keys: ["secret1", "secret1"],

View file

@ -0,0 +1,22 @@
const CouchDb = require(".")
module.exports = async clientId => {
await CouchDb.db.create(clientId)
const db = CouchDb.db.use(clientId)
await db.insert(
{
views: {
by_type: {
map: `function(doc) {
emit([doc.type], doc._id)
}`,
},
},
},
"_design/client"
)
return clientId
}

View file

@ -1,34 +0,0 @@
const { initialiseData, setupDatastore } = require("@budibase/core")
const constructHierarchy = require("../utilities/constructHierarchy")
const getDatabaseManager = require("../utilities/databaseManager")
const {
getApisForUser,
getApisWithFullAccess,
} = require("../utilities/budibaseApi")
const masterDbAppDefinition = require("../appPackages/_master/appDefinition.json")
const masterDbAccessLevels = require("../appPackages/_master/access_levels.json")
const { masterAppPackage } = require("../utilities/createAppPackage")
module.exports = async (context, datastoreModule, username, password) => {
const { config } = context
const databaseManager = getDatabaseManager(
datastoreModule,
config.datastoreConfig
)
await databaseManager.createEmptyMasterDb()
const masterDbConfig = databaseManager.masterDatastoreConfig
const datastore = setupDatastore(datastoreModule.getDatastore(masterDbConfig))
await initialiseData(datastore, constructHierarchy(masterDbAppDefinition))
const masterPackage = masterAppPackage(context)
const bbMaster = await getApisWithFullAccess(datastore, masterPackage)
await bbMaster.authApi.saveAccessLevels(masterDbAccessLevels)
const user = bbMaster.authApi.getNewUser()
user.name = username
user.accessLevels = ["owner"]
await bbMaster.authApi.createUser(user, password)
return await getApisForUser(datastore, masterPackage, username, password)
}

View file

@ -19,7 +19,7 @@ exports.authenticate = async ctx => {
// query couch for their username
const db = new CouchDB(ctx.config)(ctx.params.instanceId);
const dbUser = await db.query("database/by_username", {
const dbUser = await db.query("by_username", {
include_docs: true,
key: username
});

View file

@ -16,7 +16,7 @@ exports.create = async function(ctx) {
by_type: {
map: function(doc) {
emit([doc.type], doc._id);
}
}.toString()
}
}
});

View file

@ -1,5 +1,5 @@
const CouchDB = require("../../db")
const { schemaValidator } = require("@budibase/common")
const CouchDB = require("../../db");
const { schemaValidator } = require("../../../common");
exports.save = async function(ctx) {
const db = new CouchDB(ctx.params.instanceId);
@ -46,7 +46,7 @@ exports.save = async function(ctx) {
exports.fetch = async function(ctx) {
const db = new CouchDB(ctx.config)(ctx.params.instanceId)
const response = await db.query(
`database/${ctx.params.viewName}`,
`database/${ctx.params.modelId}`,
{
include_docs: true
}

View file

@ -189,33 +189,6 @@
lodash "^4.17.13"
to-fast-properties "^2.0.0"
"@budibase/client@^0.0.32":
version "0.0.32"
resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.0.32.tgz#76d9f147563a0bf939eae7f32ce75b2a527ba496"
integrity sha512-jmCCLn0CUoQbL6h623S5IqK6+GYLqX3WzUTZInSb1SCBOM3pI0eLP5HwTR6s7r42SfD0v9jTWRdyTnHiElNj8A==
dependencies:
"@nx-js/compiler-util" "^2.0.0"
bcryptjs "^2.4.3"
deep-equal "^2.0.1"
lodash "^4.17.15"
lunr "^2.3.5"
regexparam "^1.3.0"
shortid "^2.2.8"
svelte "^3.9.2"
"@budibase/core@^0.0.32":
version "0.0.32"
resolved "https://registry.yarnpkg.com/@budibase/core/-/core-0.0.32.tgz#c5d9ab869c5e9596a1ac337aaf041e795b1cc7fa"
integrity sha512-B6DHlz/C/m3jrxHbImT4bphdJlL7r2qmGrmcVBSc9mGHvwcRh1xfFGrsPCOU2IEJow+DWD63BIjyHzLPI3cerQ==
dependencies:
"@nx-js/compiler-util" "^2.0.0"
bcryptjs "^2.4.3"
date-fns "^1.29.0"
lodash "^4.17.13"
lunr "^2.3.5"
safe-buffer "^5.1.2"
shortid "^2.2.8"
"@cnakazawa/watch@^1.0.3":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a"
@ -384,11 +357,6 @@
path-to-regexp "1.x"
urijs "^1.19.2"
"@nx-js/compiler-util@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@nx-js/compiler-util/-/compiler-util-2.0.0.tgz#c74c12165fa2f017a292bb79af007e8fce0af297"
integrity sha512-AxSQbwj9zqt8DYPZ6LwZdytqnwfiOEdcFdq4l8sdjkZmU2clTht7RDLCI8xvkp7KqgcNaOGlTeCM55TULWruyQ==
"@sindresorhus/is@^0.14.0":
version "0.14.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
@ -670,11 +638,6 @@ array-equal@^1.0.0:
resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=
array-filter@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=
array-unique@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
@ -717,13 +680,6 @@ atob@^2.1.2:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5"
integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==
dependencies:
array-filter "^1.0.0"
aws-sign2@~0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8"
@ -1225,11 +1181,6 @@ data-urls@^1.0.0:
whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0"
date-fns@^1.29.0:
version "1.30.1"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==
debug@^2.2.0, debug@^2.3.3:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
@ -1275,25 +1226,6 @@ decompress-response@^3.3.0:
dependencies:
mimic-response "^1.0.0"
deep-equal@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.2.tgz#e68291e245493ae908ca7190c1deea57a01ed82b"
integrity sha512-kX0bjV7tdMuhrhzKPEnVwqfQCuf+IEfN+4Xqv4eKd75xGRyn8yzdQ9ujPY6a221rgJKyQC4KBu1PibDTpa6m9w==
dependencies:
es-abstract "^1.17.5"
es-get-iterator "^1.1.0"
is-arguments "^1.0.4"
is-date-object "^1.0.2"
is-regex "^1.0.5"
isarray "^2.0.5"
object-is "^1.0.2"
object-keys "^1.1.1"
regexp.prototype.flags "^1.3.0"
side-channel "^1.0.2"
which-boxed-primitive "^1.0.1"
which-collection "^1.0.1"
which-typed-array "^1.1.1"
deep-equal@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
@ -1496,7 +1428,7 @@ error-inject@^1.0.0:
resolved "https://registry.yarnpkg.com/error-inject/-/error-inject-1.0.0.tgz#e2b3d91b54aed672f309d950d154850fa11d4f37"
integrity sha1-4rPZG1Su1nLzCdlQ0VSFD6EdTzc=
es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.4, es-abstract@^1.17.5:
es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.5:
version "1.17.5"
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.5.tgz#d8c9d1d66c8981fb9200e2251d799eee92774ae9"
integrity sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==
@ -1513,19 +1445,6 @@ es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.4, es-abstrac
string.prototype.trimleft "^2.1.1"
string.prototype.trimright "^2.1.1"
es-get-iterator@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.0.tgz#bb98ad9d6d63b31aacdc8f89d5d0ee57bcb5b4c8"
integrity sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==
dependencies:
es-abstract "^1.17.4"
has-symbols "^1.0.1"
is-arguments "^1.0.4"
is-map "^2.0.1"
is-set "^2.0.1"
is-string "^1.0.5"
isarray "^2.0.5"
es-to-primitive@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a"
@ -1743,11 +1662,6 @@ for-in@^1.0.2:
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=
foreach@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k=
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@ -2149,21 +2063,11 @@ is-accessor-descriptor@^1.0.0:
dependencies:
kind-of "^6.0.0"
is-arguments@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3"
integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==
is-arrayish@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d"
integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=
is-bigint@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.0.tgz#73da8c33208d00f130e9b5e15d23eac9215601c4"
integrity sha512-t5mGUXC/xRheCK431ylNiSkGGpBp8bHENBcENTkDT6ppwPzEVxNGZRvgvmOEfbWkFhA7D2GEuE2mmQTr78sl2g==
is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
@ -2171,11 +2075,6 @@ is-binary-path@~2.1.0:
dependencies:
binary-extensions "^2.0.0"
is-boolean-object@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e"
integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ==
is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
@ -2212,7 +2111,7 @@ is-data-descriptor@^1.0.0:
dependencies:
kind-of "^6.0.0"
is-date-object@^1.0.1, is-date-object@^1.0.2:
is-date-object@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e"
integrity sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==
@ -2287,21 +2186,11 @@ is-installed-globally@^0.3.1:
global-dirs "^2.0.1"
is-path-inside "^3.0.1"
is-map@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1"
integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==
is-npm@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d"
integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==
is-number-object@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197"
integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==
is-number@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
@ -2338,21 +2227,11 @@ is-regex@^1.0.5:
dependencies:
has "^1.0.3"
is-set@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.1.tgz#d1604afdab1724986d30091575f54945da7e5f43"
integrity sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==
is-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
is-string@^1.0.4, is-string@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6"
integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==
is-symbol@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937"
@ -2369,31 +2248,11 @@ is-type-of@^1.0.0:
is-class-hotfix "~0.0.6"
isstream "~0.1.2"
is-typed-array@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.3.tgz#a4ff5a5e672e1a55f99c7f54e59597af5c1df04d"
integrity sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ==
dependencies:
available-typed-arrays "^1.0.0"
es-abstract "^1.17.4"
foreach "^2.0.5"
has-symbols "^1.0.1"
is-typedarray@^1.0.0, is-typedarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
is-weakmap@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2"
integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==
is-weakset@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83"
integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw==
is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
@ -2419,11 +2278,6 @@ isarray@1.0.0, isarray@~1.0.0:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
isarray@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723"
integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@ -3331,11 +3185,6 @@ ltgt@2.2.1, ltgt@^2.1.2:
resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5"
integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=
lunr@^2.3.5:
version "2.3.8"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072"
integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==
make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
@ -3482,11 +3331,6 @@ nan@^2.12.1:
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==
nanoid@^2.1.0:
version "2.1.11"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==
nanomatch@^1.2.9:
version "1.2.13"
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@ -3641,14 +3485,6 @@ object-inspect@^1.7.0:
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67"
integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==
object-is@^1.0.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.2.tgz#c5d2e87ff9e119f78b7a088441519e2eec1573b6"
integrity sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.17.5"
object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
@ -4084,19 +3920,6 @@ regex-not@^1.0.0, regex-not@^1.0.2:
extend-shallow "^3.0.2"
safe-regex "^1.1.0"
regexp.prototype.flags@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75"
integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.17.0-next.1"
regexparam@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f"
integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g==
registry-auth-token@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.1.1.tgz#40a33be1e82539460f94328b0f7f0f84c16d9479"
@ -4345,21 +4168,6 @@ shellwords@^0.1.1:
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==
shortid@^2.2.8:
version "2.2.15"
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122"
integrity sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==
dependencies:
nanoid "^2.1.0"
side-channel@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947"
integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA==
dependencies:
es-abstract "^1.17.0-next.1"
object-inspect "^1.7.0"
signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
@ -4680,11 +4488,6 @@ supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"
svelte@^3.9.2:
version "3.20.1"
resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.20.1.tgz#8417fcd883a2f534b642a0737368272e651cf3ac"
integrity sha512-m/dw52BZf+p6KYnyKLErIcGalu4pwJrQbUM7VZriRw6ZlJj1qMAZsLcIWzEB3I0hhdJwkKb7LrrvUIeqmbO92Q==
symbol-tree@^3.2.2:
version "3.2.4"
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
@ -5061,44 +4864,11 @@ whatwg-url@^7.0.0:
tr46 "^1.0.1"
webidl-conversions "^4.0.2"
which-boxed-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz#cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1"
integrity sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ==
dependencies:
is-bigint "^1.0.0"
is-boolean-object "^1.0.0"
is-number-object "^1.0.3"
is-string "^1.0.4"
is-symbol "^1.0.2"
which-collection@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906"
integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==
dependencies:
is-map "^2.0.1"
is-set "^2.0.1"
is-weakmap "^2.0.1"
is-weakset "^2.0.1"
which-module@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
which-typed-array@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.2.tgz#e5f98e56bda93e3dac196b01d47c1156679c00b2"
integrity sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ==
dependencies:
available-typed-arrays "^1.0.2"
es-abstract "^1.17.5"
foreach "^2.0.5"
function-bind "^1.1.1"
has-symbols "^1.0.1"
is-typed-array "^1.1.3"
which@^1.2.9, which@^1.3.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"