From 00df10bbd5d7f3fe5a010b8fd870701f8ee88f90 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 28 Jan 2020 13:06:35 +0000 Subject: [PATCH] fix bcrypt in build --- packages/core/.gitignore | 1 + packages/core/dist/budibase-core.cjs.js | 8297 ----------------- packages/core/dist/budibase-core.esm.mjs | 8276 ---------------- packages/core/dist/budibase-core.umd.js | 8296 ---------------- packages/core/rollup.config.js | 2 +- packages/server/appPackages/testApp/yarn.lock | 10 +- packages/server/yarn.lock | 57 +- 7 files changed, 11 insertions(+), 24928 deletions(-) delete mode 100644 packages/core/dist/budibase-core.cjs.js delete mode 100644 packages/core/dist/budibase-core.esm.mjs delete mode 100644 packages/core/dist/budibase-core.umd.js diff --git a/packages/core/.gitignore b/packages/core/.gitignore index 421d908e61..57bf2e6855 100644 --- a/packages/core/.gitignore +++ b/packages/core/.gitignore @@ -40,3 +40,4 @@ flow-typed/npm/* .idea npm-debug.log.* +dist diff --git a/packages/core/dist/budibase-core.cjs.js b/packages/core/dist/budibase-core.cjs.js deleted file mode 100644 index ad7e491df9..0000000000 --- a/packages/core/dist/budibase-core.cjs.js +++ /dev/null @@ -1,8297 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var fp = require('lodash/fp'); -var shortid = require('shortid'); -var _ = require('lodash'); -var ___default = _interopDefault(_); -var compilerUtil = require('@nx-js/compiler-util'); -var lunr = _interopDefault(require('lunr')); -var safeBuffer = require('safe-buffer'); - -const commonPlus = extra => fp.union(['onBegin', 'onComplete', 'onError'])(extra); - -const common = () => commonPlus([]); - -const _events = { - recordApi: { - save: commonPlus([ - 'onInvalid', - 'onRecordUpdated', - 'onRecordCreated']), - delete: common(), - getContext: common(), - getNew: common(), - load: common(), - validate: common(), - uploadFile: common(), - downloadFile: common(), - }, - indexApi: { - buildIndex: common(), - listItems: common(), - delete: common(), - aggregates: common(), - }, - collectionApi: { - getAllowedRecordTypes: common(), - initialise: common(), - delete: common(), - }, - authApi: { - authenticate: common(), - authenticateTemporaryAccess: common(), - createTemporaryAccess: common(), - createUser: common(), - enableUser: common(), - disableUser: common(), - loadAccessLevels: common(), - getNewAccessLevel: common(), - getNewUser: common(), - getNewUserAuth: common(), - getUsers: common(), - saveAccessLevels: common(), - isAuthorized: common(), - changeMyPassword: common(), - setPasswordFromTemporaryCode: common(), - scorePassword: common(), - isValidPassword: common(), - validateUser: common(), - validateAccessLevels: common(), - setUserAccessLevels: common(), - }, - templateApi: { - saveApplicationHierarchy: common(), - saveActionsAndTriggers: common(), - }, - actionsApi: { - execute: common(), - }, -}; - -const _eventsList = []; - -const makeEvent = (area, method, name) => `${area}:${method}:${name}`; - -for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - _events[areaKey][methodKey] = fp.reduce((obj, s) => { - obj[s] = makeEvent(areaKey, methodKey, s); - return obj; - }, - {})(_events[areaKey][methodKey]); - } -} - - -for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - for (const name in _events[areaKey][methodKey]) { - _eventsList.push( - _events[areaKey][methodKey][name], - ); - } - } -} - - -const events = _events; - -const eventsList = _eventsList; - -class BadRequestError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 400; - } -} - -class UnauthorisedError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 401; - } -} - -class ForbiddenError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 403; - } -} - -class NotFoundError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 404; - } -} - -const apiWrapper = async (app, eventNamespace, isAuthorized, eventContext, func, ...params) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return; - } - - const startDate = Date.now(); - const elapsed = () => (Date.now() - startDate); - - try { - await app.publish( - eventNamespace.onBegin, - eventContext, - ); - - const result = await func(...params); - - await publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result; - } catch (error) { - await publishError(app, eventContext, eventNamespace, elapsed, error); - throw error; - } -}; - -const apiWrapperSync = (app, eventNamespace, isAuthorized, eventContext, func, ...params) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return; - } - - const startDate = Date.now(); - const elapsed = () => (Date.now() - startDate); - - try { - app.publish( - eventNamespace.onBegin, - eventContext, - ); - - const result = func(...params); - - publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result; - } catch (error) { - publishError(app, eventContext, eventNamespace, elapsed, error); - throw error; - } -}; - -const handleNotAuthorized = (app, eventContext, eventNamespace) => { - const err = new UnauthorisedError(`Unauthorized: ${eventNamespace}`); - publishError(app, eventContext, eventNamespace, () => 0, err); - throw err; -}; - -const pushCallStack = (app, eventNamespace, seedCallId) => { - const callId = shortid.generate(); - - const createCallStack = () => ({ - seedCallId: !fp.isUndefined(seedCallId) - ? seedCallId - : callId, - threadCallId: callId, - stack: [], - }); - - if (fp.isUndefined(app.calls)) { - app.calls = createCallStack(); - } - - app.calls.stack.push({ - namespace: eventNamespace, - callId, - }); -}; - -const popCallStack = (app) => { - app.calls.stack.pop(); - if (app.calls.stack.length === 0) { - delete app.calls; - } -}; - -const publishError = async (app, eventContext, eventNamespace, elapsed, err) => { - const ctx = fp.cloneDeep(eventContext); - ctx.error = err; - ctx.elapsed = elapsed(); - await app.publish( - eventNamespace.onError, - ctx, - ); - popCallStack(app); -}; - -const publishComplete = async (app, eventContext, eventNamespace, elapsed, result) => { - const endcontext = fp.cloneDeep(eventContext); - endcontext.result = result; - endcontext.elapsed = elapsed(); - await app.publish( - eventNamespace.onComplete, - endcontext, - ); - popCallStack(app); - return result; -}; - -const lockOverlapMilliseconds = 10; - -const getLock = async (app, lockFile, timeoutMilliseconds, maxLockRetries, retryCount = 0) => { - try { - const timeout = (await app.getEpochTime()) - + timeoutMilliseconds; - - const lock = { - timeout, - key: lockFile, - totalTimeout: timeoutMilliseconds, - }; - - await app.datastore.createFile( - lockFile, - getLockFileContent( - lock.totalTimeout, - lock.timeout, - ), - ); - - return lock; - } catch (e) { - if (retryCount == maxLockRetries) { return NO_LOCK; } - - const lock = parseLockFileContent( - lockFile, - await app.datastore.loadFile(lockFile), - ); - - const currentEpochTime = await app.getEpochTime(); - - if (currentEpochTime < lock.timeout) { - return NO_LOCK; - } - - try { - await app.datastore.deleteFile(lockFile); - } catch (_) { - //empty - } - - await sleepForRetry(); - - return await getLock( - app, lockFile, timeoutMilliseconds, - maxLockRetries, retryCount + 1, - ); - } -}; - -const getLockFileContent = (totalTimeout, epochTime) => `${totalTimeout}:${epochTime.toString()}`; - -const parseLockFileContent = (key, content) => $(content, [ - fp.split(':'), - parts => ({ - totalTimeout: new Number(parts[0]), - timeout: new Number(parts[1]), - key, - }), -]); - -const releaseLock = async (app, lock) => { - const currentEpochTime = await app.getEpochTime(); - // only release if not timedout - if (currentEpochTime < (lock.timeout - lockOverlapMilliseconds)) { - try { - await app.datastore.deleteFile(lock.key); - } catch (_) { - //empty - } - } -}; - -const NO_LOCK = 'no lock'; -const isNolock = id => id === NO_LOCK; - -const sleepForRetry = () => new Promise(resolve => setTimeout(resolve, lockOverlapMilliseconds)); - -// this is the combinator function -const $$ = (...funcs) => arg => _.flow(funcs)(arg); - -// this is the pipe function -const $ = (arg, funcs) => $$(...funcs)(arg); - -const keySep = '/'; -const trimKeySep = str => _.trim(str, keySep); -const splitByKeySep = str => fp.split(keySep)(str); -const safeKey = key => _.replace(`${keySep}${trimKeySep(key)}`, `${keySep}${keySep}`, keySep); -const joinKey = (...strs) => { - const paramsOrArray = strs.length === 1 & fp.isArray(strs[0]) - ? strs[0] : strs; - return $(paramsOrArray, [ - fp.filter(s => !fp.isUndefined(s) - && !fp.isNull(s) - && s.toString().length > 0), - fp.join(keySep), - safeKey - ]); -}; -const splitKey = $$(trimKeySep, splitByKeySep); -const getDirFomKey = $$(splitKey, _.dropRight, p => joinKey(...p)); -const getFileFromKey = $$(splitKey, _.takeRight, _.head); - -const configFolder = `${keySep}.config`; -const fieldDefinitions = joinKey(configFolder, 'fields.json'); -const templateDefinitions = joinKey(configFolder, 'templates.json'); -const appDefinitionFile = joinKey(configFolder, 'appDefinition.json'); -const dirIndex = folderPath => joinKey(configFolder, 'dir', ...splitKey(folderPath), 'dir.idx'); -const getIndexKeyFromFileKey = $$(getDirFomKey, dirIndex); - -const ifExists = (val, exists, notExists) => (fp.isUndefined(val) - ? fp.isUndefined(notExists) ? (() => { })() : notExists() - : exists()); - -const getOrDefault = (val, defaultVal) => ifExists(val, () => val, () => defaultVal); - -const not = func => val => !func(val); -const isDefined = not(fp.isUndefined); -const isNonNull = not(fp.isNull); -const isNotNaN = not(fp.isNaN); - -const allTrue = (...funcArgs) => val => fp.reduce( - (result, conditionFunc) => (fp.isNull(result) || result == true) && conditionFunc(val), - null)(funcArgs); - -const anyTrue = (...funcArgs) => val => fp.reduce( - (result, conditionFunc) => result == true || conditionFunc(val), - null)(funcArgs); - -const insensitiveEquals = (str1, str2) => str1.trim().toLowerCase() === str2.trim().toLowerCase(); - -const isSomething = allTrue(isDefined, isNonNull, isNotNaN); -const isNothing = not(isSomething); -const isNothingOrEmpty = v => isNothing(v) || fp.isEmpty(v); -const somethingOrGetDefault = getDefaultFunc => val => (isSomething(val) ? val : getDefaultFunc()); -const somethingOrDefault = (val, defaultVal) => somethingOrGetDefault(fp.constant(defaultVal))(val); - -const mapIfSomethingOrDefault = (mapFunc, defaultVal) => val => (isSomething(val) ? mapFunc(val) : defaultVal); - -const mapIfSomethingOrBlank = mapFunc => mapIfSomethingOrDefault(mapFunc, ''); - -const none = predicate => collection => !fp.some(predicate)(collection); - -const all = predicate => collection => none(v => !predicate(v))(collection); - -const isNotEmpty = ob => !fp.isEmpty(ob); -const isNonEmptyArray = allTrue(fp.isArray, isNotEmpty); -const isNonEmptyString = allTrue(fp.isString, isNotEmpty); -const tryOr = failFunc => (func, ...args) => { - try { - return func.apply(null, ...args); - } catch (_) { - return failFunc(); - } -}; - -const tryAwaitOr = failFunc => async (func, ...args) => { - try { - return await func.apply(null, ...args); - } catch (_) { - return await failFunc(); - } -}; - -const defineError = (func, errorPrefix) => { - try { - return func(); - } catch (err) { - err.message = `${errorPrefix} : ${err.message}`; - throw err; - } -}; - -const tryOrIgnore = tryOr(() => { }); -const tryAwaitOrIgnore = tryAwaitOr(async () => { }); -const causesException = (func) => { - try { - func(); - return false; - } catch (e) { - return true; - } -}; - -const executesWithoutException = func => !causesException(func); - -const handleErrorWith = returnValInError => tryOr(fp.constant(returnValInError)); - -const handleErrorWithUndefined = handleErrorWith(undefined); - -const switchCase = (...cases) => (value) => { - const nextCase = () => _.head(cases)[0](value); - const nextResult = () => _.head(cases)[1](value); - - if (fp.isEmpty(cases)) return; // undefined - if (nextCase() === true) return nextResult(); - return switchCase(..._.tail(cases))(value); -}; - -const isValue = val1 => val2 => (val1 === val2); -const isOneOf = (...vals) => val => fp.includes(val)(vals); -const defaultCase = fp.constant(true); -const memberMatches = (member, match) => obj => match(obj[member]); - - -const StartsWith = searchFor => searchIn => _.startsWith(searchIn, searchFor); - -const contains = val => array => (_.findIndex(array, v => v === val) > -1); - -const getHashCode = (s) => { - let hash = 0; let i; let char; let - l; - if (s.length == 0) return hash; - for (i = 0, l = s.length; i < l; i++) { - char = s.charCodeAt(i); - hash = ((hash << 5) - hash) + char; - hash |= 0; // Convert to 32bit integer - } - - // converting to string, but dont want a "-" prefixed - if (hash < 0) { return `n${(hash * -1).toString()}`; } - return hash.toString(); -}; - -// thanks to https://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/ -const awEx = async (promise) => { - try { - const result = await promise; - return [undefined, result]; - } catch (error) { - return [error, undefined]; - } -}; - -const isSafeInteger = n => fp.isInteger(n) - && n <= Number.MAX_SAFE_INTEGER - && n >= 0 - Number.MAX_SAFE_INTEGER; - -const toDateOrNull = s => (fp.isNull(s) ? null - : fp.isDate(s) ? s : new Date(s)); -const toBoolOrNull = s => (fp.isNull(s) ? null - : s === 'true' || s === true); -const toNumberOrNull = s => (fp.isNull(s) ? null - : fp.toNumber(s)); - -const isArrayOfString = opts => fp.isArray(opts) && all(fp.isString)(opts); - -const pushAll = (target, items) => { - for(let i of items) target.push(i); -}; - -const pause = async duration => new Promise(res => setTimeout(res, duration)); - -const retry = async (fn, retries, delay, ...args) => { - try { - return await fn(...args); - } catch (err) { - if (retries > 1) { - return await pause(delay).then(async () => await retry(fn, (retries - 1), delay, ...args)); - } - throw err; - } -}; - -var index = { - ifExists, - getOrDefault, - isDefined, - isNonNull, - isNotNaN, - allTrue, - isSomething, - mapIfSomethingOrDefault, - mapIfSomethingOrBlank, - configFolder, - fieldDefinitions, - isNothing, - not, - switchCase, - defaultCase, - StartsWith, - contains, - templateDefinitions, - handleErrorWith, - handleErrorWithUndefined, - tryOr, - tryOrIgnore, - tryAwaitOr, - tryAwaitOrIgnore, - dirIndex, - keySep, - $, - $$, - getDirFomKey, - getFileFromKey, - splitKey, - somethingOrDefault, - getIndexKeyFromFileKey, - joinKey, - somethingOrGetDefault, - appDefinitionFile, - isValue, - all, - isOneOf, - memberMatches, - defineError, - anyTrue, - isNonEmptyArray, - causesException, - executesWithoutException, - none, - getHashCode, - awEx, - apiWrapper, - events, - eventsList, - isNothingOrEmpty, - isSafeInteger, - toNumber: fp.toNumber, - toDate: toDateOrNull, - toBool: toBoolOrNull, - isArrayOfString, - getLock, - NO_LOCK, - isNolock, - insensitiveEquals, - pause, - retry, - pushAll -}; - -const stringNotEmpty = s => isSomething(s) && s.trim().length > 0; - -const makerule = (field, error, isValid) => ({ field, error, isValid }); - -const validationError = (rule, item) => ({ ...rule, item }); - -const applyRuleSet = ruleSet => itemToValidate => $(ruleSet, [ - fp.map(applyRule(itemToValidate)), - fp.filter(isSomething), -]); - -const applyRule = itemTovalidate => rule => (rule.isValid(itemTovalidate) - ? null - : validationError(rule, itemTovalidate)); - -const filterEval = 'FILTER_EVALUATE'; -const filterCompile = 'FILTER_COMPILE'; -const mapEval = 'MAP_EVALUATE'; -const mapCompile = 'MAP_COMPILE'; - - -const getEvaluateResult = () => ({ - isError: false, - passedFilter: true, - result: null, -}); - -const compileFilter = index => compilerUtil.compileExpression(index.filter); - -const compileMap = index => compilerUtil.compileCode(index.map); - -const passesFilter = (record, index) => { - const context = { record }; - if (!index.filter) return true; - - const compiledFilter = defineError( - () => compileFilter(index), - filterCompile, - ); - - return defineError( - () => compiledFilter(context), - filterEval, - ); -}; - -const mapRecord = (record, index) => { - const recordClone = fp.cloneDeep(record); - const context = { record: recordClone }; - - const map = index.map ? index.map : 'return {...record};'; - - const compiledMap = defineError( - () => compilerUtil.compileCode(map), - mapCompile, - ); - - const mapped = defineError( - () => compiledMap(context), - mapEval, - ); - - const mappedKeys = fp.keys(mapped); - for (let i = 0; i < mappedKeys.length; i++) { - const key = mappedKeys[i]; - mapped[key] = fp.isUndefined(mapped[key]) ? null : mapped[key]; - if (fp.isFunction(mapped[key])) { - delete mapped[key]; - } - } - - mapped.key = record.key; - mapped.sortKey = index.getSortKey - ? compilerUtil.compileCode(index.getSortKey)(context) - : record.id; - - return mapped; -}; - -const evaluate = record => (index) => { - const result = getEvaluateResult(); - - try { - result.passedFilter = passesFilter(record, index); - } catch (err) { - result.isError = true; - result.passedFilter = false; - result.result = err.message; - } - - if (!result.passedFilter) return result; - - try { - result.result = mapRecord(record, index); - } catch (err) { - result.isError = true; - result.result = err.message; - } - - return result; -}; - -const indexTypes = { reference: 'reference', ancestor: 'ancestor' }; - -const indexRuleSet = [ - makerule('map', 'index has no map function', - index => isNonEmptyString(index.map)), - makerule('map', "index's map function does not compile", - index => !isNonEmptyString(index.map) - || executesWithoutException(() => compileMap(index))), - makerule('filter', "index's filter function does not compile", - index => !isNonEmptyString(index.filter) - || executesWithoutException(() => compileFilter(index))), - makerule('name', 'must declare a name for index', - index => isNonEmptyString(index.name)), - makerule('name', 'there is a duplicate named index on this node', - index => fp.isEmpty(index.name) - || fp.countBy('name')(index.parent().indexes)[index.name] === 1), - makerule('indexType', 'reference index may only exist on a record node', - index => isRecord(index.parent()) - || index.indexType !== indexTypes.reference), - makerule('indexType', `index type must be one of: ${fp.join(', ')(fp.keys(indexTypes))}`, - index => fp.includes(index.indexType)(fp.keys(indexTypes))), -]; - -const getFlattenedHierarchy = (appHierarchy, useCached = true) => { - if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { return appHierarchy.getFlattenedHierarchy(); } - - const flattenHierarchy = (currentNode, flattened) => { - flattened.push(currentNode); - if ((!currentNode.children - || currentNode.children.length === 0) - && (!currentNode.indexes - || currentNode.indexes.length === 0) - && (!currentNode.aggregateGroups - || currentNode.aggregateGroups.length === 0)) { - return flattened; - } - - const unionIfAny = l2 => l1 => fp.union(l1)(!l2 ? [] : l2); - - const children = $([], [ - unionIfAny(currentNode.children), - unionIfAny(currentNode.indexes), - unionIfAny(currentNode.aggregateGroups), - ]); - - for (const child of children) { - flattenHierarchy(child, flattened); - } - return flattened; - }; - - appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []); - return appHierarchy.getFlattenedHierarchy(); -}; - -const getLastPartInKey = key => fp.last(splitKey(key)); - -const getNodesInPath = appHierarchy => key => $(appHierarchy, [ - getFlattenedHierarchy, - fp.filter(n => new RegExp(`${n.pathRegx()}`).test(key)), -]); - -const getExactNodeForKey = appHierarchy => key => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => new RegExp(`${n.pathRegx()}$`).test(key)), -]); - -const getNodeForCollectionPath = appHierarchy => collectionKey => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => (isCollectionRecord(n) - && new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey))), -]); - -const hasMatchingAncestor = ancestorPredicate => decendantNode => switchCase( - - [node => isNothing(node.parent()), - fp.constant(false)], - - [node => ancestorPredicate(node.parent()), - fp.constant(true)], - - [defaultCase, - node => hasMatchingAncestor(ancestorPredicate)(node.parent())], - -)(decendantNode); - -const getNode = (appHierarchy, nodeKey) => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => n.nodeKey() === nodeKey - || (isCollectionRecord(n) - && n.collectionNodeKey() === nodeKey)), -]); - -const getCollectionNode = (appHierarchy, nodeKey) => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => (isCollectionRecord(n) - && n.collectionNodeKey() === nodeKey)), -]); - -const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getExactNodeForKey(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) - ? getNode(appHierarchy, keyOrNodeKey) - : nodeByKey; -}; - -const getCollectionNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getNodeForCollectionPath(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) - ? getCollectionNode(appHierarchy, keyOrNodeKey) - : nodeByKey; -}; - -const isNode = (appHierarchy, key) => isSomething(getExactNodeForKey(appHierarchy)(key)); - -const getActualKeyOfParent = (parentNodeKey, actualChildKey) => - $(actualChildKey, [ - splitKey, - fp.take(splitKey(parentNodeKey).length), - ks => joinKey(...ks), - ]); - -const getParentKey = (key) => { - return $(key, [ - splitKey, - fp.take(splitKey(key).length - 1), - joinKey, - ]); -}; - -const isKeyAncestorOf = ancestorKey => decendantNode => hasMatchingAncestor(p => p.nodeKey() === ancestorKey)(decendantNode); - -const hasNoMatchingAncestors = parentPredicate => node => !hasMatchingAncestor(parentPredicate)(node); - -const findField = (recordNode, fieldName) => fp.find(f => f.name == fieldName)(recordNode.fields); - -const isAncestor = decendant => ancestor => isKeyAncestorOf(ancestor.nodeKey())(decendant); - -const isDecendant = ancestor => decendant => isAncestor(decendant)(ancestor); - -const getRecordNodeId = recordKey => $(recordKey, [ - splitKey, - fp.last, - getRecordNodeIdFromId, -]); - -const getRecordNodeIdFromId = recordId => $(recordId, [fp.split('-'), fp.first, parseInt]); - -const getRecordNodeById = (hierarchy, recordId) => $(hierarchy, [ - getFlattenedHierarchy, - fp.find(n => isRecord(n) - && n.nodeId === getRecordNodeIdFromId(recordId)), -]); - -const recordNodeIdIsAllowed = indexNode => nodeId => indexNode.allowedRecordNodeIds.length === 0 - || fp.includes(nodeId)(indexNode.allowedRecordNodeIds); - -const recordNodeIsAllowed = indexNode => recordNode => recordNodeIdIsAllowed(indexNode)(recordNode.nodeId); - -const getAllowedRecordNodesForIndex = (appHierarchy, indexNode) => { - const recordNodes = $(appHierarchy, [ - getFlattenedHierarchy, - fp.filter(isRecord), - ]); - - if (isGlobalIndex(indexNode)) { - return $(recordNodes, [ - fp.filter(recordNodeIsAllowed(indexNode)), - ]); - } - - if (isAncestorIndex(indexNode)) { - return $(recordNodes, [ - fp.filter(isDecendant(indexNode.parent())), - fp.filter(recordNodeIsAllowed(indexNode)), - ]); - } - - if (isReferenceIndex(indexNode)) { - return $(recordNodes, [ - fp.filter(n => fp.some(fieldReversesReferenceToIndex(indexNode))(n.fields)), - ]); - } -}; - -const getNodeFromNodeKeyHash = hierarchy => hash => $(hierarchy, [ - getFlattenedHierarchy, - fp.find(n => getHashCode(n.nodeKey()) === hash), -]); - -const isRecord = node => isSomething(node) && node.type === 'record'; -const isSingleRecord = node => isRecord(node) && node.isSingle; -const isCollectionRecord = node => isRecord(node) && !node.isSingle; -const isIndex = node => isSomething(node) && node.type === 'index'; -const isaggregateGroup = node => isSomething(node) && node.type === 'aggregateGroup'; -const isShardedIndex = node => isIndex(node) && isNonEmptyString(node.getShardName); -const isRoot = node => isSomething(node) && node.isRoot(); -const isDecendantOfARecord = hasMatchingAncestor(isRecord); -const isGlobalIndex = node => isIndex(node) && isRoot(node.parent()); -const isReferenceIndex = node => isIndex(node) && node.indexType === indexTypes.reference; -const isAncestorIndex = node => isIndex(node) && node.indexType === indexTypes.ancestor; - -const fieldReversesReferenceToNode = node => field => field.type === 'reference' - && fp.intersection(field.typeOptions.reverseIndexNodeKeys)(fp.map(i => i.nodeKey())(node.indexes)) - .length > 0; - -const fieldReversesReferenceToIndex = indexNode => field => field.type === 'reference' - && fp.intersection(field.typeOptions.reverseIndexNodeKeys)([indexNode.nodeKey()]) - .length > 0; - -var hierarchy = { - getLastPartInKey, - getNodesInPath, - getExactNodeForKey, - hasMatchingAncestor, - getNode, - getNodeByKeyOrNodeKey, - isNode, - getActualKeyOfParent, - getParentKey, - isKeyAncestorOf, - hasNoMatchingAncestors, - findField, - isAncestor, - isDecendant, - getRecordNodeId, - getRecordNodeIdFromId, - getRecordNodeById, - recordNodeIdIsAllowed, - recordNodeIsAllowed, - getAllowedRecordNodesForIndex, - getNodeFromNodeKeyHash, - isRecord, - isCollectionRecord, - isIndex, - isaggregateGroup, - isShardedIndex, - isRoot, - isDecendantOfARecord, - isGlobalIndex, - isReferenceIndex, - isAncestorIndex, - fieldReversesReferenceToNode, - fieldReversesReferenceToIndex, - getFlattenedHierarchy, -}; - -const getSafeFieldParser = (tryParse, defaultValueFunctions) => (field, record) => { - if (fp.has(field.name)(record)) { - return getSafeValueParser(tryParse, defaultValueFunctions)(record[field.name]); - } - return defaultValueFunctions[field.getUndefinedValue](); -}; - -const getSafeValueParser = (tryParse, defaultValueFunctions) => (value) => { - const parsed = tryParse(value); - if (parsed.success) { - return parsed.value; - } - return defaultValueFunctions.default(); -}; - -const getNewValue = (tryParse, defaultValueFunctions) => (field) => { - const getInitialValue = fp.isUndefined(field) || fp.isUndefined(field.getInitialValue) - ? 'default' - : field.getInitialValue; - - return fp.has(getInitialValue)(defaultValueFunctions) - ? defaultValueFunctions[getInitialValue]() - : getSafeValueParser(tryParse, defaultValueFunctions)(getInitialValue); -}; - -const typeFunctions = specificFunctions => _.merge({ - value: fp.constant, - null: fp.constant(null), -}, specificFunctions); - -const validateTypeConstraints = validationRules => async (field, record, context) => { - const fieldValue = record[field.name]; - const validateRule = async r => (!await r.isValid(fieldValue, field.typeOptions, context) - ? r.getMessage(fieldValue, field.typeOptions) - : ''); - - const errors = []; - for (const r of validationRules) { - const err = await validateRule(r); - if (isNotEmpty(err)) errors.push(err); - } - - return errors; -}; - -const getDefaultOptions = fp.mapValues(v => v.defaultValue); - -const makerule$1 = (isValid, getMessage) => ({ isValid, getMessage }); -const parsedFailed = val => ({ success: false, value: val }); -const parsedSuccess = val => ({ success: true, value: val }); -const getDefaultExport = (name, tryParse, functions, options, validationRules, sampleValue, stringify) => ({ - getNew: getNewValue(tryParse, functions), - safeParseField: getSafeFieldParser(tryParse, functions), - safeParseValue: getSafeValueParser(tryParse, functions), - tryParse, - name, - getDefaultOptions: () => getDefaultOptions(fp.cloneDeep(options)), - optionDefinitions: options, - validateTypeConstraints: validateTypeConstraints(validationRules), - sampleValue, - stringify: val => (val === null || val === undefined - ? '' : stringify(val)), - getDefaultValue: functions.default, -}); - -const stringFunctions = typeFunctions({ - default: fp.constant(null), -}); - -const stringTryParse = switchCase( - [fp.isString, parsedSuccess], - [fp.isNull, parsedSuccess], - [defaultCase, v => parsedSuccess(v.toString())], -); - -const options = { - maxLength: { - defaultValue: null, - isValid: n => n === null || isSafeInteger(n) && n > 0, - requirementDescription: 'max length must be null (no limit) or a greater than zero integer', - parse: toNumberOrNull, - }, - values: { - defaultValue: null, - isValid: v => v === null || (isArrayOfString(v) && v.length > 0 && v.length < 10000), - requirementDescription: "'values' must be null (no values) or an arry of at least one string", - parse: s => s, - }, - allowDeclaredValuesOnly: { - defaultValue: false, - isValid: fp.isBoolean, - requirementDescription: 'allowDeclaredValuesOnly must be true or false', - parse: toBoolOrNull, - }, -}; - -const typeConstraints = [ - makerule$1(async (val, opts) => val === null || opts.maxLength === null || val.length <= opts.maxLength, - (val, opts) => `value exceeds maximum length of ${opts.maxLength}`), - makerule$1(async (val, opts) => val === null - || opts.allowDeclaredValuesOnly === false - || fp.includes(val)(opts.values), - (val) => `"${val}" does not exist in the list of allowed values`), -]; - -var string = getDefaultExport( - 'string', - stringTryParse, - stringFunctions, - options, - typeConstraints, - 'abcde', - str => str, -); - -const boolFunctions = typeFunctions({ - default: fp.constant(null), -}); - -const boolTryParse = switchCase( - [fp.isBoolean, parsedSuccess], - [fp.isNull, parsedSuccess], - [isOneOf('true', '1', 'yes', 'on'), () => parsedSuccess(true)], - [isOneOf('false', '0', 'no', 'off'), () => parsedSuccess(false)], - [defaultCase, parsedFailed], -); - -const options$1 = { - allowNulls: { - defaultValue: true, - isValid: fp.isBoolean, - requirementDescription: 'must be a true or false', - parse: toBoolOrNull, - }, -}; - -const typeConstraints$1 = [ - makerule$1(async (val, opts) => opts.allowNulls === true || val !== null, - () => 'field cannot be null'), -]; - -var bool = getDefaultExport( - 'bool', boolTryParse, boolFunctions, - options$1, typeConstraints$1, true, JSON.stringify, -); - -const numberFunctions = typeFunctions({ - default: fp.constant(null), -}); - -const parseStringtoNumberOrNull = (s) => { - const num = Number(s); - return isNaN(num) ? parsedFailed(s) : parsedSuccess(num); -}; - -const numberTryParse = switchCase( - [fp.isNumber, parsedSuccess], - [fp.isString, parseStringtoNumberOrNull], - [fp.isNull, parsedSuccess], - [defaultCase, parsedFailed], -); - -const options$2 = { - maxValue: { - defaultValue: Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: 'must be a valid integer', - parse: toNumberOrNull, - }, - minValue: { - defaultValue: 0 - Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: 'must be a valid integer', - parse: toNumberOrNull, - }, - decimalPlaces: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, -}; - -const getDecimalPlaces = (val) => { - const splitDecimal = val.toString().split('.'); - if (splitDecimal.length === 1) return 0; - return splitDecimal[1].length; -}; - -const typeConstraints$2 = [ - makerule$1(async (val, opts) => val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => `value (${val.toString()}) must be greater than or equal to ${opts.minValue}`), - makerule$1(async (val, opts) => val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => `value (${val.toString()}) must be less than or equal to ${opts.minValue} options`), - makerule$1(async (val, opts) => val === null || opts.decimalPlaces >= getDecimalPlaces(val), - (val, opts) => `value (${val.toString()}) must have ${opts.decimalPlaces} decimal places or less`), -]; - -var number = getDefaultExport( - 'number', - numberTryParse, - numberFunctions, - options$2, - typeConstraints$2, - 1, - num => num.toString(), -); - -const dateFunctions = typeFunctions({ - default: fp.constant(null), - now: () => new Date(), -}); - -const isValidDate = d => d instanceof Date && !isNaN(d); - -const parseStringToDate = s => switchCase( - [isValidDate, parsedSuccess], - [defaultCase, parsedFailed], -)(new Date(s)); - - -const dateTryParse = switchCase( - [fp.isDate, parsedSuccess], - [fp.isString, parseStringToDate], - [fp.isNull, parsedSuccess], - [defaultCase, parsedFailed], -); - -const options$3 = { - maxValue: { - defaultValue: new Date(32503680000000), - isValid: fp.isDate, - requirementDescription: 'must be a valid date', - parse: toDateOrNull, - }, - minValue: { - defaultValue: new Date(-8520336000000), - isValid: fp.isDate, - requirementDescription: 'must be a valid date', - parse: toDateOrNull, - }, -}; - -const typeConstraints$3 = [ - makerule$1(async (val, opts) => val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => `value (${val.toString()}) must be greater than or equal to ${opts.minValue}`), - makerule$1(async (val, opts) => val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => `value (${val.toString()}) must be less than or equal to ${opts.minValue} options`), -]; - -var datetime = getDefaultExport( - 'datetime', - dateTryParse, - dateFunctions, - options$3, - typeConstraints$3, - new Date(1984, 4, 1), - date => JSON.stringify(date).replace(new RegExp('"', 'g'), ''), -); - -const arrayFunctions = () => typeFunctions({ - default: fp.constant([]), -}); - -const mapToParsedArrary = type => $$( - fp.map(i => type.safeParseValue(i)), - parsedSuccess, -); - -const arrayTryParse = type => switchCase( - [fp.isArray, mapToParsedArrary(type)], - [defaultCase, parsedFailed], -); - -const typeName = type => `array<${type}>`; - - -const options$4 = { - maxLength: { - defaultValue: 10000, - isValid: isSafeInteger, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, - minLength: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, -}; - -const typeConstraints$4 = [ - makerule$1(async (val, opts) => val === null || val.length >= opts.minLength, - (val, opts) => `must choose ${opts.minLength} or more options`), - makerule$1(async (val, opts) => val === null || val.length <= opts.maxLength, - (val, opts) => `cannot choose more than ${opts.maxLength} options`), -]; - -var array = type => getDefaultExport( - typeName(type.name), - arrayTryParse(type), - arrayFunctions(), - options$4, - typeConstraints$4, - [type.sampleValue], - JSON.stringify, -); - -const referenceNothing = () => ({ key: '' }); - -const referenceFunctions = typeFunctions({ - default: referenceNothing, -}); - -const hasStringValue = (ob, path) => fp.has(path)(ob) - && fp.isString(ob[path]); - -const isObjectWithKey = v => fp.isObjectLike(v) - && hasStringValue(v, 'key'); - -const tryParseFromString = s => { - - try { - const asObj = JSON.parse(s); - if(isObjectWithKey) { - return parsedSuccess(asObj); - } - } - catch(_) { - // EMPTY - } - - return parsedFailed(s); -}; - -const referenceTryParse = v => switchCase( - [isObjectWithKey, parsedSuccess], - [fp.isString, tryParseFromString], - [fp.isNull, () => parsedSuccess(referenceNothing())], - [defaultCase, parsedFailed], -)(v); - -const options$5 = { - indexNodeKey: { - defaultValue: null, - isValid: isNonEmptyString, - requirementDescription: 'must be a non-empty string', - parse: s => s, - }, - displayValue: { - defaultValue: '', - isValid: isNonEmptyString, - requirementDescription: 'must be a non-empty string', - parse: s => s, - }, - reverseIndexNodeKeys: { - defaultValue: null, - isValid: v => isArrayOfString(v) && v.length > 0, - requirementDescription: 'must be a non-empty array of strings', - parse: s => s, - }, -}; - -const isEmptyString = s => fp.isString(s) && fp.isEmpty(s); - -const ensureReferenceExists = async (val, opts, context) => isEmptyString(val.key) - || await context.referenceExists(opts, val.key); - -const typeConstraints$5 = [ - makerule$1( - ensureReferenceExists, - (val, opts) => `"${val[opts.displayValue]}" does not exist in options list (key: ${val.key})`, - ), -]; - -var reference = getDefaultExport( - 'reference', - referenceTryParse, - referenceFunctions, - options$5, - typeConstraints$5, - { key: 'key', value: 'value' }, - JSON.stringify, -); - -const illegalCharacters = '*?\\/:<>|\0\b\f\v'; - -const isLegalFilename = (filePath) => { - const fn = fileName(filePath); - return fn.length <= 255 - && fp.intersection(fn.split(''))(illegalCharacters.split('')).length === 0 - && none(f => f === '..')(splitKey(filePath)); -}; - -const fileNothing = () => ({ relativePath: '', size: 0 }); - -const fileFunctions = typeFunctions({ - default: fileNothing, -}); - -const fileTryParse = v => switchCase( - [isValidFile, parsedSuccess], - [fp.isNull, () => parsedSuccess(fileNothing())], - [defaultCase, parsedFailed], -)(v); - -const fileName = filePath => $(filePath, [ - splitKey, - fp.last, -]); - -const isValidFile = f => !fp.isNull(f) - && fp.has('relativePath')(f) && fp.has('size')(f) - && fp.isNumber(f.size) - && fp.isString(f.relativePath) - && isLegalFilename(f.relativePath); - -const options$6 = {}; - -const typeConstraints$6 = []; - -var file = getDefaultExport( - 'file', - fileTryParse, - fileFunctions, - options$6, - typeConstraints$6, - { relativePath: 'some_file.jpg', size: 1000 }, - JSON.stringify, -); - -const allTypes = () => { - const basicTypes = { - string, number, datetime, bool, reference, file, - }; - - const arrays = $(basicTypes, [ - fp.keys, - fp.map((k) => { - const kvType = {}; - const concreteArray = array(basicTypes[k]); - kvType[concreteArray.name] = concreteArray; - return kvType; - }), - types => _.assign({}, ...types), - ]); - - return _.merge({}, basicTypes, arrays); -}; - - -const all$1 = allTypes(); - -const getType = (typeName) => { - if (!fp.has(typeName)(all$1)) throw new BadRequestError(`Do not recognise type ${typeName}`); - return all$1[typeName]; -}; - -const getSampleFieldValue = field => getType(field.type).sampleValue; - -const getNewFieldValue = field => getType(field.type).getNew(field); - -const safeParseField = (field, record) => getType(field.type).safeParseField(field, record); - -const validateFieldParse = (field, record) => (fp.has(field.name)(record) - ? getType(field.type).tryParse(record[field.name]) - : parsedSuccess(undefined)); // fields may be undefined by default - -const getDefaultOptions$1 = type => getType(type).getDefaultOptions(); - -const validateTypeConstraints$1 = async (field, record, context) => await getType(field.type).validateTypeConstraints(field, record, context); - -const detectType = (value) => { - if (fp.isString(value)) return string; - if (fp.isBoolean(value)) return bool; - if (fp.isNumber(value)) return number; - if (fp.isDate(value)) return datetime; - if (fp.isArray(value)) return array(detectType(value[0])); - if (fp.isObject(value) - && fp.has('key')(value) - && fp.has('value')(value)) return reference; - if (fp.isObject(value) - && fp.has('relativePath')(value) - && fp.has('size')(value)) return file; - - throw new BadRequestError(`cannot determine type: ${JSON.stringify(value)}`); -}; - -// 5 minutes -const tempCodeExpiryLength = 5 * 60 * 1000; - -const AUTH_FOLDER = '/.auth'; -const USERS_LIST_FILE = joinKey(AUTH_FOLDER, 'users.json'); -const userAuthFile = username => joinKey(AUTH_FOLDER, `auth_${username}.json`); -const USERS_LOCK_FILE = joinKey(AUTH_FOLDER, 'users_lock'); -const ACCESS_LEVELS_FILE = joinKey(AUTH_FOLDER, 'access_levels.json'); -const ACCESS_LEVELS_LOCK_FILE = joinKey(AUTH_FOLDER, 'access_levels_lock'); - -const permissionTypes = { - CREATE_RECORD: 'create record', - UPDATE_RECORD: 'update record', - READ_RECORD: 'read record', - DELETE_RECORD: 'delete record', - READ_INDEX: 'read index', - MANAGE_INDEX: 'manage index', - MANAGE_COLLECTION: 'manage collection', - WRITE_TEMPLATES: 'write templates', - CREATE_USER: 'create user', - SET_PASSWORD: 'set password', - CREATE_TEMPORARY_ACCESS: 'create temporary access', - ENABLE_DISABLE_USER: 'enable or disable user', - WRITE_ACCESS_LEVELS: 'write access levels', - LIST_USERS: 'list users', - LIST_ACCESS_LEVELS: 'list access levels', - EXECUTE_ACTION: 'execute action', - SET_USER_ACCESS_LEVELS: 'set user access levels', -}; - -const getUserByName = (users, name) => $(users, [ - fp.find(u => u.name.toLowerCase() === name.toLowerCase()), -]); - -const stripUserOfSensitiveStuff = (user) => { - const stripped = fp.clone(user); - delete stripped.tempCode; - return stripped; -}; - -const parseTemporaryCode = fullCode => $(fullCode, [ - fp.split(':'), - parts => ({ - id: parts[1], - code: parts[2], - }), -]); - -const isAuthorized = app => (permissionType, resourceKey) => apiWrapperSync( - app, - events.authApi.isAuthorized, - alwaysAuthorized, - { resourceKey, permissionType }, - _isAuthorized, app, permissionType, resourceKey, -); - -const _isAuthorized = (app, permissionType, resourceKey) => { - if (!app.user) { - return false; - } - - const validType = $(permissionTypes, [ - fp.values, - fp.includes(permissionType), - ]); - - if (!validType) { - return false; - } - - const permMatchesResource = (userperm) => { - const nodeKey = isNothing(resourceKey) - ? null - : isNode(app.hierarchy, resourceKey) - ? getNodeByKeyOrNodeKey( - app.hierarchy, resourceKey, - ).nodeKey() - : resourceKey; - - return (userperm.type === permissionType) - && ( - isNothing(resourceKey) - || nodeKey === userperm.nodeKey - ); - }; - - return $(app.user.permissions, [ - fp.some(permMatchesResource), - ]); -}; - -const nodePermission = type => ({ - add: (nodeKey, accessLevel) => accessLevel.permissions.push({ type, nodeKey }), - isAuthorized: resourceKey => app => isAuthorized(app)(type, resourceKey), - isNode: true, - get: nodeKey => ({ type, nodeKey }), -}); - -const staticPermission = type => ({ - add: accessLevel => accessLevel.permissions.push({ type }), - isAuthorized: app => isAuthorized(app)(type), - isNode: false, - get: () => ({ type }), -}); - -const createRecord = nodePermission(permissionTypes.CREATE_RECORD); - -const updateRecord = nodePermission(permissionTypes.UPDATE_RECORD); - -const deleteRecord = nodePermission(permissionTypes.DELETE_RECORD); - -const readRecord = nodePermission(permissionTypes.READ_RECORD); - -const writeTemplates = staticPermission(permissionTypes.WRITE_TEMPLATES); - -const createUser = staticPermission(permissionTypes.CREATE_USER); - -const setPassword = staticPermission(permissionTypes.SET_PASSWORD); - -const readIndex = nodePermission(permissionTypes.READ_INDEX); - -const manageIndex = staticPermission(permissionTypes.MANAGE_INDEX); - -const manageCollection = staticPermission(permissionTypes.MANAGE_COLLECTION); - -const createTemporaryAccess = staticPermission(permissionTypes.CREATE_TEMPORARY_ACCESS); - -const enableDisableUser = staticPermission(permissionTypes.ENABLE_DISABLE_USER); - -const writeAccessLevels = staticPermission(permissionTypes.WRITE_ACCESS_LEVELS); - -const listUsers = staticPermission(permissionTypes.LIST_USERS); - -const listAccessLevels = staticPermission(permissionTypes.LIST_ACCESS_LEVELS); - -const setUserAccessLevels = staticPermission(permissionTypes.SET_USER_ACCESS_LEVELS); - -const executeAction = nodePermission(permissionTypes.EXECUTE_ACTION); - -const alwaysAuthorized = () => true; - -const permission = { - createRecord, - updateRecord, - deleteRecord, - readRecord, - writeTemplates, - createUser, - setPassword, - readIndex, - createTemporaryAccess, - enableDisableUser, - writeAccessLevels, - listUsers, - listAccessLevels, - manageIndex, - manageCollection, - executeAction, - setUserAccessLevels, -}; - -const getNew = app => (collectionKey, recordTypeName) => { - const recordNode = getRecordNode(app, collectionKey); - collectionKey=safeKey(collectionKey); - return apiWrapperSync( - app, - events.recordApi.getNew, - permission.createRecord.isAuthorized(recordNode.nodeKey()), - { collectionKey, recordTypeName }, - _getNew, recordNode, collectionKey, - ); -}; - -const _getNew = (recordNode, collectionKey) => constructRecord(recordNode, getNewFieldValue, collectionKey); - -const getRecordNode = (app, collectionKey) => { - collectionKey = safeKey(collectionKey); - return getNodeForCollectionPath(app.hierarchy)(collectionKey); -}; - -const getNewChild = app => (recordKey, collectionName, recordTypeName) => - getNew(app)(joinKey(recordKey, collectionName), recordTypeName); - -const constructRecord = (recordNode, getFieldValue, collectionKey) => { - const record = $(recordNode.fields, [ - fp.keyBy('name'), - fp.mapValues(getFieldValue), - ]); - - record.id = `${recordNode.nodeId}-${shortid.generate()}`; - record.key = isSingleRecord(recordNode) - ? joinKey(collectionKey, recordNode.name) - : joinKey(collectionKey, record.id); - record.isNew = true; - record.type = recordNode.name; - return record; -}; - -const allIdChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'; - -// this should never be changed - ever -// - existing databases depend on the order of chars this string - -/** - * folderStructureArray should return an array like - * - [1] = all records fit into one folder - * - [2] = all records fite into 2 folders - * - [64, 3] = all records fit into 64 * 3 folders - * - [64, 64, 10] = all records fit into 64 * 64 * 10 folder - * (there are 64 possible chars in allIsChars) -*/ -const folderStructureArray = (recordNode) => { - - const totalFolders = Math.ceil(recordNode.estimatedRecordCount / 1000); - const folderArray = []; - let levelCount = 1; - while(64**levelCount < totalFolders) { - levelCount += 1; - folderArray.push(64); - } - - const parentFactor = (64**folderArray.length); - if(parentFactor < totalFolders) { - folderArray.push( - Math.ceil(totalFolders / parentFactor) - ); - } - - return folderArray; - - /* - const maxRecords = currentFolderPosition === 0 - ? RECORDS_PER_FOLDER - : currentFolderPosition * 64 * RECORDS_PER_FOLDER; - - if(maxRecords < recordNode.estimatedRecordCount) { - return folderStructureArray( - recordNode, - [...currentArray, 64], - currentFolderPosition + 1); - } else { - const childFolderCount = Math.ceil(recordNode.estimatedRecordCount / maxRecords ); - return [...currentArray, childFolderCount] - }*/ -}; - - -const getAllIdsIterator = app => async (collection_Key_or_NodeKey) => { - collection_Key_or_NodeKey = safeKey(collection_Key_or_NodeKey); - const recordNode = getCollectionNodeByKeyOrNodeKey( - app.hierarchy, - collection_Key_or_NodeKey, - ); - - const getAllIdsIteratorForCollectionKey = async (recordNode, collectionKey) => { - - const folderStructure = folderStructureArray(recordNode); - - let currentFolderContents = []; - let currentPosition = []; - - const collectionDir = getCollectionDir(app.hierarchy, collectionKey); - const basePath = joinKey( - collectionDir, recordNode.nodeId.toString()); - - - - // "folderStructure" determines the top, sharding folders - // we need to add one, for the collection root folder, which - // always exists - const levels = folderStructure.length + 1; - const topLevel = levels -1; - - - /* populate initial directory structure in form: - [ - {path: "/a", contents: ["b", "c", "d"]}, - {path: "/a/b", contents: ["e","f","g"]}, - {path: "/a/b/e", contents: ["1-abcd","2-cdef","3-efgh"]}, - ] - // stores contents on each parent level - // top level has ID folders - */ - const firstFolder = async () => { - - let folderLevel = 0; - - const lastPathHasContent = () => - folderLevel === 0 - || currentFolderContents[folderLevel - 1].contents.length > 0; - - - while (folderLevel <= topLevel && lastPathHasContent()) { - - let thisPath = basePath; - for(let lev = 0; lev < currentPosition.length; lev++) { - thisPath = joinKey( - thisPath, currentFolderContents[lev].contents[0]); - } - - const contentsThisLevel = - await app.datastore.getFolderContents(thisPath); - currentFolderContents.push({ - contents:contentsThisLevel, - path: thisPath - }); - - // should start as something like [0,0] - if(folderLevel < topLevel) - currentPosition.push(0); - - folderLevel+=1; - } - - return (currentPosition.length === levels - 1); - }; - - const isOnLastFolder = level => { - - const result = currentPosition[level] === currentFolderContents[level].contents.length - 1; - return result; - }; - - const getNextFolder = async (lev=undefined) => { - lev = fp.isUndefined(lev) ? topLevel : lev; - const parentLev = lev - 1; - - if(parentLev < 0) return false; - - if(isOnLastFolder(parentLev)) { - return await getNextFolder(parentLev); - } - - const newPosition = currentPosition[parentLev] + 1; - currentPosition[parentLev] = newPosition; - - const nextFolder = joinKey( - currentFolderContents[parentLev].path, - currentFolderContents[parentLev].contents[newPosition]); - currentFolderContents[lev].contents = await app.datastore.getFolderContents( - nextFolder - ); - currentFolderContents[lev].path = nextFolder; - - if(lev !== topLevel) { - - // we just advanced a parent folder, so now need to - // do the same to the next levels - let loopLevel = lev + 1; - while(loopLevel <= topLevel) { - const loopParentLevel = loopLevel-1; - - currentPosition[loopParentLevel] = 0; - const nextLoopFolder = joinKey( - currentFolderContents[loopParentLevel].path, - currentFolderContents[loopParentLevel].contents[0]); - currentFolderContents[loopLevel].contents = await app.datastore.getFolderContents( - nextLoopFolder - ); - currentFolderContents[loopLevel].path = nextLoopFolder; - loopLevel+=1; - } - } - - // true ==has more ids... (just loaded more) - return true; - }; - - - const idsCurrentFolder = () => - currentFolderContents[currentFolderContents.length - 1].contents; - - const fininshedResult = ({ done: true, result: { ids: [], collectionKey } }); - - let hasStarted = false; - let hasMore = true; - const getIdsFromCurrentfolder = async () => { - - if(!hasMore) { - return fininshedResult; - } - - if(!hasStarted) { - hasMore = await firstFolder(); - hasStarted = true; - return ({ - result: { - ids: idsCurrentFolder(), - collectionKey - }, - done: false - }) - } - - hasMore = await getNextFolder(); - - return ({ - result: { - ids: hasMore ? idsCurrentFolder() : [], - collectionKey - }, - done: !hasMore - }); - }; - - return getIdsFromCurrentfolder; - - }; - - const ancestors = $(getFlattenedHierarchy(app.hierarchy), [ - fp.filter(isCollectionRecord), - fp.filter(n => isAncestor(recordNode)(n) - || n.nodeKey() === recordNode.nodeKey()), - fp.orderBy([n => n.nodeKey().length], ['asc']), - ]); // parents first - - const traverseForIteraterators = async (parentRecordKey = '', currentNodeIndex = 0) => { - const currentNode = ancestors[currentNodeIndex]; - const currentCollectionKey = joinKey( - parentRecordKey, - currentNode.collectionName, - ); - if (currentNode.nodeKey() === recordNode.nodeKey()) { - return [ - await getAllIdsIteratorForCollectionKey( - currentNode, - currentCollectionKey, - )]; - } - const allIterators = []; - const currentIterator = await getAllIdsIteratorForCollectionKey( - currentNode, - currentCollectionKey, - ); - - let ids = await currentIterator(); - while (ids.done === false) { - for (const id of ids.result.ids) { - allIterators.push( - await traverseForIteraterators( - joinKey(currentCollectionKey, id), - currentNodeIndex + 1, - ), - ); - } - - ids = await currentIterator(); - } - - return fp.flatten(allIterators); - }; - - const iteratorsArray = await traverseForIteraterators(); - let currentIteratorIndex = 0; - return async () => { - if (iteratorsArray.length === 0) { return { done: true, result: [] }; } - const innerResult = await iteratorsArray[currentIteratorIndex](); - if (!innerResult.done) { return innerResult; } - if (currentIteratorIndex == iteratorsArray.length - 1) { - return { done: true, result: innerResult.result }; - } - currentIteratorIndex++; - return { done: false, result: innerResult.result }; - }; -}; - -const getRecordInfo = (hierarchy, key) => { - const recordNode = getExactNodeForKey(hierarchy)(key); - const pathInfo = getRecordDirectory(recordNode, key); - const dir = joinKey(pathInfo.base, ...pathInfo.subdirs); - - return { - recordJson: recordJson(dir), - files: files(dir), - child:(name) => joinKey(dir, name), - key: safeKey(key), - recordNode, pathInfo, dir - }; -}; - -const getCollectionDir = (hierarchy, collectionKey) => { - const recordNode = getNodeForCollectionPath(hierarchy)(collectionKey); - const dummyRecordKey = joinKey(collectionKey, "1-abcd"); - const pathInfo = getRecordDirectory(recordNode, dummyRecordKey); - return pathInfo.base; -}; - -const recordJson = (dir) => - joinKey(dir, "record.json"); - -const files = (dir) => - joinKey(dir, "files"); - -const getRecordDirectory = (recordNode, key) => { - const id = getFileFromKey(key); - - const traverseParentKeys = (n, parents=[]) => { - if(isRoot(n)) return parents; - const k = getActualKeyOfParent(n.nodeKey(), key); - const thisNodeDir = { - node:n, - relativeDir: joinKey( - recordRelativeDirectory(n, getFileFromKey(k))) - }; - return traverseParentKeys( - n.parent(), - [thisNodeDir, ...parents]); - }; - - const parentDirs = $(recordNode.parent(), [ - traverseParentKeys, - fp.reduce((key, item) => { - return joinKey(key, item.node.collectionName, item.relativeDir) - }, keySep) - ]); - - const subdirs = isSingleRecord(recordNode) - ? [] - : recordRelativeDirectory(recordNode, id); - const base = isSingleRecord(recordNode) - ? joinKey(parentDirs, recordNode.name) - : joinKey(parentDirs, recordNode.collectionName); - - return ({ - subdirs, base - }); -}; - -const recordRelativeDirectory = (recordNode, id) => { - const folderStructure = folderStructureArray(recordNode); - const strippedId = id.substring(recordNode.nodeId.toString().length + 1); - const subfolders = $(folderStructure, [ - fp.reduce((result, currentCount) => { - result.folders.push( - folderForChar(strippedId[result.level], currentCount) - ); - return {level:result.level+1, folders:result.folders}; - }, {level:0, folders:[]}), - f => f.folders, - fp.filter(f => !!f) - ]); - - return [recordNode.nodeId.toString(), ...subfolders, id] -}; - -const folderForChar = (char, folderCount) => - folderCount === 1 ? "" - : $(folderCount, [ - idFoldersForFolderCount, - fp.find(f => f.includes(char)) - ]); - -const idFoldersForFolderCount = (folderCount) => { - const charRangePerShard = 64 / folderCount; - const idFolders = []; - let index = 0; - let currentIdsShard = ''; - while (index < 64) { - currentIdsShard += allIdChars[index]; - if ((index + 1) % charRangePerShard === 0) { - idFolders.push(currentIdsShard); - currentIdsShard = ''; - } - index++; - } - - return idFolders; -}; - -const load = app => async key => { - key = safeKey(key); - return apiWrapper( - app, - events.recordApi.load, - permission.readRecord.isAuthorized(key), - { key }, - _load, app, key, - ); -}; - -const _loadFromInfo = async (app, recordInfo, keyStack = []) => { - const key = recordInfo.key; - const {recordNode, recordJson} = recordInfo; - const storedData = await app.datastore.loadJson(recordJson); - - const loadedRecord = $(recordNode.fields, [ - fp.keyBy('name'), - fp.mapValues(f => safeParseField(f, storedData)), - ]); - - const newKeyStack = [...keyStack, key]; - - const references = $(recordNode.fields, [ - fp.filter(f => f.type === 'reference' - && isNonEmptyString(loadedRecord[f.name].key) - && !fp.includes(loadedRecord[f.name].key)(newKeyStack)), - fp.map(f => ({ - promise: _load(app, loadedRecord[f.name].key, newKeyStack), - index: getNode(app.hierarchy, f.typeOptions.indexNodeKey), - field: f, - })), - ]); - - if (references.length > 0) { - const refRecords = await Promise.all( - fp.map(p => p.promise)(references), - ); - - for (const ref of references) { - loadedRecord[ref.field.name] = mapRecord( - refRecords[references.indexOf(ref)], - ref.index, - ); - } - } - - loadedRecord.transactionId = storedData.transactionId; - loadedRecord.isNew = false; - loadedRecord.key = key; - loadedRecord.id = $(key, [splitKey, fp.last]); - loadedRecord.type = recordNode.name; - return loadedRecord; -}; - -const _load = async (app, key, keyStack = []) => - _loadFromInfo( - app, - getRecordInfo(app.hierarchy, key), - keyStack); - -// adapted from https://github.com/dex4er/js-promise-readable -// thanks :) - -const promiseReadableStream = stream => { - - let _errored; - - const _errorHandler = err => { - _errored = err; - }; - - stream.on("error", _errorHandler); - - const read = (size) => { - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err) - } - - if (!stream.readable || stream.closed || stream.destroyed) { - return resolve(); - } - - const readableHandler = () => { - const chunk = stream.read(size); - - if (chunk) { - removeListeners(); - resolve(chunk); - } - }; - - const closeHandler = () => { - removeListeners(); - resolve(); - }; - - const endHandler = () => { - removeListeners(); - resolve(); - }; - - const errorHandler = (err) => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const removeListeners = () => { - stream.removeListener("close", closeHandler); - stream.removeListener("error", errorHandler); - stream.removeListener("end", endHandler); - stream.removeListener("readable", readableHandler); - }; - - stream.on("close", closeHandler); - stream.on("end", endHandler); - stream.on("error", errorHandler); - stream.on("readable", readableHandler); - - readableHandler(); - }); - }; - - - const destroy = () => { - if (stream) { - if (_errorHandler) { - stream.removeListener("error", _errorHandler); - } - if (typeof stream.destroy === "function") { - stream.destroy(); - } - } - }; - - return {read, destroy, stream}; - }; - -const getIndexedDataKey = (indexNode, indexDir, record) => { - - const getShardName = (indexNode, record) => { - const shardNameFunc = compilerUtil.compileCode(indexNode.getShardName); - try { - return shardNameFunc({ record }); - } catch(e) { - const errorDetails = `shardCode: ${indexNode.getShardName} :: record: ${JSON.stringify(record)} :: `; - e.message = "Error running index shardname func: " + errorDetails + e.message; - throw e; - } - }; - - const shardName = isNonEmptyString(indexNode.getShardName) - ? `${getShardName(indexNode, record)}.csv` - : 'index.csv'; - - return joinKey(indexDir, shardName); -}; - -const getShardKeysInRange = async (app, indexNode, indexDir, startRecord = null, endRecord = null) => { - const startShardName = !startRecord - ? null - : shardNameFromKey( - getIndexedDataKey( - indexNode, - indexDir, - startRecord, - ), - ); - - const endShardName = !endRecord - ? null - : shardNameFromKey( - getIndexedDataKey( - indexNode, - indexDir, - endRecord, - ), - ); - - return $(await getShardMap(app.datastore, indexDir), [ - fp.filter(k => (startRecord === null || k >= startShardName) - && (endRecord === null || k <= endShardName)), - fp.map(k => joinKey(indexDir, `${k}.csv`)), - ]); -}; - -const ensureShardNameIsInShardMap = async (store, indexDir, indexedDataKey) => { - const map = await getShardMap(store, indexDir); - const shardName = shardNameFromKey(indexedDataKey); - if (!fp.includes(shardName)(map)) { - map.push(shardName); - await writeShardMap(store, indexDir, map); - } -}; - -const getShardMap = async (datastore, indexDir) => { - const shardMapKey = getShardMapKey(indexDir); - try { - return await datastore.loadJson(shardMapKey); - } catch (_) { - await datastore.createJson(shardMapKey, []); - return []; - } -}; - -const writeShardMap = async (datastore, indexDir, shardMap) => await datastore.updateJson( - getShardMapKey(indexDir), - shardMap, -); - -const getShardMapKey = indexDir => joinKey(indexDir, 'shardMap.json'); - -const getUnshardedIndexDataKey = indexDir => joinKey(indexDir, 'index.csv'); - -const createIndexFile = async (datastore, indexedDataKey, index) => { - if (isShardedIndex(index)) { - const indexDir = getParentKey(indexedDataKey); - const shardMap = await getShardMap(datastore, indexDir); - shardMap.push( - shardNameFromKey(indexedDataKey), - ); - await writeShardMap(datastore, indexDir, shardMap); - } - await datastore.createFile(indexedDataKey, ''); -}; - -const shardNameFromKey = key => $(key, [ - splitKey, - fp.last, -]).replace('.csv', ''); - -const getIndexKey_BasedOnDecendant = (decendantKey, indexNode) => { - if (isGlobalIndex(indexNode)) { return `${indexNode.nodeKey()}`; } - - const indexedDataParentKey = getActualKeyOfParent( - indexNode.parent().nodeKey(), - decendantKey, - ); - - return joinKey( - indexedDataParentKey, - indexNode.name, - ); -}; - -const generateSchema = (hierarchy, indexNode) => { - const recordNodes = getAllowedRecordNodesForIndex(hierarchy, indexNode); - const mappedRecords = $(recordNodes, [ - fp.map(n => mapRecord(createSampleRecord(n), indexNode)), - ]); - - // always has record key and sort key - const schema = { - sortKey: all$1.string, - key: all$1.string, - }; - - const fieldsHas = fp.has(schema); - const setField = (fieldName, value) => { - if (value === null || value === undefined) { return; } - - const thisType = detectType(value); - if (fieldsHas(fieldName)) { - if (schema[fieldName] !== thisType) { - schema[fieldName] = all$1.string; - } - } else { - schema[fieldName] = thisType; - } - }; - - for (const mappedRec of mappedRecords) { - for (const f in mappedRec) { - setField(f, mappedRec[f]); - } - } - - // returing an array of {name, type} - return $(schema, [ - fp.keys, - fp.map(k => ({ name: k, type: schema[k].name })), - fp.filter(s => s.name !== 'sortKey'), - fp.orderBy('name', ['desc']), // reverse aplha - fp.concat([{ name: 'sortKey', type: all$1.string.name }]), // sortKey on end - fp.reverse, // sortKey first, then rest are alphabetical - ]); -}; - -const createSampleRecord = recordNode => constructRecord( - recordNode, - getSampleFieldValue, - recordNode.parent().nodeKey(), -); - -var global$1 = (typeof global !== "undefined" ? global : - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : {}); - -var lookup = []; -var revLookup = []; -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; -var inited = false; -function init () { - inited = true; - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; -} - -function toByteArray (b64) { - if (!inited) { - init(); - } - var i, j, l, tmp, placeHolders, arr; - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = new Arr(len * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len; - - var L = 0; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]; - arr[L++] = (tmp >> 16) & 0xFF; - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[L++] = tmp & 0xFF; - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output.push(tripletToBase64(tmp)); - } - return output.join('') -} - -function fromByteArray (uint8) { - if (!inited) { - init(); - } - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var output = ''; - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - output += lookup[tmp >> 2]; - output += lookup[(tmp << 4) & 0x3F]; - output += '=='; - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]); - output += lookup[tmp >> 10]; - output += lookup[(tmp >> 4) & 0x3F]; - output += lookup[(tmp << 2) & 0x3F]; - output += '='; - } - - parts.push(output); - - return parts.join('') -} - -function read (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -function write (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; -} - -var toString = {}.toString; - -var isArray = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - -var INSPECT_MAX_BYTES = 50; - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined - ? global$1.TYPED_ARRAY_SUPPORT - : true; - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length); - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length); - } - that.length = length; - } - - return that -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192; // not used by this implementation - -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype; - return arr -}; - -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -}; - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype; - Buffer.__proto__ = Uint8Array; -} - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} - -function alloc (that, size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -}; - -function allocUnsafe (that, size) { - assertSize(size); - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0; - } - } - return that -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -}; -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) -}; - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0; - that = createBuffer(that, length); - - var actual = that.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual); - } - - return that -} - -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0; - that = createBuffer(that, length); - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255; - } - return that -} - -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength; // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array); - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset); - } else { - array = new Uint8Array(array, byteOffset, length); - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array; - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array); - } - return that -} - -function fromObject (that, obj) { - if (internalIsBuffer(obj)) { - var len = checked(obj.length) | 0; - that = createBuffer(that, len); - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len); - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') -} - -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} -Buffer.isBuffer = isBuffer; -function internalIsBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!internalIsBuffer(a) || !internalIsBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length; - var y = b.length; - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -}; - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -}; - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - var buffer = Buffer.allocUnsafe(length); - var pos = 0; - for (i = 0; i < list.length; ++i) { - var buf = list[i]; - if (!internalIsBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer -}; - -function byteLength (string, encoding) { - if (internalIsBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string; - } - - var len = string.length; - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } -} -Buffer.byteLength = byteLength; - -function slowToString (encoding, start, end) { - var loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } -} - -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true; - -function swap (b, n, m) { - var i = b[n]; - b[n] = b[m]; - b[m] = i; -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this -}; - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this -}; - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this -}; - -Buffer.prototype.toString = function toString () { - var length = this.length | 0; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -}; - -Buffer.prototype.equals = function equals (b) { - if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -}; - -Buffer.prototype.inspect = function inspect () { - var str = ''; - var max = INSPECT_MAX_BYTES; - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); - if (this.length > max) str += ' ... '; - } - return '' -}; - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!internalIsBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - var x = thisEnd - thisStart; - var y = end - start; - var len = Math.min(x, y); - - var thisCopy = this.slice(thisStart, thisEnd); - var targetCopy = target.slice(start, end); - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -}; - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000; - } - byteOffset = +byteOffset; // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (internalIsBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1; - var arrLength = arr.length; - var valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i; - if (dir) { - var foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - var found = true; - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -}; - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -}; - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -}; - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - var remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0; - if (isFinite(length)) { - length = length | 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } -}; - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -}; - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return fromByteArray(buf) - } else { - return fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - var res = []; - - var i = start; - while (i < end) { - var firstByte = buf[i]; - var codePoint = null; - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000; - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = ''; - var i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; ++i) { - out += toHex(buf[i]); - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end); - var res = ''; - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - var newBuf; - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end); - newBuf.__proto__ = Buffer.prototype; - } else { - var sliceLen = end - start; - newBuf = new Buffer(sliceLen, undefined); - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start]; - } - } - - return newBuf -}; - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val -}; - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - var val = this[offset + --byteLength]; - var mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val -}; - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] -}; - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) -}; - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] -}; - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -}; - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -}; - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val -}; - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var i = byteLength; - var mul = 1; - var val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val -}; - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -}; - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val -}; - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val -}; - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -}; - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -}; - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, true, 23, 4) -}; - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, false, 23, 4) -}; - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, true, 52, 8) -}; - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, false, 52, 8) -}; - -function checkInt (buf, value, offset, ext, max, min) { - if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var mul = 1; - var i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var i = byteLength - 1; - var mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - this[offset] = (value & 0xff); - return offset + 1 -}; - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8; - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 -}; - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 -}; - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff; - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 -}; - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 -}; - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = 0; - var mul = 1; - var sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = byteLength - 1; - var mul = 1; - var sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 -}; - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 -}; - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 -}; - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 -}; - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (value < 0) value = 0xffffffff + value + 1; - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 -}; - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -}; - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -}; - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -}; - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -}; - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - var len = end - start; - var i; - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start]; - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start]; - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ); - } - - return len -}; - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (val.length === 1) { - var code = val.charCodeAt(0); - if (code < 256) { - val = code; - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255; - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - var i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - var bytes = internalIsBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()); - var len = bytes.length; - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this -}; - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity; - var codePoint; - var length = string.length; - var leadSurrogate = null; - var bytes = []; - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo; - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray -} - - -function base64ToBytes (str) { - return toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i -} - -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} - - -// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -function isBuffer(obj) { - return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj)) -} - -function isFastBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0)) -} - -// Copyright Joyent, Inc. and other Node contributors. -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - }; - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -function StringDecoder(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -} - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} - -const BUFFER_MAX_BYTES = 524288; // 0.5Mb - -const CONTINUE_READING_RECORDS = "CONTINUE_READING"; -const READ_REMAINING_TEXT = "READ_REMAINING"; -const CANCEL_READ = "CANCEL"; - -const getIndexWriter = (hierarchy, indexNode, readableStream, writableStream, end) => { - const schema = generateSchema(hierarchy, indexNode); - - return ({ - read: read$1(readableStream, schema), - updateIndex: updateIndex(readableStream, writableStream, schema) - }); -}; - -const getIndexReader = (hierarchy, indexNode, readableStream) => - read$1( - readableStream, - generateSchema(hierarchy, indexNode) - ); - -const updateIndex = (readableStream, writableStream, schema) => async (itemsToWrite, keysToRemove) => { - const write = newOutputWriter(BUFFER_MAX_BYTES, writableStream); - const writtenItems = []; - await read$1(readableStream, schema)( - async indexedItem => { - const updated = fp.find(i => indexedItem.key === i.key)(itemsToWrite); - const removed = fp.find(k => indexedItem.key === k)(keysToRemove); - - if(isSomething(removed)) - return CONTINUE_READING_RECORDS; - - if(isSomething(updated)) { - const serializedItem = serializeItem(schema, updated); - await write(serializedItem); - writtenItems.push(updated); - } else { - await write( - serializeItem(schema, indexedItem) - ); - } - - return CONTINUE_READING_RECORDS; - - }, - async text => await write(text) - ); - - if(writtenItems.length !== itemsToWrite.length) { - const toAdd = fp.difference(itemsToWrite, writtenItems); - for(let added of toAdd) { - await write( - serializeItem(schema, added) - ); - } - } else if(writtenItems.length === 0) { - // potentially are no records - await write(""); - } - - await write(); - await writableStream.end(); -}; - -const read$1 = (readableStream, schema) => async (onGetItem, onGetText) => { - const readInput = newInputReader(readableStream); - let text = await readInput(); - let status = CONTINUE_READING_RECORDS; - while(text.length > 0) { - - if(status === READ_REMAINING_TEXT) { - await onGetText(text); - continue; - } - - if(status === CANCEL_READ) { - return; - } - - let rowText = ""; - let currentCharIndex=0; - for(let currentChar of text) { - rowText += currentChar; - if(currentChar === "\r") { - status = await onGetItem( - deserializeRow(schema, rowText) - ); - rowText = ""; - if(status === READ_REMAINING_TEXT) { - break; - } - } - currentCharIndex++; - } - - if(currentCharIndex < text.length -1) { - await onGetText(text.substring(currentCharIndex + 1)); - } - - text = await readInput(); - } - - await readableStream.destroy(); - -}; - -const newOutputWriter = (flushBoundary, writableStream) => { - - let currentBuffer = null; - - return async (text) => { - - if(fp.isString(text) && currentBuffer === null) - currentBuffer = safeBuffer.Buffer.from(text, "utf8"); - else if(fp.isString(text)) - currentBuffer = safeBuffer.Buffer.concat([ - currentBuffer, - safeBuffer.Buffer.from(text, "utf8") - ]); - - if(currentBuffer !== null && - (currentBuffer.length > flushBoundary - || !fp.isString(text))) { - - await writableStream.write(currentBuffer); - currentBuffer = null; - } - } -}; - -const newInputReader = (readableStream) => { - - const decoder = new StringDecoder('utf8'); - let remainingBytes = []; - - return async () => { - - let nextBytesBuffer = await readableStream.read(BUFFER_MAX_BYTES); - const remainingBuffer = safeBuffer.Buffer.from(remainingBytes); - - if(!nextBytesBuffer) nextBytesBuffer = safeBuffer.Buffer.from([]); - - const moreToRead = nextBytesBuffer.length === BUFFER_MAX_BYTES; - - const buffer = safeBuffer.Buffer.concat( - [remainingBuffer, nextBytesBuffer], - remainingBuffer.length + nextBytesBuffer.length); - - const text = decoder.write(buffer); - remainingBytes = decoder.end(buffer); - - if(!moreToRead && remainingBytes.length > 0) { - // if for any reason, we have remaining bytes at the end - // of the stream, just discard - dont see why this should - // ever happen, but if it does, it could cause a stack overflow - remainingBytes = []; - } - - return text; - }; -}; - -const deserializeRow = (schema, rowText) => { - let currentPropIndex = 0; - let currentCharIndex = 0; - let currentValueText = ""; - let isEscaped = false; - const item = {}; - - const setCurrentProp = () => { - const currentProp = schema[currentPropIndex]; - const type = getType(currentProp.type); - const value = currentValueText === "" - ? type.getDefaultValue() - : type.safeParseValue( - currentValueText); - item[currentProp.name] = value; - }; - - while(currentPropIndex < schema.length) { - - if(currentCharIndex < rowText.length) { - const currentChar = rowText[currentCharIndex]; - if(isEscaped) { - if(currentChar === "r") { - currentValueText += "\r"; - } else { - currentValueText += currentChar; - } - isEscaped = false; - } else { - if(currentChar === ",") { - setCurrentProp(); - currentValueText = ""; - currentPropIndex++; - } else if(currentChar === "\\") { - isEscaped = true; - } else { - currentValueText += currentChar; - } - } - currentCharIndex++; - } else { - currentValueText = ""; - setCurrentProp(); - currentPropIndex++; - } - } - - return item; -}; - -const serializeItem = (schema, item) => { - - let rowText = ""; - - for(let prop of schema) { - const type = getType(prop.type); - const value = fp.has(prop.name)(item) - ? item[prop.name] - : type.getDefaultValue(); - - const valStr = type.stringify(value); - - for(let i = 0; i < valStr.length; i++) { - const currentChar = valStr[i]; - if(currentChar === "," - || currentChar === "\r" - || currentChar === "\\") { - rowText += "\\"; - } - - if(currentChar === "\r") { - rowText += "r"; - } else { - rowText += currentChar; - } - } - - rowText += ","; - } - - rowText += "\r"; - return rowText; -}; - -const readIndex$1 = async (hierarchy, datastore, index, indexedDataKey) => { - const records = []; - const doRead = iterateIndex( - async item => { - records.push(item); - return CONTINUE_READING_RECORDS; - }, - async () => records - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); -}; - -const searchIndex = async (hierarchy, datastore, index, indexedDataKey, searchPhrase) => { - const records = []; - const schema = generateSchema(hierarchy, index); - const doRead = iterateIndex( - async item => { - const idx = lunr(function () { - this.ref('key'); - for (const field of schema) { - this.field(field.name); - } - this.add(item); - }); - const searchResults = idx.search(searchPhrase); - if (searchResults.length === 1) { - item._searchResult = searchResults[0]; - records.push(item); - } - return CONTINUE_READING_RECORDS; - }, - async () => records - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); -}; - -const iterateIndex = (onGetItem, getFinalResult) => async (hierarchy, datastore, index, indexedDataKey) => { - try { - const readableStream = promiseReadableStream( - await datastore.readableFileStream(indexedDataKey) - ); - - const read = getIndexReader(hierarchy, index, readableStream); - await read(onGetItem); - return getFinalResult(); - } catch (e) { - if (await datastore.exists(indexedDataKey)) { - throw e; - } else { - await createIndexFile( - datastore, - indexedDataKey, - index, - ); - } - return []; - } -}; - -const getIndexDir = (hierarchy, indexKey) => { - - const parentKey = getParentKey(indexKey); - - if(parentKey === "") return indexKey; - if(parentKey === keySep) return indexKey; - - const recordInfo = getRecordInfo( - hierarchy, - parentKey); - - return recordInfo.child( - getLastPartInKey(indexKey)); -}; - -const listItems = app => async (indexKey, options) => { - indexKey = safeKey(indexKey); - return apiWrapper( - app, - events.indexApi.listItems, - permission.readIndex.isAuthorized(indexKey), - { indexKey, options }, - _listItems, app, indexKey, options, - ); -}; - -const defaultOptions = { rangeStartParams: null, rangeEndParams: null, searchPhrase: null }; - -const _listItems = async (app, indexKey, options = defaultOptions) => { - const { searchPhrase, rangeStartParams, rangeEndParams } = $({}, [ - fp.merge(options), - fp.merge(defaultOptions), - ]); - - const getItems = async indexedDataKey => (isNonEmptyString(searchPhrase) - ? await searchIndex( - app.hierarchy, - app.datastore, - indexNode, - indexedDataKey, - searchPhrase, - ) - : await readIndex$1( - app.hierarchy, - app.datastore, - indexNode, - indexedDataKey, - )); - - indexKey = safeKey(indexKey); - const indexNode = getExactNodeForKey(app.hierarchy)(indexKey); - const indexDir = getIndexDir(app.hierarchy, indexKey); - - if (!isIndex(indexNode)) { throw new Error('supplied key is not an index'); } - - if (isShardedIndex(indexNode)) { - const shardKeys = await getShardKeysInRange( - app, indexNode, indexDir, rangeStartParams, rangeEndParams, - ); - const items = []; - for (const k of shardKeys) { - items.push(await getItems(k)); - } - return fp.flatten(items); - } - return await getItems( - getUnshardedIndexDataKey(indexDir), - ); -}; - -const getContext = app => recordKey => { - recordKey = safeKey(recordKey); - return apiWrapperSync( - app, - events.recordApi.getContext, - permission.readRecord.isAuthorized(recordKey), - { recordKey }, - _getContext, app, recordKey, - ); -}; - -const _getContext = (app, recordKey) => { - recordKey = safeKey(recordKey); - const recordNode = getExactNodeForKey(app.hierarchy)(recordKey); - - const cachedReferenceIndexes = {}; - - const lazyLoadReferenceIndex = async (typeOptions) => { - if (!fp.has(typeOptions.indexNodeKey)(cachedReferenceIndexes)) { - cachedReferenceIndexes[typeOptions.indexNodeKey] = { - typeOptions, - data: await readReferenceIndex( - app, recordKey, typeOptions, - ), - }; - } - - return cachedReferenceIndexes[typeOptions.indexNodeKey]; - }; - - const getTypeOptions = typeOptions_or_fieldName => (fp.isString(typeOptions_or_fieldName) - ? findField(recordNode, typeOptions_or_fieldName) - .typeOptions - : typeOptions_or_fieldName); - - return { - referenceExists: async (typeOptions_or_fieldName, key) => { - const typeOptions = getTypeOptions(typeOptions_or_fieldName); - const { data } = await lazyLoadReferenceIndex(typeOptions); - return fp.some(i => i.key === key)(data); - }, - referenceOptions: async (typeOptions_or_fieldName) => { - const typeOptions = getTypeOptions(typeOptions_or_fieldName); - const { data } = await lazyLoadReferenceIndex(typeOptions); - return data; - }, - recordNode, - }; -}; - -const readReferenceIndex = async (app, recordKey, typeOptions) => { - const indexNode = getNode(app.hierarchy, typeOptions.indexNodeKey); - const indexKey = isGlobalIndex(indexNode) - ? indexNode.nodeKey() - : getIndexKey_BasedOnDecendant( - recordKey, indexNode, - ); - - const items = await listItems(app)(indexKey); - return $(items, [ - fp.map(i => ({ - key: i.key, - value: i[typeOptions.displayValue], - })), - ]); -}; - -const fieldParseError = (fieldName, value) => ({ - fields: [fieldName], - message: `Could not parse field ${fieldName}:${value}`, -}); - -const validateAllFieldParse = (record, recordNode) => $(recordNode.fields, [ - fp.map(f => ({ name: f.name, parseResult: validateFieldParse(f, record) })), - fp.reduce((errors, f) => { - if (f.parseResult.success) return errors; - errors.push( - fieldParseError(f.name, f.parseResult.value), - ); - return errors; - }, []), -]); - -const validateAllTypeConstraints = async (record, recordNode, context) => { - const errors = []; - for (const field of recordNode.fields) { - $(await validateTypeConstraints$1(field, record, context), [ - fp.filter(isNonEmptyString), - fp.map(m => ({ message: m, fields: [field.name] })), - fp.each(e => errors.push(e)), - ]); - } - return errors; -}; - -const runRecordValidationRules = (record, recordNode) => { - const runValidationRule = (rule) => { - const isValid = compilerUtil.compileExpression(rule.expressionWhenValid); - const expressionContext = { record, _: ___default }; - return (isValid(expressionContext) - ? { valid: true } - : ({ - valid: false, - fields: rule.invalidFields, - message: rule.messageWhenInvalid, - })); - }; - - return $(recordNode.validationRules, [ - fp.map(runValidationRule), - fp.flatten, - fp.filter(r => r.valid === false), - fp.map(r => ({ fields: r.fields, message: r.message })), - ]); -}; - -const validate = app => async (record, context) => { - context = isNothing(context) - ? _getContext(app, record.key) - : context; - - const recordNode = getExactNodeForKey(app.hierarchy)(record.key); - const fieldParseFails = validateAllFieldParse(record, recordNode); - - // non parsing would cause further issues - exit here - if (!fp.isEmpty(fieldParseFails)) { return ({ isValid: false, errors: fieldParseFails }); } - - const recordValidationRuleFails = runRecordValidationRules(record, recordNode); - const typeContraintFails = await validateAllTypeConstraints(record, recordNode, context); - - if (fp.isEmpty(fieldParseFails) - && fp.isEmpty(recordValidationRuleFails) - && fp.isEmpty(typeContraintFails)) { - return ({ isValid: true, errors: [] }); - } - - return ({ - isValid: false, - errors: ___default.union(fieldParseFails, typeContraintFails, recordValidationRuleFails), - }); -}; - -const ensureCollectionIsInitialised = async (datastore, node, dir) => { - if (!await datastore.exists(dir)) { - await datastore.createFolder(dir); - await datastore.createFolder(joinKey(dir, node.nodeId)); - } -}; - -const initialiseRootCollections = async (datastore, hierarchy) => { - const rootCollectionRecord = allTrue( - n => isRoot(n.parent()), - isCollectionRecord, - ); - - const flathierarchy = getFlattenedHierarchy(hierarchy); - - const collectionRecords = $(flathierarchy, [ - fp.filter(rootCollectionRecord), - ]); - - for (const col of collectionRecords) { - await ensureCollectionIsInitialised( - datastore, - col, - col.collectionPathRegx() - ); - } -}; - -const initialiseChildCollections = async (app, recordInfo) => { - const childCollectionRecords = $(recordInfo.recordNode, [ - n => n.children, - fp.filter(isCollectionRecord), - ]); - - for (const child of childCollectionRecords) { - await ensureCollectionIsInitialised( - app.datastore, - child, - recordInfo.child(child.collectionName), - ); - } -}; - -const TRANSACTIONS_FOLDER = `${keySep}.transactions`; -const LOCK_FILENAME = 'lock'; -const LOCK_FILE_KEY = joinKey( - TRANSACTIONS_FOLDER, LOCK_FILENAME, -); -const idSep = '$'; - -const isOfType = typ => trans => trans.transactionType === typ; - -const CREATE_RECORD_TRANSACTION = 'create'; -const UPDATE_RECORD_TRANSACTION = 'update'; -const DELETE_RECORD_TRANSACTION = 'delete'; -const BUILD_INDEX_TRANSACTION = 'build'; - -const isUpdate = isOfType(UPDATE_RECORD_TRANSACTION); -const isDelete = isOfType(DELETE_RECORD_TRANSACTION); -const isCreate = isOfType(CREATE_RECORD_TRANSACTION); -const isBuildIndex = isOfType(BUILD_INDEX_TRANSACTION); - -const keyToFolderName = nodeKey => getHashCode(nodeKey); - -const getTransactionId = (recordId, transactionType, uniqueId) => - `${recordId}${idSep}${transactionType}${idSep}${uniqueId}`; - -const buildIndexFolder = '.BUILD-'; -const nodeKeyHashFromBuildFolder = folder => folder.replace(buildIndexFolder, ''); - -const isBuildIndexFolder = key => getLastPartInKey(key).startsWith(buildIndexFolder); - -const IndexNodeKeyFolder = indexNodeKey => joinKey( - TRANSACTIONS_FOLDER, - buildIndexFolder + keyToFolderName(indexNodeKey), -); - -const IndexNodeKeyBatchFolder = (indexNodeKey, count) => - joinKey(IndexNodeKeyFolder(indexNodeKey), Math.floor(count / BUILDINDEX_BATCH_COUNT).toString()); - -const BUILDINDEX_BATCH_COUNT = 1000; -const timeoutMilliseconds = 30 * 1000; // 30 secs -const maxLockRetries = 1; - -const transactionForCreateRecord = async (app, record) => await transaction( - app.datastore, CREATE_RECORD_TRANSACTION, - record.key, { record }, - getTransactionKey_Records, -); - -const transactionForUpdateRecord = async (app, oldRecord, newRecord) => await transaction( - app.datastore, UPDATE_RECORD_TRANSACTION, - newRecord.key, { oldRecord, record: newRecord }, - getTransactionKey_Records, -); - -const transactionForDeleteRecord = async (app, record) => await transaction( - app.datastore, DELETE_RECORD_TRANSACTION, - record.key, { record }, - getTransactionKey_Records, -); - -const transactionForBuildIndex = async (app, indexNodeKey, recordKey, count) => { - const transactionFolder = IndexNodeKeyBatchFolder(indexNodeKey, count); - if (count % BUILDINDEX_BATCH_COUNT === 0) { - await app.datastore.createFolder(transactionFolder); - } - - return await transaction( - app.datastore, BUILD_INDEX_TRANSACTION, - recordKey, { recordKey }, - id => joinKey(transactionFolder, id), - ); -}; - -const createBuildIndexFolder = async (datastore, indexNodeKey) => await datastore.createFolder( - IndexNodeKeyFolder(indexNodeKey), -); - -const getTransactionKey_Records = id => joinKey(TRANSACTIONS_FOLDER, id); - -const transaction = async (datastore, transactionType, recordKey, data, getTransactionKey) => { - const recordId = getLastPartInKey(recordKey); - const uniqueId = shortid.generate(); - const id = getTransactionId( - recordId, transactionType, uniqueId, - ); - - const key = getTransactionKey(id); - - const trans = { - transactionType, - recordKey, - ...data, - id, - }; - - await datastore.createJson( - key, trans, - ); - - return trans; -}; - -const initialiseIndex = async (datastore, dir, index) => { - const indexDir = joinKey(dir, index.name); - - await datastore.createFolder(indexDir); - - if (isShardedIndex(index)) { - await datastore.createFile( - getShardMapKey(indexDir), - '[]', - ); - } else { - await createIndexFile( - datastore, - getUnshardedIndexDataKey(indexDir), - index, - ); - } -}; - -const save = app => async (record, context) => apiWrapper( - app, - events.recordApi.save, - record.isNew - ? permission.createRecord.isAuthorized(record.key) - : permission.updateRecord.isAuthorized(record.key), { record }, - _save, app, record, context, false, -); - - -const _save = async (app, record, context, skipValidation = false) => { - const recordClone = fp.cloneDeep(record); - if (!skipValidation) { - const validationResult = await validate(app)(recordClone, context); - if (!validationResult.isValid) { - await app.publish(events.recordApi.save.onInvalid, { record, validationResult }); - throw new BadRequestError(`Save : Record Invalid : ${ - JSON.stringify(validationResult.errors)}`); - } - } - - const recordInfo = getRecordInfo(app.hierarchy, record.key); - const { - recordNode, pathInfo, - recordJson, files, - } = recordInfo; - - if (recordClone.isNew) { - - if(!recordNode) - throw new Error("Cannot find node for " + record.key); - - const transaction = await transactionForCreateRecord( - app, recordClone, - ); - recordClone.transactionId = transaction.id; - await createRecordFolderPath(app.datastore, pathInfo); - await app.datastore.createFolder(files); - await app.datastore.createJson(recordJson, recordClone); - await initialiseReverseReferenceIndexes(app, recordInfo); - await initialiseAncestorIndexes(app, recordInfo); - await initialiseChildCollections(app, recordInfo); - await app.publish(events.recordApi.save.onRecordCreated, { - record: recordClone, - }); - } else { - const oldRecord = await _loadFromInfo(app, recordInfo); - const transaction = await transactionForUpdateRecord( - app, oldRecord, recordClone, - ); - recordClone.transactionId = transaction.id; - await app.datastore.updateJson( - recordJson, - recordClone, - ); - await app.publish(events.recordApi.save.onRecordUpdated, { - old: oldRecord, - new: recordClone, - }); - } - - await app.cleanupTransactions(); - - const returnedClone = fp.cloneDeep(recordClone); - returnedClone.isNew = false; - return returnedClone; -}; - -const initialiseAncestorIndexes = async (app, recordInfo) => { - for (const index of recordInfo.recordNode.indexes) { - const indexKey = recordInfo.child(index.name); - if (!await app.datastore.exists(indexKey)) { - await initialiseIndex(app.datastore, recordInfo.dir, index); - } - } -}; - -const initialiseReverseReferenceIndexes = async (app, recordInfo) => { - - const indexNodes = $(fieldsThatReferenceThisRecord(app, recordInfo.recordNode), [ - fp.map(f => $(f.typeOptions.reverseIndexNodeKeys, [ - fp.map(n => getNode( - app.hierarchy, - n, - )), - ])), - fp.flatten, - ]); - - for (const indexNode of indexNodes) { - await initialiseIndex( - app.datastore, recordInfo.dir, indexNode, - ); - } -}; - -const fieldsThatReferenceThisRecord = (app, recordNode) => $(app.hierarchy, [ - getFlattenedHierarchy, - fp.filter(isRecord), - fp.map(n => n.fields), - fp.flatten, - fp.filter(fieldReversesReferenceToNode(recordNode)), -]); - -const createRecordFolderPath = async (datastore, pathInfo) => { - - const recursiveCreateFolder = async (subdirs, dirsThatNeedCreated=undefined) => { - - // iterate backwards through directory hierachy - // until we get to a folder that exists, then create the rest - // e.g - // - some/folder/here - // - some/folder - // - some - const thisFolder = joinKey(pathInfo.base, ...subdirs); - - if(await datastore.exists(thisFolder)) { - - let creationFolder = thisFolder; - for(let nextDir of (dirsThatNeedCreated || []) ) { - creationFolder = joinKey(creationFolder, nextDir); - await datastore.createFolder(creationFolder); - } - - } else if(!dirsThatNeedCreated || dirsThatNeedCreated.length > 0) { - - dirsThatNeedCreated = !dirsThatNeedCreated - ? [] - :dirsThatNeedCreated; - - await recursiveCreateFolder( - fp.take(subdirs.length - 1)(subdirs), - [...fp.takeRight(1)(subdirs), ...dirsThatNeedCreated] - ); - } - }; - - await recursiveCreateFolder(pathInfo.subdirs); - - return joinKey(pathInfo.base, ...pathInfo.subdirs); - -}; - -const deleteCollection = (app, disableCleanup = false) => async key => apiWrapper( - app, - events.collectionApi.delete, - permission.manageCollection.isAuthorized, - { key }, - _deleteCollection, app, key, disableCleanup, -); - -/* - const recordNode = getCollectionNode(app.hierarchy, key); - -*/ - -const _deleteCollection = async (app, key, disableCleanup) => { - key = safeKey(key); - const collectionDir = getCollectionDir(app.hierarchy, key); - await deleteRecords(app, key); - await deleteCollectionFolder(app, collectionDir); - if (!disableCleanup) { await app.cleanupTransactions(); } -}; - -const deleteCollectionFolder = async (app, dir) => - await app.datastore.deleteFolder(dir); - -const deleteRecords = async (app, key) => { - - const iterate = await getAllIdsIterator(app)(key); - - let ids = await iterate(); - while (!ids.done) { - if (ids.result.collectionKey === key) { - for (const id of ids.result.ids) { - await _deleteRecord( - app, - joinKey(key, id), - true, - ); - } - } - - ids = await iterate(); - } -}; - -const deleteRecord$1 = (app, disableCleanup = false) => async key => { - key = safeKey(key); - return apiWrapper( - app, - events.recordApi.delete, - permission.deleteRecord.isAuthorized(key), - { key }, - _deleteRecord, app, key, disableCleanup, - ); -}; - -// called deleteRecord because delete is a keyword -const _deleteRecord = async (app, key, disableCleanup) => { - const recordInfo = getRecordInfo(app.hierarchy, key); - key = recordInfo.key; - const node = getExactNodeForKey(app.hierarchy)(key); - - const record = await _load(app, key); - await transactionForDeleteRecord(app, record); - - for (const collectionRecord of node.children) { - const collectionKey = joinKey( - key, collectionRecord.collectionName, - ); - await _deleteCollection(app, collectionKey, true); - } - - await app.datastore.deleteFolder(recordInfo.dir); - - if (!disableCleanup) { await app.cleanupTransactions(); } -}; - -const uploadFile = app => async (recordKey, readableStream, relativeFilePath) => apiWrapper( - app, - events.recordApi.uploadFile, - permission.updateRecord.isAuthorized(recordKey), - { recordKey, readableStream, relativeFilePath }, - _uploadFile, app, recordKey, readableStream, relativeFilePath, -); - -const _uploadFile = async (app, recordKey, readableStream, relativeFilePath) => { - if (isNothing(recordKey)) { throw new BadRequestError('Record Key not supplied'); } - if (isNothing(relativeFilePath)) { throw new BadRequestError('file path not supplied'); } - if (!isLegalFilename(relativeFilePath)) { throw new BadRequestError('Illegal filename'); } - - const recordInfo = getRecordInfo(app.hierarchy, recordKey); - const record = await _loadFromInfo(app, recordInfo); - - const fullFilePath = safeGetFullFilePath( - recordInfo.dir, relativeFilePath, - ); - - const tempFilePath = `${fullFilePath}_${shortid.generate()}.temp`; - - const outputStream = await app.datastore.writableFileStream( - tempFilePath, - ); - - return new Promise((resolve,reject) => { - readableStream.pipe(outputStream); - outputStream.on('error', reject); - outputStream.on('finish', resolve); - }) - .then(() => app.datastore.getFileSize(tempFilePath)) - .then(size => { - const isExpectedFileSize = checkFileSizeAgainstFields( - app, record, relativeFilePath, size - ); - if (!isExpectedFileSize) { throw new BadRequestError(`Fields for ${relativeFilePath} do not have expected size: ${join(',')(incorrectFields)}`); } - - }) - .then(() => tryAwaitOrIgnore(app.datastore.deleteFile, fullFilePath)) - .then(() => app.datastore.renameFile(tempFilePath, fullFilePath)); - -}; - -const checkFileSizeAgainstFields = (app, record, relativeFilePath, expectedSize) => { - const recordNode = getExactNodeForKey(app.hierarchy)(record.key); - - const incorrectFileFields = $(recordNode.fields, [ - fp.filter(f => f.type === 'file' - && record[f.name].relativePath === relativeFilePath - && record[f.name].size !== expectedSize), - fp.map(f => f.name), - ]); - - const incorrectFileArrayFields = $(recordNode.fields, [ - fp.filter(a => a.type === 'array' - && $(record[a.name], [ - fp.some(f => record[f.name].relativePath === relativeFilePath - && record[f.name].size !== expectedSize), - ])), - fp.map(f => f.name), - ]); - - const incorrectFields = [ - ...incorrectFileFields, - ...incorrectFileArrayFields, - ]; - - if (incorrectFields.length > 0) { - return false; - } - - return true; -}; - -const safeGetFullFilePath = (recordDir, relativeFilePath) => { - const naughtyUser = () => { throw new ForbiddenError('naughty naughty'); }; - - if (relativeFilePath.startsWith('..')) naughtyUser(); - - const pathParts = splitKey(relativeFilePath); - - if (fp.includes('..')(pathParts)) naughtyUser(); - - const recordKeyParts = splitKey(recordDir); - - const fullPathParts = [ - ...recordKeyParts, - 'files', - ...fp.filter(p => p !== '.')(pathParts), - ]; - - return joinKey(fullPathParts); -}; - -const downloadFile = app => async (recordKey, relativePath) => apiWrapper( - app, - events.recordApi.uploadFile, - permission.readRecord.isAuthorized(recordKey), - { recordKey, relativePath },//remove dupe key 'recordKey' from object - _downloadFile, app, recordKey, relativePath, -); - - -const _downloadFile = async (app, recordKey, relativePath) => { - if (isNothing(recordKey)) { throw new BadRequestError('Record Key not supplied'); } - if (isNothing(relativePath)) { throw new BadRequestError('file path not supplied'); } - - const {dir} = getRecordInfo(app.hierarchy, recordKey); - return await app.datastore.readableFileStream( - safeGetFullFilePath( - dir, relativePath, - ), - ); -}; - -const customId = app => (nodeName, id) => { - const node = $(app.hierarchy, [ - getFlattenedHierarchy, - fp.find(n => n.name === nodeName), - ]); - - if (!node) throw new NotFoundError(`Cannot find node ${nodeName}`); - - return `${node.nodeId}-${id}`; -}; - -const setCustomId = app => (record, id) => { - record.id = customId(app)(record.type, id); - - const keyParts = splitKey(record.key); - - record.key = $(keyParts, [ - fp.take(keyParts.length - 1), - fp.union([record.id]), - joinKey, - ]); - - return record; -}; - -const api = app => ({ - getNew: getNew(app), - getNewChild: getNewChild(app), - save: save(app), - load: load(app), - delete: deleteRecord$1(app, false), - validate: validate(app), - getContext: getContext(app), - uploadFile: uploadFile(app), - downloadFile: downloadFile(app), - customId: customId(app), - setCustomId: setCustomId(app), -}); - - -const getRecordApi = app => api(app); - -const getAllowedRecordTypes = app => key => apiWrapperSync( - app, - events.collectionApi.getAllowedRecordTypes, - alwaysAuthorized, - { key }, - _getAllowedRecordTypes, app, key, -); - -const _getAllowedRecordTypes = (app, key) => { - key = safeKey(key); - const node = getNodeForCollectionPath(app.hierarchy)(key); - return isNothing(node) ? [] : [node.name]; -}; - -const getCollectionApi = app => ({ - getAllowedRecordTypes: getAllowedRecordTypes(app), - getAllIdsIterator: getAllIdsIterator(app), - delete: deleteCollection(app), -}); - -/** rebuilds an index - * @param {object} app - the application container - * @param {string} indexNodeKey - node key of the index, which the index belongs to - */ -const buildIndex = app => async indexNodeKey => apiWrapper( - app, - events.indexApi.buildIndex, - permission.manageIndex.isAuthorized, - { indexNodeKey }, - _buildIndex, app, indexNodeKey, -); - -const _buildIndex = async (app, indexNodeKey) => { - const indexNode = getNode(app.hierarchy, indexNodeKey); - - await createBuildIndexFolder(app.datastore, indexNodeKey); - - if (!isIndex(indexNode)) { throw new BadRequestError('BuildIndex: must supply an indexnode'); } - - if (indexNode.indexType === 'reference') { - await buildReverseReferenceIndex( - app, indexNode, - ); - } else { - await buildHeirarchalIndex( - app, indexNode, - ); - } - - await app.cleanupTransactions(); -}; - -const buildReverseReferenceIndex = async (app, indexNode) => { - // Iterate through all referencING records, - // and update referenced index for each record - let recordCount = 0; - const referencingNodes = $(app.hierarchy, [ - getFlattenedHierarchy, - fp.filter(n => isRecord(n) - && fp.some(fieldReversesReferenceToIndex(indexNode))(n.fields)), - ]); - - const createTransactionsForReferencingNode = async (referencingNode) => { - const iterateReferencingNodes = await getAllIdsIterator(app)(referencingNode.collectionNodeKey()); - - let referencingIdIterator = await iterateReferencingNodes(); - while (!referencingIdIterator.done) { - const { result } = referencingIdIterator; - for (const id of result.ids) { - const recordKey = joinKey(result.collectionKey, id); - await transactionForBuildIndex(app, indexNode.nodeKey(), recordKey, recordCount); - recordCount++; - } - referencingIdIterator = await iterateReferencingNodes(); - } - }; - - for (const referencingNode of referencingNodes) { - await createTransactionsForReferencingNode(referencingNode); - } -}; - -/* -const getAllowedParentCollectionNodes = (hierarchy, indexNode) => $(getAllowedRecordNodesForIndex(hierarchy, indexNode), [ - map(n => n.parent()), -]); -*/ - -const buildHeirarchalIndex = async (app, indexNode) => { - let recordCount = 0; - - const createTransactionsForIds = async (collectionKey, ids) => { - for (const recordId of ids) { - const recordKey = joinKey(collectionKey, recordId); - - const recordNode = getRecordNodeById( - app.hierarchy, - recordId, - ); - - if (recordNodeApplies(indexNode)(recordNode)) { - await transactionForBuildIndex( - app, indexNode.nodeKey(), - recordKey, recordCount, - ); - recordCount++; - } - } - }; - - - const collectionRecords = getAllowedRecordNodesForIndex(app.hierarchy, indexNode); - - for (const targetCollectionRecordNode of collectionRecords) { - const allIdsIterator = await getAllIdsIterator(app)(targetCollectionRecordNode.collectionNodeKey()); - - let allIds = await allIdsIterator(); - while (allIds.done === false) { - await createTransactionsForIds( - allIds.result.collectionKey, - allIds.result.ids, - ); - allIds = await allIdsIterator(); - } - } - - return recordCount; -}; - -// const chooseChildRecordNodeByKey = (collectionNode, recordId) => find(c => recordId.startsWith(c.nodeId))(collectionNode.children); - -const recordNodeApplies = indexNode => recordNode => fp.includes(recordNode.nodeId)(indexNode.allowedRecordNodeIds); - -const aggregates = app => async (indexKey, rangeStartParams = null, rangeEndParams = null) => apiWrapper( - app, - events.indexApi.aggregates, - permission.readIndex.isAuthorized(indexKey), - { indexKey, rangeStartParams, rangeEndParams }, - _aggregates, app, indexKey, rangeStartParams, rangeEndParams, -); - -const _aggregates = async (app, indexKey, rangeStartParams, rangeEndParams) => { - indexKey = safeKey(indexKey); - const indexNode = getExactNodeForKey(app.hierarchy)(indexKey); - const indexDir = getIndexDir(app.hierarchy, indexKey); - - if (!isIndex(indexNode)) { throw new BadRequestError('supplied key is not an index'); } - - if (isShardedIndex(indexNode)) { - const shardKeys = await getShardKeysInRange( - app, indexNode, indexDir, rangeStartParams, rangeEndParams, - ); - let aggregateResult = null; - for (const k of shardKeys) { - const shardResult = await getAggregates(app.hierarchy, app.datastore, indexNode, k); - if (aggregateResult === null) { - aggregateResult = shardResult; - } else { - aggregateResult = mergeShardAggregate( - aggregateResult, - shardResult, - ); - } - } - return aggregateResult; - } - return await getAggregates( - app.hierarchy, - app.datastore, - indexNode, - getUnshardedIndexDataKey(indexDir), - ); -}; - -const mergeShardAggregate = (totals, shard) => { - const mergeGrouping = (tot, shr) => { - tot.count += shr.count; - for (const aggName in tot) { - if (aggName === 'count') continue; - const totagg = tot[aggName]; - const shragg = shr[aggName]; - totagg.sum += shragg.sum; - totagg.max = totagg.max > shragg.max - ? totagg.max - : shragg.max; - totagg.min = totagg.min < shragg.min - ? totagg.min - : shragg.min; - totagg.mean = totagg.sum / tot.count; - } - return tot; - }; - - for (const aggGroupDef in totals) { - for (const grouping in shard[aggGroupDef]) { - const groupingTotal = totals[aggGroupDef][grouping]; - totals[aggGroupDef][grouping] = fp.isUndefined(groupingTotal) - ? shard[aggGroupDef][grouping] - : mergeGrouping( - totals[aggGroupDef][grouping], - shard[aggGroupDef][grouping], - ); - } - } - - return totals; -}; - -const getAggregates = async (hierarchy, datastore, index, indexedDataKey) => { - const aggregateResult = {}; - const doRead = iterateIndex( - async item => { - applyItemToAggregateResult( - index, aggregateResult, item, - ); - return CONTINUE_READING_RECORDS; - }, - async () => aggregateResult - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); -}; - - -const applyItemToAggregateResult = (indexNode, result, item) => { - const getInitialAggregateResult = () => ({ - sum: 0, mean: null, max: null, min: null, - }); - - const applyAggregateResult = (agg, existing, count) => { - const value = compilerUtil.compileCode(agg.aggregatedValue)({ record: item }); - - if (!fp.isNumber(value)) return existing; - - existing.sum += value; - existing.max = value > existing.max || existing.max === null - ? value - : existing.max; - existing.min = value < existing.min || existing.min === null - ? value - : existing.min; - existing.mean = existing.sum / count; - return existing; - }; - - for (const aggGroup of indexNode.aggregateGroups) { - if (!fp.has(aggGroup.name)(result)) { - result[aggGroup.name] = {}; - } - - const thisGroupResult = result[aggGroup.name]; - - if (isNonEmptyString(aggGroup.condition)) { - if (!compilerUtil.compileExpression(aggGroup.condition)({ record: item })) { - continue; - } - } - - let group = isNonEmptyString(aggGroup.groupBy) - ? compilerUtil.compileCode(aggGroup.groupBy)({ record: item }) - : 'all'; - if (!isNonEmptyString(group)) { - group = '(none)'; - } - - if (!fp.has(group)(thisGroupResult)) { - thisGroupResult[group] = { count: 0 }; - for (const agg of aggGroup.aggregates) { - thisGroupResult[group][agg.name] = getInitialAggregateResult(); - } - } - - thisGroupResult[group].count++; - - for (const agg of aggGroup.aggregates) { - const existingValues = thisGroupResult[group][agg.name]; - thisGroupResult[group][agg.name] = applyAggregateResult( - agg, existingValues, - thisGroupResult[group].count, - ); - } - } -}; - -const getIndexApi = app => ({ - listItems: listItems(app), - buildIndex: buildIndex(app), - aggregates: aggregates(app), -}); - -const createNodeErrors = { - indexCannotBeParent: 'Index template cannot be a parent', - allNonRootNodesMustHaveParent: 'Only the root node may have no parent', - indexParentMustBeRecordOrRoot: 'An index may only have a record or root as a parent', - aggregateParentMustBeAnIndex: 'aggregateGroup parent must be an index', -}; - -const pathRegxMaker = node => () => node.nodeKey().replace(/{id}/g, '[a-zA-Z0-9_-]+'); - -const nodeKeyMaker = node => () => switchCase( - - [n => isRecord(n) && !isSingleRecord(n), - n => joinKey( - node.parent().nodeKey(), - node.collectionName, - `${n.nodeId}-{id}`, - )], - - [isRoot, - fp.constant('/')], - - [defaultCase, - n => joinKey(node.parent().nodeKey(), n.name)], - -)(node); - - -const validate$1 = parent => (node) => { - if (isIndex(node) - && isSomething(parent) - && !isRoot(parent) - && !isRecord(parent)) { - throw new BadRequestError(createNodeErrors.indexParentMustBeRecordOrRoot); - } - - if (isaggregateGroup(node) - && isSomething(parent) - && !isIndex(parent)) { - throw new BadRequestError(createNodeErrors.aggregateParentMustBeAnIndex); - } - - if (isNothing(parent) && !isRoot(node)) { throw new BadRequestError(createNodeErrors.allNonRootNodesMustHaveParent); } - - return node; -}; - -const construct = parent => (node) => { - node.nodeKey = nodeKeyMaker(node); - node.pathRegx = pathRegxMaker(node); - node.parent = fp.constant(parent); - node.isRoot = () => isNothing(parent) - && node.name === 'root' - && node.type === 'root'; - if (isCollectionRecord(node)) { - node.collectionNodeKey = () => joinKey( - parent.nodeKey(), node.collectionName, - ); - node.collectionPathRegx = () => joinKey( - parent.pathRegx(), node.collectionName, - ); - } - return node; -}; - -const addToParent = (obj) => { - const parent = obj.parent(); - if (isSomething(parent)) { - if (isIndex(obj)) - // Q: why are indexes not children ? - // A: because they cannot have children of their own. - { - parent.indexes.push(obj); - } - else if (isaggregateGroup(obj)) - { - parent.aggregateGroups.push(obj); - } else { - parent.children.push(obj); - } - - if (isRecord(obj)) { - const defaultIndex = _.find( - parent.indexes, - i => i.name === `${parent.name}_index`, - ); - if (defaultIndex) { - defaultIndex.allowedRecordNodeIds.push(obj.nodeId); - } - } - } - return obj; -}; - -const constructNode = (parent, obj) => $(obj, [ - construct(parent), - validate$1(parent), - addToParent, -]); - -const getNodeId = (parentNode) => { - // this case is handled better elsewhere - if (!parentNode) return null; - const findRoot = n => (isRoot(n) ? n : findRoot(n.parent())); - const root = findRoot(parentNode); - - return ($(root, [ - getFlattenedHierarchy, - fp.map(n => n.nodeId), - fp.max]) + 1); -}; - -const constructHierarchy = (node, parent) => { - construct(parent)(node); - if (node.indexes) { - _.each(node.indexes, - child => constructHierarchy(child, node)); - } - if (node.aggregateGroups) { - _.each(node.aggregateGroups, - child => constructHierarchy(child, node)); - } - if (node.children && node.children.length > 0) { - _.each(node.children, - child => constructHierarchy(child, node)); - } - if (node.fields) { - _.each(node.fields, - f => _.each(f.typeOptions, (val, key) => { - const def = all$1[f.type].optionDefinitions[key]; - if (!def) { - // unknown typeOption - delete f.typeOptions[key]; - } else { - f.typeOptions[key] = def.parse(val); - } - })); - } - return node; -}; - - -const getNewRootLevel = () => construct()({ - name: 'root', - type: 'root', - children: [], - pathMaps: [], - indexes: [], - nodeId: 0, -}); - -const _getNewRecordTemplate = (parent, name, createDefaultIndex, isSingle) => { - const node = constructNode(parent, { - name, - type: 'record', - fields: [], - children: [], - validationRules: [], - nodeId: getNodeId(parent), - indexes: [], - estimatedRecordCount: isRecord(parent) ? 500 : 1000000, - collectionName: '', - isSingle, - }); - - if (createDefaultIndex) { - const defaultIndex = getNewIndexTemplate(parent); - defaultIndex.name = `${name}_index`; - defaultIndex.allowedRecordNodeIds.push(node.nodeId); - } - - return node; -}; - -const getNewRecordTemplate = (parent, name = '', createDefaultIndex = true) => _getNewRecordTemplate(parent, name, createDefaultIndex, false); - -const getNewSingleRecordTemplate = parent => _getNewRecordTemplate(parent, '', false, true); - -const getNewIndexTemplate = (parent, type = 'ancestor') => constructNode(parent, { - name: '', - type: 'index', - map: 'return {...record};', - filter: '', - indexType: type, - getShardName: '', - getSortKey: 'record.id', - aggregateGroups: [], - allowedRecordNodeIds: [], - nodeId: getNodeId(parent), -}); - -const getNewAggregateGroupTemplate = index => constructNode(index, { - name: '', - type: 'aggregateGroup', - groupBy: '', - aggregates: [], - condition: '', - nodeId: getNodeId(index), -}); - -const getNewAggregateTemplate = (set) => { - const aggregatedValue = { - name: '', - aggregatedValue: '', - }; - set.aggregates.push(aggregatedValue); - return aggregatedValue; -}; - -const fieldErrors = { - AddFieldValidationFailed: 'Add field validation: ', -}; - -const allowedTypes = () => fp.keys(all$1); - -const getNewField = type => ({ - name: '', // how field is referenced internally - type, - typeOptions: getDefaultOptions$1(type), - label: '', // how field is displayed - getInitialValue: 'default', // function that gets value when initially created - getUndefinedValue: 'default', // function that gets value when field undefined on record -}); - -const fieldRules = allFields => [ - makerule('name', 'field name is not set', - f => isNonEmptyString(f.name)), - makerule('type', 'field type is not set', - f => isNonEmptyString(f.type)), - makerule('label', 'field label is not set', - f => isNonEmptyString(f.label)), - makerule('getInitialValue', 'getInitialValue function is not set', - f => isNonEmptyString(f.getInitialValue)), - makerule('getUndefinedValue', 'getUndefinedValue function is not set', - f => isNonEmptyString(f.getUndefinedValue)), - makerule('name', 'field name is duplicated', - f => isNothingOrEmpty(f.name) - || fp.countBy('name')(allFields)[f.name] === 1), - makerule('type', 'type is unknown', - f => isNothingOrEmpty(f.type) - || fp.some(t => f.type === t)(allowedTypes())), -]; - -const typeOptionsRules = (field) => { - const type = all$1[field.type]; - if (isNothing(type)) return []; - - const def = optName => type.optionDefinitions[optName]; - - return $(field.typeOptions, [ - fp.keys, - fp.filter(o => isSomething(def(o)) - && isSomething(def(o).isValid)), - fp.map(o => makerule( - `typeOptions.${o}`, - `${def(o).requirementDescription}`, - field => def(o).isValid(field.typeOptions[o]), - )), - ]); -}; - -const validateField = allFields => (field) => { - const everySingleField = fp.includes(field)(allFields) ? allFields : [...allFields, field]; - return applyRuleSet([...fieldRules(everySingleField), ...typeOptionsRules(field)])(field); -}; - -const validateAllFields = recordNode => $(recordNode.fields, [ - fp.map(validateField(recordNode.fields)), - fp.flatten, -]); - -const addField = (recordTemplate, field) => { - if (isNothingOrEmpty(field.label)) { - field.label = field.name; - } - const validationMessages = validateField([...recordTemplate.fields, field])(field); - if (validationMessages.length > 0) { - const errors = fp.map(m => m.error)(validationMessages); - throw new BadRequestError(`${fieldErrors.AddFieldValidationFailed} ${errors.join(', ')}`); - } - recordTemplate.fields.push(field); -}; - -const getNewRecordValidationRule = (invalidFields, - messageWhenInvalid, - expressionWhenValid) => ({ - invalidFields, messageWhenInvalid, expressionWhenValid, -}); - -const getStaticValue = switchCase( - [fp.isNumber, v => v.toString()], - [fp.isBoolean, v => v.toString()], - [fp.defaultCase, v => `'${v}'`], -); - -const commonRecordValidationRules = ({ - - fieldNotEmpty: fieldName => getNewRecordValidationRule( - [fieldName], - `${fieldName} is empty`, - `!_.isEmpty(record['${fieldName}'])`, - ), - - fieldBetween: (fieldName, min, max) => getNewRecordValidationRule( - [fieldName], - `${fieldName} must be between ${min.toString()} and ${max.toString()}`, - `record['${fieldName}'] >= ${getStaticValue(min)} && record['${fieldName}'] <= ${getStaticValue(max)} `, - ), - - fieldGreaterThan: (fieldName, min, max) => getNewRecordValidationRule( - [fieldName], - `${fieldName} must be greater than ${min.toString()} and ${max.toString()}`, - `record['${fieldName}'] >= ${getStaticValue(min)} `, - ), -}); - -const addRecordValidationRule = recordNode => rule => recordNode.validationRules.push(rule); - -const createTrigger = () => ({ - actionName: '', - eventName: '', - // function, has access to event context, - // returns object that is used as parameter to action - // only used if triggered by event - optionsCreator: '', - // action runs if true, - // has access to event context - condition: '', -}); - -const createAction = () => ({ - name: '', - behaviourSource: '', - // name of function in actionSource - behaviourName: '', - // parameter passed into behaviour. - // any other parms passed at runtime e.g. - // by trigger, or manually, will be merged into this - initialOptions: {}, -}); - -const aggregateRules = [ - makerule('name', 'choose a name for the aggregate', - a => isNonEmptyString(a.name)), - makerule('aggregatedValue', 'aggregatedValue does not compile', - a => fp.isEmpty(a.aggregatedValue) - || executesWithoutException( - () => compilerUtil.compileCode(a.aggregatedValue), - )), -]; - -const validateAggregate = aggregate => applyRuleSet(aggregateRules)(aggregate); - -const validateAllAggregates = all => $(all, [ - fp.map(validateAggregate), - fp.flatten, -]); - -const ruleSet = (...sets) => fp.constant(fp.flatten([...sets])); - -const commonRules = [ - makerule('name', 'node name is not set', - node => stringNotEmpty(node.name)), - makerule('type', 'node type not recognised', - anyTrue(isRecord, isRoot, isIndex, isaggregateGroup)), -]; - -const recordRules = [ - makerule('fields', 'no fields have been added to the record', - node => isNonEmptyArray(node.fields)), - makerule('validationRules', "validation rule is missing a 'messageWhenValid' member", - node => fp.every(r => fp.has('messageWhenInvalid')(r))(node.validationRules)), - makerule('validationRules', "validation rule is missing a 'expressionWhenValid' member", - node => fp.every(r => fp.has('expressionWhenValid')(r))(node.validationRules)), -]; - - -const aggregateGroupRules = [ - makerule('condition', 'condition does not compile', - a => fp.isEmpty(a.condition) - || executesWithoutException( - () => compilerUtil.compileExpression(a.condition), - )), -]; - -const getRuleSet = node => switchCase( - - [isRecord, ruleSet( - commonRules, - recordRules, - )], - - [isIndex, ruleSet( - commonRules, - indexRuleSet, - )], - - [isaggregateGroup, ruleSet( - commonRules, - aggregateGroupRules, - )], - - [defaultCase, ruleSet(commonRules, [])], -)(node); - -const validateNode = node => applyRuleSet(getRuleSet(node))(node); - -const validateAll = (appHierarchy) => { - const flattened = getFlattenedHierarchy( - appHierarchy, - ); - - const duplicateNameRule = makerule( - 'name', 'node names must be unique under shared parent', - n => fp.filter(f => f.parent() === n.parent() - && f.name === n.name)(flattened).length === 1, - ); - - const duplicateNodeKeyErrors = $(flattened, [ - fp.map(n => applyRuleSet([duplicateNameRule])(n)), - fp.filter(isSomething), - fp.flatten, - ]); - - const fieldErrors = $(flattened, [ - fp.filter(isRecord), - fp.map(validateAllFields), - fp.flatten, - ]); - - const aggregateErrors = $(flattened, [ - fp.filter(isaggregateGroup), - fp.map(s => validateAllAggregates( - s.aggregates, - )), - fp.flatten, - ]); - - return $(flattened, [ - fp.map(validateNode), - fp.flatten, - fp.union(duplicateNodeKeyErrors), - fp.union(fieldErrors), - fp.union(aggregateErrors), - ]); -}; - -const actionRules = [ - makerule('name', 'action must have a name', - a => isNonEmptyString(a.name)), - makerule('behaviourName', 'must supply a behaviour name to the action', - a => isNonEmptyString(a.behaviourName)), - makerule('behaviourSource', 'must supply a behaviour source for the action', - a => isNonEmptyString(a.behaviourSource)), -]; - -const duplicateActionRule = makerule('', 'action name must be unique', () => {}); - -const validateAction = action => applyRuleSet(actionRules)(action); - - -const validateActions = (allActions) => { - const duplicateActions = $(allActions, [ - fp.filter(a => fp.filter(a2 => a2.name === a.name)(allActions).length > 1), - fp.map(a => validationError(duplicateActionRule, a)), - ]); - - const errors = $(allActions, [ - fp.map(validateAction), - fp.flatten, - fp.union(duplicateActions), - fp.uniqBy('name'), - ]); - - return errors; -}; - -const triggerRules = actions => ([ - makerule('actionName', 'must specify an action', - t => isNonEmptyString(t.actionName)), - makerule('eventName', 'must specify and event', - t => isNonEmptyString(t.eventName)), - makerule('actionName', 'specified action not supplied', - t => !t.actionName - || fp.some(a => a.name === t.actionName)(actions)), - makerule('eventName', 'invalid Event Name', - t => !t.eventName - || fp.includes(t.eventName)(eventsList)), - makerule('optionsCreator', 'Options Creator does not compile - check your expression', - (t) => { - if (!t.optionsCreator) return true; - try { - compilerUtil.compileCode(t.optionsCreator); - return true; - } catch (_) { return false; } - }), - makerule('condition', 'Trigger condition does not compile - check your expression', - (t) => { - if (!t.condition) return true; - try { - compilerUtil.compileExpression(t.condition); - return true; - } catch (_) { return false; } - }), -]); - -const validateTrigger = (trigger, allActions) => { - const errors = applyRuleSet(triggerRules(allActions))(trigger); - - return errors; -}; - -const validateTriggers = (triggers, allActions) => $(triggers, [ - fp.map(t => validateTrigger(t, allActions)), - fp.flatten, -]); - -const getApplicationDefinition = datastore => async () => { - const exists = await datastore.exists(appDefinitionFile); - - if (!exists) throw new Error('Application definition does not exist'); - - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.hierarchy = constructHierarchy( - appDefinition.hierarchy, - ); - return appDefinition; -}; - -const saveApplicationHierarchy = app => async hierarchy => apiWrapper( - app, - events.templateApi.saveApplicationHierarchy, - permission.writeTemplates.isAuthorized, - { hierarchy }, - _saveApplicationHierarchy, app.datastore, hierarchy, -); - - -const _saveApplicationHierarchy = async (datastore, hierarchy) => { - const validationErrors = await validateAll(hierarchy); - if (validationErrors.length > 0) { - throw new Error(`Hierarchy is invalid: ${_.join( - validationErrors.map(e => `${e.item.nodeKey ? e.item.nodeKey() : ''} : ${e.error}`), - ',', - )}`); - } - - if (await datastore.exists(appDefinitionFile)) { - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.hierarchy = hierarchy; - await datastore.updateJson(appDefinitionFile, appDefinition); - } else { - await datastore.createFolder('/.config'); - const appDefinition = { actions: [], triggers: [], hierarchy }; - await datastore.createJson(appDefinitionFile, appDefinition); - } -}; - -const saveActionsAndTriggers = app => async (actions, triggers) => apiWrapper( - app, - events.templateApi.saveActionsAndTriggers, - permission.writeTemplates.isAuthorized, - { actions, triggers }, - _saveActionsAndTriggers, app.datastore, actions, triggers, -); - -const _saveActionsAndTriggers = async (datastore, actions, triggers) => { - if (await datastore.exists(appDefinitionFile)) { - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.actions = actions; - appDefinition.triggers = triggers; - - const actionValidErrs = fp.map(e => e.error)(validateActions(actions)); - - if (actionValidErrs.length > 0) { - throw new BadRequestError(`Actions are invalid: ${_.join(actionValidErrs, ', ')}`); - } - - const triggerValidErrs = fp.map(e => e.error)(validateTriggers(triggers, actions)); - - if (triggerValidErrs.length > 0) { - throw new BadRequestError(`Triggers are invalid: ${_.join(triggerValidErrs, ', ')}`); - } - - await datastore.updateJson(appDefinitionFile, appDefinition); - } else { - throw new BadRequestError('Cannot save actions: Application definition does not exist'); - } -}; - -const getBehaviourSources = async (datastore) => { - await datastore.loadFile('/.config/behaviourSources.js'); -}; - -const api$1 = app => ({ - - getApplicationDefinition: getApplicationDefinition(app.datastore), - saveApplicationHierarchy: saveApplicationHierarchy(app), - saveActionsAndTriggers: saveActionsAndTriggers(app), - getBehaviourSources: () => getBehaviourSources(app.datastore), - getNewRootLevel, - constructNode, - getNewIndexTemplate, - getNewRecordTemplate, - getNewField, - validateField, - addField, - fieldErrors, - getNewRecordValidationRule, - commonRecordValidationRules, - addRecordValidationRule, - createAction, - createTrigger, - validateActions, - validateTrigger, - getNewAggregateGroupTemplate, - getNewAggregateTemplate, - constructHierarchy, - getNewSingleRecordTemplate, - allTypes: all$1, - validateNode, - validateAll, - validateTriggers, -}); - - -const getTemplateApi = app => api$1(app); - -const getUsers = app => async () => apiWrapper( - app, - events.authApi.getUsers, - permission.listUsers.isAuthorized, - {}, - _getUsers, app, -); - -const _getUsers = async app => $(await app.datastore.loadJson(USERS_LIST_FILE), [ - fp.map(stripUserOfSensitiveStuff), -]); - -const loadAccessLevels = app => async () => apiWrapper( - app, - events.authApi.loadAccessLevels, - permission.listAccessLevels.isAuthorized, - {}, - _loadAccessLevels, app, -); - -const _loadAccessLevels = async app => await app.datastore.loadJson(ACCESS_LEVELS_FILE); - -const dummyHash = '$argon2i$v=19$m=4096,t=3,p=1$UZRo409UYBGjHJS3CV6Uxw$rU84qUqPeORFzKYmYY0ceBLDaPO+JWSH4PfNiKXfIKk'; - -const authenticate = app => async (username, password) => apiWrapper( - app, - events.authApi.authenticate, - alwaysAuthorized, - { username, password }, - _authenticate, app, username, password, -); - -const _authenticate = async (app, username, password) => { - if (isNothingOrEmpty(username) || isNothingOrEmpty(password)) { return null; } - - const allUsers = await _getUsers(app); - let user = getUserByName( - allUsers, - username, - ); - - const notAUser = 'not-a-user'; - // continue with non-user - so time to verify remains consistent - // with verification of a valid user - if (!user || !user.enabled) { user = notAUser; } - - let userAuth; - try { - userAuth = await app.datastore.loadJson( - userAuthFile(username), - ); - } catch (_) { - userAuth = { accessLevels: [], passwordHash: dummyHash }; - } - - const permissions = await buildUserPermissions(app, user.accessLevels); - - const verified = await app.crypto.verify( - userAuth.passwordHash, - password, - ); - - if (user === notAUser) { return null; } - - return verified - ? { - ...user, permissions, temp: false, isUser: true, - } - : null; -}; - -const authenticateTemporaryAccess = app => async (tempAccessCode) => { - if (isNothingOrEmpty(tempAccessCode)) { return null; } - - const temp = parseTemporaryCode(tempAccessCode); - let user = $(await _getUsers(app), [ - fp.find(u => u.temporaryAccessId === temp.id), - ]); - - const notAUser = 'not-a-user'; - if (!user || !user.enabled) { user = notAUser; } - - let userAuth; - try { - userAuth = await app.datastore.loadJson( - userAuthFile(user.name), - ); - } catch (e) { - userAuth = { - temporaryAccessHash: dummyHash, - temporaryAccessExpiryEpoch: (await app.getEpochTime() + 10000), - }; - } - - if (userAuth.temporaryAccessExpiryEpoch < await app.getEpochTime()) { user = notAUser; } - - const tempCode = !temp.code ? shortid.generate() : temp.code; - const verified = await app.crypto.verify( - userAuth.temporaryAccessHash, - tempCode, - ); - - if (user === notAUser) { return null; } - - return verified - ? { - ...user, - permissions: [], - temp: true, - isUser: true, - } - : null; -}; - -const buildUserPermissions = async (app, userAccessLevels) => { - const allAccessLevels = await _loadAccessLevels(app); - - return $(allAccessLevels.levels, [ - fp.filter(l => fp.some(ua => l.name === ua)(userAccessLevels)), - fp.map(l => l.permissions), - fp.flatten, - ]); -}; - -const createTemporaryAccess$1 = app => async userName => apiWrapper( - app, - events.authApi.createTemporaryAccess, - alwaysAuthorized, - { userName }, - _createTemporaryAccess, app, userName, -); - -const _createTemporaryAccess = async (app, userName) => { - const tempCode = await getTemporaryCode(app); - - const lock = await getLock( - app, USERS_LOCK_FILE, 1000, 2, - ); - - if (isNolock(lock)) { throw new Error('Unable to create temporary access, could not get lock - try again'); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - - const user = getUserByName(users, userName); - user.temporaryAccessId = tempCode.temporaryAccessId; - - await app.datastore.updateJson( - USERS_LIST_FILE, - users, - ); - } finally { - await releaseLock(app, lock); - } - - const userAuth = await app.datastore.loadJson( - userAuthFile(userName), - ); - userAuth.temporaryAccessHash = tempCode.temporaryAccessHash; - - userAuth.temporaryAccessExpiryEpoch = tempCode.temporaryAccessExpiryEpoch; - - await app.datastore.updateJson( - userAuthFile(userName), - userAuth, - ); - - return tempCode.tempCode; -}; - -const getTemporaryCode = async (app) => { - const tempCode = shortid.generate() - + shortid.generate() - + shortid.generate() - + shortid.generate(); - - const tempId = shortid.generate(); - - return { - temporaryAccessHash: await app.crypto.hash( - tempCode, - ), - temporaryAccessExpiryEpoch: - (await app.getEpochTime()) + tempCodeExpiryLength, - tempCode: `tmp:${tempId}:${tempCode}`, - temporaryAccessId: tempId, - }; -}; - -const userRules = allUsers => [ - makerule('name', 'username must be set', - u => isNonEmptyString(u.name)), - makerule('accessLevels', 'user must have at least one access level', - u => u.accessLevels.length > 0), - makerule('name', 'username must be unique', - u => fp.filter(u2 => insensitiveEquals(u2.name, u.name))(allUsers).length === 1), - makerule('accessLevels', 'access levels must only contain stings', - u => all(isNonEmptyString)(u.accessLevels)), -]; - -const validateUser = () => (allusers, user) => applyRuleSet(userRules(allusers))(user); - -const getNewUser = app => () => apiWrapperSync( - app, - events.authApi.getNewUser, - permission.createUser.isAuthorized, - {}, - _getNewUser, app, -); - -const _getNewUser = () => ({ - name: '', - accessLevels: [], - enabled: true, - temporaryAccessId: '', -}); - -const getNewUserAuth = app => () => apiWrapperSync( - app, - events.authApi.getNewUserAuth, - permission.createUser.isAuthorized, - {}, - _getNewUserAuth, app, -); - -const _getNewUserAuth = () => ({ - passwordHash: '', - temporaryAccessHash: '', - temporaryAccessExpiryEpoch: 0, -}); - -const isValidPassword = app => password => apiWrapperSync( - app, - events.authApi.isValidPassword, - alwaysAuthorized, - { password }, - _isValidPassword, app, password, -); - -const _isValidPassword = (app, password) => scorePassword(password).score > 30; - -const changeMyPassword = app => async (currentPw, newpassword) => apiWrapper( - app, - events.authApi.changeMyPassword, - alwaysAuthorized, - { currentPw, newpassword }, - _changeMyPassword, app, currentPw, newpassword, -); - -const _changeMyPassword = async (app, currentPw, newpassword) => { - const existingAuth = await app.datastore.loadJson( - userAuthFile(app.user.name), - ); - - if (isSomething(existingAuth.passwordHash)) { - const verified = await app.crypto.verify( - existingAuth.passwordHash, - currentPw, - ); - - if (verified) { - await await doSet( - app, existingAuth, - app.user.name, newpassword, - ); - return true; - } - } - - return false; -}; - -const setPasswordFromTemporaryCode = app => async (tempCode, newpassword) => apiWrapper( - app, - events.authApi.setPasswordFromTemporaryCode, - alwaysAuthorized, - { tempCode, newpassword }, - _setPasswordFromTemporaryCode, app, tempCode, newpassword, -); - - -const _setPasswordFromTemporaryCode = async (app, tempCode, newpassword) => { - const currentTime = await app.getEpochTime(); - - const temp = parseTemporaryCode(tempCode); - - const user = $(await _getUsers(app), [ - fp.find(u => u.temporaryAccessId === temp.id), - ]); - - if (!user) { return false; } - - const existingAuth = await app.datastore.loadJson( - userAuthFile(user.name), - ); - - if (isSomething(existingAuth.temporaryAccessHash) - && existingAuth.temporaryAccessExpiryEpoch > currentTime) { - const verified = await app.crypto.verify( - existingAuth.temporaryAccessHash, - temp.code, - ); - - if (verified) { - await doSet( - app, existingAuth, - user.name, newpassword, - ); - return true; - } - } - - return false; -}; - -const doSet = async (app, auth, username, newpassword) => { - auth.temporaryAccessHash = ''; - auth.temporaryAccessExpiryEpoch = 0; - auth.passwordHash = await app.crypto.hash( - newpassword, - ); - await app.datastore.updateJson( - userAuthFile(username), - auth, - ); -}; - -const scorePassword = app => password => apiWrapperSync( - app, - events.authApi.scorePassword, - alwaysAuthorized, - { password }, - _scorePassword, password, -); - -const _scorePassword = (password) => { - // from https://stackoverflow.com/questions/948172/password-strength-meter - // thank you https://stackoverflow.com/users/46617/tm-lv - - let score = 0; - if (!password) { return score; } - - // award every unique letter until 5 repetitions - const letters = new Object(); - for (let i = 0; i < password.length; i++) { - letters[password[i]] = (letters[password[i]] || 0) + 1; - score += 5.0 / letters[password[i]]; - } - - // bonus points for mixing it up - const variations = { - digits: /\d/.test(password), - lower: /[a-z]/.test(password), - upper: /[A-Z]/.test(password), - nonWords: /\W/.test(password), - }; - - let variationCount = 0; - for (const check in variations) { - variationCount += (variations[check] == true) ? 1 : 0; - } - score += (variationCount - 1) * 10; - - const strengthText = score > 80 - ? 'strong' - : score > 60 - ? 'good' - : score >= 30 - ? 'weak' - : 'very weak'; - - return { - score: parseInt(score), - strengthText, - }; -}; - -const createUser$1 = app => async (user, password = null) => apiWrapper( - app, - events.authApi.createUser, - permission.createUser.isAuthorized, - { user, password }, - _createUser, app, user, password, -); - -const _createUser = async (app, user, password = null) => { - const lock = await getLock( - app, USERS_LOCK_FILE, 1000, 2, - ); - - if (isNolock(lock)) { throw new Error('Unable to create user, could not get lock - try again'); } - - const users = await app.datastore.loadJson(USERS_LIST_FILE); - - const userErrors = validateUser()([...users, user], user); - if (userErrors.length > 0) { throw new BadRequestError(`User is invalid. ${fp.join('; ')(userErrors)}`); } - - const { auth, tempCode, temporaryAccessId } = await getAccess( - app, password, - ); - user.tempCode = tempCode; - user.temporaryAccessId = temporaryAccessId; - - if (fp.some(u => insensitiveEquals(u.name, user.name))(users)) { - throw new BadRequestError('User already exists'); - } - - users.push( - stripUserOfSensitiveStuff(user), - ); - - await app.datastore.updateJson( - USERS_LIST_FILE, - users, - ); - - try { - await app.datastore.createJson( - userAuthFile(user.name), - auth, - ); - } catch (_) { - await app.datastore.updateJson( - userAuthFile(user.name), - auth, - ); - } - - await releaseLock(app, lock); - - return user; -}; - -const getAccess = async (app, password) => { - const auth = getNewUserAuth(app)(); - - if (isNonEmptyString(password)) { - if (isValidPassword(password)) { - auth.passwordHash = await app.crypto.hash(password); - auth.temporaryAccessHash = ''; - auth.temporaryAccessId = ''; - auth.temporaryAccessExpiryEpoch = 0; - return { auth }; - } - throw new BadRequestError('Password does not meet requirements'); - } else { - const tempAccess = await getTemporaryCode(app); - auth.temporaryAccessHash = tempAccess.temporaryAccessHash; - auth.temporaryAccessExpiryEpoch = tempAccess.temporaryAccessExpiryEpoch; - auth.passwordHash = ''; - return ({ - auth, - tempCode: tempAccess.tempCode, - temporaryAccessId: tempAccess.temporaryAccessId, - }); - } -}; - -const enableUser = app => async username => apiWrapper( - app, - events.authApi.enableUser, - permission.enableDisableUser.isAuthorized, - { username }, - _enableUser, app, username, -); - -const disableUser = app => async username => apiWrapper( - app, - events.authApi.disableUser, - permission.enableDisableUser.isAuthorized, - { username }, - _disableUser, app, username, -); - -const _enableUser = async (app, username) => await toggleUser(app, username, true); - -const _disableUser = async (app, username) => await toggleUser(app, username, false); - -const toggleUser = async (app, username, enabled) => { - const lock = await getLock(app, USERS_LOCK_FILE, 1000, 1, 0); - - const actionName = enabled ? 'enable' : 'disable'; - - if (isNolock(lock)) { throw new Error(`Could not ${actionName} user - cannot get lock`); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - const user = getUserByName(users, username); - if (!user) { throw new NotFoundError(`Could not find user to ${actionName}`); } - - if (user.enabled === !enabled) { - user.enabled = enabled; - await app.datastore.updateJson(USERS_LIST_FILE, users); - } - } finally { - releaseLock(app, lock); - } -}; - -const getNewAccessLevel = () => () => ({ - name: '', - permissions: [], - default:false -}); - -const isAllowedType = t => $(permissionTypes, [ - fp.values, - fp.includes(t), -]); - -const isRecordOrIndexType = t => fp.some(p => p === t)([ - permissionTypes.CREATE_RECORD, - permissionTypes.UPDATE_RECORD, - permissionTypes.DELETE_RECORD, - permissionTypes.READ_RECORD, - permissionTypes.READ_INDEX, - permissionTypes.EXECUTE_ACTION, -]); - - -const permissionRules = app => ([ - makerule('type', 'type must be one of allowed types', - p => isAllowedType(p.type)), - makerule('nodeKey', 'record and index permissions must include a valid nodeKey', - p => (!isRecordOrIndexType(p.type)) - || isSomething(getNode(app.hierarchy, p.nodeKey))), -]); - -const applyPermissionRules = app => applyRuleSet(permissionRules(app)); - -const accessLevelRules = allLevels => ([ - makerule('name', 'name must be set', - l => isNonEmptyString(l.name)), - makerule('name', 'access level names must be unique', - l => fp.isEmpty(l.name) - || fp.filter(a => insensitiveEquals(l.name, a.name))(allLevels).length === 1), -]); - -const applyLevelRules = allLevels => applyRuleSet(accessLevelRules(allLevels)); - -const validateAccessLevel = app => (allLevels, level) => { - const errs = $(level.permissions, [ - fp.map(applyPermissionRules(app)), - fp.flatten, - fp.concat( - applyLevelRules(allLevels)(level), - ), - ]); - - return errs; -}; - -const validateAccessLevels = app => allLevels => apiWrapperSync( - app, - events.authApi.validateAccessLevels, - alwaysAuthorized, - { allLevels }, - _validateAccessLevels, app, allLevels, -); - -const _validateAccessLevels = (app, allLevels) => $(allLevels, [ - fp.map(l => validateAccessLevel(app)(allLevels, l)), - fp.flatten, - fp.uniqWith((x, y) => x.field === y.field - && x.item === y.item - && x.error === y.error), -]); - -const saveAccessLevels = app => async accessLevels => apiWrapper( - app, - events.authApi.saveAccessLevels, - permission.writeAccessLevels.isAuthorized, - { accessLevels }, - _saveAccessLevels, app, accessLevels, -); - -const _saveAccessLevels = async (app, accessLevels) => { - const validationErrors = validateAccessLevels(app)(accessLevels.levels); - if (validationErrors.length > 0) { - const errs = $(validationErrors, [ - fp.map(e => e.error), - fp.join(', '), - ]); - throw new Error( - `Access Levels Invalid: ${errs}`, - ); - } - - const lock = await getLock( - app, ACCESS_LEVELS_LOCK_FILE, 2000, 2, - ); - - if (isNolock(lock)) { throw new Error('Could not get lock to save access levels'); } - - try { - const existing = await app.datastore.loadJson(ACCESS_LEVELS_FILE); - if (existing.version !== accessLevels.version) { throw new Error('Access levels have already been updated, since you loaded'); } - - accessLevels.version++; - - app.datastore.updateJson(ACCESS_LEVELS_FILE, accessLevels); - } finally { - await releaseLock(app, lock); - } -}; - -const generateFullPermissions = (app) => { - const allNodes = getFlattenedHierarchy(app.hierarchy); - const accessLevel = { permissions: [] }; - - const recordNodes = $(allNodes, [ - fp.filter(isRecord), - ]); - - for (const n of recordNodes) { - permission.createRecord.add(n.nodeKey(), accessLevel); - permission.updateRecord.add(n.nodeKey(), accessLevel); - permission.deleteRecord.add(n.nodeKey(), accessLevel); - permission.readRecord.add(n.nodeKey(), accessLevel); - } - - const indexNodes = $(allNodes, [ - fp.filter(isIndex), - ]); - - for (const n of indexNodes) { - permission.readIndex.add(n.nodeKey(), accessLevel); - } - - for (const a of fp.keys(app.actions)) { - permission.executeAction.add(a, accessLevel); - } - - $(permission, [ - fp.values, - fp.filter(p => !p.isNode), - fp.each(p => p.add(accessLevel)), - ]); - - return accessLevel.permissions; -}; - -const setUserAccessLevels$1 = app => async (userName, accessLevels) => apiWrapper( - app, - events.authApi.setUserAccessLevels, - permission.setUserAccessLevels.isAuthorized, - { userName, accessLevels }, - _setUserAccessLevels, app, userName, accessLevels, -); - -const _setUserAccessLevels = async (app, username, accessLevels) => { - const lock = await getLock(app, USERS_LOCK_FILE, 1000, 1, 0); - - const actualAccessLevels = $( - await app.datastore.loadJson(ACCESS_LEVELS_FILE), - [ - l => l.levels, - fp.map(l => l.name), - ], - ); - - const missing = fp.difference(accessLevels)(actualAccessLevels); - if (missing.length > 0) { - throw new Error(`Invalid access levels supplied: ${fp.join(', ', missing)}`); - } - - if (isNolock(lock)) { throw new Error('Could set user access levels cannot get lock'); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - const user = getUserByName(users, username); - if (!user) { throw new NotFoundError(`Could not find user with ${username}`); } - - user.accessLevels = accessLevels; - await app.datastore.updateJson(USERS_LIST_FILE, users); - } finally { - releaseLock(app, lock); - } -}; - -const getAuthApi = app => ({ - authenticate: authenticate(app), - authenticateTemporaryAccess: authenticateTemporaryAccess(app), - createTemporaryAccess: createTemporaryAccess$1(app), - createUser: createUser$1(app), - loadAccessLevels: loadAccessLevels(app), - enableUser: enableUser(app), - disableUser: disableUser(app), - getNewAccessLevel: getNewAccessLevel(), - getNewUser: getNewUser(app), - getNewUserAuth: getNewUserAuth(app), - getUsers: getUsers(app), - saveAccessLevels: saveAccessLevels(app), - isAuthorized: isAuthorized(app), - changeMyPassword: changeMyPassword(app), - setPasswordFromTemporaryCode: setPasswordFromTemporaryCode(app), - scorePassword, - isValidPassword: isValidPassword(app), - validateUser: validateUser(), - validateAccessLevels: validateAccessLevels(app), - generateFullPermissions: () => generateFullPermissions(app), - setUserAccessLevels: setUserAccessLevels$1(app), -}); - -const executeAction$1 = app => (actionName, options) => { - apiWrapperSync( - app, - events.actionsApi.execute, - permission.executeAction.isAuthorized(actionName), - { actionName, options }, - app.actions[actionName], options, - ); -}; - -const _executeAction = (behaviourSources, action, options) => behaviourSources[action.behaviourSource][action.behaviourName](options); - -const getActionsApi = app => ({ - execute: executeAction$1(app), -}); - -const publish = handlers => async (eventName, context = {}) => { - if (!fp.has(eventName)(handlers)) return; - - for (const handler of handlers[eventName]) { - await handler(eventName, context); - } -}; - -const subscribe = handlers => (eventName, handler) => { - if (!fp.has(eventName)(handlers)) { - handlers[eventName] = []; - } - handlers[eventName].push(handler); -}; - -const createEventAggregator = () => { - const handlers = {}; - const eventAggregator = ({ - publish: publish(handlers), - subscribe: subscribe(handlers), - }); - return eventAggregator; -}; - -const createJson = originalCreateFile => async (key, obj, retries = 2, delay = 100) => await retry(originalCreateFile, retries, delay, key, JSON.stringify(obj)); - -const createNewFile = originalCreateFile => async (path, content, retries = 2, delay = 100) => await retry(originalCreateFile, retries, delay, path, content); - -const loadJson = datastore => async (key, retries = 3, delay = 100) => { - try { - return await retry(JSON.parse, retries, delay, await datastore.loadFile(key)); - } catch (err) { - const newErr = new NotFoundError(err.message); - newErr.stack = err.stack; - throw(newErr); - } -}; - -const updateJson = datastore => async (key, obj, retries = 3, delay = 100) => { - try { - return await retry(datastore.updateFile, retries, delay, key, JSON.stringify(obj)); - } catch (err) { - const newErr = new NotFoundError(err.message); - newErr.stack = err.stack; - throw(newErr); - } -}; - -const setupDatastore = (datastore) => { - const originalCreateFile = datastore.createFile; - datastore.loadJson = loadJson(datastore); - datastore.createJson = createJson(originalCreateFile); - datastore.updateJson = updateJson(datastore); - datastore.createFile = createNewFile(originalCreateFile); - if (datastore.createEmptyDb) { delete datastore.createEmptyDb; } - return datastore; -}; - -const compileCode = code => { - let func; - - try { - func = compilerUtil.compileCode(code); - } catch(e) { - e.message = `Error compiling code : ${code} : ${e.message}`; - throw e; - } - - return func; -}; - -const compileExpression = code => { - let func; - - try { - func = compilerUtil.compileExpression(code); - } catch(e) { - e.message = `Error compiling expression : ${code} : ${e.message}`; - throw e; - } - - return func; -}; - -const initialiseActions = (subscribe, behaviourSources, actions, triggers, apis) => { - validateSources(behaviourSources, actions); - subscribeTriggers(subscribe, behaviourSources, actions, triggers, apis); - return createActionsCollection(behaviourSources, actions); -}; - -const createActionsCollection = (behaviourSources, actions) => $(actions, [ - fp.reduce((all, a) => { - all[a.name] = opts => _executeAction(behaviourSources, a, opts); - return all; - }, {}), -]); - -const subscribeTriggers = (subscribe, behaviourSources, actions, triggers, apis) => { - const createOptions = (optionsCreator, eventContext) => { - if (!optionsCreator) return {}; - const create = compileCode(optionsCreator); - return create({ context: eventContext, apis }); - }; - - const shouldRunTrigger = (trigger, eventContext) => { - if (!trigger.condition) return true; - const shouldRun = compileExpression(trigger.condition); - return shouldRun({ context: eventContext }); - }; - - for (let trig of triggers) { - subscribe(trig.eventName, async (ev, ctx) => { - if (shouldRunTrigger(trig, ctx)) { - await _executeAction( - behaviourSources, - fp.find(a => a.name === trig.actionName)(actions), - createOptions(trig.optionsCreator, ctx), - ); - } - }); - } -}; - -const validateSources = (behaviourSources, actions) => { - const declaredSources = $(actions, [ - fp.uniqBy(a => a.behaviourSource), - fp.map(a => a.behaviourSource), - ]); - - const suppliedSources = fp.keys(behaviourSources); - - const missingSources = fp.difference( - declaredSources, suppliedSources, - ); - - if (missingSources.length > 0) { - throw new BadRequestError(`Declared behaviour sources are not supplied: ${fp.join(', ', missingSources)}`); - } - - const missingBehaviours = $(actions, [ - fp.filter(a => !fp.isFunction(behaviourSources[a.behaviourSource][a.behaviourName])), - fp.map(a => `Action: ${a.name} : ${a.behaviourSource}.${a.behaviourName}`), - ]); - - if (missingBehaviours.length > 0) { - throw new NotFoundError(`Missing behaviours: could not find behaviour functions: ${fp.join(', ', missingBehaviours)}`); - } -}; - -const retrieve = async (app) => { - const transactionFiles = await app.datastore.getFolderContents( - TRANSACTIONS_FOLDER, - ); - - let transactions = []; - - if (fp.some(isBuildIndexFolder)(transactionFiles)) { - const buildIndexFolder = fp.find(isBuildIndexFolder)(transactionFiles); - - transactions = await retrieveBuildIndexTransactions( - app, - joinKey(TRANSACTIONS_FOLDER, buildIndexFolder), - ); - } - - if (transactions.length > 0) return transactions; - - return await retrieveStandardTransactions( - app, transactionFiles, - ); -}; - -const retrieveBuildIndexTransactions = async (app, buildIndexFolder) => { - const childFolders = await app.datastore.getFolderContents(buildIndexFolder); - if (childFolders.length === 0) { - // cleanup - await app.datastore.deleteFolder(buildIndexFolder); - return []; - } - - const getTransactionFiles = async (childFolderIndex = 0) => { - if (childFolderIndex >= childFolders.length) return []; - - const childFolderKey = joinKey(buildIndexFolder, childFolders[childFolderIndex]); - const files = await app.datastore.getFolderContents( - childFolderKey, - ); - - if (files.length === 0) { - await app.datastore.deleteFolder(childFolderKey); - return await getTransactionFiles(childFolderIndex + 1); - } - - return { childFolderKey, files }; - }; - - const transactionFiles = await getTransactionFiles(); - - if (transactionFiles.files.length === 0) return []; - - const transactions = $(transactionFiles.files, [ - fp.map(parseTransactionId), - ]); - - for (const t of transactions) { - const transactionContent = await app.datastore.loadJson( - joinKey( - transactionFiles.childFolderKey, - t.fullId, - ), - ); - t.record = await _load(app, transactionContent.recordKey); - } - - transactions.indexNode = $(buildIndexFolder, [ - getLastPartInKey, - nodeKeyHashFromBuildFolder, - getNodeFromNodeKeyHash(app.hierarchy), - ]); - - transactions.folderKey = transactionFiles.childFolderKey; - - return transactions; -}; - -const retrieveStandardTransactions = async (app, transactionFiles) => { - const transactionIds = $(transactionFiles, [ - fp.filter(f => f !== LOCK_FILENAME - && !isBuildIndexFolder(f)), - fp.map(parseTransactionId), - ]); - - const transactionIdsByRecord = $(transactionIds, [ - fp.groupBy('recordId'), - ]); - - const dedupedTransactions = []; - - const verify = async (t) => { - if (t.verified === true) return t; - - const id = getTransactionId( - t.recordId, - t.transactionType, - t.uniqueId, - ); - - const transaction = await app.datastore.loadJson( - joinKey(TRANSACTIONS_FOLDER, id), - ); - - if (isDelete(t)) { - t.record = transaction.record; - t.verified = true; - return t; - } - - const rec = await _load( - app, - transaction.recordKey, - ); - if (rec.transactionId === id) { - t.record = rec; - if (transaction.oldRecord) { t.oldRecord = transaction.oldRecord; } - t.verified = true; - } else { - t.verified = false; - } - - return t; - }; - - const pickOne = async (trans, forType) => { - const transForType = fp.filter(forType)(trans); - if (transForType.length === 1) { - const t = await verify(transForType[0]); - return (t.verified === true ? t : null); - } - for (let t of transForType) { - t = await verify(t); - if (t.verified === true) { return t; } - } - - return null; - }; - - for (const recordId in transactionIdsByRecord) { - const transIdsForRecord = transactionIdsByRecord[recordId]; - if (transIdsForRecord.length === 1) { - const t = await verify(transIdsForRecord[0]); - if (t.verified) { dedupedTransactions.push(t); } - continue; - } - if (fp.some(isDelete)(transIdsForRecord)) { - const t = await verify(fp.find(isDelete)(transIdsForRecord)); - if (t.verified) { dedupedTransactions.push(t); } - continue; - } - if (fp.some(isUpdate)(transIdsForRecord)) { - const upd = await pickOne(transIdsForRecord, isUpdate); - if (isSomething(upd) && upd.verified) { dedupedTransactions.push(upd); } - continue; - } - if (fp.some(isCreate)(transIdsForRecord)) { - const cre = await pickOne(transIdsForRecord, isCreate); - if (isSomething(cre)) { dedupedTransactions.push(cre); } - continue; - } - } - - const duplicates = $(transactionIds, [ - fp.filter(t => none(ddt => ddt.uniqueId === t.uniqueId)(dedupedTransactions)), - ]); - - - const deletePromises = fp.map(t => app.datastore.deleteFile( - joinKey( - TRANSACTIONS_FOLDER, - getTransactionId( - t.recordId, - t.transactionType, - t.uniqueId, - ), - ), - ))(duplicates); - - await Promise.all(deletePromises); - - return dedupedTransactions; -}; - -const parseTransactionId = (id) => { - const splitId = fp.split(idSep)(id); - return ({ - recordId: splitId[0], - transactionType: splitId[1], - uniqueId: splitId[2], - fullId: id, - }); -}; - -const getRelevantAncestorIndexes = (hierarchy, record) => { - const key = record.key; - const keyParts = splitKey(key); - const nodeId = getRecordNodeId(key); - - const flatHierarchy = _.orderBy(getFlattenedHierarchy(hierarchy), - [node => node.pathRegx().length], - ['desc']); - - const makeindexNodeAndDir_ForAncestorIndex = (indexNode, parentRecordDir) => makeIndexNodeAndDir(indexNode, joinKey(parentRecordDir, indexNode.name)); - - const traverseAncestorIndexesInPath = () => fp.reduce((acc, part) => { - const currentIndexKey = joinKey(acc.lastIndexKey, part); - acc.lastIndexKey = currentIndexKey; - const testPathRegx = p => new RegExp(`${p.pathRegx()}$`).test(currentIndexKey); - const nodeMatch = fp.find(testPathRegx)(flatHierarchy); - - if (isNothing(nodeMatch)) { return acc; } - - if (!isRecord(nodeMatch) - || nodeMatch.indexes.length === 0) { return acc; } - - const indexes = $(nodeMatch.indexes, [ - fp.filter(i => i.indexType === indexTypes.ancestor - && (i.allowedRecordNodeIds.length === 0 - || fp.includes(nodeId)(i.allowedRecordNodeIds))), - ]); - - const currentRecordDir = getRecordInfo(hierarchy, currentIndexKey).dir; - - fp.each(v => acc.nodesAndKeys.push( - makeindexNodeAndDir_ForAncestorIndex(v, currentRecordDir), - ))(indexes); - - return acc; - }, { lastIndexKey: '', nodesAndKeys: [] })(keyParts).nodesAndKeys; - - const rootIndexes = $(flatHierarchy, [ - fp.filter(n => isGlobalIndex(n) && recordNodeIdIsAllowed(n)(nodeId)), - fp.map(i => makeIndexNodeAndDir( - i, - getIndexDir(hierarchy, i.nodeKey()))), - ]); - - return fp.union(traverseAncestorIndexesInPath())(rootIndexes); -}; - -const getRelevantReverseReferenceIndexes = (hierarchy, record) => $(record.key, [ - getExactNodeForKey(hierarchy), - n => n.fields, - fp.filter(f => f.type === 'reference' - && isSomething(record[f.name]) - && isNonEmptyString(record[f.name].key)), - fp.map(f => $(f.typeOptions.reverseIndexNodeKeys, [ - fp.map(n => ({ - recordNode: getNode(hierarchy, n), - field: f, - })), - ])), - fp.flatten, - fp.map(n => makeIndexNodeAndDir( - n.recordNode, - joinKey( - getRecordInfo(hierarchy, record[n.field.name].key).dir, - n.recordNode.name), - )), -]); - -const makeIndexNodeAndDir = (indexNode, indexDir) => ({ indexNode, indexDir }); - -// adapted from https://github.com/dex4er/js-promise-writable - // Thank you :) - const promiseWriteableStream = stream => { - - let _errored; - - const _errorHandler = err => { - _errored = err; - }; - - stream.on("error", _errorHandler); - - const write = chunk => { - let rejected = false; - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err); - } - - if (!stream.writable || stream.closed || stream.destroyed) { - return reject(new Error("write after end")); - } - - const writeErrorHandler = err => { - _errored = undefined; - rejected = true; - reject(err); - }; - - stream.once("error", writeErrorHandler); - - const canWrite = stream.write(chunk); - - stream.removeListener("error", writeErrorHandler); - - if (canWrite) { - if (!rejected) { - resolve(chunk.length); - } - } else { - const errorHandler = err => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const drainHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const closeHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const finishHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const removeListeners = () => { - stream.removeListener("close", closeHandler); - stream.removeListener("drain", drainHandler); - stream.removeListener("error", errorHandler); - stream.removeListener("finish", finishHandler); - }; - - stream.on("close", closeHandler); - stream.on("drain", drainHandler); - stream.on("error", errorHandler); - stream.on("finish", finishHandler); - } - }) - }; - - const end = () => { - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err); - } - - if (!stream.writable || stream.closed || stream.destroyed) { - return resolve(); - } - - const finishHandler = () => { - removeListeners(); - resolve(); - }; - - const errorHandler = (err) => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const removeListeners = () => { - stream.removeListener("error", errorHandler); - stream.removeListener("finish", finishHandler); - }; - - stream.on("finish", finishHandler); - stream.on("error", errorHandler); - - stream.end(); - }) - }; - - return {write, end}; - }; - -const applyToShard = async (hierarchy, store, indexDir, - indexNode, indexShardKey, recordsToWrite, keysToRemove) => { - const createIfNotExists = recordsToWrite.length > 0; - const writer = await getWriter(hierarchy, store, indexDir, indexShardKey, indexNode, createIfNotExists); - if (writer === SHARD_DELETED) return; - - await writer.updateIndex(recordsToWrite, keysToRemove); - await swapTempFileIn(store, indexShardKey); -}; - -const SHARD_DELETED = 'SHARD_DELETED'; -const getWriter = async (hierarchy, store, indexDir, indexedDataKey, indexNode, createIfNotExists) => { - let readableStream = null; - - if (isShardedIndex(indexNode)) { - await ensureShardNameIsInShardMap(store, indexDir, indexedDataKey); - if(!await store.exists(indexedDataKey)) { - if (await store.exists(getParentKey(indexedDataKey))) { - await store.createFile(indexedDataKey, ""); - } else { - return SHARD_DELETED; - } - } - } - - try { - - readableStream = promiseReadableStream( - await store.readableFileStream(indexedDataKey) - ); - - } catch (e) { - - if (await store.exists(indexedDataKey)) { - throw e; - } else { - if (createIfNotExists) { - if(await store.exists(getParentKey(indexedDataKey))) { - await store.createFile(indexedDataKey, ''); - } else { - return SHARD_DELETED; - } - } else { - return SHARD_DELETED; - } - - readableStream = promiseReadableStream( - await store.readableFileStream(indexedDataKey) - ); - - } - } - - const writableStream = promiseWriteableStream( - await store.writableFileStream(indexedDataKey + ".temp") - ); - - return getIndexWriter( - hierarchy, indexNode, - readableStream, writableStream - ); -}; - -const swapTempFileIn = async (store, indexedDataKey, isRetry = false) => { - const tempFile = `${indexedDataKey}.temp`; - try { - await store.deleteFile(indexedDataKey); - } catch (e) { - // ignore failure, incase it has not been created yet - - // if parent folder does not exist, assume that this index - // should not be there - if(!await store.exists(getParentKey(indexedDataKey))) { - return; - } - } - try { - await store.renameFile(tempFile, indexedDataKey); - } catch (e) { - // retrying in case delete failure was for some other reason - if (!isRetry) { - await swapTempFileIn(store, indexedDataKey, true); - } else { - throw new Error("Failed to swap in index filed: " + e.message); - } - } -}; - -const executeTransactions = app => async (transactions) => { - const recordsByShard = mappedRecordsByIndexShard(app.hierarchy, transactions); - - for (const shard of fp.keys(recordsByShard)) { - await applyToShard( - app.hierarchy, app.datastore, - recordsByShard[shard].indexDir, - recordsByShard[shard].indexNode, - shard, - recordsByShard[shard].writes, - recordsByShard[shard].removes, - ); - } -}; - -const mappedRecordsByIndexShard = (hierarchy, transactions) => { - const updates = getUpdateTransactionsByShard( - hierarchy, transactions, - ); - - const created = getCreateTransactionsByShard( - hierarchy, transactions, - ); - const deletes = getDeleteTransactionsByShard( - hierarchy, transactions, - ); - - const indexBuild = getBuildIndexTransactionsByShard( - hierarchy, - transactions, - ); - - const toRemove = [ - ...deletes, - ...updates.toRemove, - ]; - - const toWrite = [ - ...created, - ...updates.toWrite, - ...indexBuild, - ]; - - const transByShard = {}; - - const initialiseShard = (t) => { - if (fp.isUndefined(transByShard[t.indexShardKey])) { - transByShard[t.indexShardKey] = { - writes: [], - removes: [], - indexDir: t.indexDir, - indexNodeKey: t.indexNode.nodeKey(), - indexNode: t.indexNode, - }; - } - }; - - for (const trans of toWrite) { - initialiseShard(trans); - transByShard[trans.indexShardKey].writes.push( - trans.mappedRecord.result, - ); - } - - for (const trans of toRemove) { - initialiseShard(trans); - transByShard[trans.indexShardKey].removes.push( - trans.mappedRecord.result.key, - ); - } - - return transByShard; -}; - -const getUpdateTransactionsByShard = (hierarchy, transactions) => { - const updateTransactions = $(transactions, [fp.filter(isUpdate)]); - - const evaluateIndex = (record, indexNodeAndPath) => { - const mappedRecord = evaluate(record)(indexNodeAndPath.indexNode); - return ({ - mappedRecord, - indexNode: indexNodeAndPath.indexNode, - indexDir: indexNodeAndPath.indexDir, - indexShardKey: getIndexedDataKey( - indexNodeAndPath.indexNode, - indexNodeAndPath.indexDir, - mappedRecord.result, - ), - }); - }; - - const getIndexNodesToApply = indexFilter => (t, indexes) => $(indexes, [ - fp.map(n => ({ - old: evaluateIndex(t.oldRecord, n), - new: evaluateIndex(t.record, n), - })), - fp.filter(indexFilter), - ]); - - const toRemoveFilter = (n, isUnreferenced) => n.old.mappedRecord.passedFilter === true - && (n.new.mappedRecord.passedFilter === false - || isUnreferenced); - - const toAddFilter = (n, isNewlyReferenced) => (n.old.mappedRecord.passedFilter === false - || isNewlyReferenced) - && n.new.mappedRecord.passedFilter === true; - - const toUpdateFilter = n => n.new.mappedRecord.passedFilter === true - && n.old.mappedRecord.passedFilter === true - && !fp.isEqual(n.old.mappedRecord.result, - n.new.mappedRecord.result); - - const toRemove = []; - const toWrite = []; - - for (const t of updateTransactions) { - const ancestorIdxs = getRelevantAncestorIndexes( - hierarchy, t.record, - ); - - const referenceChanges = diffReverseRefForUpdate( - hierarchy, t.oldRecord, t.record, - ); - - // old records to remove (filtered out) - const filteredOut_toRemove = _.union( - getIndexNodesToApply(toRemoveFilter)(t, ancestorIdxs), - // still referenced - check filter - getIndexNodesToApply(toRemoveFilter)(t, referenceChanges.notChanged), - // un referenced - remove if in there already - getIndexNodesToApply(n => toRemoveFilter(n, true))(t, referenceChanges.unReferenced), - ); - - // new records to add (filtered in) - const filteredIn_toAdd = _.union( - getIndexNodesToApply(toAddFilter)(t, ancestorIdxs), - // newly referenced - check filter - getIndexNodesToApply(n => toAddFilter(n, true))(t, referenceChanges.newlyReferenced), - // reference unchanged - rerun filter in case something else changed - getIndexNodesToApply(toAddFilter)(t, referenceChanges.notChanged), - ); - - const changed = _.union( - getIndexNodesToApply(toUpdateFilter)(t, ancestorIdxs), - // still referenced - recheck filter - getIndexNodesToApply(toUpdateFilter)(t, referenceChanges.notChanged), - ); - - const shardKeyChanged = $(changed, [ - fp.filter(c => c.old.indexShardKey !== c.new.indexShardKey), - ]); - - const changedInSameShard = $(shardKeyChanged, [ - fp.difference(changed), - ]); - - for (const res of shardKeyChanged) { - fp.pull(res)(changed); - filteredOut_toRemove.push(res); - filteredIn_toAdd.push(res); - } - - toRemove.push( - $(filteredOut_toRemove, [ - fp.map(i => i.old), - ]), - ); - - toWrite.push( - $(filteredIn_toAdd, [ - fp.map(i => i.new), - ]), - ); - - toWrite.push( - $(changedInSameShard, [ - fp.map(i => i.new), - ]), - ); - } - - return ({ - toRemove: fp.flatten(toRemove), - toWrite: fp.flatten(toWrite), - }); -}; - -const getBuildIndexTransactionsByShard = (hierarchy, transactions) => { - const buildTransactions = $(transactions, [fp.filter(isBuildIndex)]); - if (!isNonEmptyArray(buildTransactions)) return []; - const indexNode = transactions.indexNode; - - const getIndexDirs = (t) => { - if (isGlobalIndex(indexNode)) { - return [indexNode.nodeKey()]; - } - - if (isReferenceIndex(indexNode)) { - const recordNode = getExactNodeForKey(hierarchy)(t.record.key); - const refFields = $(recordNode.fields, [ - fp.filter(fieldReversesReferenceToIndex(indexNode)), - ]); - const indexDirs = []; - for (const refField of refFields) { - const refValue = t.record[refField.name]; - if (isSomething(refValue) - && isNonEmptyString(refValue.key)) { - const indexDir = joinKey( - getRecordInfo(hierarchy, refValue.key).dir, - indexNode.name, - ); - - if (!fp.includes(indexDir)(indexDirs)) { indexDirs.push(indexDir); } - } - } - return indexDirs; - } - - const indexKey = joinKey( - getActualKeyOfParent( - indexNode.parent().nodeKey(), - t.record.key, - ), - indexNode.name, - ); - - return [getIndexDir(hierarchy, indexKey)]; - }; - - return $(buildTransactions, [ - fp.map((t) => { - const mappedRecord = evaluate(t.record)(indexNode); - if (!mappedRecord.passedFilter) return null; - const indexDirs = getIndexDirs(t); - return $(indexDirs, [ - fp.map(indexDir => ({ - mappedRecord, - indexNode, - indexDir, - indexShardKey: getIndexedDataKey( - indexNode, - indexDir, - mappedRecord.result, - ), - })), - ]); - }), - fp.flatten, - fp.filter(isSomething), - ]); -}; - -const get_Create_Delete_TransactionsByShard = pred => (hierarchy, transactions) => { - const createTransactions = $(transactions, [fp.filter(pred)]); - - const getIndexNodesToApply = (t, indexes) => $(indexes, [ - fp.map((n) => { - const mappedRecord = evaluate(t.record)(n.indexNode); - return ({ - mappedRecord, - indexNode: n.indexNode, - indexDir: n.indexDir, - indexShardKey: getIndexedDataKey( - n.indexNode, - n.indexDir, - mappedRecord.result, - ), - }); - }), - fp.filter(n => n.mappedRecord.passedFilter), - ]); - - const allToApply = []; - - for (const t of createTransactions) { - const ancestorIdxs = getRelevantAncestorIndexes(hierarchy, t.record); - const reverseRef = getRelevantReverseReferenceIndexes(hierarchy, t.record); - - allToApply.push( - getIndexNodesToApply(t, ancestorIdxs), - ); - allToApply.push( - getIndexNodesToApply(t, reverseRef), - ); - } - - return fp.flatten(allToApply); -}; - -const getDeleteTransactionsByShard = get_Create_Delete_TransactionsByShard(isDelete); - -const getCreateTransactionsByShard = get_Create_Delete_TransactionsByShard(isCreate); - -const diffReverseRefForUpdate = (appHierarchy, oldRecord, newRecord) => { - const oldIndexes = getRelevantReverseReferenceIndexes( - appHierarchy, oldRecord, - ); - const newIndexes = getRelevantReverseReferenceIndexes( - appHierarchy, newRecord, - ); - - const unReferenced = fp.differenceBy( - i => i.indexDir, - oldIndexes, newIndexes, - ); - - const newlyReferenced = fp.differenceBy( - i => i.indexDir, - newIndexes, oldIndexes, - ); - - const notChanged = fp.intersectionBy( - i => i.indexDir, - newIndexes, oldIndexes, - ); - - return { - unReferenced, - newlyReferenced, - notChanged, - }; -}; - -const cleanup = async (app) => { - const lock = await getTransactionLock(app); - if (isNolock(lock)) return; - - try { - const transactions = await retrieve(app); - if (transactions.length > 0) { - await executeTransactions(app)(transactions); - - const folder = transactions.folderKey - ? transactions.folderKey - : TRANSACTIONS_FOLDER; - - const deleteFiles = $(transactions, [ - fp.map(t => joinKey( - folder, - getTransactionId( - t.recordId, t.transactionType, - t.uniqueId, - ), - )), - fp.map(app.datastore.deleteFile), - ]); - - await Promise.all(deleteFiles); - } - } finally { - await releaseLock(app, lock); - } -}; - -const getTransactionLock = async app => await getLock( - app, LOCK_FILE_KEY, - timeoutMilliseconds, maxLockRetries, -); - -const initialiseData = async (datastore, applicationDefinition, accessLevels) => { - await datastore.createFolder(configFolder); - await datastore.createJson(appDefinitionFile, applicationDefinition); - - await initialiseRootCollections(datastore, applicationDefinition.hierarchy); - await initialiseRootIndexes(datastore, applicationDefinition.hierarchy); - - await datastore.createFolder(TRANSACTIONS_FOLDER); - - await datastore.createFolder(AUTH_FOLDER); - - await datastore.createJson(USERS_LIST_FILE, []); - - await datastore.createJson( - ACCESS_LEVELS_FILE, - accessLevels ? accessLevels : { version: 0, levels: [] }); - - await initialiseRootSingleRecords(datastore, applicationDefinition.hierarchy); -}; - -const initialiseRootIndexes = async (datastore, hierarchy) => { - const flathierarchy = getFlattenedHierarchy(hierarchy); - const globalIndexes = $(flathierarchy, [ - fp.filter(isGlobalIndex), - ]); - - for (const index of globalIndexes) { - if (!await datastore.exists(index.nodeKey())) { - await initialiseIndex(datastore, '', index); - } - } -}; - -const initialiseRootSingleRecords = async (datastore, hierarchy) => { - const app = { - publish:()=>{}, - cleanupTransactions: () => {}, - datastore, hierarchy - }; - - const flathierarchy = getFlattenedHierarchy(hierarchy); - const singleRecords = $(flathierarchy, [ - fp.filter(isSingleRecord), - ]); - - for (let record of singleRecords) { - await datastore.createFolder(record.nodeKey()); - const result = _getNew(record, ""); - await _save(app,result); - } -}; - -const getDatabaseManager = databaseManager => ({ - createEmptyMasterDb: createEmptyMasterDb(databaseManager), - createEmptyInstanceDb: createEmptyInstanceDb(databaseManager), - getInstanceDbRootConfig: databaseManager.getInstanceDbRootConfig, - masterDatastoreConfig: getMasterDatastoreConfig(databaseManager), - getInstanceDatastoreConfig: getInstanceDatastoreConfig(databaseManager), -}); - -const getMasterDatastoreConfig = databaseManager => databaseManager.getDatastoreConfig('master'); - -const getInstanceDatastoreConfig = databaseManager => (applicationId, instanceId) => databaseManager.getDatastoreConfig( - applicationId, instanceId, -); - -const createEmptyMasterDb = databaseManager => async () => await databaseManager.createEmptyDb('master'); - -const createEmptyInstanceDb = databaseManager => async (applicationId, instanceId) => { - if (isNothing(applicationId)) { throw new Error('CreateDb: application id not supplied'); } - if (isNothing(instanceId)) { throw new Error('CreateDb: instance id not supplied'); } - - return await databaseManager.createEmptyDb( - applicationId, - instanceId, - ); -}; - -const getAppApis = async (store, behaviourSources = null, - cleanupTransactions = null, - getEpochTime = null, - crypto = null, - appDefinition = null) => { - - store = setupDatastore(store); - - if(!appDefinition) - appDefinition = await getApplicationDefinition(store)(); - - if(!behaviourSources) - behaviourSources = await getBehaviourSources(store); - - const eventAggregator = createEventAggregator(); - - const app = { - datastore:store, - crypto, - publish:eventAggregator.publish, - hierarchy:appDefinition.hierarchy, - actions:appDefinition.actions - }; - - const templateApi = getTemplateApi(app); - - app.cleanupTransactions = isSomething(cleanupTransactions) - ? cleanupTransactions - : async () => await cleanup(app); - - app.getEpochTime = isSomething(getEpochTime) - ? getEpochTime - : async () => (new Date()).getTime(); - - const recordApi = getRecordApi(app); - const collectionApi = getCollectionApi(app); - const indexApi = getIndexApi(app); - const authApi = getAuthApi(app); - const actionsApi = getActionsApi(app); - - const authenticateAs = async (username, password) => { - app.user = await authApi.authenticate(username, password); - }; - - const withFullAccess = () => - userWithFullAccess(app); - - const asUser = (user) => { - app.user = user; - }; - - let apis = { - recordApi, - templateApi, - collectionApi, - indexApi, - authApi, - actionsApi, - subscribe: eventAggregator.subscribe, - authenticateAs, - withFullAccess, - asUser - }; - - apis.actions = initialiseActions( - eventAggregator.subscribe, - behaviourSources, - appDefinition.actions, - appDefinition.triggers, - apis); - - - return apis; -}; - -const userWithFullAccess = (app) => { - app.user = { - name: "app", - permissions : generateFullPermissions(app), - isUser:false, - temp:false - }; - return app.user; -}; - -exports.common = index; -exports.default = getAppApis; -exports.events = events; -exports.eventsList = eventsList; -exports.getActionsApi = getActionsApi; -exports.getAppApis = getAppApis; -exports.getAuthApi = getAuthApi; -exports.getCollectionApi = getCollectionApi; -exports.getDatabaseManager = getDatabaseManager; -exports.getIndexApi = getIndexApi; -exports.getRecordApi = getRecordApi; -exports.getTemplateApi = getTemplateApi; -exports.hierarchy = hierarchy; -exports.initialiseData = initialiseData; -exports.setupDatastore = setupDatastore; -exports.userWithFullAccess = userWithFullAccess; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVkaWJhc2UtY29yZS5janMuanMiLCJzb3VyY2VzIjpbIi4uL3NyYy9jb21tb24vZXZlbnRzLmpzIiwiLi4vc3JjL2NvbW1vbi9lcnJvcnMuanMiLCIuLi9zcmMvY29tbW9uL2FwaVdyYXBwZXIuanMiLCIuLi9zcmMvY29tbW9uL2xvY2suanMiLCIuLi9zcmMvY29tbW9uL2luZGV4LmpzIiwiLi4vc3JjL2NvbW1vbi92YWxpZGF0aW9uQ29tbW9uLmpzIiwiLi4vc3JjL2luZGV4aW5nL2V2YWx1YXRlLmpzIiwiLi4vc3JjL3RlbXBsYXRlQXBpL2luZGV4ZXMuanMiLCIuLi9zcmMvdGVtcGxhdGVBcGkvaGllcmFyY2h5LmpzIiwiLi4vc3JjL3R5cGVzL3R5cGVIZWxwZXJzLmpzIiwiLi4vc3JjL3R5cGVzL3N0cmluZy5qcyIsIi4uL3NyYy90eXBlcy9ib29sLmpzIiwiLi4vc3JjL3R5cGVzL251bWJlci5qcyIsIi4uL3NyYy90eXBlcy9kYXRldGltZS5qcyIsIi4uL3NyYy90eXBlcy9hcnJheS5qcyIsIi4uL3NyYy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AgICAgICBjdXJyZW50Rm9sZGVyQ29udGVudHNbbG9vcExldmVsXS5jb250ZW50cyA9IGF3YWl0IGFwcC5kYXRhc3RvcmUuZ2V0Rm9sZGVyQ29udGVudHMoXG4gICAgICAgICAgICBuZXh0TG9vcEZvbGRlclxuICAgICAgICAgICk7XG4gICAgICAgICAgY3VycmVudEZvbGRlckNvbnRlbnRzW2xvb3BMZXZlbF0ucGF0aCA9IG5leHRMb29wRm9sZGVyO1xuICAgICAgICAgIGxvb3BMZXZlbCs9MTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyB0cnVlID09aGFzIG1vcmUgaWRzLi4uIChqdXN0IGxvYWRlZCBtb3JlKVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG5cbiAgICBjb25zdCBpZHNDdXJyZW50Rm9sZGVyID0gKCkgPT4gXG4gICAgICBjdXJyZW50Rm9sZGVyQ29udGVudHNbY3VycmVudEZvbGRlckNvbnRlbnRzLmxlbmd0aCAtIDFdLmNvbnRlbnRzO1xuXG4gICAgY29uc3QgZmluaW5zaGVkUmVzdWx0ID0gKHsgZG9uZTogdHJ1ZSwgcmVzdWx0OiB7IGlkczogW10sIGNvbGxlY3Rpb25LZXkgfSB9KTtcblxuICAgIGxldCBoYXNTdGFydGVkID0gZmFsc2U7XG4gICAgbGV0IGhhc01vcmUgPSB0cnVlO1xuICAgIGNvbnN0IGdldElkc0Zyb21DdXJyZW50Zm9sZGVyID0gYXN5bmMgKCkgPT4ge1xuXG4gICAgICBpZighaGFzTW9yZSkge1xuICAgICAgICByZXR1cm4gZmluaW5zaGVkUmVzdWx0O1xuICAgICAgfVxuXG4gICAgICBpZighaGFzU3RhcnRlZCkge1xuICAgICAgICBoYXNNb3JlID0gYXdhaXQgZmlyc3RGb2xkZXIoKTtcbiAgICAgICAgaGFzU3RhcnRlZCA9IHRydWU7XG4gICAgICAgIHJldHVybiAoe1xuICAgICAgICAgIHJlc3VsdDoge1xuICAgICAgICAgICAga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gIGlmIChfZXJyb3JlZCkge1xuICAgICAgICAgIGNvbnN0IGVyciA9IF9lcnJvcmVkO1xuICAgICAgICAgIF9lcnJvcmVkID0gdW5kZWZpbmVkO1xuICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKVxuICAgICAgICB9XG4gIFxuICAgICAgICBpZiAoIXN0cmVhbS5yZWFkYWJsZSB8fCBzdHJlYW0uY2xvc2VkIHx8IHN0cmVhbS5kZXN0cm95ZWQpIHtcbiAgICAgICAgICByZXR1cm4gcmVzb2x2ZSgpO1xuICAgICAgICB9XG4gIFxuICAgICAgICBjb25zdCByZWFkYWJsZUhhbmRsZXIgPSAoKSA9PiB7XG4gICAgICAgICAgY29uc3QgY2h1bmsgPSBzdHJlYW0ucmVhZChzaXplKTtcbiAgXG4gICAgICAgICAgaWYgKGNodW5rKSB7XG4gICAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIHJlc29sdmUoY2h1bmspO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3QgY2xvc2VIYW5kbGVyID0gKCkgPT4ge1xuICAgICAgICAgIHJlbW92ZUxpc3RlbmVycygpO1xuICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3QgZW5kSGFuZGxlciA9ICgpID0+IHtcbiAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgIH1cbiAgXG4gICAgICAgIGNvbnN0IGVycm9ySGFuZGxlciA9IChlcnIpID0+IHtcbiAgICAgICAgICBfZXJyb3JlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3QgcmVtb3ZlTGlzdGVuZXJzID0gKCkgPT4ge1xuICAgICAgICAgIHN0cmVhbS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RikgPDwgMHg2IHwgKHNlY29uZEJ5dGUgJiAweDNGKVxuICAgICAgICAgICAgaWYgKHRlbXBDb2RlUG9pbnQgPiAweDdGKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGlmICgoc2Vjb25kQnl0ZSAmIDB4QzApID09PSAweDgwICYmICh0aGlyZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweEYpIDw8IDB4QyB8IChzZWNvbmRCeXRlICYgMHgzRikgPDwgMHg2IHwgKHRoaXJkQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0ZGICYmICh0ZW1wQ29kZVBvaW50IDwgMHhEODAwIHx8IHRlbXBDb2RlUG9pbnQgPiAweERGRkYpKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGZvdXJ0aEJ5dGUgPSBidWZbaSArIDNdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODAgJiYgKHRoaXJkQnl0ZSAmIDB4QzApID09PSAweDgwICYmIChmb3VydGhCeXRlICYgMHhDMCkgPT09IDB4ODApIHtcbiAgICAgICA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WFkYWJsZVN0cmVhbSwgc2NoZW1hKSA9PiBhc3luYyAob25HZXRJdGVtLCBvbkdldFRleHQpID0+IHtcbiAgICBjb25zdCByZWFkSW5wdXQgPSBuZXdJbnB1dFJlYWRlcihyZWFkYWJsZVN0cmVhbSk7XG4gICAgbGV0IHRleHQgPSBhd2FpdCByZWFkSW5wdXQoKTtcbiAgICBsZXQgc3RhdHVzID0gQ09OVElOVUVfUkVBRElOR19SRUNPUkRTO1xuICAgIHdoaWxlKHRleHQubGVuZ3RoID4gMCkge1xuXG4gICAgICAgIGlmKHN0YXR1cyA9PT0gUkVBRF9SRU1BSU5JTkdfVEVYVCkge1xuICAgICAgICAgICAgYXdhaXQgb25HZXRUZXh0KHRleHQpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZihzdGF0dXMgPT09IENBTkNFTF9SRUFEKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgcm93VGV4dCA9IFwiXCI7XG4gICAgICAgIGxldCBjdXJyZW50Q2hhckluZGV4PTA7XG4gICAgICAgIGZvcihsZXQgY3VycmVudENoYXIgb2YgdGV4dCkge1xuICAgICAgICAgICAgcm93VGV4dCArPSBjdXJyZW50Q2hhcjtcbiAgICAgICAgICAgIGlmKGN1cnJlbnRDaGFyID09PSBcIlxcclwiKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gYXdhaXQgb25HZXRJdGVtKFxuICAgICAgICAgICAgICAgICAgICBkZXNlcmlhbGl6ZVJvdyhzY2hlbWEsIHJvd1RleHQpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICByb3dUZXh0ID0gXCJcIjtcbiAgICAgICAgICAgICAgICBpZihzdGF0dXMgPT09IFJFQURfUkVNQUlOSU5HX1RFWFQpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudENoYXJJbmRleCsrO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYoY3VycmVudENoYXJJbmRleCA8IHRleHQubGVuZ3RoIC0xKSB7XG4gICAgICAgICAgICBhd2FpdCBvbkdldFRleHQodGV4dC5zdWJzdHJpbmcoY3VycmVudENoYXJJbmRleCArIDEpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRleHQgPSBhd2FpdCByZWFkSW5wdXQoKTtcbiAgICB9XG5cbiAgICBhd2FpdCByZWFkYWJsZVN0cmVhbS5kZXN0cm95KCk7XG5cbn07XG5cbmNvbnN0IG5ld091dHB1dFdyaXRlciA9IChmbHVzaEJvdW5kYXJ5LCB3cml0YWJsZVN0cmVhbSkgPT4ge1xuICAgIFxuICAgIGxldCBjdXJyZW50QnVmZmVyID0gbnVsbDtcblxuICAgIHJldHVybiBhc3luYyAodGV4dCkgPT4ge1xuXG4gICAgICAgIGlmKGlzU3RyaW5nKHRleHQpICYmIGN1cnJlbnRCdWZmZXIgPT09IG51bGwpXG4gICAgICAgICAgICBjdXJyZW50QnVmZmVyID0gQnVmZmVyLmZyb20odGV4dCwgXCJ1dGY4XCIpO1xuICAgICAgICBlbHNlIGlmKGlzU3RyaW5nKHRleHQpKVxuICAgICAgICAgICAgY3VycmVudEJ1ZmZlciA9IEJ1ZmZlci5jb25jYXQoW1xuICAgICAgICAgICAgICAgIGN1cnJlbnRCdWZmZXIsXG4gICAgICAgICAgICAgICAgQnVmZmVyLmZyb20odGV4dCwgXCJ1dGY4XCIpXG4gICAgICAgICAgICBdKTtcbiAgICAgICAgXG4gICAgICAgIGlmKGN1cnJlbnRCdWZmZXIgIT09IG51bGwgJiZcbiAgICAgICAgICAgIChjdXJyZW50QnVmZmVyLmxlbmd0aCA+IGZsdXNoQm91bmRhcnlcbiAgICAgICAgICAgICB8fCAhaXNTdHJpbmcodGV4dCkpKSB7XG5cbiAgICAgICAgICAgIGF3YWl0IHdyaXRhYmxlU3RyZWFtLndyaXRl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ycmVudFByb3AubmFtZV0gPSB2YWx1ZTtcbiAgICB9O1xuICAgIFxuICAgIHdoaWxlKGN1cnJlbnRQcm9wSW5kZXggPCBzY2hlbWEubGVuZ3RoKSB7XG5cbiAgICAgICAgaWYoY3VycmVudENoYXJJbmRleCA8IHJvd1RleHQubGVuZ3RoKSB7XG4gICAgICAgICAgICBjb25zdCBjdXJyZW50Q2hhciA9IHJvd1RleHRbY3VycmVudENoYXJJbmRleF07XG4gICAgICAgICAgICBpZihpc0VzY2FwZWQpIHtcbiAgICAgICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCJyXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCArPSBcIlxcclwiO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQgKz0gY3VycmVudENoYXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzRXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCIsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0Q3VycmVudFByb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQcm9wSW5kZXgrKztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYoY3VycmVudENoYXIgPT09IFwiXFxcXFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGlzRXNjYXBlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCArPSBjdXJyZW50Q2hhcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjdXJyZW50Q2hhckluZGV4Kys7IFxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCA9IFwiXCI7XG4gICAgICAgICAgICBzZXRDdXJyZW50UHJvcCgpO1xuICAgICAgICAgICAgY3VycmVudFByb3BJbmRleCsrO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGl0ZW07XG59O1xuXG5leHBvcnQgY29uc3Qgc2VyaWFsaXplSXRlbSA9IChzY2hlbWEsIGl0ZW0pICA9PiB7XG5cbiAgICBsZXQgcm93VGV4dCA9IFwiXCJcblxuICAgIGZvcihsZXQgcHJvcCBvZiBzY2hlbWEpIHtcbiAgICAgICAgY29uc3QgdHlwZSA9IGdldFR5cGUocHJvcC50eXBlKTtcbiAgICAgICAgY29uc3QgdmFsdWUgPSBoYXMocHJvcC5uYW1lKShpdGVtKVxuICAgICAgICAgICAgICAgICAgICAgID8gaXRlbVtwcm9wLm5hbWVdXG4gICAgICAgICAgICAgICAgICAgICAgOiB0eXBlLmdldERlZmF1bHRWYWx1ZSgpXG4gICAgICAgIFxuICAgICAgICBjb25zdCB2YWxTdHIgPSB0eXBlLnN0cmluZ2lmeSh2YWx1ZSk7XG5cbiAgICAgICAgZm9yKGxldCBpID0gMDsgaSA8IHZhbFN0ci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgY29uc3QgY3VycmVudENoYXIgPSB2YWxTdHJbaV07XG4gICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCIsXCIgXG4gICAgICAgICAgICAgICB8fCBjdXJyZW50Q2hhciA9PT0gXCJcXHJcIiBcbiAgICAgICAgICAgICAgIHx8IGN1cnJlbnRDaGFyID09PSBcIlxcXFxcIikge1xuICAgICAgICAgICAgICAgIHJvd1RleHQgKz0gXCJcXFxcXCI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmKGN1cnJlbnRDaGFyID09PSBcIlxcclwiKSB7XG4gICAgICAgICAgICAgICAgcm93VGV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vbnN0IGVycm9ySGFuZGxlciA9IGVyciA9PiB7XG4gICAgICAgICAgICBfZXJyb3JlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgICAgfVxuICBcbiAgICAgICAgICBjb25zdCBkcmFpbkhhbmRsZXIgPSAoKSA9PiB7XG4gICAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIHJlc29sdmUoY2h1bmsubGVuZ3RoKTtcbiAgICAgICAgICB9XG4gIFxuICAgICAgICAgIGNvbnN0IGNsb3NlSGFuZGxlciA9ICgpID0+IHtcbiAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgcmVzb2x2ZShjaHVuay5sZW5ndGgpO1xuICAgICAgICAgIH1cbiAgXG4gICAgICAgICAgY29uc3QgZmluaXNoSGFuZGxlciA9ICgpID0+IHtcbiAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgcmVzb2x2ZShjaHVuay5sZW5ndGgpO1xuICAgICAgICAgIH1cbiAgXG4gICAgICAgICAgY29uc3QgcmVtb3ZlTGlzdGVuZXJzID0gKCkgPT4ge1xuICAgICAgICAgICAgc3RyZWFtLnJlbW92ZUxpc3RlbmVyKFwiY2xvc2VcIiwgY2xvc2VIYW5kbGVyKTtcbiAgICAgICAgICAgIHN0cmVhbS5yZW1vdmVMaXN0ZW5lcihcImRyYWluXCIsIGRyYWluSGFuZGxlcik7XG4gICAgICAgICAgICBzdHJlYW0ucmVtb3ZlTGlzdGVuZXIoXCJlcnJvclwiLCBlcnJvckhhbmRsZXIpO1xuICAgICAgICAgICAgc3RyZWFtLnJlbW92ZUxpc3RlbmVyKFwiZmluaXNoXCIsIGZpbmlzaEhhbmRsZXIpO1xuICAgICAgICAgIH1cbiAgXG4gICAgICAgICAgc3RyZWFtLm9uKFwiY2xvc2VcIiwgY2xvc2VIYW5kbGVyKTtcbiAgICAgICAgICBzdHJlYW0ub24oXCJkcmFpblwiLCBkcmFpbkhhbmRsZXIpO1xuICAgICAgICAgIHN0cmVhbS5vbihcImVycm9yXCIsIGVycm9ySGFuZGxlcik7XG4gICAgICAgICAgc3RyZWFtLm9uKFwiZmluaXNoXCIsIGZpbmlzaEhhbmRsZXIpO1xuICAgICAgICB9XG4gICAgICB9KVxuICAgIH1cbiAgXG4gICAgY29uc3QgZW5kID0gKCkgPT4ge1xuICBcbiAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgIGlmIChfZXJyb3JlZCkge1xuICAgICAgICAgIGNvbnN0IGVyciA9IF9lcnJvcmVkO1xuICAgICAgICAgIF9lcnJvcmVkID0gdW5kZWZpbmVkO1xuICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgaWYgKCFzdHJlYW0ud3JpdGFibGUgfHwgc3RyZWFtLmNsb3NlZCB8fCBzdHJlYW0uZGVzdHJveWVkKSB7XG4gICAgICAgICAgcmV0dXJuIHJlc29sdmUoKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3QgZmluaXNoSGFuZGxlciA9ICgpID0+IHtcbiAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgIH1cbiAgXG4gICAgICAgIGNvbnN0IGVycm9ySGFuZGxlciA9IChlcnIpID0+IHtcbiAgICAgICAgICBfZXJyb3JlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3QgcmVtb3ZlTGlzdGVuZXJzID0gKCkgPT4ge1xuICAgICAgICAgIHN0cmVhbS5yZW1vdmVMaXN0ZW5l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s7Ozs7OzsifQ== diff --git a/packages/core/dist/budibase-core.esm.mjs b/packages/core/dist/budibase-core.esm.mjs deleted file mode 100644 index 92be43d1c1..0000000000 --- a/packages/core/dist/budibase-core.esm.mjs +++ /dev/null @@ -1,8276 +0,0 @@ -import { union, reduce, isUndefined, cloneDeep, split, toNumber, isArray as isArray$1, filter, isNull, join as join$1, isNaN as isNaN$1, isEmpty, constant, some, includes, isInteger, isDate, isString, map, keys, isFunction, countBy, last, find, take, first, intersection, mapValues, has, isBoolean, isNumber, isObjectLike, isObject, clone, values, keyBy, orderBy, flatten, concat, reverse, difference, merge as merge$1, each, takeRight as takeRight$1, max, defaultCase as defaultCase$1, uniqBy, every, uniqWith, groupBy, pull, differenceBy, intersectionBy, isEqual } from 'lodash/fp'; -import { generate } from 'shortid'; -import _, { flow, dropRight, head, takeRight, tail, startsWith, findIndex, replace, trim, merge, assign, each as each$1, find as find$1, join as join$2, orderBy as orderBy$1, union as union$1 } from 'lodash'; -import { compileCode as compileCode$1, compileExpression as compileExpression$1 } from '@nx-js/compiler-util'; -import lunr from 'lunr'; -import { Buffer as Buffer$1 } from 'safe-buffer'; - -const commonPlus = extra => union(['onBegin', 'onComplete', 'onError'])(extra); - -const common = () => commonPlus([]); - -const _events = { - recordApi: { - save: commonPlus([ - 'onInvalid', - 'onRecordUpdated', - 'onRecordCreated']), - delete: common(), - getContext: common(), - getNew: common(), - load: common(), - validate: common(), - uploadFile: common(), - downloadFile: common(), - }, - indexApi: { - buildIndex: common(), - listItems: common(), - delete: common(), - aggregates: common(), - }, - collectionApi: { - getAllowedRecordTypes: common(), - initialise: common(), - delete: common(), - }, - authApi: { - authenticate: common(), - authenticateTemporaryAccess: common(), - createTemporaryAccess: common(), - createUser: common(), - enableUser: common(), - disableUser: common(), - loadAccessLevels: common(), - getNewAccessLevel: common(), - getNewUser: common(), - getNewUserAuth: common(), - getUsers: common(), - saveAccessLevels: common(), - isAuthorized: common(), - changeMyPassword: common(), - setPasswordFromTemporaryCode: common(), - scorePassword: common(), - isValidPassword: common(), - validateUser: common(), - validateAccessLevels: common(), - setUserAccessLevels: common(), - }, - templateApi: { - saveApplicationHierarchy: common(), - saveActionsAndTriggers: common(), - }, - actionsApi: { - execute: common(), - }, -}; - -const _eventsList = []; - -const makeEvent = (area, method, name) => `${area}:${method}:${name}`; - -for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - _events[areaKey][methodKey] = reduce((obj, s) => { - obj[s] = makeEvent(areaKey, methodKey, s); - return obj; - }, - {})(_events[areaKey][methodKey]); - } -} - - -for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - for (const name in _events[areaKey][methodKey]) { - _eventsList.push( - _events[areaKey][methodKey][name], - ); - } - } -} - - -const events = _events; - -const eventsList = _eventsList; - -class BadRequestError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 400; - } -} - -class UnauthorisedError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 401; - } -} - -class ForbiddenError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 403; - } -} - -class NotFoundError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 404; - } -} - -const apiWrapper = async (app, eventNamespace, isAuthorized, eventContext, func, ...params) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return; - } - - const startDate = Date.now(); - const elapsed = () => (Date.now() - startDate); - - try { - await app.publish( - eventNamespace.onBegin, - eventContext, - ); - - const result = await func(...params); - - await publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result; - } catch (error) { - await publishError(app, eventContext, eventNamespace, elapsed, error); - throw error; - } -}; - -const apiWrapperSync = (app, eventNamespace, isAuthorized, eventContext, func, ...params) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return; - } - - const startDate = Date.now(); - const elapsed = () => (Date.now() - startDate); - - try { - app.publish( - eventNamespace.onBegin, - eventContext, - ); - - const result = func(...params); - - publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result; - } catch (error) { - publishError(app, eventContext, eventNamespace, elapsed, error); - throw error; - } -}; - -const handleNotAuthorized = (app, eventContext, eventNamespace) => { - const err = new UnauthorisedError(`Unauthorized: ${eventNamespace}`); - publishError(app, eventContext, eventNamespace, () => 0, err); - throw err; -}; - -const pushCallStack = (app, eventNamespace, seedCallId) => { - const callId = generate(); - - const createCallStack = () => ({ - seedCallId: !isUndefined(seedCallId) - ? seedCallId - : callId, - threadCallId: callId, - stack: [], - }); - - if (isUndefined(app.calls)) { - app.calls = createCallStack(); - } - - app.calls.stack.push({ - namespace: eventNamespace, - callId, - }); -}; - -const popCallStack = (app) => { - app.calls.stack.pop(); - if (app.calls.stack.length === 0) { - delete app.calls; - } -}; - -const publishError = async (app, eventContext, eventNamespace, elapsed, err) => { - const ctx = cloneDeep(eventContext); - ctx.error = err; - ctx.elapsed = elapsed(); - await app.publish( - eventNamespace.onError, - ctx, - ); - popCallStack(app); -}; - -const publishComplete = async (app, eventContext, eventNamespace, elapsed, result) => { - const endcontext = cloneDeep(eventContext); - endcontext.result = result; - endcontext.elapsed = elapsed(); - await app.publish( - eventNamespace.onComplete, - endcontext, - ); - popCallStack(app); - return result; -}; - -const lockOverlapMilliseconds = 10; - -const getLock = async (app, lockFile, timeoutMilliseconds, maxLockRetries, retryCount = 0) => { - try { - const timeout = (await app.getEpochTime()) - + timeoutMilliseconds; - - const lock = { - timeout, - key: lockFile, - totalTimeout: timeoutMilliseconds, - }; - - await app.datastore.createFile( - lockFile, - getLockFileContent( - lock.totalTimeout, - lock.timeout, - ), - ); - - return lock; - } catch (e) { - if (retryCount == maxLockRetries) { return NO_LOCK; } - - const lock = parseLockFileContent( - lockFile, - await app.datastore.loadFile(lockFile), - ); - - const currentEpochTime = await app.getEpochTime(); - - if (currentEpochTime < lock.timeout) { - return NO_LOCK; - } - - try { - await app.datastore.deleteFile(lockFile); - } catch (_) { - //empty - } - - await sleepForRetry(); - - return await getLock( - app, lockFile, timeoutMilliseconds, - maxLockRetries, retryCount + 1, - ); - } -}; - -const getLockFileContent = (totalTimeout, epochTime) => `${totalTimeout}:${epochTime.toString()}`; - -const parseLockFileContent = (key, content) => $(content, [ - split(':'), - parts => ({ - totalTimeout: new Number(parts[0]), - timeout: new Number(parts[1]), - key, - }), -]); - -const releaseLock = async (app, lock) => { - const currentEpochTime = await app.getEpochTime(); - // only release if not timedout - if (currentEpochTime < (lock.timeout - lockOverlapMilliseconds)) { - try { - await app.datastore.deleteFile(lock.key); - } catch (_) { - //empty - } - } -}; - -const NO_LOCK = 'no lock'; -const isNolock = id => id === NO_LOCK; - -const sleepForRetry = () => new Promise(resolve => setTimeout(resolve, lockOverlapMilliseconds)); - -// this is the combinator function -const $$ = (...funcs) => arg => flow(funcs)(arg); - -// this is the pipe function -const $ = (arg, funcs) => $$(...funcs)(arg); - -const keySep = '/'; -const trimKeySep = str => trim(str, keySep); -const splitByKeySep = str => split(keySep)(str); -const safeKey = key => replace(`${keySep}${trimKeySep(key)}`, `${keySep}${keySep}`, keySep); -const joinKey = (...strs) => { - const paramsOrArray = strs.length === 1 & isArray$1(strs[0]) - ? strs[0] : strs; - return $(paramsOrArray, [ - filter(s => !isUndefined(s) - && !isNull(s) - && s.toString().length > 0), - join$1(keySep), - safeKey - ]); -}; -const splitKey = $$(trimKeySep, splitByKeySep); -const getDirFomKey = $$(splitKey, dropRight, p => joinKey(...p)); -const getFileFromKey = $$(splitKey, takeRight, head); - -const configFolder = `${keySep}.config`; -const fieldDefinitions = joinKey(configFolder, 'fields.json'); -const templateDefinitions = joinKey(configFolder, 'templates.json'); -const appDefinitionFile = joinKey(configFolder, 'appDefinition.json'); -const dirIndex = folderPath => joinKey(configFolder, 'dir', ...splitKey(folderPath), 'dir.idx'); -const getIndexKeyFromFileKey = $$(getDirFomKey, dirIndex); - -const ifExists = (val, exists, notExists) => (isUndefined(val) - ? isUndefined(notExists) ? (() => { })() : notExists() - : exists()); - -const getOrDefault = (val, defaultVal) => ifExists(val, () => val, () => defaultVal); - -const not = func => val => !func(val); -const isDefined = not(isUndefined); -const isNonNull = not(isNull); -const isNotNaN = not(isNaN$1); - -const allTrue = (...funcArgs) => val => reduce( - (result, conditionFunc) => (isNull(result) || result == true) && conditionFunc(val), - null)(funcArgs); - -const anyTrue = (...funcArgs) => val => reduce( - (result, conditionFunc) => result == true || conditionFunc(val), - null)(funcArgs); - -const insensitiveEquals = (str1, str2) => str1.trim().toLowerCase() === str2.trim().toLowerCase(); - -const isSomething = allTrue(isDefined, isNonNull, isNotNaN); -const isNothing = not(isSomething); -const isNothingOrEmpty = v => isNothing(v) || isEmpty(v); -const somethingOrGetDefault = getDefaultFunc => val => (isSomething(val) ? val : getDefaultFunc()); -const somethingOrDefault = (val, defaultVal) => somethingOrGetDefault(constant(defaultVal))(val); - -const mapIfSomethingOrDefault = (mapFunc, defaultVal) => val => (isSomething(val) ? mapFunc(val) : defaultVal); - -const mapIfSomethingOrBlank = mapFunc => mapIfSomethingOrDefault(mapFunc, ''); - -const none = predicate => collection => !some(predicate)(collection); - -const all = predicate => collection => none(v => !predicate(v))(collection); - -const isNotEmpty = ob => !isEmpty(ob); -const isNonEmptyArray = allTrue(isArray$1, isNotEmpty); -const isNonEmptyString = allTrue(isString, isNotEmpty); -const tryOr = failFunc => (func, ...args) => { - try { - return func.apply(null, ...args); - } catch (_) { - return failFunc(); - } -}; - -const tryAwaitOr = failFunc => async (func, ...args) => { - try { - return await func.apply(null, ...args); - } catch (_) { - return await failFunc(); - } -}; - -const defineError = (func, errorPrefix) => { - try { - return func(); - } catch (err) { - err.message = `${errorPrefix} : ${err.message}`; - throw err; - } -}; - -const tryOrIgnore = tryOr(() => { }); -const tryAwaitOrIgnore = tryAwaitOr(async () => { }); -const causesException = (func) => { - try { - func(); - return false; - } catch (e) { - return true; - } -}; - -const executesWithoutException = func => !causesException(func); - -const handleErrorWith = returnValInError => tryOr(constant(returnValInError)); - -const handleErrorWithUndefined = handleErrorWith(undefined); - -const switchCase = (...cases) => (value) => { - const nextCase = () => head(cases)[0](value); - const nextResult = () => head(cases)[1](value); - - if (isEmpty(cases)) return; // undefined - if (nextCase() === true) return nextResult(); - return switchCase(...tail(cases))(value); -}; - -const isValue = val1 => val2 => (val1 === val2); -const isOneOf = (...vals) => val => includes(val)(vals); -const defaultCase = constant(true); -const memberMatches = (member, match) => obj => match(obj[member]); - - -const StartsWith = searchFor => searchIn => startsWith(searchIn, searchFor); - -const contains = val => array => (findIndex(array, v => v === val) > -1); - -const getHashCode = (s) => { - let hash = 0; let i; let char; let - l; - if (s.length == 0) return hash; - for (i = 0, l = s.length; i < l; i++) { - char = s.charCodeAt(i); - hash = ((hash << 5) - hash) + char; - hash |= 0; // Convert to 32bit integer - } - - // converting to string, but dont want a "-" prefixed - if (hash < 0) { return `n${(hash * -1).toString()}`; } - return hash.toString(); -}; - -// thanks to https://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/ -const awEx = async (promise) => { - try { - const result = await promise; - return [undefined, result]; - } catch (error) { - return [error, undefined]; - } -}; - -const isSafeInteger = n => isInteger(n) - && n <= Number.MAX_SAFE_INTEGER - && n >= 0 - Number.MAX_SAFE_INTEGER; - -const toDateOrNull = s => (isNull(s) ? null - : isDate(s) ? s : new Date(s)); -const toBoolOrNull = s => (isNull(s) ? null - : s === 'true' || s === true); -const toNumberOrNull = s => (isNull(s) ? null - : toNumber(s)); - -const isArrayOfString = opts => isArray$1(opts) && all(isString)(opts); - -const pushAll = (target, items) => { - for(let i of items) target.push(i); -}; - -const pause = async duration => new Promise(res => setTimeout(res, duration)); - -const retry = async (fn, retries, delay, ...args) => { - try { - return await fn(...args); - } catch (err) { - if (retries > 1) { - return await pause(delay).then(async () => await retry(fn, (retries - 1), delay, ...args)); - } - throw err; - } -}; - -var index = { - ifExists, - getOrDefault, - isDefined, - isNonNull, - isNotNaN, - allTrue, - isSomething, - mapIfSomethingOrDefault, - mapIfSomethingOrBlank, - configFolder, - fieldDefinitions, - isNothing, - not, - switchCase, - defaultCase, - StartsWith, - contains, - templateDefinitions, - handleErrorWith, - handleErrorWithUndefined, - tryOr, - tryOrIgnore, - tryAwaitOr, - tryAwaitOrIgnore, - dirIndex, - keySep, - $, - $$, - getDirFomKey, - getFileFromKey, - splitKey, - somethingOrDefault, - getIndexKeyFromFileKey, - joinKey, - somethingOrGetDefault, - appDefinitionFile, - isValue, - all, - isOneOf, - memberMatches, - defineError, - anyTrue, - isNonEmptyArray, - causesException, - executesWithoutException, - none, - getHashCode, - awEx, - apiWrapper, - events, - eventsList, - isNothingOrEmpty, - isSafeInteger, - toNumber, - toDate: toDateOrNull, - toBool: toBoolOrNull, - isArrayOfString, - getLock, - NO_LOCK, - isNolock, - insensitiveEquals, - pause, - retry, - pushAll -}; - -const stringNotEmpty = s => isSomething(s) && s.trim().length > 0; - -const makerule = (field, error, isValid) => ({ field, error, isValid }); - -const validationError = (rule, item) => ({ ...rule, item }); - -const applyRuleSet = ruleSet => itemToValidate => $(ruleSet, [ - map(applyRule(itemToValidate)), - filter(isSomething), -]); - -const applyRule = itemTovalidate => rule => (rule.isValid(itemTovalidate) - ? null - : validationError(rule, itemTovalidate)); - -const filterEval = 'FILTER_EVALUATE'; -const filterCompile = 'FILTER_COMPILE'; -const mapEval = 'MAP_EVALUATE'; -const mapCompile = 'MAP_COMPILE'; - - -const getEvaluateResult = () => ({ - isError: false, - passedFilter: true, - result: null, -}); - -const compileFilter = index => compileExpression$1(index.filter); - -const compileMap = index => compileCode$1(index.map); - -const passesFilter = (record, index) => { - const context = { record }; - if (!index.filter) return true; - - const compiledFilter = defineError( - () => compileFilter(index), - filterCompile, - ); - - return defineError( - () => compiledFilter(context), - filterEval, - ); -}; - -const mapRecord = (record, index) => { - const recordClone = cloneDeep(record); - const context = { record: recordClone }; - - const map = index.map ? index.map : 'return {...record};'; - - const compiledMap = defineError( - () => compileCode$1(map), - mapCompile, - ); - - const mapped = defineError( - () => compiledMap(context), - mapEval, - ); - - const mappedKeys = keys(mapped); - for (let i = 0; i < mappedKeys.length; i++) { - const key = mappedKeys[i]; - mapped[key] = isUndefined(mapped[key]) ? null : mapped[key]; - if (isFunction(mapped[key])) { - delete mapped[key]; - } - } - - mapped.key = record.key; - mapped.sortKey = index.getSortKey - ? compileCode$1(index.getSortKey)(context) - : record.id; - - return mapped; -}; - -const evaluate = record => (index) => { - const result = getEvaluateResult(); - - try { - result.passedFilter = passesFilter(record, index); - } catch (err) { - result.isError = true; - result.passedFilter = false; - result.result = err.message; - } - - if (!result.passedFilter) return result; - - try { - result.result = mapRecord(record, index); - } catch (err) { - result.isError = true; - result.result = err.message; - } - - return result; -}; - -const indexTypes = { reference: 'reference', ancestor: 'ancestor' }; - -const indexRuleSet = [ - makerule('map', 'index has no map function', - index => isNonEmptyString(index.map)), - makerule('map', "index's map function does not compile", - index => !isNonEmptyString(index.map) - || executesWithoutException(() => compileMap(index))), - makerule('filter', "index's filter function does not compile", - index => !isNonEmptyString(index.filter) - || executesWithoutException(() => compileFilter(index))), - makerule('name', 'must declare a name for index', - index => isNonEmptyString(index.name)), - makerule('name', 'there is a duplicate named index on this node', - index => isEmpty(index.name) - || countBy('name')(index.parent().indexes)[index.name] === 1), - makerule('indexType', 'reference index may only exist on a record node', - index => isRecord(index.parent()) - || index.indexType !== indexTypes.reference), - makerule('indexType', `index type must be one of: ${join$1(', ')(keys(indexTypes))}`, - index => includes(index.indexType)(keys(indexTypes))), -]; - -const getFlattenedHierarchy = (appHierarchy, useCached = true) => { - if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { return appHierarchy.getFlattenedHierarchy(); } - - const flattenHierarchy = (currentNode, flattened) => { - flattened.push(currentNode); - if ((!currentNode.children - || currentNode.children.length === 0) - && (!currentNode.indexes - || currentNode.indexes.length === 0) - && (!currentNode.aggregateGroups - || currentNode.aggregateGroups.length === 0)) { - return flattened; - } - - const unionIfAny = l2 => l1 => union(l1)(!l2 ? [] : l2); - - const children = $([], [ - unionIfAny(currentNode.children), - unionIfAny(currentNode.indexes), - unionIfAny(currentNode.aggregateGroups), - ]); - - for (const child of children) { - flattenHierarchy(child, flattened); - } - return flattened; - }; - - appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []); - return appHierarchy.getFlattenedHierarchy(); -}; - -const getLastPartInKey = key => last(splitKey(key)); - -const getNodesInPath = appHierarchy => key => $(appHierarchy, [ - getFlattenedHierarchy, - filter(n => new RegExp(`${n.pathRegx()}`).test(key)), -]); - -const getExactNodeForKey = appHierarchy => key => $(appHierarchy, [ - getFlattenedHierarchy, - find(n => new RegExp(`${n.pathRegx()}$`).test(key)), -]); - -const getNodeForCollectionPath = appHierarchy => collectionKey => $(appHierarchy, [ - getFlattenedHierarchy, - find(n => (isCollectionRecord(n) - && new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey))), -]); - -const hasMatchingAncestor = ancestorPredicate => decendantNode => switchCase( - - [node => isNothing(node.parent()), - constant(false)], - - [node => ancestorPredicate(node.parent()), - constant(true)], - - [defaultCase, - node => hasMatchingAncestor(ancestorPredicate)(node.parent())], - -)(decendantNode); - -const getNode = (appHierarchy, nodeKey) => $(appHierarchy, [ - getFlattenedHierarchy, - find(n => n.nodeKey() === nodeKey - || (isCollectionRecord(n) - && n.collectionNodeKey() === nodeKey)), -]); - -const getCollectionNode = (appHierarchy, nodeKey) => $(appHierarchy, [ - getFlattenedHierarchy, - find(n => (isCollectionRecord(n) - && n.collectionNodeKey() === nodeKey)), -]); - -const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getExactNodeForKey(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) - ? getNode(appHierarchy, keyOrNodeKey) - : nodeByKey; -}; - -const getCollectionNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getNodeForCollectionPath(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) - ? getCollectionNode(appHierarchy, keyOrNodeKey) - : nodeByKey; -}; - -const isNode = (appHierarchy, key) => isSomething(getExactNodeForKey(appHierarchy)(key)); - -const getActualKeyOfParent = (parentNodeKey, actualChildKey) => - $(actualChildKey, [ - splitKey, - take(splitKey(parentNodeKey).length), - ks => joinKey(...ks), - ]); - -const getParentKey = (key) => { - return $(key, [ - splitKey, - take(splitKey(key).length - 1), - joinKey, - ]); -}; - -const isKeyAncestorOf = ancestorKey => decendantNode => hasMatchingAncestor(p => p.nodeKey() === ancestorKey)(decendantNode); - -const hasNoMatchingAncestors = parentPredicate => node => !hasMatchingAncestor(parentPredicate)(node); - -const findField = (recordNode, fieldName) => find(f => f.name == fieldName)(recordNode.fields); - -const isAncestor = decendant => ancestor => isKeyAncestorOf(ancestor.nodeKey())(decendant); - -const isDecendant = ancestor => decendant => isAncestor(decendant)(ancestor); - -const getRecordNodeId = recordKey => $(recordKey, [ - splitKey, - last, - getRecordNodeIdFromId, -]); - -const getRecordNodeIdFromId = recordId => $(recordId, [split('-'), first, parseInt]); - -const getRecordNodeById = (hierarchy, recordId) => $(hierarchy, [ - getFlattenedHierarchy, - find(n => isRecord(n) - && n.nodeId === getRecordNodeIdFromId(recordId)), -]); - -const recordNodeIdIsAllowed = indexNode => nodeId => indexNode.allowedRecordNodeIds.length === 0 - || includes(nodeId)(indexNode.allowedRecordNodeIds); - -const recordNodeIsAllowed = indexNode => recordNode => recordNodeIdIsAllowed(indexNode)(recordNode.nodeId); - -const getAllowedRecordNodesForIndex = (appHierarchy, indexNode) => { - const recordNodes = $(appHierarchy, [ - getFlattenedHierarchy, - filter(isRecord), - ]); - - if (isGlobalIndex(indexNode)) { - return $(recordNodes, [ - filter(recordNodeIsAllowed(indexNode)), - ]); - } - - if (isAncestorIndex(indexNode)) { - return $(recordNodes, [ - filter(isDecendant(indexNode.parent())), - filter(recordNodeIsAllowed(indexNode)), - ]); - } - - if (isReferenceIndex(indexNode)) { - return $(recordNodes, [ - filter(n => some(fieldReversesReferenceToIndex(indexNode))(n.fields)), - ]); - } -}; - -const getNodeFromNodeKeyHash = hierarchy => hash => $(hierarchy, [ - getFlattenedHierarchy, - find(n => getHashCode(n.nodeKey()) === hash), -]); - -const isRecord = node => isSomething(node) && node.type === 'record'; -const isSingleRecord = node => isRecord(node) && node.isSingle; -const isCollectionRecord = node => isRecord(node) && !node.isSingle; -const isIndex = node => isSomething(node) && node.type === 'index'; -const isaggregateGroup = node => isSomething(node) && node.type === 'aggregateGroup'; -const isShardedIndex = node => isIndex(node) && isNonEmptyString(node.getShardName); -const isRoot = node => isSomething(node) && node.isRoot(); -const isDecendantOfARecord = hasMatchingAncestor(isRecord); -const isGlobalIndex = node => isIndex(node) && isRoot(node.parent()); -const isReferenceIndex = node => isIndex(node) && node.indexType === indexTypes.reference; -const isAncestorIndex = node => isIndex(node) && node.indexType === indexTypes.ancestor; - -const fieldReversesReferenceToNode = node => field => field.type === 'reference' - && intersection(field.typeOptions.reverseIndexNodeKeys)(map(i => i.nodeKey())(node.indexes)) - .length > 0; - -const fieldReversesReferenceToIndex = indexNode => field => field.type === 'reference' - && intersection(field.typeOptions.reverseIndexNodeKeys)([indexNode.nodeKey()]) - .length > 0; - -var hierarchy = { - getLastPartInKey, - getNodesInPath, - getExactNodeForKey, - hasMatchingAncestor, - getNode, - getNodeByKeyOrNodeKey, - isNode, - getActualKeyOfParent, - getParentKey, - isKeyAncestorOf, - hasNoMatchingAncestors, - findField, - isAncestor, - isDecendant, - getRecordNodeId, - getRecordNodeIdFromId, - getRecordNodeById, - recordNodeIdIsAllowed, - recordNodeIsAllowed, - getAllowedRecordNodesForIndex, - getNodeFromNodeKeyHash, - isRecord, - isCollectionRecord, - isIndex, - isaggregateGroup, - isShardedIndex, - isRoot, - isDecendantOfARecord, - isGlobalIndex, - isReferenceIndex, - isAncestorIndex, - fieldReversesReferenceToNode, - fieldReversesReferenceToIndex, - getFlattenedHierarchy, -}; - -const getSafeFieldParser = (tryParse, defaultValueFunctions) => (field, record) => { - if (has(field.name)(record)) { - return getSafeValueParser(tryParse, defaultValueFunctions)(record[field.name]); - } - return defaultValueFunctions[field.getUndefinedValue](); -}; - -const getSafeValueParser = (tryParse, defaultValueFunctions) => (value) => { - const parsed = tryParse(value); - if (parsed.success) { - return parsed.value; - } - return defaultValueFunctions.default(); -}; - -const getNewValue = (tryParse, defaultValueFunctions) => (field) => { - const getInitialValue = isUndefined(field) || isUndefined(field.getInitialValue) - ? 'default' - : field.getInitialValue; - - return has(getInitialValue)(defaultValueFunctions) - ? defaultValueFunctions[getInitialValue]() - : getSafeValueParser(tryParse, defaultValueFunctions)(getInitialValue); -}; - -const typeFunctions = specificFunctions => merge({ - value: constant, - null: constant(null), -}, specificFunctions); - -const validateTypeConstraints = validationRules => async (field, record, context) => { - const fieldValue = record[field.name]; - const validateRule = async r => (!await r.isValid(fieldValue, field.typeOptions, context) - ? r.getMessage(fieldValue, field.typeOptions) - : ''); - - const errors = []; - for (const r of validationRules) { - const err = await validateRule(r); - if (isNotEmpty(err)) errors.push(err); - } - - return errors; -}; - -const getDefaultOptions = mapValues(v => v.defaultValue); - -const makerule$1 = (isValid, getMessage) => ({ isValid, getMessage }); -const parsedFailed = val => ({ success: false, value: val }); -const parsedSuccess = val => ({ success: true, value: val }); -const getDefaultExport = (name, tryParse, functions, options, validationRules, sampleValue, stringify) => ({ - getNew: getNewValue(tryParse, functions), - safeParseField: getSafeFieldParser(tryParse, functions), - safeParseValue: getSafeValueParser(tryParse, functions), - tryParse, - name, - getDefaultOptions: () => getDefaultOptions(cloneDeep(options)), - optionDefinitions: options, - validateTypeConstraints: validateTypeConstraints(validationRules), - sampleValue, - stringify: val => (val === null || val === undefined - ? '' : stringify(val)), - getDefaultValue: functions.default, -}); - -const stringFunctions = typeFunctions({ - default: constant(null), -}); - -const stringTryParse = switchCase( - [isString, parsedSuccess], - [isNull, parsedSuccess], - [defaultCase, v => parsedSuccess(v.toString())], -); - -const options = { - maxLength: { - defaultValue: null, - isValid: n => n === null || isSafeInteger(n) && n > 0, - requirementDescription: 'max length must be null (no limit) or a greater than zero integer', - parse: toNumberOrNull, - }, - values: { - defaultValue: null, - isValid: v => v === null || (isArrayOfString(v) && v.length > 0 && v.length < 10000), - requirementDescription: "'values' must be null (no values) or an arry of at least one string", - parse: s => s, - }, - allowDeclaredValuesOnly: { - defaultValue: false, - isValid: isBoolean, - requirementDescription: 'allowDeclaredValuesOnly must be true or false', - parse: toBoolOrNull, - }, -}; - -const typeConstraints = [ - makerule$1(async (val, opts) => val === null || opts.maxLength === null || val.length <= opts.maxLength, - (val, opts) => `value exceeds maximum length of ${opts.maxLength}`), - makerule$1(async (val, opts) => val === null - || opts.allowDeclaredValuesOnly === false - || includes(val)(opts.values), - (val) => `"${val}" does not exist in the list of allowed values`), -]; - -var string = getDefaultExport( - 'string', - stringTryParse, - stringFunctions, - options, - typeConstraints, - 'abcde', - str => str, -); - -const boolFunctions = typeFunctions({ - default: constant(null), -}); - -const boolTryParse = switchCase( - [isBoolean, parsedSuccess], - [isNull, parsedSuccess], - [isOneOf('true', '1', 'yes', 'on'), () => parsedSuccess(true)], - [isOneOf('false', '0', 'no', 'off'), () => parsedSuccess(false)], - [defaultCase, parsedFailed], -); - -const options$1 = { - allowNulls: { - defaultValue: true, - isValid: isBoolean, - requirementDescription: 'must be a true or false', - parse: toBoolOrNull, - }, -}; - -const typeConstraints$1 = [ - makerule$1(async (val, opts) => opts.allowNulls === true || val !== null, - () => 'field cannot be null'), -]; - -var bool = getDefaultExport( - 'bool', boolTryParse, boolFunctions, - options$1, typeConstraints$1, true, JSON.stringify, -); - -const numberFunctions = typeFunctions({ - default: constant(null), -}); - -const parseStringtoNumberOrNull = (s) => { - const num = Number(s); - return isNaN(num) ? parsedFailed(s) : parsedSuccess(num); -}; - -const numberTryParse = switchCase( - [isNumber, parsedSuccess], - [isString, parseStringtoNumberOrNull], - [isNull, parsedSuccess], - [defaultCase, parsedFailed], -); - -const options$2 = { - maxValue: { - defaultValue: Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: 'must be a valid integer', - parse: toNumberOrNull, - }, - minValue: { - defaultValue: 0 - Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: 'must be a valid integer', - parse: toNumberOrNull, - }, - decimalPlaces: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, -}; - -const getDecimalPlaces = (val) => { - const splitDecimal = val.toString().split('.'); - if (splitDecimal.length === 1) return 0; - return splitDecimal[1].length; -}; - -const typeConstraints$2 = [ - makerule$1(async (val, opts) => val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => `value (${val.toString()}) must be greater than or equal to ${opts.minValue}`), - makerule$1(async (val, opts) => val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => `value (${val.toString()}) must be less than or equal to ${opts.minValue} options`), - makerule$1(async (val, opts) => val === null || opts.decimalPlaces >= getDecimalPlaces(val), - (val, opts) => `value (${val.toString()}) must have ${opts.decimalPlaces} decimal places or less`), -]; - -var number = getDefaultExport( - 'number', - numberTryParse, - numberFunctions, - options$2, - typeConstraints$2, - 1, - num => num.toString(), -); - -const dateFunctions = typeFunctions({ - default: constant(null), - now: () => new Date(), -}); - -const isValidDate = d => d instanceof Date && !isNaN(d); - -const parseStringToDate = s => switchCase( - [isValidDate, parsedSuccess], - [defaultCase, parsedFailed], -)(new Date(s)); - - -const dateTryParse = switchCase( - [isDate, parsedSuccess], - [isString, parseStringToDate], - [isNull, parsedSuccess], - [defaultCase, parsedFailed], -); - -const options$3 = { - maxValue: { - defaultValue: new Date(32503680000000), - isValid: isDate, - requirementDescription: 'must be a valid date', - parse: toDateOrNull, - }, - minValue: { - defaultValue: new Date(-8520336000000), - isValid: isDate, - requirementDescription: 'must be a valid date', - parse: toDateOrNull, - }, -}; - -const typeConstraints$3 = [ - makerule$1(async (val, opts) => val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => `value (${val.toString()}) must be greater than or equal to ${opts.minValue}`), - makerule$1(async (val, opts) => val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => `value (${val.toString()}) must be less than or equal to ${opts.minValue} options`), -]; - -var datetime = getDefaultExport( - 'datetime', - dateTryParse, - dateFunctions, - options$3, - typeConstraints$3, - new Date(1984, 4, 1), - date => JSON.stringify(date).replace(new RegExp('"', 'g'), ''), -); - -const arrayFunctions = () => typeFunctions({ - default: constant([]), -}); - -const mapToParsedArrary = type => $$( - map(i => type.safeParseValue(i)), - parsedSuccess, -); - -const arrayTryParse = type => switchCase( - [isArray$1, mapToParsedArrary(type)], - [defaultCase, parsedFailed], -); - -const typeName = type => `array<${type}>`; - - -const options$4 = { - maxLength: { - defaultValue: 10000, - isValid: isSafeInteger, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, - minLength: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, -}; - -const typeConstraints$4 = [ - makerule$1(async (val, opts) => val === null || val.length >= opts.minLength, - (val, opts) => `must choose ${opts.minLength} or more options`), - makerule$1(async (val, opts) => val === null || val.length <= opts.maxLength, - (val, opts) => `cannot choose more than ${opts.maxLength} options`), -]; - -var array = type => getDefaultExport( - typeName(type.name), - arrayTryParse(type), - arrayFunctions(), - options$4, - typeConstraints$4, - [type.sampleValue], - JSON.stringify, -); - -const referenceNothing = () => ({ key: '' }); - -const referenceFunctions = typeFunctions({ - default: referenceNothing, -}); - -const hasStringValue = (ob, path) => has(path)(ob) - && isString(ob[path]); - -const isObjectWithKey = v => isObjectLike(v) - && hasStringValue(v, 'key'); - -const tryParseFromString = s => { - - try { - const asObj = JSON.parse(s); - if(isObjectWithKey) { - return parsedSuccess(asObj); - } - } - catch(_) { - // EMPTY - } - - return parsedFailed(s); -}; - -const referenceTryParse = v => switchCase( - [isObjectWithKey, parsedSuccess], - [isString, tryParseFromString], - [isNull, () => parsedSuccess(referenceNothing())], - [defaultCase, parsedFailed], -)(v); - -const options$5 = { - indexNodeKey: { - defaultValue: null, - isValid: isNonEmptyString, - requirementDescription: 'must be a non-empty string', - parse: s => s, - }, - displayValue: { - defaultValue: '', - isValid: isNonEmptyString, - requirementDescription: 'must be a non-empty string', - parse: s => s, - }, - reverseIndexNodeKeys: { - defaultValue: null, - isValid: v => isArrayOfString(v) && v.length > 0, - requirementDescription: 'must be a non-empty array of strings', - parse: s => s, - }, -}; - -const isEmptyString = s => isString(s) && isEmpty(s); - -const ensureReferenceExists = async (val, opts, context) => isEmptyString(val.key) - || await context.referenceExists(opts, val.key); - -const typeConstraints$5 = [ - makerule$1( - ensureReferenceExists, - (val, opts) => `"${val[opts.displayValue]}" does not exist in options list (key: ${val.key})`, - ), -]; - -var reference = getDefaultExport( - 'reference', - referenceTryParse, - referenceFunctions, - options$5, - typeConstraints$5, - { key: 'key', value: 'value' }, - JSON.stringify, -); - -const illegalCharacters = '*?\\/:<>|\0\b\f\v'; - -const isLegalFilename = (filePath) => { - const fn = fileName(filePath); - return fn.length <= 255 - && intersection(fn.split(''))(illegalCharacters.split('')).length === 0 - && none(f => f === '..')(splitKey(filePath)); -}; - -const fileNothing = () => ({ relativePath: '', size: 0 }); - -const fileFunctions = typeFunctions({ - default: fileNothing, -}); - -const fileTryParse = v => switchCase( - [isValidFile, parsedSuccess], - [isNull, () => parsedSuccess(fileNothing())], - [defaultCase, parsedFailed], -)(v); - -const fileName = filePath => $(filePath, [ - splitKey, - last, -]); - -const isValidFile = f => !isNull(f) - && has('relativePath')(f) && has('size')(f) - && isNumber(f.size) - && isString(f.relativePath) - && isLegalFilename(f.relativePath); - -const options$6 = {}; - -const typeConstraints$6 = []; - -var file = getDefaultExport( - 'file', - fileTryParse, - fileFunctions, - options$6, - typeConstraints$6, - { relativePath: 'some_file.jpg', size: 1000 }, - JSON.stringify, -); - -const allTypes = () => { - const basicTypes = { - string, number, datetime, bool, reference, file, - }; - - const arrays = $(basicTypes, [ - keys, - map((k) => { - const kvType = {}; - const concreteArray = array(basicTypes[k]); - kvType[concreteArray.name] = concreteArray; - return kvType; - }), - types => assign({}, ...types), - ]); - - return merge({}, basicTypes, arrays); -}; - - -const all$1 = allTypes(); - -const getType = (typeName) => { - if (!has(typeName)(all$1)) throw new BadRequestError(`Do not recognise type ${typeName}`); - return all$1[typeName]; -}; - -const getSampleFieldValue = field => getType(field.type).sampleValue; - -const getNewFieldValue = field => getType(field.type).getNew(field); - -const safeParseField = (field, record) => getType(field.type).safeParseField(field, record); - -const validateFieldParse = (field, record) => (has(field.name)(record) - ? getType(field.type).tryParse(record[field.name]) - : parsedSuccess(undefined)); // fields may be undefined by default - -const getDefaultOptions$1 = type => getType(type).getDefaultOptions(); - -const validateTypeConstraints$1 = async (field, record, context) => await getType(field.type).validateTypeConstraints(field, record, context); - -const detectType = (value) => { - if (isString(value)) return string; - if (isBoolean(value)) return bool; - if (isNumber(value)) return number; - if (isDate(value)) return datetime; - if (isArray$1(value)) return array(detectType(value[0])); - if (isObject(value) - && has('key')(value) - && has('value')(value)) return reference; - if (isObject(value) - && has('relativePath')(value) - && has('size')(value)) return file; - - throw new BadRequestError(`cannot determine type: ${JSON.stringify(value)}`); -}; - -// 5 minutes -const tempCodeExpiryLength = 5 * 60 * 1000; - -const AUTH_FOLDER = '/.auth'; -const USERS_LIST_FILE = joinKey(AUTH_FOLDER, 'users.json'); -const userAuthFile = username => joinKey(AUTH_FOLDER, `auth_${username}.json`); -const USERS_LOCK_FILE = joinKey(AUTH_FOLDER, 'users_lock'); -const ACCESS_LEVELS_FILE = joinKey(AUTH_FOLDER, 'access_levels.json'); -const ACCESS_LEVELS_LOCK_FILE = joinKey(AUTH_FOLDER, 'access_levels_lock'); - -const permissionTypes = { - CREATE_RECORD: 'create record', - UPDATE_RECORD: 'update record', - READ_RECORD: 'read record', - DELETE_RECORD: 'delete record', - READ_INDEX: 'read index', - MANAGE_INDEX: 'manage index', - MANAGE_COLLECTION: 'manage collection', - WRITE_TEMPLATES: 'write templates', - CREATE_USER: 'create user', - SET_PASSWORD: 'set password', - CREATE_TEMPORARY_ACCESS: 'create temporary access', - ENABLE_DISABLE_USER: 'enable or disable user', - WRITE_ACCESS_LEVELS: 'write access levels', - LIST_USERS: 'list users', - LIST_ACCESS_LEVELS: 'list access levels', - EXECUTE_ACTION: 'execute action', - SET_USER_ACCESS_LEVELS: 'set user access levels', -}; - -const getUserByName = (users, name) => $(users, [ - find(u => u.name.toLowerCase() === name.toLowerCase()), -]); - -const stripUserOfSensitiveStuff = (user) => { - const stripped = clone(user); - delete stripped.tempCode; - return stripped; -}; - -const parseTemporaryCode = fullCode => $(fullCode, [ - split(':'), - parts => ({ - id: parts[1], - code: parts[2], - }), -]); - -const isAuthorized = app => (permissionType, resourceKey) => apiWrapperSync( - app, - events.authApi.isAuthorized, - alwaysAuthorized, - { resourceKey, permissionType }, - _isAuthorized, app, permissionType, resourceKey, -); - -const _isAuthorized = (app, permissionType, resourceKey) => { - if (!app.user) { - return false; - } - - const validType = $(permissionTypes, [ - values, - includes(permissionType), - ]); - - if (!validType) { - return false; - } - - const permMatchesResource = (userperm) => { - const nodeKey = isNothing(resourceKey) - ? null - : isNode(app.hierarchy, resourceKey) - ? getNodeByKeyOrNodeKey( - app.hierarchy, resourceKey, - ).nodeKey() - : resourceKey; - - return (userperm.type === permissionType) - && ( - isNothing(resourceKey) - || nodeKey === userperm.nodeKey - ); - }; - - return $(app.user.permissions, [ - some(permMatchesResource), - ]); -}; - -const nodePermission = type => ({ - add: (nodeKey, accessLevel) => accessLevel.permissions.push({ type, nodeKey }), - isAuthorized: resourceKey => app => isAuthorized(app)(type, resourceKey), - isNode: true, - get: nodeKey => ({ type, nodeKey }), -}); - -const staticPermission = type => ({ - add: accessLevel => accessLevel.permissions.push({ type }), - isAuthorized: app => isAuthorized(app)(type), - isNode: false, - get: () => ({ type }), -}); - -const createRecord = nodePermission(permissionTypes.CREATE_RECORD); - -const updateRecord = nodePermission(permissionTypes.UPDATE_RECORD); - -const deleteRecord = nodePermission(permissionTypes.DELETE_RECORD); - -const readRecord = nodePermission(permissionTypes.READ_RECORD); - -const writeTemplates = staticPermission(permissionTypes.WRITE_TEMPLATES); - -const createUser = staticPermission(permissionTypes.CREATE_USER); - -const setPassword = staticPermission(permissionTypes.SET_PASSWORD); - -const readIndex = nodePermission(permissionTypes.READ_INDEX); - -const manageIndex = staticPermission(permissionTypes.MANAGE_INDEX); - -const manageCollection = staticPermission(permissionTypes.MANAGE_COLLECTION); - -const createTemporaryAccess = staticPermission(permissionTypes.CREATE_TEMPORARY_ACCESS); - -const enableDisableUser = staticPermission(permissionTypes.ENABLE_DISABLE_USER); - -const writeAccessLevels = staticPermission(permissionTypes.WRITE_ACCESS_LEVELS); - -const listUsers = staticPermission(permissionTypes.LIST_USERS); - -const listAccessLevels = staticPermission(permissionTypes.LIST_ACCESS_LEVELS); - -const setUserAccessLevels = staticPermission(permissionTypes.SET_USER_ACCESS_LEVELS); - -const executeAction = nodePermission(permissionTypes.EXECUTE_ACTION); - -const alwaysAuthorized = () => true; - -const permission = { - createRecord, - updateRecord, - deleteRecord, - readRecord, - writeTemplates, - createUser, - setPassword, - readIndex, - createTemporaryAccess, - enableDisableUser, - writeAccessLevels, - listUsers, - listAccessLevels, - manageIndex, - manageCollection, - executeAction, - setUserAccessLevels, -}; - -const getNew = app => (collectionKey, recordTypeName) => { - const recordNode = getRecordNode(app, collectionKey); - collectionKey=safeKey(collectionKey); - return apiWrapperSync( - app, - events.recordApi.getNew, - permission.createRecord.isAuthorized(recordNode.nodeKey()), - { collectionKey, recordTypeName }, - _getNew, recordNode, collectionKey, - ); -}; - -const _getNew = (recordNode, collectionKey) => constructRecord(recordNode, getNewFieldValue, collectionKey); - -const getRecordNode = (app, collectionKey) => { - collectionKey = safeKey(collectionKey); - return getNodeForCollectionPath(app.hierarchy)(collectionKey); -}; - -const getNewChild = app => (recordKey, collectionName, recordTypeName) => - getNew(app)(joinKey(recordKey, collectionName), recordTypeName); - -const constructRecord = (recordNode, getFieldValue, collectionKey) => { - const record = $(recordNode.fields, [ - keyBy('name'), - mapValues(getFieldValue), - ]); - - record.id = `${recordNode.nodeId}-${generate()}`; - record.key = isSingleRecord(recordNode) - ? joinKey(collectionKey, recordNode.name) - : joinKey(collectionKey, record.id); - record.isNew = true; - record.type = recordNode.name; - return record; -}; - -const allIdChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'; - -// this should never be changed - ever -// - existing databases depend on the order of chars this string - -/** - * folderStructureArray should return an array like - * - [1] = all records fit into one folder - * - [2] = all records fite into 2 folders - * - [64, 3] = all records fit into 64 * 3 folders - * - [64, 64, 10] = all records fit into 64 * 64 * 10 folder - * (there are 64 possible chars in allIsChars) -*/ -const folderStructureArray = (recordNode) => { - - const totalFolders = Math.ceil(recordNode.estimatedRecordCount / 1000); - const folderArray = []; - let levelCount = 1; - while(64**levelCount < totalFolders) { - levelCount += 1; - folderArray.push(64); - } - - const parentFactor = (64**folderArray.length); - if(parentFactor < totalFolders) { - folderArray.push( - Math.ceil(totalFolders / parentFactor) - ); - } - - return folderArray; - - /* - const maxRecords = currentFolderPosition === 0 - ? RECORDS_PER_FOLDER - : currentFolderPosition * 64 * RECORDS_PER_FOLDER; - - if(maxRecords < recordNode.estimatedRecordCount) { - return folderStructureArray( - recordNode, - [...currentArray, 64], - currentFolderPosition + 1); - } else { - const childFolderCount = Math.ceil(recordNode.estimatedRecordCount / maxRecords ); - return [...currentArray, childFolderCount] - }*/ -}; - - -const getAllIdsIterator = app => async (collection_Key_or_NodeKey) => { - collection_Key_or_NodeKey = safeKey(collection_Key_or_NodeKey); - const recordNode = getCollectionNodeByKeyOrNodeKey( - app.hierarchy, - collection_Key_or_NodeKey, - ); - - const getAllIdsIteratorForCollectionKey = async (recordNode, collectionKey) => { - - const folderStructure = folderStructureArray(recordNode); - - let currentFolderContents = []; - let currentPosition = []; - - const collectionDir = getCollectionDir(app.hierarchy, collectionKey); - const basePath = joinKey( - collectionDir, recordNode.nodeId.toString()); - - - - // "folderStructure" determines the top, sharding folders - // we need to add one, for the collection root folder, which - // always exists - const levels = folderStructure.length + 1; - const topLevel = levels -1; - - - /* populate initial directory structure in form: - [ - {path: "/a", contents: ["b", "c", "d"]}, - {path: "/a/b", contents: ["e","f","g"]}, - {path: "/a/b/e", contents: ["1-abcd","2-cdef","3-efgh"]}, - ] - // stores contents on each parent level - // top level has ID folders - */ - const firstFolder = async () => { - - let folderLevel = 0; - - const lastPathHasContent = () => - folderLevel === 0 - || currentFolderContents[folderLevel - 1].contents.length > 0; - - - while (folderLevel <= topLevel && lastPathHasContent()) { - - let thisPath = basePath; - for(let lev = 0; lev < currentPosition.length; lev++) { - thisPath = joinKey( - thisPath, currentFolderContents[lev].contents[0]); - } - - const contentsThisLevel = - await app.datastore.getFolderContents(thisPath); - currentFolderContents.push({ - contents:contentsThisLevel, - path: thisPath - }); - - // should start as something like [0,0] - if(folderLevel < topLevel) - currentPosition.push(0); - - folderLevel+=1; - } - - return (currentPosition.length === levels - 1); - }; - - const isOnLastFolder = level => { - - const result = currentPosition[level] === currentFolderContents[level].contents.length - 1; - return result; - }; - - const getNextFolder = async (lev=undefined) => { - lev = isUndefined(lev) ? topLevel : lev; - const parentLev = lev - 1; - - if(parentLev < 0) return false; - - if(isOnLastFolder(parentLev)) { - return await getNextFolder(parentLev); - } - - const newPosition = currentPosition[parentLev] + 1; - currentPosition[parentLev] = newPosition; - - const nextFolder = joinKey( - currentFolderContents[parentLev].path, - currentFolderContents[parentLev].contents[newPosition]); - currentFolderContents[lev].contents = await app.datastore.getFolderContents( - nextFolder - ); - currentFolderContents[lev].path = nextFolder; - - if(lev !== topLevel) { - - // we just advanced a parent folder, so now need to - // do the same to the next levels - let loopLevel = lev + 1; - while(loopLevel <= topLevel) { - const loopParentLevel = loopLevel-1; - - currentPosition[loopParentLevel] = 0; - const nextLoopFolder = joinKey( - currentFolderContents[loopParentLevel].path, - currentFolderContents[loopParentLevel].contents[0]); - currentFolderContents[loopLevel].contents = await app.datastore.getFolderContents( - nextLoopFolder - ); - currentFolderContents[loopLevel].path = nextLoopFolder; - loopLevel+=1; - } - } - - // true ==has more ids... (just loaded more) - return true; - }; - - - const idsCurrentFolder = () => - currentFolderContents[currentFolderContents.length - 1].contents; - - const fininshedResult = ({ done: true, result: { ids: [], collectionKey } }); - - let hasStarted = false; - let hasMore = true; - const getIdsFromCurrentfolder = async () => { - - if(!hasMore) { - return fininshedResult; - } - - if(!hasStarted) { - hasMore = await firstFolder(); - hasStarted = true; - return ({ - result: { - ids: idsCurrentFolder(), - collectionKey - }, - done: false - }) - } - - hasMore = await getNextFolder(); - - return ({ - result: { - ids: hasMore ? idsCurrentFolder() : [], - collectionKey - }, - done: !hasMore - }); - }; - - return getIdsFromCurrentfolder; - - }; - - const ancestors = $(getFlattenedHierarchy(app.hierarchy), [ - filter(isCollectionRecord), - filter(n => isAncestor(recordNode)(n) - || n.nodeKey() === recordNode.nodeKey()), - orderBy([n => n.nodeKey().length], ['asc']), - ]); // parents first - - const traverseForIteraterators = async (parentRecordKey = '', currentNodeIndex = 0) => { - const currentNode = ancestors[currentNodeIndex]; - const currentCollectionKey = joinKey( - parentRecordKey, - currentNode.collectionName, - ); - if (currentNode.nodeKey() === recordNode.nodeKey()) { - return [ - await getAllIdsIteratorForCollectionKey( - currentNode, - currentCollectionKey, - )]; - } - const allIterators = []; - const currentIterator = await getAllIdsIteratorForCollectionKey( - currentNode, - currentCollectionKey, - ); - - let ids = await currentIterator(); - while (ids.done === false) { - for (const id of ids.result.ids) { - allIterators.push( - await traverseForIteraterators( - joinKey(currentCollectionKey, id), - currentNodeIndex + 1, - ), - ); - } - - ids = await currentIterator(); - } - - return flatten(allIterators); - }; - - const iteratorsArray = await traverseForIteraterators(); - let currentIteratorIndex = 0; - return async () => { - if (iteratorsArray.length === 0) { return { done: true, result: [] }; } - const innerResult = await iteratorsArray[currentIteratorIndex](); - if (!innerResult.done) { return innerResult; } - if (currentIteratorIndex == iteratorsArray.length - 1) { - return { done: true, result: innerResult.result }; - } - currentIteratorIndex++; - return { done: false, result: innerResult.result }; - }; -}; - -const getRecordInfo = (hierarchy, key) => { - const recordNode = getExactNodeForKey(hierarchy)(key); - const pathInfo = getRecordDirectory(recordNode, key); - const dir = joinKey(pathInfo.base, ...pathInfo.subdirs); - - return { - recordJson: recordJson(dir), - files: files(dir), - child:(name) => joinKey(dir, name), - key: safeKey(key), - recordNode, pathInfo, dir - }; -}; - -const getCollectionDir = (hierarchy, collectionKey) => { - const recordNode = getNodeForCollectionPath(hierarchy)(collectionKey); - const dummyRecordKey = joinKey(collectionKey, "1-abcd"); - const pathInfo = getRecordDirectory(recordNode, dummyRecordKey); - return pathInfo.base; -}; - -const recordJson = (dir) => - joinKey(dir, "record.json"); - -const files = (dir) => - joinKey(dir, "files"); - -const getRecordDirectory = (recordNode, key) => { - const id = getFileFromKey(key); - - const traverseParentKeys = (n, parents=[]) => { - if(isRoot(n)) return parents; - const k = getActualKeyOfParent(n.nodeKey(), key); - const thisNodeDir = { - node:n, - relativeDir: joinKey( - recordRelativeDirectory(n, getFileFromKey(k))) - }; - return traverseParentKeys( - n.parent(), - [thisNodeDir, ...parents]); - }; - - const parentDirs = $(recordNode.parent(), [ - traverseParentKeys, - reduce((key, item) => { - return joinKey(key, item.node.collectionName, item.relativeDir) - }, keySep) - ]); - - const subdirs = isSingleRecord(recordNode) - ? [] - : recordRelativeDirectory(recordNode, id); - const base = isSingleRecord(recordNode) - ? joinKey(parentDirs, recordNode.name) - : joinKey(parentDirs, recordNode.collectionName); - - return ({ - subdirs, base - }); -}; - -const recordRelativeDirectory = (recordNode, id) => { - const folderStructure = folderStructureArray(recordNode); - const strippedId = id.substring(recordNode.nodeId.toString().length + 1); - const subfolders = $(folderStructure, [ - reduce((result, currentCount) => { - result.folders.push( - folderForChar(strippedId[result.level], currentCount) - ); - return {level:result.level+1, folders:result.folders}; - }, {level:0, folders:[]}), - f => f.folders, - filter(f => !!f) - ]); - - return [recordNode.nodeId.toString(), ...subfolders, id] -}; - -const folderForChar = (char, folderCount) => - folderCount === 1 ? "" - : $(folderCount, [ - idFoldersForFolderCount, - find(f => f.includes(char)) - ]); - -const idFoldersForFolderCount = (folderCount) => { - const charRangePerShard = 64 / folderCount; - const idFolders = []; - let index = 0; - let currentIdsShard = ''; - while (index < 64) { - currentIdsShard += allIdChars[index]; - if ((index + 1) % charRangePerShard === 0) { - idFolders.push(currentIdsShard); - currentIdsShard = ''; - } - index++; - } - - return idFolders; -}; - -const load = app => async key => { - key = safeKey(key); - return apiWrapper( - app, - events.recordApi.load, - permission.readRecord.isAuthorized(key), - { key }, - _load, app, key, - ); -}; - -const _loadFromInfo = async (app, recordInfo, keyStack = []) => { - const key = recordInfo.key; - const {recordNode, recordJson} = recordInfo; - const storedData = await app.datastore.loadJson(recordJson); - - const loadedRecord = $(recordNode.fields, [ - keyBy('name'), - mapValues(f => safeParseField(f, storedData)), - ]); - - const newKeyStack = [...keyStack, key]; - - const references = $(recordNode.fields, [ - filter(f => f.type === 'reference' - && isNonEmptyString(loadedRecord[f.name].key) - && !includes(loadedRecord[f.name].key)(newKeyStack)), - map(f => ({ - promise: _load(app, loadedRecord[f.name].key, newKeyStack), - index: getNode(app.hierarchy, f.typeOptions.indexNodeKey), - field: f, - })), - ]); - - if (references.length > 0) { - const refRecords = await Promise.all( - map(p => p.promise)(references), - ); - - for (const ref of references) { - loadedRecord[ref.field.name] = mapRecord( - refRecords[references.indexOf(ref)], - ref.index, - ); - } - } - - loadedRecord.transactionId = storedData.transactionId; - loadedRecord.isNew = false; - loadedRecord.key = key; - loadedRecord.id = $(key, [splitKey, last]); - loadedRecord.type = recordNode.name; - return loadedRecord; -}; - -const _load = async (app, key, keyStack = []) => - _loadFromInfo( - app, - getRecordInfo(app.hierarchy, key), - keyStack); - -// adapted from https://github.com/dex4er/js-promise-readable -// thanks :) - -const promiseReadableStream = stream => { - - let _errored; - - const _errorHandler = err => { - _errored = err; - }; - - stream.on("error", _errorHandler); - - const read = (size) => { - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err) - } - - if (!stream.readable || stream.closed || stream.destroyed) { - return resolve(); - } - - const readableHandler = () => { - const chunk = stream.read(size); - - if (chunk) { - removeListeners(); - resolve(chunk); - } - }; - - const closeHandler = () => { - removeListeners(); - resolve(); - }; - - const endHandler = () => { - removeListeners(); - resolve(); - }; - - const errorHandler = (err) => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const removeListeners = () => { - stream.removeListener("close", closeHandler); - stream.removeListener("error", errorHandler); - stream.removeListener("end", endHandler); - stream.removeListener("readable", readableHandler); - }; - - stream.on("close", closeHandler); - stream.on("end", endHandler); - stream.on("error", errorHandler); - stream.on("readable", readableHandler); - - readableHandler(); - }); - }; - - - const destroy = () => { - if (stream) { - if (_errorHandler) { - stream.removeListener("error", _errorHandler); - } - if (typeof stream.destroy === "function") { - stream.destroy(); - } - } - }; - - return {read, destroy, stream}; - }; - -const getIndexedDataKey = (indexNode, indexDir, record) => { - - const getShardName = (indexNode, record) => { - const shardNameFunc = compileCode$1(indexNode.getShardName); - try { - return shardNameFunc({ record }); - } catch(e) { - const errorDetails = `shardCode: ${indexNode.getShardName} :: record: ${JSON.stringify(record)} :: `; - e.message = "Error running index shardname func: " + errorDetails + e.message; - throw e; - } - }; - - const shardName = isNonEmptyString(indexNode.getShardName) - ? `${getShardName(indexNode, record)}.csv` - : 'index.csv'; - - return joinKey(indexDir, shardName); -}; - -const getShardKeysInRange = async (app, indexNode, indexDir, startRecord = null, endRecord = null) => { - const startShardName = !startRecord - ? null - : shardNameFromKey( - getIndexedDataKey( - indexNode, - indexDir, - startRecord, - ), - ); - - const endShardName = !endRecord - ? null - : shardNameFromKey( - getIndexedDataKey( - indexNode, - indexDir, - endRecord, - ), - ); - - return $(await getShardMap(app.datastore, indexDir), [ - filter(k => (startRecord === null || k >= startShardName) - && (endRecord === null || k <= endShardName)), - map(k => joinKey(indexDir, `${k}.csv`)), - ]); -}; - -const ensureShardNameIsInShardMap = async (store, indexDir, indexedDataKey) => { - const map = await getShardMap(store, indexDir); - const shardName = shardNameFromKey(indexedDataKey); - if (!includes(shardName)(map)) { - map.push(shardName); - await writeShardMap(store, indexDir, map); - } -}; - -const getShardMap = async (datastore, indexDir) => { - const shardMapKey = getShardMapKey(indexDir); - try { - return await datastore.loadJson(shardMapKey); - } catch (_) { - await datastore.createJson(shardMapKey, []); - return []; - } -}; - -const writeShardMap = async (datastore, indexDir, shardMap) => await datastore.updateJson( - getShardMapKey(indexDir), - shardMap, -); - -const getShardMapKey = indexDir => joinKey(indexDir, 'shardMap.json'); - -const getUnshardedIndexDataKey = indexDir => joinKey(indexDir, 'index.csv'); - -const createIndexFile = async (datastore, indexedDataKey, index) => { - if (isShardedIndex(index)) { - const indexDir = getParentKey(indexedDataKey); - const shardMap = await getShardMap(datastore, indexDir); - shardMap.push( - shardNameFromKey(indexedDataKey), - ); - await writeShardMap(datastore, indexDir, shardMap); - } - await datastore.createFile(indexedDataKey, ''); -}; - -const shardNameFromKey = key => $(key, [ - splitKey, - last, -]).replace('.csv', ''); - -const getIndexKey_BasedOnDecendant = (decendantKey, indexNode) => { - if (isGlobalIndex(indexNode)) { return `${indexNode.nodeKey()}`; } - - const indexedDataParentKey = getActualKeyOfParent( - indexNode.parent().nodeKey(), - decendantKey, - ); - - return joinKey( - indexedDataParentKey, - indexNode.name, - ); -}; - -const generateSchema = (hierarchy, indexNode) => { - const recordNodes = getAllowedRecordNodesForIndex(hierarchy, indexNode); - const mappedRecords = $(recordNodes, [ - map(n => mapRecord(createSampleRecord(n), indexNode)), - ]); - - // always has record key and sort key - const schema = { - sortKey: all$1.string, - key: all$1.string, - }; - - const fieldsHas = has(schema); - const setField = (fieldName, value) => { - if (value === null || value === undefined) { return; } - - const thisType = detectType(value); - if (fieldsHas(fieldName)) { - if (schema[fieldName] !== thisType) { - schema[fieldName] = all$1.string; - } - } else { - schema[fieldName] = thisType; - } - }; - - for (const mappedRec of mappedRecords) { - for (const f in mappedRec) { - setField(f, mappedRec[f]); - } - } - - // returing an array of {name, type} - return $(schema, [ - keys, - map(k => ({ name: k, type: schema[k].name })), - filter(s => s.name !== 'sortKey'), - orderBy('name', ['desc']), // reverse aplha - concat([{ name: 'sortKey', type: all$1.string.name }]), // sortKey on end - reverse, // sortKey first, then rest are alphabetical - ]); -}; - -const createSampleRecord = recordNode => constructRecord( - recordNode, - getSampleFieldValue, - recordNode.parent().nodeKey(), -); - -var global$1 = (typeof global !== "undefined" ? global : - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : {}); - -var lookup = []; -var revLookup = []; -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; -var inited = false; -function init () { - inited = true; - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; -} - -function toByteArray (b64) { - if (!inited) { - init(); - } - var i, j, l, tmp, placeHolders, arr; - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = new Arr(len * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len; - - var L = 0; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]; - arr[L++] = (tmp >> 16) & 0xFF; - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[L++] = tmp & 0xFF; - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output.push(tripletToBase64(tmp)); - } - return output.join('') -} - -function fromByteArray (uint8) { - if (!inited) { - init(); - } - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var output = ''; - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - output += lookup[tmp >> 2]; - output += lookup[(tmp << 4) & 0x3F]; - output += '=='; - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]); - output += lookup[tmp >> 10]; - output += lookup[(tmp >> 4) & 0x3F]; - output += lookup[(tmp << 2) & 0x3F]; - output += '='; - } - - parts.push(output); - - return parts.join('') -} - -function read (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -function write (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; -} - -var toString = {}.toString; - -var isArray = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - -var INSPECT_MAX_BYTES = 50; - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined - ? global$1.TYPED_ARRAY_SUPPORT - : true; - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length); - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length); - } - that.length = length; - } - - return that -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192; // not used by this implementation - -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype; - return arr -}; - -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -}; - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype; - Buffer.__proto__ = Uint8Array; -} - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} - -function alloc (that, size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -}; - -function allocUnsafe (that, size) { - assertSize(size); - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0; - } - } - return that -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -}; -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) -}; - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0; - that = createBuffer(that, length); - - var actual = that.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual); - } - - return that -} - -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0; - that = createBuffer(that, length); - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255; - } - return that -} - -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength; // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array); - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset); - } else { - array = new Uint8Array(array, byteOffset, length); - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array; - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array); - } - return that -} - -function fromObject (that, obj) { - if (internalIsBuffer(obj)) { - var len = checked(obj.length) | 0; - that = createBuffer(that, len); - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len); - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') -} - -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} -Buffer.isBuffer = isBuffer; -function internalIsBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!internalIsBuffer(a) || !internalIsBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length; - var y = b.length; - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -}; - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -}; - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - var buffer = Buffer.allocUnsafe(length); - var pos = 0; - for (i = 0; i < list.length; ++i) { - var buf = list[i]; - if (!internalIsBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer -}; - -function byteLength (string, encoding) { - if (internalIsBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string; - } - - var len = string.length; - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } -} -Buffer.byteLength = byteLength; - -function slowToString (encoding, start, end) { - var loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } -} - -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true; - -function swap (b, n, m) { - var i = b[n]; - b[n] = b[m]; - b[m] = i; -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this -}; - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this -}; - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this -}; - -Buffer.prototype.toString = function toString () { - var length = this.length | 0; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -}; - -Buffer.prototype.equals = function equals (b) { - if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -}; - -Buffer.prototype.inspect = function inspect () { - var str = ''; - var max = INSPECT_MAX_BYTES; - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); - if (this.length > max) str += ' ... '; - } - return '' -}; - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!internalIsBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - var x = thisEnd - thisStart; - var y = end - start; - var len = Math.min(x, y); - - var thisCopy = this.slice(thisStart, thisEnd); - var targetCopy = target.slice(start, end); - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -}; - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000; - } - byteOffset = +byteOffset; // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (internalIsBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1; - var arrLength = arr.length; - var valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i; - if (dir) { - var foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - var found = true; - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -}; - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -}; - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -}; - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - var remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0; - if (isFinite(length)) { - length = length | 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } -}; - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -}; - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return fromByteArray(buf) - } else { - return fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - var res = []; - - var i = start; - while (i < end) { - var firstByte = buf[i]; - var codePoint = null; - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000; - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = ''; - var i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; ++i) { - out += toHex(buf[i]); - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end); - var res = ''; - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - var newBuf; - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end); - newBuf.__proto__ = Buffer.prototype; - } else { - var sliceLen = end - start; - newBuf = new Buffer(sliceLen, undefined); - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start]; - } - } - - return newBuf -}; - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val -}; - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - var val = this[offset + --byteLength]; - var mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val -}; - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] -}; - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) -}; - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] -}; - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -}; - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -}; - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val -}; - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var i = byteLength; - var mul = 1; - var val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val -}; - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -}; - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val -}; - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val -}; - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -}; - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -}; - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, true, 23, 4) -}; - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, false, 23, 4) -}; - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, true, 52, 8) -}; - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, false, 52, 8) -}; - -function checkInt (buf, value, offset, ext, max, min) { - if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var mul = 1; - var i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var i = byteLength - 1; - var mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - this[offset] = (value & 0xff); - return offset + 1 -}; - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8; - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 -}; - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 -}; - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff; - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 -}; - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 -}; - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = 0; - var mul = 1; - var sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = byteLength - 1; - var mul = 1; - var sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength -}; - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 -}; - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 -}; - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 -}; - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 -}; - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (value < 0) value = 0xffffffff + value + 1; - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 -}; - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -}; - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -}; - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -}; - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -}; - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - var len = end - start; - var i; - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start]; - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start]; - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ); - } - - return len -}; - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (val.length === 1) { - var code = val.charCodeAt(0); - if (code < 256) { - val = code; - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255; - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - var i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - var bytes = internalIsBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()); - var len = bytes.length; - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this -}; - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity; - var codePoint; - var length = string.length; - var leadSurrogate = null; - var bytes = []; - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo; - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray -} - - -function base64ToBytes (str) { - return toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i -} - -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} - - -// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -function isBuffer(obj) { - return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj)) -} - -function isFastBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0)) -} - -// Copyright Joyent, Inc. and other Node contributors. -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - }; - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -function StringDecoder(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -} - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} - -const BUFFER_MAX_BYTES = 524288; // 0.5Mb - -const CONTINUE_READING_RECORDS = "CONTINUE_READING"; -const READ_REMAINING_TEXT = "READ_REMAINING"; -const CANCEL_READ = "CANCEL"; - -const getIndexWriter = (hierarchy, indexNode, readableStream, writableStream, end) => { - const schema = generateSchema(hierarchy, indexNode); - - return ({ - read: read$1(readableStream, schema), - updateIndex: updateIndex(readableStream, writableStream, schema) - }); -}; - -const getIndexReader = (hierarchy, indexNode, readableStream) => - read$1( - readableStream, - generateSchema(hierarchy, indexNode) - ); - -const updateIndex = (readableStream, writableStream, schema) => async (itemsToWrite, keysToRemove) => { - const write = newOutputWriter(BUFFER_MAX_BYTES, writableStream); - const writtenItems = []; - await read$1(readableStream, schema)( - async indexedItem => { - const updated = find(i => indexedItem.key === i.key)(itemsToWrite); - const removed = find(k => indexedItem.key === k)(keysToRemove); - - if(isSomething(removed)) - return CONTINUE_READING_RECORDS; - - if(isSomething(updated)) { - const serializedItem = serializeItem(schema, updated); - await write(serializedItem); - writtenItems.push(updated); - } else { - await write( - serializeItem(schema, indexedItem) - ); - } - - return CONTINUE_READING_RECORDS; - - }, - async text => await write(text) - ); - - if(writtenItems.length !== itemsToWrite.length) { - const toAdd = difference(itemsToWrite, writtenItems); - for(let added of toAdd) { - await write( - serializeItem(schema, added) - ); - } - } else if(writtenItems.length === 0) { - // potentially are no records - await write(""); - } - - await write(); - await writableStream.end(); -}; - -const read$1 = (readableStream, schema) => async (onGetItem, onGetText) => { - const readInput = newInputReader(readableStream); - let text = await readInput(); - let status = CONTINUE_READING_RECORDS; - while(text.length > 0) { - - if(status === READ_REMAINING_TEXT) { - await onGetText(text); - continue; - } - - if(status === CANCEL_READ) { - return; - } - - let rowText = ""; - let currentCharIndex=0; - for(let currentChar of text) { - rowText += currentChar; - if(currentChar === "\r") { - status = await onGetItem( - deserializeRow(schema, rowText) - ); - rowText = ""; - if(status === READ_REMAINING_TEXT) { - break; - } - } - currentCharIndex++; - } - - if(currentCharIndex < text.length -1) { - await onGetText(text.substring(currentCharIndex + 1)); - } - - text = await readInput(); - } - - await readableStream.destroy(); - -}; - -const newOutputWriter = (flushBoundary, writableStream) => { - - let currentBuffer = null; - - return async (text) => { - - if(isString(text) && currentBuffer === null) - currentBuffer = Buffer$1.from(text, "utf8"); - else if(isString(text)) - currentBuffer = Buffer$1.concat([ - currentBuffer, - Buffer$1.from(text, "utf8") - ]); - - if(currentBuffer !== null && - (currentBuffer.length > flushBoundary - || !isString(text))) { - - await writableStream.write(currentBuffer); - currentBuffer = null; - } - } -}; - -const newInputReader = (readableStream) => { - - const decoder = new StringDecoder('utf8'); - let remainingBytes = []; - - return async () => { - - let nextBytesBuffer = await readableStream.read(BUFFER_MAX_BYTES); - const remainingBuffer = Buffer$1.from(remainingBytes); - - if(!nextBytesBuffer) nextBytesBuffer = Buffer$1.from([]); - - const moreToRead = nextBytesBuffer.length === BUFFER_MAX_BYTES; - - const buffer = Buffer$1.concat( - [remainingBuffer, nextBytesBuffer], - remainingBuffer.length + nextBytesBuffer.length); - - const text = decoder.write(buffer); - remainingBytes = decoder.end(buffer); - - if(!moreToRead && remainingBytes.length > 0) { - // if for any reason, we have remaining bytes at the end - // of the stream, just discard - dont see why this should - // ever happen, but if it does, it could cause a stack overflow - remainingBytes = []; - } - - return text; - }; -}; - -const deserializeRow = (schema, rowText) => { - let currentPropIndex = 0; - let currentCharIndex = 0; - let currentValueText = ""; - let isEscaped = false; - const item = {}; - - const setCurrentProp = () => { - const currentProp = schema[currentPropIndex]; - const type = getType(currentProp.type); - const value = currentValueText === "" - ? type.getDefaultValue() - : type.safeParseValue( - currentValueText); - item[currentProp.name] = value; - }; - - while(currentPropIndex < schema.length) { - - if(currentCharIndex < rowText.length) { - const currentChar = rowText[currentCharIndex]; - if(isEscaped) { - if(currentChar === "r") { - currentValueText += "\r"; - } else { - currentValueText += currentChar; - } - isEscaped = false; - } else { - if(currentChar === ",") { - setCurrentProp(); - currentValueText = ""; - currentPropIndex++; - } else if(currentChar === "\\") { - isEscaped = true; - } else { - currentValueText += currentChar; - } - } - currentCharIndex++; - } else { - currentValueText = ""; - setCurrentProp(); - currentPropIndex++; - } - } - - return item; -}; - -const serializeItem = (schema, item) => { - - let rowText = ""; - - for(let prop of schema) { - const type = getType(prop.type); - const value = has(prop.name)(item) - ? item[prop.name] - : type.getDefaultValue(); - - const valStr = type.stringify(value); - - for(let i = 0; i < valStr.length; i++) { - const currentChar = valStr[i]; - if(currentChar === "," - || currentChar === "\r" - || currentChar === "\\") { - rowText += "\\"; - } - - if(currentChar === "\r") { - rowText += "r"; - } else { - rowText += currentChar; - } - } - - rowText += ","; - } - - rowText += "\r"; - return rowText; -}; - -const readIndex$1 = async (hierarchy, datastore, index, indexedDataKey) => { - const records = []; - const doRead = iterateIndex( - async item => { - records.push(item); - return CONTINUE_READING_RECORDS; - }, - async () => records - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); -}; - -const searchIndex = async (hierarchy, datastore, index, indexedDataKey, searchPhrase) => { - const records = []; - const schema = generateSchema(hierarchy, index); - const doRead = iterateIndex( - async item => { - const idx = lunr(function () { - this.ref('key'); - for (const field of schema) { - this.field(field.name); - } - this.add(item); - }); - const searchResults = idx.search(searchPhrase); - if (searchResults.length === 1) { - item._searchResult = searchResults[0]; - records.push(item); - } - return CONTINUE_READING_RECORDS; - }, - async () => records - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); -}; - -const iterateIndex = (onGetItem, getFinalResult) => async (hierarchy, datastore, index, indexedDataKey) => { - try { - const readableStream = promiseReadableStream( - await datastore.readableFileStream(indexedDataKey) - ); - - const read = getIndexReader(hierarchy, index, readableStream); - await read(onGetItem); - return getFinalResult(); - } catch (e) { - if (await datastore.exists(indexedDataKey)) { - throw e; - } else { - await createIndexFile( - datastore, - indexedDataKey, - index, - ); - } - return []; - } -}; - -const getIndexDir = (hierarchy, indexKey) => { - - const parentKey = getParentKey(indexKey); - - if(parentKey === "") return indexKey; - if(parentKey === keySep) return indexKey; - - const recordInfo = getRecordInfo( - hierarchy, - parentKey); - - return recordInfo.child( - getLastPartInKey(indexKey)); -}; - -const listItems = app => async (indexKey, options) => { - indexKey = safeKey(indexKey); - return apiWrapper( - app, - events.indexApi.listItems, - permission.readIndex.isAuthorized(indexKey), - { indexKey, options }, - _listItems, app, indexKey, options, - ); -}; - -const defaultOptions = { rangeStartParams: null, rangeEndParams: null, searchPhrase: null }; - -const _listItems = async (app, indexKey, options = defaultOptions) => { - const { searchPhrase, rangeStartParams, rangeEndParams } = $({}, [ - merge$1(options), - merge$1(defaultOptions), - ]); - - const getItems = async indexedDataKey => (isNonEmptyString(searchPhrase) - ? await searchIndex( - app.hierarchy, - app.datastore, - indexNode, - indexedDataKey, - searchPhrase, - ) - : await readIndex$1( - app.hierarchy, - app.datastore, - indexNode, - indexedDataKey, - )); - - indexKey = safeKey(indexKey); - const indexNode = getExactNodeForKey(app.hierarchy)(indexKey); - const indexDir = getIndexDir(app.hierarchy, indexKey); - - if (!isIndex(indexNode)) { throw new Error('supplied key is not an index'); } - - if (isShardedIndex(indexNode)) { - const shardKeys = await getShardKeysInRange( - app, indexNode, indexDir, rangeStartParams, rangeEndParams, - ); - const items = []; - for (const k of shardKeys) { - items.push(await getItems(k)); - } - return flatten(items); - } - return await getItems( - getUnshardedIndexDataKey(indexDir), - ); -}; - -const getContext = app => recordKey => { - recordKey = safeKey(recordKey); - return apiWrapperSync( - app, - events.recordApi.getContext, - permission.readRecord.isAuthorized(recordKey), - { recordKey }, - _getContext, app, recordKey, - ); -}; - -const _getContext = (app, recordKey) => { - recordKey = safeKey(recordKey); - const recordNode = getExactNodeForKey(app.hierarchy)(recordKey); - - const cachedReferenceIndexes = {}; - - const lazyLoadReferenceIndex = async (typeOptions) => { - if (!has(typeOptions.indexNodeKey)(cachedReferenceIndexes)) { - cachedReferenceIndexes[typeOptions.indexNodeKey] = { - typeOptions, - data: await readReferenceIndex( - app, recordKey, typeOptions, - ), - }; - } - - return cachedReferenceIndexes[typeOptions.indexNodeKey]; - }; - - const getTypeOptions = typeOptions_or_fieldName => (isString(typeOptions_or_fieldName) - ? findField(recordNode, typeOptions_or_fieldName) - .typeOptions - : typeOptions_or_fieldName); - - return { - referenceExists: async (typeOptions_or_fieldName, key) => { - const typeOptions = getTypeOptions(typeOptions_or_fieldName); - const { data } = await lazyLoadReferenceIndex(typeOptions); - return some(i => i.key === key)(data); - }, - referenceOptions: async (typeOptions_or_fieldName) => { - const typeOptions = getTypeOptions(typeOptions_or_fieldName); - const { data } = await lazyLoadReferenceIndex(typeOptions); - return data; - }, - recordNode, - }; -}; - -const readReferenceIndex = async (app, recordKey, typeOptions) => { - const indexNode = getNode(app.hierarchy, typeOptions.indexNodeKey); - const indexKey = isGlobalIndex(indexNode) - ? indexNode.nodeKey() - : getIndexKey_BasedOnDecendant( - recordKey, indexNode, - ); - - const items = await listItems(app)(indexKey); - return $(items, [ - map(i => ({ - key: i.key, - value: i[typeOptions.displayValue], - })), - ]); -}; - -const fieldParseError = (fieldName, value) => ({ - fields: [fieldName], - message: `Could not parse field ${fieldName}:${value}`, -}); - -const validateAllFieldParse = (record, recordNode) => $(recordNode.fields, [ - map(f => ({ name: f.name, parseResult: validateFieldParse(f, record) })), - reduce((errors, f) => { - if (f.parseResult.success) return errors; - errors.push( - fieldParseError(f.name, f.parseResult.value), - ); - return errors; - }, []), -]); - -const validateAllTypeConstraints = async (record, recordNode, context) => { - const errors = []; - for (const field of recordNode.fields) { - $(await validateTypeConstraints$1(field, record, context), [ - filter(isNonEmptyString), - map(m => ({ message: m, fields: [field.name] })), - each(e => errors.push(e)), - ]); - } - return errors; -}; - -const runRecordValidationRules = (record, recordNode) => { - const runValidationRule = (rule) => { - const isValid = compileExpression$1(rule.expressionWhenValid); - const expressionContext = { record, _ }; - return (isValid(expressionContext) - ? { valid: true } - : ({ - valid: false, - fields: rule.invalidFields, - message: rule.messageWhenInvalid, - })); - }; - - return $(recordNode.validationRules, [ - map(runValidationRule), - flatten, - filter(r => r.valid === false), - map(r => ({ fields: r.fields, message: r.message })), - ]); -}; - -const validate = app => async (record, context) => { - context = isNothing(context) - ? _getContext(app, record.key) - : context; - - const recordNode = getExactNodeForKey(app.hierarchy)(record.key); - const fieldParseFails = validateAllFieldParse(record, recordNode); - - // non parsing would cause further issues - exit here - if (!isEmpty(fieldParseFails)) { return ({ isValid: false, errors: fieldParseFails }); } - - const recordValidationRuleFails = runRecordValidationRules(record, recordNode); - const typeContraintFails = await validateAllTypeConstraints(record, recordNode, context); - - if (isEmpty(fieldParseFails) - && isEmpty(recordValidationRuleFails) - && isEmpty(typeContraintFails)) { - return ({ isValid: true, errors: [] }); - } - - return ({ - isValid: false, - errors: _.union(fieldParseFails, typeContraintFails, recordValidationRuleFails), - }); -}; - -const ensureCollectionIsInitialised = async (datastore, node, dir) => { - if (!await datastore.exists(dir)) { - await datastore.createFolder(dir); - await datastore.createFolder(joinKey(dir, node.nodeId)); - } -}; - -const initialiseRootCollections = async (datastore, hierarchy) => { - const rootCollectionRecord = allTrue( - n => isRoot(n.parent()), - isCollectionRecord, - ); - - const flathierarchy = getFlattenedHierarchy(hierarchy); - - const collectionRecords = $(flathierarchy, [ - filter(rootCollectionRecord), - ]); - - for (const col of collectionRecords) { - await ensureCollectionIsInitialised( - datastore, - col, - col.collectionPathRegx() - ); - } -}; - -const initialiseChildCollections = async (app, recordInfo) => { - const childCollectionRecords = $(recordInfo.recordNode, [ - n => n.children, - filter(isCollectionRecord), - ]); - - for (const child of childCollectionRecords) { - await ensureCollectionIsInitialised( - app.datastore, - child, - recordInfo.child(child.collectionName), - ); - } -}; - -const TRANSACTIONS_FOLDER = `${keySep}.transactions`; -const LOCK_FILENAME = 'lock'; -const LOCK_FILE_KEY = joinKey( - TRANSACTIONS_FOLDER, LOCK_FILENAME, -); -const idSep = '$'; - -const isOfType = typ => trans => trans.transactionType === typ; - -const CREATE_RECORD_TRANSACTION = 'create'; -const UPDATE_RECORD_TRANSACTION = 'update'; -const DELETE_RECORD_TRANSACTION = 'delete'; -const BUILD_INDEX_TRANSACTION = 'build'; - -const isUpdate = isOfType(UPDATE_RECORD_TRANSACTION); -const isDelete = isOfType(DELETE_RECORD_TRANSACTION); -const isCreate = isOfType(CREATE_RECORD_TRANSACTION); -const isBuildIndex = isOfType(BUILD_INDEX_TRANSACTION); - -const keyToFolderName = nodeKey => getHashCode(nodeKey); - -const getTransactionId = (recordId, transactionType, uniqueId) => - `${recordId}${idSep}${transactionType}${idSep}${uniqueId}`; - -const buildIndexFolder = '.BUILD-'; -const nodeKeyHashFromBuildFolder = folder => folder.replace(buildIndexFolder, ''); - -const isBuildIndexFolder = key => getLastPartInKey(key).startsWith(buildIndexFolder); - -const IndexNodeKeyFolder = indexNodeKey => joinKey( - TRANSACTIONS_FOLDER, - buildIndexFolder + keyToFolderName(indexNodeKey), -); - -const IndexNodeKeyBatchFolder = (indexNodeKey, count) => - joinKey(IndexNodeKeyFolder(indexNodeKey), Math.floor(count / BUILDINDEX_BATCH_COUNT).toString()); - -const BUILDINDEX_BATCH_COUNT = 1000; -const timeoutMilliseconds = 30 * 1000; // 30 secs -const maxLockRetries = 1; - -const transactionForCreateRecord = async (app, record) => await transaction( - app.datastore, CREATE_RECORD_TRANSACTION, - record.key, { record }, - getTransactionKey_Records, -); - -const transactionForUpdateRecord = async (app, oldRecord, newRecord) => await transaction( - app.datastore, UPDATE_RECORD_TRANSACTION, - newRecord.key, { oldRecord, record: newRecord }, - getTransactionKey_Records, -); - -const transactionForDeleteRecord = async (app, record) => await transaction( - app.datastore, DELETE_RECORD_TRANSACTION, - record.key, { record }, - getTransactionKey_Records, -); - -const transactionForBuildIndex = async (app, indexNodeKey, recordKey, count) => { - const transactionFolder = IndexNodeKeyBatchFolder(indexNodeKey, count); - if (count % BUILDINDEX_BATCH_COUNT === 0) { - await app.datastore.createFolder(transactionFolder); - } - - return await transaction( - app.datastore, BUILD_INDEX_TRANSACTION, - recordKey, { recordKey }, - id => joinKey(transactionFolder, id), - ); -}; - -const createBuildIndexFolder = async (datastore, indexNodeKey) => await datastore.createFolder( - IndexNodeKeyFolder(indexNodeKey), -); - -const getTransactionKey_Records = id => joinKey(TRANSACTIONS_FOLDER, id); - -const transaction = async (datastore, transactionType, recordKey, data, getTransactionKey) => { - const recordId = getLastPartInKey(recordKey); - const uniqueId = generate(); - const id = getTransactionId( - recordId, transactionType, uniqueId, - ); - - const key = getTransactionKey(id); - - const trans = { - transactionType, - recordKey, - ...data, - id, - }; - - await datastore.createJson( - key, trans, - ); - - return trans; -}; - -const initialiseIndex = async (datastore, dir, index) => { - const indexDir = joinKey(dir, index.name); - - await datastore.createFolder(indexDir); - - if (isShardedIndex(index)) { - await datastore.createFile( - getShardMapKey(indexDir), - '[]', - ); - } else { - await createIndexFile( - datastore, - getUnshardedIndexDataKey(indexDir), - index, - ); - } -}; - -const save = app => async (record, context) => apiWrapper( - app, - events.recordApi.save, - record.isNew - ? permission.createRecord.isAuthorized(record.key) - : permission.updateRecord.isAuthorized(record.key), { record }, - _save, app, record, context, false, -); - - -const _save = async (app, record, context, skipValidation = false) => { - const recordClone = cloneDeep(record); - if (!skipValidation) { - const validationResult = await validate(app)(recordClone, context); - if (!validationResult.isValid) { - await app.publish(events.recordApi.save.onInvalid, { record, validationResult }); - throw new BadRequestError(`Save : Record Invalid : ${ - JSON.stringify(validationResult.errors)}`); - } - } - - const recordInfo = getRecordInfo(app.hierarchy, record.key); - const { - recordNode, pathInfo, - recordJson, files, - } = recordInfo; - - if (recordClone.isNew) { - - if(!recordNode) - throw new Error("Cannot find node for " + record.key); - - const transaction = await transactionForCreateRecord( - app, recordClone, - ); - recordClone.transactionId = transaction.id; - await createRecordFolderPath(app.datastore, pathInfo); - await app.datastore.createFolder(files); - await app.datastore.createJson(recordJson, recordClone); - await initialiseReverseReferenceIndexes(app, recordInfo); - await initialiseAncestorIndexes(app, recordInfo); - await initialiseChildCollections(app, recordInfo); - await app.publish(events.recordApi.save.onRecordCreated, { - record: recordClone, - }); - } else { - const oldRecord = await _loadFromInfo(app, recordInfo); - const transaction = await transactionForUpdateRecord( - app, oldRecord, recordClone, - ); - recordClone.transactionId = transaction.id; - await app.datastore.updateJson( - recordJson, - recordClone, - ); - await app.publish(events.recordApi.save.onRecordUpdated, { - old: oldRecord, - new: recordClone, - }); - } - - await app.cleanupTransactions(); - - const returnedClone = cloneDeep(recordClone); - returnedClone.isNew = false; - return returnedClone; -}; - -const initialiseAncestorIndexes = async (app, recordInfo) => { - for (const index of recordInfo.recordNode.indexes) { - const indexKey = recordInfo.child(index.name); - if (!await app.datastore.exists(indexKey)) { - await initialiseIndex(app.datastore, recordInfo.dir, index); - } - } -}; - -const initialiseReverseReferenceIndexes = async (app, recordInfo) => { - - const indexNodes = $(fieldsThatReferenceThisRecord(app, recordInfo.recordNode), [ - map(f => $(f.typeOptions.reverseIndexNodeKeys, [ - map(n => getNode( - app.hierarchy, - n, - )), - ])), - flatten, - ]); - - for (const indexNode of indexNodes) { - await initialiseIndex( - app.datastore, recordInfo.dir, indexNode, - ); - } -}; - -const fieldsThatReferenceThisRecord = (app, recordNode) => $(app.hierarchy, [ - getFlattenedHierarchy, - filter(isRecord), - map(n => n.fields), - flatten, - filter(fieldReversesReferenceToNode(recordNode)), -]); - -const createRecordFolderPath = async (datastore, pathInfo) => { - - const recursiveCreateFolder = async (subdirs, dirsThatNeedCreated=undefined) => { - - // iterate backwards through directory hierachy - // until we get to a folder that exists, then create the rest - // e.g - // - some/folder/here - // - some/folder - // - some - const thisFolder = joinKey(pathInfo.base, ...subdirs); - - if(await datastore.exists(thisFolder)) { - - let creationFolder = thisFolder; - for(let nextDir of (dirsThatNeedCreated || []) ) { - creationFolder = joinKey(creationFolder, nextDir); - await datastore.createFolder(creationFolder); - } - - } else if(!dirsThatNeedCreated || dirsThatNeedCreated.length > 0) { - - dirsThatNeedCreated = !dirsThatNeedCreated - ? [] - :dirsThatNeedCreated; - - await recursiveCreateFolder( - take(subdirs.length - 1)(subdirs), - [...takeRight$1(1)(subdirs), ...dirsThatNeedCreated] - ); - } - }; - - await recursiveCreateFolder(pathInfo.subdirs); - - return joinKey(pathInfo.base, ...pathInfo.subdirs); - -}; - -const deleteCollection = (app, disableCleanup = false) => async key => apiWrapper( - app, - events.collectionApi.delete, - permission.manageCollection.isAuthorized, - { key }, - _deleteCollection, app, key, disableCleanup, -); - -/* - const recordNode = getCollectionNode(app.hierarchy, key); - -*/ - -const _deleteCollection = async (app, key, disableCleanup) => { - key = safeKey(key); - const collectionDir = getCollectionDir(app.hierarchy, key); - await deleteRecords(app, key); - await deleteCollectionFolder(app, collectionDir); - if (!disableCleanup) { await app.cleanupTransactions(); } -}; - -const deleteCollectionFolder = async (app, dir) => - await app.datastore.deleteFolder(dir); - -const deleteRecords = async (app, key) => { - - const iterate = await getAllIdsIterator(app)(key); - - let ids = await iterate(); - while (!ids.done) { - if (ids.result.collectionKey === key) { - for (const id of ids.result.ids) { - await _deleteRecord( - app, - joinKey(key, id), - true, - ); - } - } - - ids = await iterate(); - } -}; - -const deleteRecord$1 = (app, disableCleanup = false) => async key => { - key = safeKey(key); - return apiWrapper( - app, - events.recordApi.delete, - permission.deleteRecord.isAuthorized(key), - { key }, - _deleteRecord, app, key, disableCleanup, - ); -}; - -// called deleteRecord because delete is a keyword -const _deleteRecord = async (app, key, disableCleanup) => { - const recordInfo = getRecordInfo(app.hierarchy, key); - key = recordInfo.key; - const node = getExactNodeForKey(app.hierarchy)(key); - - const record = await _load(app, key); - await transactionForDeleteRecord(app, record); - - for (const collectionRecord of node.children) { - const collectionKey = joinKey( - key, collectionRecord.collectionName, - ); - await _deleteCollection(app, collectionKey, true); - } - - await app.datastore.deleteFolder(recordInfo.dir); - - if (!disableCleanup) { await app.cleanupTransactions(); } -}; - -const uploadFile = app => async (recordKey, readableStream, relativeFilePath) => apiWrapper( - app, - events.recordApi.uploadFile, - permission.updateRecord.isAuthorized(recordKey), - { recordKey, readableStream, relativeFilePath }, - _uploadFile, app, recordKey, readableStream, relativeFilePath, -); - -const _uploadFile = async (app, recordKey, readableStream, relativeFilePath) => { - if (isNothing(recordKey)) { throw new BadRequestError('Record Key not supplied'); } - if (isNothing(relativeFilePath)) { throw new BadRequestError('file path not supplied'); } - if (!isLegalFilename(relativeFilePath)) { throw new BadRequestError('Illegal filename'); } - - const recordInfo = getRecordInfo(app.hierarchy, recordKey); - const record = await _loadFromInfo(app, recordInfo); - - const fullFilePath = safeGetFullFilePath( - recordInfo.dir, relativeFilePath, - ); - - const tempFilePath = `${fullFilePath}_${generate()}.temp`; - - const outputStream = await app.datastore.writableFileStream( - tempFilePath, - ); - - return new Promise((resolve,reject) => { - readableStream.pipe(outputStream); - outputStream.on('error', reject); - outputStream.on('finish', resolve); - }) - .then(() => app.datastore.getFileSize(tempFilePath)) - .then(size => { - const isExpectedFileSize = checkFileSizeAgainstFields( - app, record, relativeFilePath, size - ); - if (!isExpectedFileSize) { throw new BadRequestError(`Fields for ${relativeFilePath} do not have expected size: ${join(',')(incorrectFields)}`); } - - }) - .then(() => tryAwaitOrIgnore(app.datastore.deleteFile, fullFilePath)) - .then(() => app.datastore.renameFile(tempFilePath, fullFilePath)); - -}; - -const checkFileSizeAgainstFields = (app, record, relativeFilePath, expectedSize) => { - const recordNode = getExactNodeForKey(app.hierarchy)(record.key); - - const incorrectFileFields = $(recordNode.fields, [ - filter(f => f.type === 'file' - && record[f.name].relativePath === relativeFilePath - && record[f.name].size !== expectedSize), - map(f => f.name), - ]); - - const incorrectFileArrayFields = $(recordNode.fields, [ - filter(a => a.type === 'array' - && $(record[a.name], [ - some(f => record[f.name].relativePath === relativeFilePath - && record[f.name].size !== expectedSize), - ])), - map(f => f.name), - ]); - - const incorrectFields = [ - ...incorrectFileFields, - ...incorrectFileArrayFields, - ]; - - if (incorrectFields.length > 0) { - return false; - } - - return true; -}; - -const safeGetFullFilePath = (recordDir, relativeFilePath) => { - const naughtyUser = () => { throw new ForbiddenError('naughty naughty'); }; - - if (relativeFilePath.startsWith('..')) naughtyUser(); - - const pathParts = splitKey(relativeFilePath); - - if (includes('..')(pathParts)) naughtyUser(); - - const recordKeyParts = splitKey(recordDir); - - const fullPathParts = [ - ...recordKeyParts, - 'files', - ...filter(p => p !== '.')(pathParts), - ]; - - return joinKey(fullPathParts); -}; - -const downloadFile = app => async (recordKey, relativePath) => apiWrapper( - app, - events.recordApi.uploadFile, - permission.readRecord.isAuthorized(recordKey), - { recordKey, relativePath },//remove dupe key 'recordKey' from object - _downloadFile, app, recordKey, relativePath, -); - - -const _downloadFile = async (app, recordKey, relativePath) => { - if (isNothing(recordKey)) { throw new BadRequestError('Record Key not supplied'); } - if (isNothing(relativePath)) { throw new BadRequestError('file path not supplied'); } - - const {dir} = getRecordInfo(app.hierarchy, recordKey); - return await app.datastore.readableFileStream( - safeGetFullFilePath( - dir, relativePath, - ), - ); -}; - -const customId = app => (nodeName, id) => { - const node = $(app.hierarchy, [ - getFlattenedHierarchy, - find(n => n.name === nodeName), - ]); - - if (!node) throw new NotFoundError(`Cannot find node ${nodeName}`); - - return `${node.nodeId}-${id}`; -}; - -const setCustomId = app => (record, id) => { - record.id = customId(app)(record.type, id); - - const keyParts = splitKey(record.key); - - record.key = $(keyParts, [ - take(keyParts.length - 1), - union([record.id]), - joinKey, - ]); - - return record; -}; - -const api = app => ({ - getNew: getNew(app), - getNewChild: getNewChild(app), - save: save(app), - load: load(app), - delete: deleteRecord$1(app, false), - validate: validate(app), - getContext: getContext(app), - uploadFile: uploadFile(app), - downloadFile: downloadFile(app), - customId: customId(app), - setCustomId: setCustomId(app), -}); - - -const getRecordApi = app => api(app); - -const getAllowedRecordTypes = app => key => apiWrapperSync( - app, - events.collectionApi.getAllowedRecordTypes, - alwaysAuthorized, - { key }, - _getAllowedRecordTypes, app, key, -); - -const _getAllowedRecordTypes = (app, key) => { - key = safeKey(key); - const node = getNodeForCollectionPath(app.hierarchy)(key); - return isNothing(node) ? [] : [node.name]; -}; - -const getCollectionApi = app => ({ - getAllowedRecordTypes: getAllowedRecordTypes(app), - getAllIdsIterator: getAllIdsIterator(app), - delete: deleteCollection(app), -}); - -/** rebuilds an index - * @param {object} app - the application container - * @param {string} indexNodeKey - node key of the index, which the index belongs to - */ -const buildIndex = app => async indexNodeKey => apiWrapper( - app, - events.indexApi.buildIndex, - permission.manageIndex.isAuthorized, - { indexNodeKey }, - _buildIndex, app, indexNodeKey, -); - -const _buildIndex = async (app, indexNodeKey) => { - const indexNode = getNode(app.hierarchy, indexNodeKey); - - await createBuildIndexFolder(app.datastore, indexNodeKey); - - if (!isIndex(indexNode)) { throw new BadRequestError('BuildIndex: must supply an indexnode'); } - - if (indexNode.indexType === 'reference') { - await buildReverseReferenceIndex( - app, indexNode, - ); - } else { - await buildHeirarchalIndex( - app, indexNode, - ); - } - - await app.cleanupTransactions(); -}; - -const buildReverseReferenceIndex = async (app, indexNode) => { - // Iterate through all referencING records, - // and update referenced index for each record - let recordCount = 0; - const referencingNodes = $(app.hierarchy, [ - getFlattenedHierarchy, - filter(n => isRecord(n) - && some(fieldReversesReferenceToIndex(indexNode))(n.fields)), - ]); - - const createTransactionsForReferencingNode = async (referencingNode) => { - const iterateReferencingNodes = await getAllIdsIterator(app)(referencingNode.collectionNodeKey()); - - let referencingIdIterator = await iterateReferencingNodes(); - while (!referencingIdIterator.done) { - const { result } = referencingIdIterator; - for (const id of result.ids) { - const recordKey = joinKey(result.collectionKey, id); - await transactionForBuildIndex(app, indexNode.nodeKey(), recordKey, recordCount); - recordCount++; - } - referencingIdIterator = await iterateReferencingNodes(); - } - }; - - for (const referencingNode of referencingNodes) { - await createTransactionsForReferencingNode(referencingNode); - } -}; - -/* -const getAllowedParentCollectionNodes = (hierarchy, indexNode) => $(getAllowedRecordNodesForIndex(hierarchy, indexNode), [ - map(n => n.parent()), -]); -*/ - -const buildHeirarchalIndex = async (app, indexNode) => { - let recordCount = 0; - - const createTransactionsForIds = async (collectionKey, ids) => { - for (const recordId of ids) { - const recordKey = joinKey(collectionKey, recordId); - - const recordNode = getRecordNodeById( - app.hierarchy, - recordId, - ); - - if (recordNodeApplies(indexNode)(recordNode)) { - await transactionForBuildIndex( - app, indexNode.nodeKey(), - recordKey, recordCount, - ); - recordCount++; - } - } - }; - - - const collectionRecords = getAllowedRecordNodesForIndex(app.hierarchy, indexNode); - - for (const targetCollectionRecordNode of collectionRecords) { - const allIdsIterator = await getAllIdsIterator(app)(targetCollectionRecordNode.collectionNodeKey()); - - let allIds = await allIdsIterator(); - while (allIds.done === false) { - await createTransactionsForIds( - allIds.result.collectionKey, - allIds.result.ids, - ); - allIds = await allIdsIterator(); - } - } - - return recordCount; -}; - -// const chooseChildRecordNodeByKey = (collectionNode, recordId) => find(c => recordId.startsWith(c.nodeId))(collectionNode.children); - -const recordNodeApplies = indexNode => recordNode => includes(recordNode.nodeId)(indexNode.allowedRecordNodeIds); - -const aggregates = app => async (indexKey, rangeStartParams = null, rangeEndParams = null) => apiWrapper( - app, - events.indexApi.aggregates, - permission.readIndex.isAuthorized(indexKey), - { indexKey, rangeStartParams, rangeEndParams }, - _aggregates, app, indexKey, rangeStartParams, rangeEndParams, -); - -const _aggregates = async (app, indexKey, rangeStartParams, rangeEndParams) => { - indexKey = safeKey(indexKey); - const indexNode = getExactNodeForKey(app.hierarchy)(indexKey); - const indexDir = getIndexDir(app.hierarchy, indexKey); - - if (!isIndex(indexNode)) { throw new BadRequestError('supplied key is not an index'); } - - if (isShardedIndex(indexNode)) { - const shardKeys = await getShardKeysInRange( - app, indexNode, indexDir, rangeStartParams, rangeEndParams, - ); - let aggregateResult = null; - for (const k of shardKeys) { - const shardResult = await getAggregates(app.hierarchy, app.datastore, indexNode, k); - if (aggregateResult === null) { - aggregateResult = shardResult; - } else { - aggregateResult = mergeShardAggregate( - aggregateResult, - shardResult, - ); - } - } - return aggregateResult; - } - return await getAggregates( - app.hierarchy, - app.datastore, - indexNode, - getUnshardedIndexDataKey(indexDir), - ); -}; - -const mergeShardAggregate = (totals, shard) => { - const mergeGrouping = (tot, shr) => { - tot.count += shr.count; - for (const aggName in tot) { - if (aggName === 'count') continue; - const totagg = tot[aggName]; - const shragg = shr[aggName]; - totagg.sum += shragg.sum; - totagg.max = totagg.max > shragg.max - ? totagg.max - : shragg.max; - totagg.min = totagg.min < shragg.min - ? totagg.min - : shragg.min; - totagg.mean = totagg.sum / tot.count; - } - return tot; - }; - - for (const aggGroupDef in totals) { - for (const grouping in shard[aggGroupDef]) { - const groupingTotal = totals[aggGroupDef][grouping]; - totals[aggGroupDef][grouping] = isUndefined(groupingTotal) - ? shard[aggGroupDef][grouping] - : mergeGrouping( - totals[aggGroupDef][grouping], - shard[aggGroupDef][grouping], - ); - } - } - - return totals; -}; - -const getAggregates = async (hierarchy, datastore, index, indexedDataKey) => { - const aggregateResult = {}; - const doRead = iterateIndex( - async item => { - applyItemToAggregateResult( - index, aggregateResult, item, - ); - return CONTINUE_READING_RECORDS; - }, - async () => aggregateResult - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); -}; - - -const applyItemToAggregateResult = (indexNode, result, item) => { - const getInitialAggregateResult = () => ({ - sum: 0, mean: null, max: null, min: null, - }); - - const applyAggregateResult = (agg, existing, count) => { - const value = compileCode$1(agg.aggregatedValue)({ record: item }); - - if (!isNumber(value)) return existing; - - existing.sum += value; - existing.max = value > existing.max || existing.max === null - ? value - : existing.max; - existing.min = value < existing.min || existing.min === null - ? value - : existing.min; - existing.mean = existing.sum / count; - return existing; - }; - - for (const aggGroup of indexNode.aggregateGroups) { - if (!has(aggGroup.name)(result)) { - result[aggGroup.name] = {}; - } - - const thisGroupResult = result[aggGroup.name]; - - if (isNonEmptyString(aggGroup.condition)) { - if (!compileExpression$1(aggGroup.condition)({ record: item })) { - continue; - } - } - - let group = isNonEmptyString(aggGroup.groupBy) - ? compileCode$1(aggGroup.groupBy)({ record: item }) - : 'all'; - if (!isNonEmptyString(group)) { - group = '(none)'; - } - - if (!has(group)(thisGroupResult)) { - thisGroupResult[group] = { count: 0 }; - for (const agg of aggGroup.aggregates) { - thisGroupResult[group][agg.name] = getInitialAggregateResult(); - } - } - - thisGroupResult[group].count++; - - for (const agg of aggGroup.aggregates) { - const existingValues = thisGroupResult[group][agg.name]; - thisGroupResult[group][agg.name] = applyAggregateResult( - agg, existingValues, - thisGroupResult[group].count, - ); - } - } -}; - -const getIndexApi = app => ({ - listItems: listItems(app), - buildIndex: buildIndex(app), - aggregates: aggregates(app), -}); - -const createNodeErrors = { - indexCannotBeParent: 'Index template cannot be a parent', - allNonRootNodesMustHaveParent: 'Only the root node may have no parent', - indexParentMustBeRecordOrRoot: 'An index may only have a record or root as a parent', - aggregateParentMustBeAnIndex: 'aggregateGroup parent must be an index', -}; - -const pathRegxMaker = node => () => node.nodeKey().replace(/{id}/g, '[a-zA-Z0-9_-]+'); - -const nodeKeyMaker = node => () => switchCase( - - [n => isRecord(n) && !isSingleRecord(n), - n => joinKey( - node.parent().nodeKey(), - node.collectionName, - `${n.nodeId}-{id}`, - )], - - [isRoot, - constant('/')], - - [defaultCase, - n => joinKey(node.parent().nodeKey(), n.name)], - -)(node); - - -const validate$1 = parent => (node) => { - if (isIndex(node) - && isSomething(parent) - && !isRoot(parent) - && !isRecord(parent)) { - throw new BadRequestError(createNodeErrors.indexParentMustBeRecordOrRoot); - } - - if (isaggregateGroup(node) - && isSomething(parent) - && !isIndex(parent)) { - throw new BadRequestError(createNodeErrors.aggregateParentMustBeAnIndex); - } - - if (isNothing(parent) && !isRoot(node)) { throw new BadRequestError(createNodeErrors.allNonRootNodesMustHaveParent); } - - return node; -}; - -const construct = parent => (node) => { - node.nodeKey = nodeKeyMaker(node); - node.pathRegx = pathRegxMaker(node); - node.parent = constant(parent); - node.isRoot = () => isNothing(parent) - && node.name === 'root' - && node.type === 'root'; - if (isCollectionRecord(node)) { - node.collectionNodeKey = () => joinKey( - parent.nodeKey(), node.collectionName, - ); - node.collectionPathRegx = () => joinKey( - parent.pathRegx(), node.collectionName, - ); - } - return node; -}; - -const addToParent = (obj) => { - const parent = obj.parent(); - if (isSomething(parent)) { - if (isIndex(obj)) - // Q: why are indexes not children ? - // A: because they cannot have children of their own. - { - parent.indexes.push(obj); - } - else if (isaggregateGroup(obj)) - { - parent.aggregateGroups.push(obj); - } else { - parent.children.push(obj); - } - - if (isRecord(obj)) { - const defaultIndex = find$1( - parent.indexes, - i => i.name === `${parent.name}_index`, - ); - if (defaultIndex) { - defaultIndex.allowedRecordNodeIds.push(obj.nodeId); - } - } - } - return obj; -}; - -const constructNode = (parent, obj) => $(obj, [ - construct(parent), - validate$1(parent), - addToParent, -]); - -const getNodeId = (parentNode) => { - // this case is handled better elsewhere - if (!parentNode) return null; - const findRoot = n => (isRoot(n) ? n : findRoot(n.parent())); - const root = findRoot(parentNode); - - return ($(root, [ - getFlattenedHierarchy, - map(n => n.nodeId), - max]) + 1); -}; - -const constructHierarchy = (node, parent) => { - construct(parent)(node); - if (node.indexes) { - each$1(node.indexes, - child => constructHierarchy(child, node)); - } - if (node.aggregateGroups) { - each$1(node.aggregateGroups, - child => constructHierarchy(child, node)); - } - if (node.children && node.children.length > 0) { - each$1(node.children, - child => constructHierarchy(child, node)); - } - if (node.fields) { - each$1(node.fields, - f => each$1(f.typeOptions, (val, key) => { - const def = all$1[f.type].optionDefinitions[key]; - if (!def) { - // unknown typeOption - delete f.typeOptions[key]; - } else { - f.typeOptions[key] = def.parse(val); - } - })); - } - return node; -}; - - -const getNewRootLevel = () => construct()({ - name: 'root', - type: 'root', - children: [], - pathMaps: [], - indexes: [], - nodeId: 0, -}); - -const _getNewRecordTemplate = (parent, name, createDefaultIndex, isSingle) => { - const node = constructNode(parent, { - name, - type: 'record', - fields: [], - children: [], - validationRules: [], - nodeId: getNodeId(parent), - indexes: [], - estimatedRecordCount: isRecord(parent) ? 500 : 1000000, - collectionName: '', - isSingle, - }); - - if (createDefaultIndex) { - const defaultIndex = getNewIndexTemplate(parent); - defaultIndex.name = `${name}_index`; - defaultIndex.allowedRecordNodeIds.push(node.nodeId); - } - - return node; -}; - -const getNewRecordTemplate = (parent, name = '', createDefaultIndex = true) => _getNewRecordTemplate(parent, name, createDefaultIndex, false); - -const getNewSingleRecordTemplate = parent => _getNewRecordTemplate(parent, '', false, true); - -const getNewIndexTemplate = (parent, type = 'ancestor') => constructNode(parent, { - name: '', - type: 'index', - map: 'return {...record};', - filter: '', - indexType: type, - getShardName: '', - getSortKey: 'record.id', - aggregateGroups: [], - allowedRecordNodeIds: [], - nodeId: getNodeId(parent), -}); - -const getNewAggregateGroupTemplate = index => constructNode(index, { - name: '', - type: 'aggregateGroup', - groupBy: '', - aggregates: [], - condition: '', - nodeId: getNodeId(index), -}); - -const getNewAggregateTemplate = (set) => { - const aggregatedValue = { - name: '', - aggregatedValue: '', - }; - set.aggregates.push(aggregatedValue); - return aggregatedValue; -}; - -const fieldErrors = { - AddFieldValidationFailed: 'Add field validation: ', -}; - -const allowedTypes = () => keys(all$1); - -const getNewField = type => ({ - name: '', // how field is referenced internally - type, - typeOptions: getDefaultOptions$1(type), - label: '', // how field is displayed - getInitialValue: 'default', // function that gets value when initially created - getUndefinedValue: 'default', // function that gets value when field undefined on record -}); - -const fieldRules = allFields => [ - makerule('name', 'field name is not set', - f => isNonEmptyString(f.name)), - makerule('type', 'field type is not set', - f => isNonEmptyString(f.type)), - makerule('label', 'field label is not set', - f => isNonEmptyString(f.label)), - makerule('getInitialValue', 'getInitialValue function is not set', - f => isNonEmptyString(f.getInitialValue)), - makerule('getUndefinedValue', 'getUndefinedValue function is not set', - f => isNonEmptyString(f.getUndefinedValue)), - makerule('name', 'field name is duplicated', - f => isNothingOrEmpty(f.name) - || countBy('name')(allFields)[f.name] === 1), - makerule('type', 'type is unknown', - f => isNothingOrEmpty(f.type) - || some(t => f.type === t)(allowedTypes())), -]; - -const typeOptionsRules = (field) => { - const type = all$1[field.type]; - if (isNothing(type)) return []; - - const def = optName => type.optionDefinitions[optName]; - - return $(field.typeOptions, [ - keys, - filter(o => isSomething(def(o)) - && isSomething(def(o).isValid)), - map(o => makerule( - `typeOptions.${o}`, - `${def(o).requirementDescription}`, - field => def(o).isValid(field.typeOptions[o]), - )), - ]); -}; - -const validateField = allFields => (field) => { - const everySingleField = includes(field)(allFields) ? allFields : [...allFields, field]; - return applyRuleSet([...fieldRules(everySingleField), ...typeOptionsRules(field)])(field); -}; - -const validateAllFields = recordNode => $(recordNode.fields, [ - map(validateField(recordNode.fields)), - flatten, -]); - -const addField = (recordTemplate, field) => { - if (isNothingOrEmpty(field.label)) { - field.label = field.name; - } - const validationMessages = validateField([...recordTemplate.fields, field])(field); - if (validationMessages.length > 0) { - const errors = map(m => m.error)(validationMessages); - throw new BadRequestError(`${fieldErrors.AddFieldValidationFailed} ${errors.join(', ')}`); - } - recordTemplate.fields.push(field); -}; - -const getNewRecordValidationRule = (invalidFields, - messageWhenInvalid, - expressionWhenValid) => ({ - invalidFields, messageWhenInvalid, expressionWhenValid, -}); - -const getStaticValue = switchCase( - [isNumber, v => v.toString()], - [isBoolean, v => v.toString()], - [defaultCase$1, v => `'${v}'`], -); - -const commonRecordValidationRules = ({ - - fieldNotEmpty: fieldName => getNewRecordValidationRule( - [fieldName], - `${fieldName} is empty`, - `!_.isEmpty(record['${fieldName}'])`, - ), - - fieldBetween: (fieldName, min, max) => getNewRecordValidationRule( - [fieldName], - `${fieldName} must be between ${min.toString()} and ${max.toString()}`, - `record['${fieldName}'] >= ${getStaticValue(min)} && record['${fieldName}'] <= ${getStaticValue(max)} `, - ), - - fieldGreaterThan: (fieldName, min, max) => getNewRecordValidationRule( - [fieldName], - `${fieldName} must be greater than ${min.toString()} and ${max.toString()}`, - `record['${fieldName}'] >= ${getStaticValue(min)} `, - ), -}); - -const addRecordValidationRule = recordNode => rule => recordNode.validationRules.push(rule); - -const createTrigger = () => ({ - actionName: '', - eventName: '', - // function, has access to event context, - // returns object that is used as parameter to action - // only used if triggered by event - optionsCreator: '', - // action runs if true, - // has access to event context - condition: '', -}); - -const createAction = () => ({ - name: '', - behaviourSource: '', - // name of function in actionSource - behaviourName: '', - // parameter passed into behaviour. - // any other parms passed at runtime e.g. - // by trigger, or manually, will be merged into this - initialOptions: {}, -}); - -const aggregateRules = [ - makerule('name', 'choose a name for the aggregate', - a => isNonEmptyString(a.name)), - makerule('aggregatedValue', 'aggregatedValue does not compile', - a => isEmpty(a.aggregatedValue) - || executesWithoutException( - () => compileCode$1(a.aggregatedValue), - )), -]; - -const validateAggregate = aggregate => applyRuleSet(aggregateRules)(aggregate); - -const validateAllAggregates = all => $(all, [ - map(validateAggregate), - flatten, -]); - -const ruleSet = (...sets) => constant(flatten([...sets])); - -const commonRules = [ - makerule('name', 'node name is not set', - node => stringNotEmpty(node.name)), - makerule('type', 'node type not recognised', - anyTrue(isRecord, isRoot, isIndex, isaggregateGroup)), -]; - -const recordRules = [ - makerule('fields', 'no fields have been added to the record', - node => isNonEmptyArray(node.fields)), - makerule('validationRules', "validation rule is missing a 'messageWhenValid' member", - node => every(r => has('messageWhenInvalid')(r))(node.validationRules)), - makerule('validationRules', "validation rule is missing a 'expressionWhenValid' member", - node => every(r => has('expressionWhenValid')(r))(node.validationRules)), -]; - - -const aggregateGroupRules = [ - makerule('condition', 'condition does not compile', - a => isEmpty(a.condition) - || executesWithoutException( - () => compileExpression$1(a.condition), - )), -]; - -const getRuleSet = node => switchCase( - - [isRecord, ruleSet( - commonRules, - recordRules, - )], - - [isIndex, ruleSet( - commonRules, - indexRuleSet, - )], - - [isaggregateGroup, ruleSet( - commonRules, - aggregateGroupRules, - )], - - [defaultCase, ruleSet(commonRules, [])], -)(node); - -const validateNode = node => applyRuleSet(getRuleSet(node))(node); - -const validateAll = (appHierarchy) => { - const flattened = getFlattenedHierarchy( - appHierarchy, - ); - - const duplicateNameRule = makerule( - 'name', 'node names must be unique under shared parent', - n => filter(f => f.parent() === n.parent() - && f.name === n.name)(flattened).length === 1, - ); - - const duplicateNodeKeyErrors = $(flattened, [ - map(n => applyRuleSet([duplicateNameRule])(n)), - filter(isSomething), - flatten, - ]); - - const fieldErrors = $(flattened, [ - filter(isRecord), - map(validateAllFields), - flatten, - ]); - - const aggregateErrors = $(flattened, [ - filter(isaggregateGroup), - map(s => validateAllAggregates( - s.aggregates, - )), - flatten, - ]); - - return $(flattened, [ - map(validateNode), - flatten, - union(duplicateNodeKeyErrors), - union(fieldErrors), - union(aggregateErrors), - ]); -}; - -const actionRules = [ - makerule('name', 'action must have a name', - a => isNonEmptyString(a.name)), - makerule('behaviourName', 'must supply a behaviour name to the action', - a => isNonEmptyString(a.behaviourName)), - makerule('behaviourSource', 'must supply a behaviour source for the action', - a => isNonEmptyString(a.behaviourSource)), -]; - -const duplicateActionRule = makerule('', 'action name must be unique', () => {}); - -const validateAction = action => applyRuleSet(actionRules)(action); - - -const validateActions = (allActions) => { - const duplicateActions = $(allActions, [ - filter(a => filter(a2 => a2.name === a.name)(allActions).length > 1), - map(a => validationError(duplicateActionRule, a)), - ]); - - const errors = $(allActions, [ - map(validateAction), - flatten, - union(duplicateActions), - uniqBy('name'), - ]); - - return errors; -}; - -const triggerRules = actions => ([ - makerule('actionName', 'must specify an action', - t => isNonEmptyString(t.actionName)), - makerule('eventName', 'must specify and event', - t => isNonEmptyString(t.eventName)), - makerule('actionName', 'specified action not supplied', - t => !t.actionName - || some(a => a.name === t.actionName)(actions)), - makerule('eventName', 'invalid Event Name', - t => !t.eventName - || includes(t.eventName)(eventsList)), - makerule('optionsCreator', 'Options Creator does not compile - check your expression', - (t) => { - if (!t.optionsCreator) return true; - try { - compileCode$1(t.optionsCreator); - return true; - } catch (_) { return false; } - }), - makerule('condition', 'Trigger condition does not compile - check your expression', - (t) => { - if (!t.condition) return true; - try { - compileExpression$1(t.condition); - return true; - } catch (_) { return false; } - }), -]); - -const validateTrigger = (trigger, allActions) => { - const errors = applyRuleSet(triggerRules(allActions))(trigger); - - return errors; -}; - -const validateTriggers = (triggers, allActions) => $(triggers, [ - map(t => validateTrigger(t, allActions)), - flatten, -]); - -const getApplicationDefinition = datastore => async () => { - const exists = await datastore.exists(appDefinitionFile); - - if (!exists) throw new Error('Application definition does not exist'); - - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.hierarchy = constructHierarchy( - appDefinition.hierarchy, - ); - return appDefinition; -}; - -const saveApplicationHierarchy = app => async hierarchy => apiWrapper( - app, - events.templateApi.saveApplicationHierarchy, - permission.writeTemplates.isAuthorized, - { hierarchy }, - _saveApplicationHierarchy, app.datastore, hierarchy, -); - - -const _saveApplicationHierarchy = async (datastore, hierarchy) => { - const validationErrors = await validateAll(hierarchy); - if (validationErrors.length > 0) { - throw new Error(`Hierarchy is invalid: ${join$2( - validationErrors.map(e => `${e.item.nodeKey ? e.item.nodeKey() : ''} : ${e.error}`), - ',', - )}`); - } - - if (await datastore.exists(appDefinitionFile)) { - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.hierarchy = hierarchy; - await datastore.updateJson(appDefinitionFile, appDefinition); - } else { - await datastore.createFolder('/.config'); - const appDefinition = { actions: [], triggers: [], hierarchy }; - await datastore.createJson(appDefinitionFile, appDefinition); - } -}; - -const saveActionsAndTriggers = app => async (actions, triggers) => apiWrapper( - app, - events.templateApi.saveActionsAndTriggers, - permission.writeTemplates.isAuthorized, - { actions, triggers }, - _saveActionsAndTriggers, app.datastore, actions, triggers, -); - -const _saveActionsAndTriggers = async (datastore, actions, triggers) => { - if (await datastore.exists(appDefinitionFile)) { - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.actions = actions; - appDefinition.triggers = triggers; - - const actionValidErrs = map(e => e.error)(validateActions(actions)); - - if (actionValidErrs.length > 0) { - throw new BadRequestError(`Actions are invalid: ${join$2(actionValidErrs, ', ')}`); - } - - const triggerValidErrs = map(e => e.error)(validateTriggers(triggers, actions)); - - if (triggerValidErrs.length > 0) { - throw new BadRequestError(`Triggers are invalid: ${join$2(triggerValidErrs, ', ')}`); - } - - await datastore.updateJson(appDefinitionFile, appDefinition); - } else { - throw new BadRequestError('Cannot save actions: Application definition does not exist'); - } -}; - -const getBehaviourSources = async (datastore) => { - await datastore.loadFile('/.config/behaviourSources.js'); -}; - -const api$1 = app => ({ - - getApplicationDefinition: getApplicationDefinition(app.datastore), - saveApplicationHierarchy: saveApplicationHierarchy(app), - saveActionsAndTriggers: saveActionsAndTriggers(app), - getBehaviourSources: () => getBehaviourSources(app.datastore), - getNewRootLevel, - constructNode, - getNewIndexTemplate, - getNewRecordTemplate, - getNewField, - validateField, - addField, - fieldErrors, - getNewRecordValidationRule, - commonRecordValidationRules, - addRecordValidationRule, - createAction, - createTrigger, - validateActions, - validateTrigger, - getNewAggregateGroupTemplate, - getNewAggregateTemplate, - constructHierarchy, - getNewSingleRecordTemplate, - allTypes: all$1, - validateNode, - validateAll, - validateTriggers, -}); - - -const getTemplateApi = app => api$1(app); - -const getUsers = app => async () => apiWrapper( - app, - events.authApi.getUsers, - permission.listUsers.isAuthorized, - {}, - _getUsers, app, -); - -const _getUsers = async app => $(await app.datastore.loadJson(USERS_LIST_FILE), [ - map(stripUserOfSensitiveStuff), -]); - -const loadAccessLevels = app => async () => apiWrapper( - app, - events.authApi.loadAccessLevels, - permission.listAccessLevels.isAuthorized, - {}, - _loadAccessLevels, app, -); - -const _loadAccessLevels = async app => await app.datastore.loadJson(ACCESS_LEVELS_FILE); - -const dummyHash = '$argon2i$v=19$m=4096,t=3,p=1$UZRo409UYBGjHJS3CV6Uxw$rU84qUqPeORFzKYmYY0ceBLDaPO+JWSH4PfNiKXfIKk'; - -const authenticate = app => async (username, password) => apiWrapper( - app, - events.authApi.authenticate, - alwaysAuthorized, - { username, password }, - _authenticate, app, username, password, -); - -const _authenticate = async (app, username, password) => { - if (isNothingOrEmpty(username) || isNothingOrEmpty(password)) { return null; } - - const allUsers = await _getUsers(app); - let user = getUserByName( - allUsers, - username, - ); - - const notAUser = 'not-a-user'; - // continue with non-user - so time to verify remains consistent - // with verification of a valid user - if (!user || !user.enabled) { user = notAUser; } - - let userAuth; - try { - userAuth = await app.datastore.loadJson( - userAuthFile(username), - ); - } catch (_) { - userAuth = { accessLevels: [], passwordHash: dummyHash }; - } - - const permissions = await buildUserPermissions(app, user.accessLevels); - - const verified = await app.crypto.verify( - userAuth.passwordHash, - password, - ); - - if (user === notAUser) { return null; } - - return verified - ? { - ...user, permissions, temp: false, isUser: true, - } - : null; -}; - -const authenticateTemporaryAccess = app => async (tempAccessCode) => { - if (isNothingOrEmpty(tempAccessCode)) { return null; } - - const temp = parseTemporaryCode(tempAccessCode); - let user = $(await _getUsers(app), [ - find(u => u.temporaryAccessId === temp.id), - ]); - - const notAUser = 'not-a-user'; - if (!user || !user.enabled) { user = notAUser; } - - let userAuth; - try { - userAuth = await app.datastore.loadJson( - userAuthFile(user.name), - ); - } catch (e) { - userAuth = { - temporaryAccessHash: dummyHash, - temporaryAccessExpiryEpoch: (await app.getEpochTime() + 10000), - }; - } - - if (userAuth.temporaryAccessExpiryEpoch < await app.getEpochTime()) { user = notAUser; } - - const tempCode = !temp.code ? generate() : temp.code; - const verified = await app.crypto.verify( - userAuth.temporaryAccessHash, - tempCode, - ); - - if (user === notAUser) { return null; } - - return verified - ? { - ...user, - permissions: [], - temp: true, - isUser: true, - } - : null; -}; - -const buildUserPermissions = async (app, userAccessLevels) => { - const allAccessLevels = await _loadAccessLevels(app); - - return $(allAccessLevels.levels, [ - filter(l => some(ua => l.name === ua)(userAccessLevels)), - map(l => l.permissions), - flatten, - ]); -}; - -const createTemporaryAccess$1 = app => async userName => apiWrapper( - app, - events.authApi.createTemporaryAccess, - alwaysAuthorized, - { userName }, - _createTemporaryAccess, app, userName, -); - -const _createTemporaryAccess = async (app, userName) => { - const tempCode = await getTemporaryCode(app); - - const lock = await getLock( - app, USERS_LOCK_FILE, 1000, 2, - ); - - if (isNolock(lock)) { throw new Error('Unable to create temporary access, could not get lock - try again'); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - - const user = getUserByName(users, userName); - user.temporaryAccessId = tempCode.temporaryAccessId; - - await app.datastore.updateJson( - USERS_LIST_FILE, - users, - ); - } finally { - await releaseLock(app, lock); - } - - const userAuth = await app.datastore.loadJson( - userAuthFile(userName), - ); - userAuth.temporaryAccessHash = tempCode.temporaryAccessHash; - - userAuth.temporaryAccessExpiryEpoch = tempCode.temporaryAccessExpiryEpoch; - - await app.datastore.updateJson( - userAuthFile(userName), - userAuth, - ); - - return tempCode.tempCode; -}; - -const getTemporaryCode = async (app) => { - const tempCode = generate() - + generate() - + generate() - + generate(); - - const tempId = generate(); - - return { - temporaryAccessHash: await app.crypto.hash( - tempCode, - ), - temporaryAccessExpiryEpoch: - (await app.getEpochTime()) + tempCodeExpiryLength, - tempCode: `tmp:${tempId}:${tempCode}`, - temporaryAccessId: tempId, - }; -}; - -const userRules = allUsers => [ - makerule('name', 'username must be set', - u => isNonEmptyString(u.name)), - makerule('accessLevels', 'user must have at least one access level', - u => u.accessLevels.length > 0), - makerule('name', 'username must be unique', - u => filter(u2 => insensitiveEquals(u2.name, u.name))(allUsers).length === 1), - makerule('accessLevels', 'access levels must only contain stings', - u => all(isNonEmptyString)(u.accessLevels)), -]; - -const validateUser = () => (allusers, user) => applyRuleSet(userRules(allusers))(user); - -const getNewUser = app => () => apiWrapperSync( - app, - events.authApi.getNewUser, - permission.createUser.isAuthorized, - {}, - _getNewUser, app, -); - -const _getNewUser = () => ({ - name: '', - accessLevels: [], - enabled: true, - temporaryAccessId: '', -}); - -const getNewUserAuth = app => () => apiWrapperSync( - app, - events.authApi.getNewUserAuth, - permission.createUser.isAuthorized, - {}, - _getNewUserAuth, app, -); - -const _getNewUserAuth = () => ({ - passwordHash: '', - temporaryAccessHash: '', - temporaryAccessExpiryEpoch: 0, -}); - -const isValidPassword = app => password => apiWrapperSync( - app, - events.authApi.isValidPassword, - alwaysAuthorized, - { password }, - _isValidPassword, app, password, -); - -const _isValidPassword = (app, password) => scorePassword(password).score > 30; - -const changeMyPassword = app => async (currentPw, newpassword) => apiWrapper( - app, - events.authApi.changeMyPassword, - alwaysAuthorized, - { currentPw, newpassword }, - _changeMyPassword, app, currentPw, newpassword, -); - -const _changeMyPassword = async (app, currentPw, newpassword) => { - const existingAuth = await app.datastore.loadJson( - userAuthFile(app.user.name), - ); - - if (isSomething(existingAuth.passwordHash)) { - const verified = await app.crypto.verify( - existingAuth.passwordHash, - currentPw, - ); - - if (verified) { - await await doSet( - app, existingAuth, - app.user.name, newpassword, - ); - return true; - } - } - - return false; -}; - -const setPasswordFromTemporaryCode = app => async (tempCode, newpassword) => apiWrapper( - app, - events.authApi.setPasswordFromTemporaryCode, - alwaysAuthorized, - { tempCode, newpassword }, - _setPasswordFromTemporaryCode, app, tempCode, newpassword, -); - - -const _setPasswordFromTemporaryCode = async (app, tempCode, newpassword) => { - const currentTime = await app.getEpochTime(); - - const temp = parseTemporaryCode(tempCode); - - const user = $(await _getUsers(app), [ - find(u => u.temporaryAccessId === temp.id), - ]); - - if (!user) { return false; } - - const existingAuth = await app.datastore.loadJson( - userAuthFile(user.name), - ); - - if (isSomething(existingAuth.temporaryAccessHash) - && existingAuth.temporaryAccessExpiryEpoch > currentTime) { - const verified = await app.crypto.verify( - existingAuth.temporaryAccessHash, - temp.code, - ); - - if (verified) { - await doSet( - app, existingAuth, - user.name, newpassword, - ); - return true; - } - } - - return false; -}; - -const doSet = async (app, auth, username, newpassword) => { - auth.temporaryAccessHash = ''; - auth.temporaryAccessExpiryEpoch = 0; - auth.passwordHash = await app.crypto.hash( - newpassword, - ); - await app.datastore.updateJson( - userAuthFile(username), - auth, - ); -}; - -const scorePassword = app => password => apiWrapperSync( - app, - events.authApi.scorePassword, - alwaysAuthorized, - { password }, - _scorePassword, password, -); - -const _scorePassword = (password) => { - // from https://stackoverflow.com/questions/948172/password-strength-meter - // thank you https://stackoverflow.com/users/46617/tm-lv - - let score = 0; - if (!password) { return score; } - - // award every unique letter until 5 repetitions - const letters = new Object(); - for (let i = 0; i < password.length; i++) { - letters[password[i]] = (letters[password[i]] || 0) + 1; - score += 5.0 / letters[password[i]]; - } - - // bonus points for mixing it up - const variations = { - digits: /\d/.test(password), - lower: /[a-z]/.test(password), - upper: /[A-Z]/.test(password), - nonWords: /\W/.test(password), - }; - - let variationCount = 0; - for (const check in variations) { - variationCount += (variations[check] == true) ? 1 : 0; - } - score += (variationCount - 1) * 10; - - const strengthText = score > 80 - ? 'strong' - : score > 60 - ? 'good' - : score >= 30 - ? 'weak' - : 'very weak'; - - return { - score: parseInt(score), - strengthText, - }; -}; - -const createUser$1 = app => async (user, password = null) => apiWrapper( - app, - events.authApi.createUser, - permission.createUser.isAuthorized, - { user, password }, - _createUser, app, user, password, -); - -const _createUser = async (app, user, password = null) => { - const lock = await getLock( - app, USERS_LOCK_FILE, 1000, 2, - ); - - if (isNolock(lock)) { throw new Error('Unable to create user, could not get lock - try again'); } - - const users = await app.datastore.loadJson(USERS_LIST_FILE); - - const userErrors = validateUser()([...users, user], user); - if (userErrors.length > 0) { throw new BadRequestError(`User is invalid. ${join$1('; ')(userErrors)}`); } - - const { auth, tempCode, temporaryAccessId } = await getAccess( - app, password, - ); - user.tempCode = tempCode; - user.temporaryAccessId = temporaryAccessId; - - if (some(u => insensitiveEquals(u.name, user.name))(users)) { - throw new BadRequestError('User already exists'); - } - - users.push( - stripUserOfSensitiveStuff(user), - ); - - await app.datastore.updateJson( - USERS_LIST_FILE, - users, - ); - - try { - await app.datastore.createJson( - userAuthFile(user.name), - auth, - ); - } catch (_) { - await app.datastore.updateJson( - userAuthFile(user.name), - auth, - ); - } - - await releaseLock(app, lock); - - return user; -}; - -const getAccess = async (app, password) => { - const auth = getNewUserAuth(app)(); - - if (isNonEmptyString(password)) { - if (isValidPassword(password)) { - auth.passwordHash = await app.crypto.hash(password); - auth.temporaryAccessHash = ''; - auth.temporaryAccessId = ''; - auth.temporaryAccessExpiryEpoch = 0; - return { auth }; - } - throw new BadRequestError('Password does not meet requirements'); - } else { - const tempAccess = await getTemporaryCode(app); - auth.temporaryAccessHash = tempAccess.temporaryAccessHash; - auth.temporaryAccessExpiryEpoch = tempAccess.temporaryAccessExpiryEpoch; - auth.passwordHash = ''; - return ({ - auth, - tempCode: tempAccess.tempCode, - temporaryAccessId: tempAccess.temporaryAccessId, - }); - } -}; - -const enableUser = app => async username => apiWrapper( - app, - events.authApi.enableUser, - permission.enableDisableUser.isAuthorized, - { username }, - _enableUser, app, username, -); - -const disableUser = app => async username => apiWrapper( - app, - events.authApi.disableUser, - permission.enableDisableUser.isAuthorized, - { username }, - _disableUser, app, username, -); - -const _enableUser = async (app, username) => await toggleUser(app, username, true); - -const _disableUser = async (app, username) => await toggleUser(app, username, false); - -const toggleUser = async (app, username, enabled) => { - const lock = await getLock(app, USERS_LOCK_FILE, 1000, 1, 0); - - const actionName = enabled ? 'enable' : 'disable'; - - if (isNolock(lock)) { throw new Error(`Could not ${actionName} user - cannot get lock`); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - const user = getUserByName(users, username); - if (!user) { throw new NotFoundError(`Could not find user to ${actionName}`); } - - if (user.enabled === !enabled) { - user.enabled = enabled; - await app.datastore.updateJson(USERS_LIST_FILE, users); - } - } finally { - releaseLock(app, lock); - } -}; - -const getNewAccessLevel = () => () => ({ - name: '', - permissions: [], - default:false -}); - -const isAllowedType = t => $(permissionTypes, [ - values, - includes(t), -]); - -const isRecordOrIndexType = t => some(p => p === t)([ - permissionTypes.CREATE_RECORD, - permissionTypes.UPDATE_RECORD, - permissionTypes.DELETE_RECORD, - permissionTypes.READ_RECORD, - permissionTypes.READ_INDEX, - permissionTypes.EXECUTE_ACTION, -]); - - -const permissionRules = app => ([ - makerule('type', 'type must be one of allowed types', - p => isAllowedType(p.type)), - makerule('nodeKey', 'record and index permissions must include a valid nodeKey', - p => (!isRecordOrIndexType(p.type)) - || isSomething(getNode(app.hierarchy, p.nodeKey))), -]); - -const applyPermissionRules = app => applyRuleSet(permissionRules(app)); - -const accessLevelRules = allLevels => ([ - makerule('name', 'name must be set', - l => isNonEmptyString(l.name)), - makerule('name', 'access level names must be unique', - l => isEmpty(l.name) - || filter(a => insensitiveEquals(l.name, a.name))(allLevels).length === 1), -]); - -const applyLevelRules = allLevels => applyRuleSet(accessLevelRules(allLevels)); - -const validateAccessLevel = app => (allLevels, level) => { - const errs = $(level.permissions, [ - map(applyPermissionRules(app)), - flatten, - concat( - applyLevelRules(allLevels)(level), - ), - ]); - - return errs; -}; - -const validateAccessLevels = app => allLevels => apiWrapperSync( - app, - events.authApi.validateAccessLevels, - alwaysAuthorized, - { allLevels }, - _validateAccessLevels, app, allLevels, -); - -const _validateAccessLevels = (app, allLevels) => $(allLevels, [ - map(l => validateAccessLevel(app)(allLevels, l)), - flatten, - uniqWith((x, y) => x.field === y.field - && x.item === y.item - && x.error === y.error), -]); - -const saveAccessLevels = app => async accessLevels => apiWrapper( - app, - events.authApi.saveAccessLevels, - permission.writeAccessLevels.isAuthorized, - { accessLevels }, - _saveAccessLevels, app, accessLevels, -); - -const _saveAccessLevels = async (app, accessLevels) => { - const validationErrors = validateAccessLevels(app)(accessLevels.levels); - if (validationErrors.length > 0) { - const errs = $(validationErrors, [ - map(e => e.error), - join$1(', '), - ]); - throw new Error( - `Access Levels Invalid: ${errs}`, - ); - } - - const lock = await getLock( - app, ACCESS_LEVELS_LOCK_FILE, 2000, 2, - ); - - if (isNolock(lock)) { throw new Error('Could not get lock to save access levels'); } - - try { - const existing = await app.datastore.loadJson(ACCESS_LEVELS_FILE); - if (existing.version !== accessLevels.version) { throw new Error('Access levels have already been updated, since you loaded'); } - - accessLevels.version++; - - app.datastore.updateJson(ACCESS_LEVELS_FILE, accessLevels); - } finally { - await releaseLock(app, lock); - } -}; - -const generateFullPermissions = (app) => { - const allNodes = getFlattenedHierarchy(app.hierarchy); - const accessLevel = { permissions: [] }; - - const recordNodes = $(allNodes, [ - filter(isRecord), - ]); - - for (const n of recordNodes) { - permission.createRecord.add(n.nodeKey(), accessLevel); - permission.updateRecord.add(n.nodeKey(), accessLevel); - permission.deleteRecord.add(n.nodeKey(), accessLevel); - permission.readRecord.add(n.nodeKey(), accessLevel); - } - - const indexNodes = $(allNodes, [ - filter(isIndex), - ]); - - for (const n of indexNodes) { - permission.readIndex.add(n.nodeKey(), accessLevel); - } - - for (const a of keys(app.actions)) { - permission.executeAction.add(a, accessLevel); - } - - $(permission, [ - values, - filter(p => !p.isNode), - each(p => p.add(accessLevel)), - ]); - - return accessLevel.permissions; -}; - -const setUserAccessLevels$1 = app => async (userName, accessLevels) => apiWrapper( - app, - events.authApi.setUserAccessLevels, - permission.setUserAccessLevels.isAuthorized, - { userName, accessLevels }, - _setUserAccessLevels, app, userName, accessLevels, -); - -const _setUserAccessLevels = async (app, username, accessLevels) => { - const lock = await getLock(app, USERS_LOCK_FILE, 1000, 1, 0); - - const actualAccessLevels = $( - await app.datastore.loadJson(ACCESS_LEVELS_FILE), - [ - l => l.levels, - map(l => l.name), - ], - ); - - const missing = difference(accessLevels)(actualAccessLevels); - if (missing.length > 0) { - throw new Error(`Invalid access levels supplied: ${join$1(', ', missing)}`); - } - - if (isNolock(lock)) { throw new Error('Could set user access levels cannot get lock'); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - const user = getUserByName(users, username); - if (!user) { throw new NotFoundError(`Could not find user with ${username}`); } - - user.accessLevels = accessLevels; - await app.datastore.updateJson(USERS_LIST_FILE, users); - } finally { - releaseLock(app, lock); - } -}; - -const getAuthApi = app => ({ - authenticate: authenticate(app), - authenticateTemporaryAccess: authenticateTemporaryAccess(app), - createTemporaryAccess: createTemporaryAccess$1(app), - createUser: createUser$1(app), - loadAccessLevels: loadAccessLevels(app), - enableUser: enableUser(app), - disableUser: disableUser(app), - getNewAccessLevel: getNewAccessLevel(), - getNewUser: getNewUser(app), - getNewUserAuth: getNewUserAuth(app), - getUsers: getUsers(app), - saveAccessLevels: saveAccessLevels(app), - isAuthorized: isAuthorized(app), - changeMyPassword: changeMyPassword(app), - setPasswordFromTemporaryCode: setPasswordFromTemporaryCode(app), - scorePassword, - isValidPassword: isValidPassword(app), - validateUser: validateUser(), - validateAccessLevels: validateAccessLevels(app), - generateFullPermissions: () => generateFullPermissions(app), - setUserAccessLevels: setUserAccessLevels$1(app), -}); - -const executeAction$1 = app => (actionName, options) => { - apiWrapperSync( - app, - events.actionsApi.execute, - permission.executeAction.isAuthorized(actionName), - { actionName, options }, - app.actions[actionName], options, - ); -}; - -const _executeAction = (behaviourSources, action, options) => behaviourSources[action.behaviourSource][action.behaviourName](options); - -const getActionsApi = app => ({ - execute: executeAction$1(app), -}); - -const publish = handlers => async (eventName, context = {}) => { - if (!has(eventName)(handlers)) return; - - for (const handler of handlers[eventName]) { - await handler(eventName, context); - } -}; - -const subscribe = handlers => (eventName, handler) => { - if (!has(eventName)(handlers)) { - handlers[eventName] = []; - } - handlers[eventName].push(handler); -}; - -const createEventAggregator = () => { - const handlers = {}; - const eventAggregator = ({ - publish: publish(handlers), - subscribe: subscribe(handlers), - }); - return eventAggregator; -}; - -const createJson = originalCreateFile => async (key, obj, retries = 2, delay = 100) => await retry(originalCreateFile, retries, delay, key, JSON.stringify(obj)); - -const createNewFile = originalCreateFile => async (path, content, retries = 2, delay = 100) => await retry(originalCreateFile, retries, delay, path, content); - -const loadJson = datastore => async (key, retries = 3, delay = 100) => { - try { - return await retry(JSON.parse, retries, delay, await datastore.loadFile(key)); - } catch (err) { - const newErr = new NotFoundError(err.message); - newErr.stack = err.stack; - throw(newErr); - } -}; - -const updateJson = datastore => async (key, obj, retries = 3, delay = 100) => { - try { - return await retry(datastore.updateFile, retries, delay, key, JSON.stringify(obj)); - } catch (err) { - const newErr = new NotFoundError(err.message); - newErr.stack = err.stack; - throw(newErr); - } -}; - -const setupDatastore = (datastore) => { - const originalCreateFile = datastore.createFile; - datastore.loadJson = loadJson(datastore); - datastore.createJson = createJson(originalCreateFile); - datastore.updateJson = updateJson(datastore); - datastore.createFile = createNewFile(originalCreateFile); - if (datastore.createEmptyDb) { delete datastore.createEmptyDb; } - return datastore; -}; - -const compileCode = code => { - let func; - - try { - func = compileCode$1(code); - } catch(e) { - e.message = `Error compiling code : ${code} : ${e.message}`; - throw e; - } - - return func; -}; - -const compileExpression = code => { - let func; - - try { - func = compileExpression$1(code); - } catch(e) { - e.message = `Error compiling expression : ${code} : ${e.message}`; - throw e; - } - - return func; -}; - -const initialiseActions = (subscribe, behaviourSources, actions, triggers, apis) => { - validateSources(behaviourSources, actions); - subscribeTriggers(subscribe, behaviourSources, actions, triggers, apis); - return createActionsCollection(behaviourSources, actions); -}; - -const createActionsCollection = (behaviourSources, actions) => $(actions, [ - reduce((all, a) => { - all[a.name] = opts => _executeAction(behaviourSources, a, opts); - return all; - }, {}), -]); - -const subscribeTriggers = (subscribe, behaviourSources, actions, triggers, apis) => { - const createOptions = (optionsCreator, eventContext) => { - if (!optionsCreator) return {}; - const create = compileCode(optionsCreator); - return create({ context: eventContext, apis }); - }; - - const shouldRunTrigger = (trigger, eventContext) => { - if (!trigger.condition) return true; - const shouldRun = compileExpression(trigger.condition); - return shouldRun({ context: eventContext }); - }; - - for (let trig of triggers) { - subscribe(trig.eventName, async (ev, ctx) => { - if (shouldRunTrigger(trig, ctx)) { - await _executeAction( - behaviourSources, - find(a => a.name === trig.actionName)(actions), - createOptions(trig.optionsCreator, ctx), - ); - } - }); - } -}; - -const validateSources = (behaviourSources, actions) => { - const declaredSources = $(actions, [ - uniqBy(a => a.behaviourSource), - map(a => a.behaviourSource), - ]); - - const suppliedSources = keys(behaviourSources); - - const missingSources = difference( - declaredSources, suppliedSources, - ); - - if (missingSources.length > 0) { - throw new BadRequestError(`Declared behaviour sources are not supplied: ${join$1(', ', missingSources)}`); - } - - const missingBehaviours = $(actions, [ - filter(a => !isFunction(behaviourSources[a.behaviourSource][a.behaviourName])), - map(a => `Action: ${a.name} : ${a.behaviourSource}.${a.behaviourName}`), - ]); - - if (missingBehaviours.length > 0) { - throw new NotFoundError(`Missing behaviours: could not find behaviour functions: ${join$1(', ', missingBehaviours)}`); - } -}; - -const retrieve = async (app) => { - const transactionFiles = await app.datastore.getFolderContents( - TRANSACTIONS_FOLDER, - ); - - let transactions = []; - - if (some(isBuildIndexFolder)(transactionFiles)) { - const buildIndexFolder = find(isBuildIndexFolder)(transactionFiles); - - transactions = await retrieveBuildIndexTransactions( - app, - joinKey(TRANSACTIONS_FOLDER, buildIndexFolder), - ); - } - - if (transactions.length > 0) return transactions; - - return await retrieveStandardTransactions( - app, transactionFiles, - ); -}; - -const retrieveBuildIndexTransactions = async (app, buildIndexFolder) => { - const childFolders = await app.datastore.getFolderContents(buildIndexFolder); - if (childFolders.length === 0) { - // cleanup - await app.datastore.deleteFolder(buildIndexFolder); - return []; - } - - const getTransactionFiles = async (childFolderIndex = 0) => { - if (childFolderIndex >= childFolders.length) return []; - - const childFolderKey = joinKey(buildIndexFolder, childFolders[childFolderIndex]); - const files = await app.datastore.getFolderContents( - childFolderKey, - ); - - if (files.length === 0) { - await app.datastore.deleteFolder(childFolderKey); - return await getTransactionFiles(childFolderIndex + 1); - } - - return { childFolderKey, files }; - }; - - const transactionFiles = await getTransactionFiles(); - - if (transactionFiles.files.length === 0) return []; - - const transactions = $(transactionFiles.files, [ - map(parseTransactionId), - ]); - - for (const t of transactions) { - const transactionContent = await app.datastore.loadJson( - joinKey( - transactionFiles.childFolderKey, - t.fullId, - ), - ); - t.record = await _load(app, transactionContent.recordKey); - } - - transactions.indexNode = $(buildIndexFolder, [ - getLastPartInKey, - nodeKeyHashFromBuildFolder, - getNodeFromNodeKeyHash(app.hierarchy), - ]); - - transactions.folderKey = transactionFiles.childFolderKey; - - return transactions; -}; - -const retrieveStandardTransactions = async (app, transactionFiles) => { - const transactionIds = $(transactionFiles, [ - filter(f => f !== LOCK_FILENAME - && !isBuildIndexFolder(f)), - map(parseTransactionId), - ]); - - const transactionIdsByRecord = $(transactionIds, [ - groupBy('recordId'), - ]); - - const dedupedTransactions = []; - - const verify = async (t) => { - if (t.verified === true) return t; - - const id = getTransactionId( - t.recordId, - t.transactionType, - t.uniqueId, - ); - - const transaction = await app.datastore.loadJson( - joinKey(TRANSACTIONS_FOLDER, id), - ); - - if (isDelete(t)) { - t.record = transaction.record; - t.verified = true; - return t; - } - - const rec = await _load( - app, - transaction.recordKey, - ); - if (rec.transactionId === id) { - t.record = rec; - if (transaction.oldRecord) { t.oldRecord = transaction.oldRecord; } - t.verified = true; - } else { - t.verified = false; - } - - return t; - }; - - const pickOne = async (trans, forType) => { - const transForType = filter(forType)(trans); - if (transForType.length === 1) { - const t = await verify(transForType[0]); - return (t.verified === true ? t : null); - } - for (let t of transForType) { - t = await verify(t); - if (t.verified === true) { return t; } - } - - return null; - }; - - for (const recordId in transactionIdsByRecord) { - const transIdsForRecord = transactionIdsByRecord[recordId]; - if (transIdsForRecord.length === 1) { - const t = await verify(transIdsForRecord[0]); - if (t.verified) { dedupedTransactions.push(t); } - continue; - } - if (some(isDelete)(transIdsForRecord)) { - const t = await verify(find(isDelete)(transIdsForRecord)); - if (t.verified) { dedupedTransactions.push(t); } - continue; - } - if (some(isUpdate)(transIdsForRecord)) { - const upd = await pickOne(transIdsForRecord, isUpdate); - if (isSomething(upd) && upd.verified) { dedupedTransactions.push(upd); } - continue; - } - if (some(isCreate)(transIdsForRecord)) { - const cre = await pickOne(transIdsForRecord, isCreate); - if (isSomething(cre)) { dedupedTransactions.push(cre); } - continue; - } - } - - const duplicates = $(transactionIds, [ - filter(t => none(ddt => ddt.uniqueId === t.uniqueId)(dedupedTransactions)), - ]); - - - const deletePromises = map(t => app.datastore.deleteFile( - joinKey( - TRANSACTIONS_FOLDER, - getTransactionId( - t.recordId, - t.transactionType, - t.uniqueId, - ), - ), - ))(duplicates); - - await Promise.all(deletePromises); - - return dedupedTransactions; -}; - -const parseTransactionId = (id) => { - const splitId = split(idSep)(id); - return ({ - recordId: splitId[0], - transactionType: splitId[1], - uniqueId: splitId[2], - fullId: id, - }); -}; - -const getRelevantAncestorIndexes = (hierarchy, record) => { - const key = record.key; - const keyParts = splitKey(key); - const nodeId = getRecordNodeId(key); - - const flatHierarchy = orderBy$1(getFlattenedHierarchy(hierarchy), - [node => node.pathRegx().length], - ['desc']); - - const makeindexNodeAndDir_ForAncestorIndex = (indexNode, parentRecordDir) => makeIndexNodeAndDir(indexNode, joinKey(parentRecordDir, indexNode.name)); - - const traverseAncestorIndexesInPath = () => reduce((acc, part) => { - const currentIndexKey = joinKey(acc.lastIndexKey, part); - acc.lastIndexKey = currentIndexKey; - const testPathRegx = p => new RegExp(`${p.pathRegx()}$`).test(currentIndexKey); - const nodeMatch = find(testPathRegx)(flatHierarchy); - - if (isNothing(nodeMatch)) { return acc; } - - if (!isRecord(nodeMatch) - || nodeMatch.indexes.length === 0) { return acc; } - - const indexes = $(nodeMatch.indexes, [ - filter(i => i.indexType === indexTypes.ancestor - && (i.allowedRecordNodeIds.length === 0 - || includes(nodeId)(i.allowedRecordNodeIds))), - ]); - - const currentRecordDir = getRecordInfo(hierarchy, currentIndexKey).dir; - - each(v => acc.nodesAndKeys.push( - makeindexNodeAndDir_ForAncestorIndex(v, currentRecordDir), - ))(indexes); - - return acc; - }, { lastIndexKey: '', nodesAndKeys: [] })(keyParts).nodesAndKeys; - - const rootIndexes = $(flatHierarchy, [ - filter(n => isGlobalIndex(n) && recordNodeIdIsAllowed(n)(nodeId)), - map(i => makeIndexNodeAndDir( - i, - getIndexDir(hierarchy, i.nodeKey()))), - ]); - - return union(traverseAncestorIndexesInPath())(rootIndexes); -}; - -const getRelevantReverseReferenceIndexes = (hierarchy, record) => $(record.key, [ - getExactNodeForKey(hierarchy), - n => n.fields, - filter(f => f.type === 'reference' - && isSomething(record[f.name]) - && isNonEmptyString(record[f.name].key)), - map(f => $(f.typeOptions.reverseIndexNodeKeys, [ - map(n => ({ - recordNode: getNode(hierarchy, n), - field: f, - })), - ])), - flatten, - map(n => makeIndexNodeAndDir( - n.recordNode, - joinKey( - getRecordInfo(hierarchy, record[n.field.name].key).dir, - n.recordNode.name), - )), -]); - -const makeIndexNodeAndDir = (indexNode, indexDir) => ({ indexNode, indexDir }); - -// adapted from https://github.com/dex4er/js-promise-writable - // Thank you :) - const promiseWriteableStream = stream => { - - let _errored; - - const _errorHandler = err => { - _errored = err; - }; - - stream.on("error", _errorHandler); - - const write = chunk => { - let rejected = false; - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err); - } - - if (!stream.writable || stream.closed || stream.destroyed) { - return reject(new Error("write after end")); - } - - const writeErrorHandler = err => { - _errored = undefined; - rejected = true; - reject(err); - }; - - stream.once("error", writeErrorHandler); - - const canWrite = stream.write(chunk); - - stream.removeListener("error", writeErrorHandler); - - if (canWrite) { - if (!rejected) { - resolve(chunk.length); - } - } else { - const errorHandler = err => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const drainHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const closeHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const finishHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const removeListeners = () => { - stream.removeListener("close", closeHandler); - stream.removeListener("drain", drainHandler); - stream.removeListener("error", errorHandler); - stream.removeListener("finish", finishHandler); - }; - - stream.on("close", closeHandler); - stream.on("drain", drainHandler); - stream.on("error", errorHandler); - stream.on("finish", finishHandler); - } - }) - }; - - const end = () => { - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err); - } - - if (!stream.writable || stream.closed || stream.destroyed) { - return resolve(); - } - - const finishHandler = () => { - removeListeners(); - resolve(); - }; - - const errorHandler = (err) => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const removeListeners = () => { - stream.removeListener("error", errorHandler); - stream.removeListener("finish", finishHandler); - }; - - stream.on("finish", finishHandler); - stream.on("error", errorHandler); - - stream.end(); - }) - }; - - return {write, end}; - }; - -const applyToShard = async (hierarchy, store, indexDir, - indexNode, indexShardKey, recordsToWrite, keysToRemove) => { - const createIfNotExists = recordsToWrite.length > 0; - const writer = await getWriter(hierarchy, store, indexDir, indexShardKey, indexNode, createIfNotExists); - if (writer === SHARD_DELETED) return; - - await writer.updateIndex(recordsToWrite, keysToRemove); - await swapTempFileIn(store, indexShardKey); -}; - -const SHARD_DELETED = 'SHARD_DELETED'; -const getWriter = async (hierarchy, store, indexDir, indexedDataKey, indexNode, createIfNotExists) => { - let readableStream = null; - - if (isShardedIndex(indexNode)) { - await ensureShardNameIsInShardMap(store, indexDir, indexedDataKey); - if(!await store.exists(indexedDataKey)) { - if (await store.exists(getParentKey(indexedDataKey))) { - await store.createFile(indexedDataKey, ""); - } else { - return SHARD_DELETED; - } - } - } - - try { - - readableStream = promiseReadableStream( - await store.readableFileStream(indexedDataKey) - ); - - } catch (e) { - - if (await store.exists(indexedDataKey)) { - throw e; - } else { - if (createIfNotExists) { - if(await store.exists(getParentKey(indexedDataKey))) { - await store.createFile(indexedDataKey, ''); - } else { - return SHARD_DELETED; - } - } else { - return SHARD_DELETED; - } - - readableStream = promiseReadableStream( - await store.readableFileStream(indexedDataKey) - ); - - } - } - - const writableStream = promiseWriteableStream( - await store.writableFileStream(indexedDataKey + ".temp") - ); - - return getIndexWriter( - hierarchy, indexNode, - readableStream, writableStream - ); -}; - -const swapTempFileIn = async (store, indexedDataKey, isRetry = false) => { - const tempFile = `${indexedDataKey}.temp`; - try { - await store.deleteFile(indexedDataKey); - } catch (e) { - // ignore failure, incase it has not been created yet - - // if parent folder does not exist, assume that this index - // should not be there - if(!await store.exists(getParentKey(indexedDataKey))) { - return; - } - } - try { - await store.renameFile(tempFile, indexedDataKey); - } catch (e) { - // retrying in case delete failure was for some other reason - if (!isRetry) { - await swapTempFileIn(store, indexedDataKey, true); - } else { - throw new Error("Failed to swap in index filed: " + e.message); - } - } -}; - -const executeTransactions = app => async (transactions) => { - const recordsByShard = mappedRecordsByIndexShard(app.hierarchy, transactions); - - for (const shard of keys(recordsByShard)) { - await applyToShard( - app.hierarchy, app.datastore, - recordsByShard[shard].indexDir, - recordsByShard[shard].indexNode, - shard, - recordsByShard[shard].writes, - recordsByShard[shard].removes, - ); - } -}; - -const mappedRecordsByIndexShard = (hierarchy, transactions) => { - const updates = getUpdateTransactionsByShard( - hierarchy, transactions, - ); - - const created = getCreateTransactionsByShard( - hierarchy, transactions, - ); - const deletes = getDeleteTransactionsByShard( - hierarchy, transactions, - ); - - const indexBuild = getBuildIndexTransactionsByShard( - hierarchy, - transactions, - ); - - const toRemove = [ - ...deletes, - ...updates.toRemove, - ]; - - const toWrite = [ - ...created, - ...updates.toWrite, - ...indexBuild, - ]; - - const transByShard = {}; - - const initialiseShard = (t) => { - if (isUndefined(transByShard[t.indexShardKey])) { - transByShard[t.indexShardKey] = { - writes: [], - removes: [], - indexDir: t.indexDir, - indexNodeKey: t.indexNode.nodeKey(), - indexNode: t.indexNode, - }; - } - }; - - for (const trans of toWrite) { - initialiseShard(trans); - transByShard[trans.indexShardKey].writes.push( - trans.mappedRecord.result, - ); - } - - for (const trans of toRemove) { - initialiseShard(trans); - transByShard[trans.indexShardKey].removes.push( - trans.mappedRecord.result.key, - ); - } - - return transByShard; -}; - -const getUpdateTransactionsByShard = (hierarchy, transactions) => { - const updateTransactions = $(transactions, [filter(isUpdate)]); - - const evaluateIndex = (record, indexNodeAndPath) => { - const mappedRecord = evaluate(record)(indexNodeAndPath.indexNode); - return ({ - mappedRecord, - indexNode: indexNodeAndPath.indexNode, - indexDir: indexNodeAndPath.indexDir, - indexShardKey: getIndexedDataKey( - indexNodeAndPath.indexNode, - indexNodeAndPath.indexDir, - mappedRecord.result, - ), - }); - }; - - const getIndexNodesToApply = indexFilter => (t, indexes) => $(indexes, [ - map(n => ({ - old: evaluateIndex(t.oldRecord, n), - new: evaluateIndex(t.record, n), - })), - filter(indexFilter), - ]); - - const toRemoveFilter = (n, isUnreferenced) => n.old.mappedRecord.passedFilter === true - && (n.new.mappedRecord.passedFilter === false - || isUnreferenced); - - const toAddFilter = (n, isNewlyReferenced) => (n.old.mappedRecord.passedFilter === false - || isNewlyReferenced) - && n.new.mappedRecord.passedFilter === true; - - const toUpdateFilter = n => n.new.mappedRecord.passedFilter === true - && n.old.mappedRecord.passedFilter === true - && !isEqual(n.old.mappedRecord.result, - n.new.mappedRecord.result); - - const toRemove = []; - const toWrite = []; - - for (const t of updateTransactions) { - const ancestorIdxs = getRelevantAncestorIndexes( - hierarchy, t.record, - ); - - const referenceChanges = diffReverseRefForUpdate( - hierarchy, t.oldRecord, t.record, - ); - - // old records to remove (filtered out) - const filteredOut_toRemove = union$1( - getIndexNodesToApply(toRemoveFilter)(t, ancestorIdxs), - // still referenced - check filter - getIndexNodesToApply(toRemoveFilter)(t, referenceChanges.notChanged), - // un referenced - remove if in there already - getIndexNodesToApply(n => toRemoveFilter(n, true))(t, referenceChanges.unReferenced), - ); - - // new records to add (filtered in) - const filteredIn_toAdd = union$1( - getIndexNodesToApply(toAddFilter)(t, ancestorIdxs), - // newly referenced - check filter - getIndexNodesToApply(n => toAddFilter(n, true))(t, referenceChanges.newlyReferenced), - // reference unchanged - rerun filter in case something else changed - getIndexNodesToApply(toAddFilter)(t, referenceChanges.notChanged), - ); - - const changed = union$1( - getIndexNodesToApply(toUpdateFilter)(t, ancestorIdxs), - // still referenced - recheck filter - getIndexNodesToApply(toUpdateFilter)(t, referenceChanges.notChanged), - ); - - const shardKeyChanged = $(changed, [ - filter(c => c.old.indexShardKey !== c.new.indexShardKey), - ]); - - const changedInSameShard = $(shardKeyChanged, [ - difference(changed), - ]); - - for (const res of shardKeyChanged) { - pull(res)(changed); - filteredOut_toRemove.push(res); - filteredIn_toAdd.push(res); - } - - toRemove.push( - $(filteredOut_toRemove, [ - map(i => i.old), - ]), - ); - - toWrite.push( - $(filteredIn_toAdd, [ - map(i => i.new), - ]), - ); - - toWrite.push( - $(changedInSameShard, [ - map(i => i.new), - ]), - ); - } - - return ({ - toRemove: flatten(toRemove), - toWrite: flatten(toWrite), - }); -}; - -const getBuildIndexTransactionsByShard = (hierarchy, transactions) => { - const buildTransactions = $(transactions, [filter(isBuildIndex)]); - if (!isNonEmptyArray(buildTransactions)) return []; - const indexNode = transactions.indexNode; - - const getIndexDirs = (t) => { - if (isGlobalIndex(indexNode)) { - return [indexNode.nodeKey()]; - } - - if (isReferenceIndex(indexNode)) { - const recordNode = getExactNodeForKey(hierarchy)(t.record.key); - const refFields = $(recordNode.fields, [ - filter(fieldReversesReferenceToIndex(indexNode)), - ]); - const indexDirs = []; - for (const refField of refFields) { - const refValue = t.record[refField.name]; - if (isSomething(refValue) - && isNonEmptyString(refValue.key)) { - const indexDir = joinKey( - getRecordInfo(hierarchy, refValue.key).dir, - indexNode.name, - ); - - if (!includes(indexDir)(indexDirs)) { indexDirs.push(indexDir); } - } - } - return indexDirs; - } - - const indexKey = joinKey( - getActualKeyOfParent( - indexNode.parent().nodeKey(), - t.record.key, - ), - indexNode.name, - ); - - return [getIndexDir(hierarchy, indexKey)]; - }; - - return $(buildTransactions, [ - map((t) => { - const mappedRecord = evaluate(t.record)(indexNode); - if (!mappedRecord.passedFilter) return null; - const indexDirs = getIndexDirs(t); - return $(indexDirs, [ - map(indexDir => ({ - mappedRecord, - indexNode, - indexDir, - indexShardKey: getIndexedDataKey( - indexNode, - indexDir, - mappedRecord.result, - ), - })), - ]); - }), - flatten, - filter(isSomething), - ]); -}; - -const get_Create_Delete_TransactionsByShard = pred => (hierarchy, transactions) => { - const createTransactions = $(transactions, [filter(pred)]); - - const getIndexNodesToApply = (t, indexes) => $(indexes, [ - map((n) => { - const mappedRecord = evaluate(t.record)(n.indexNode); - return ({ - mappedRecord, - indexNode: n.indexNode, - indexDir: n.indexDir, - indexShardKey: getIndexedDataKey( - n.indexNode, - n.indexDir, - mappedRecord.result, - ), - }); - }), - filter(n => n.mappedRecord.passedFilter), - ]); - - const allToApply = []; - - for (const t of createTransactions) { - const ancestorIdxs = getRelevantAncestorIndexes(hierarchy, t.record); - const reverseRef = getRelevantReverseReferenceIndexes(hierarchy, t.record); - - allToApply.push( - getIndexNodesToApply(t, ancestorIdxs), - ); - allToApply.push( - getIndexNodesToApply(t, reverseRef), - ); - } - - return flatten(allToApply); -}; - -const getDeleteTransactionsByShard = get_Create_Delete_TransactionsByShard(isDelete); - -const getCreateTransactionsByShard = get_Create_Delete_TransactionsByShard(isCreate); - -const diffReverseRefForUpdate = (appHierarchy, oldRecord, newRecord) => { - const oldIndexes = getRelevantReverseReferenceIndexes( - appHierarchy, oldRecord, - ); - const newIndexes = getRelevantReverseReferenceIndexes( - appHierarchy, newRecord, - ); - - const unReferenced = differenceBy( - i => i.indexDir, - oldIndexes, newIndexes, - ); - - const newlyReferenced = differenceBy( - i => i.indexDir, - newIndexes, oldIndexes, - ); - - const notChanged = intersectionBy( - i => i.indexDir, - newIndexes, oldIndexes, - ); - - return { - unReferenced, - newlyReferenced, - notChanged, - }; -}; - -const cleanup = async (app) => { - const lock = await getTransactionLock(app); - if (isNolock(lock)) return; - - try { - const transactions = await retrieve(app); - if (transactions.length > 0) { - await executeTransactions(app)(transactions); - - const folder = transactions.folderKey - ? transactions.folderKey - : TRANSACTIONS_FOLDER; - - const deleteFiles = $(transactions, [ - map(t => joinKey( - folder, - getTransactionId( - t.recordId, t.transactionType, - t.uniqueId, - ), - )), - map(app.datastore.deleteFile), - ]); - - await Promise.all(deleteFiles); - } - } finally { - await releaseLock(app, lock); - } -}; - -const getTransactionLock = async app => await getLock( - app, LOCK_FILE_KEY, - timeoutMilliseconds, maxLockRetries, -); - -const initialiseData = async (datastore, applicationDefinition, accessLevels) => { - await datastore.createFolder(configFolder); - await datastore.createJson(appDefinitionFile, applicationDefinition); - - await initialiseRootCollections(datastore, applicationDefinition.hierarchy); - await initialiseRootIndexes(datastore, applicationDefinition.hierarchy); - - await datastore.createFolder(TRANSACTIONS_FOLDER); - - await datastore.createFolder(AUTH_FOLDER); - - await datastore.createJson(USERS_LIST_FILE, []); - - await datastore.createJson( - ACCESS_LEVELS_FILE, - accessLevels ? accessLevels : { version: 0, levels: [] }); - - await initialiseRootSingleRecords(datastore, applicationDefinition.hierarchy); -}; - -const initialiseRootIndexes = async (datastore, hierarchy) => { - const flathierarchy = getFlattenedHierarchy(hierarchy); - const globalIndexes = $(flathierarchy, [ - filter(isGlobalIndex), - ]); - - for (const index of globalIndexes) { - if (!await datastore.exists(index.nodeKey())) { - await initialiseIndex(datastore, '', index); - } - } -}; - -const initialiseRootSingleRecords = async (datastore, hierarchy) => { - const app = { - publish:()=>{}, - cleanupTransactions: () => {}, - datastore, hierarchy - }; - - const flathierarchy = getFlattenedHierarchy(hierarchy); - const singleRecords = $(flathierarchy, [ - filter(isSingleRecord), - ]); - - for (let record of singleRecords) { - await datastore.createFolder(record.nodeKey()); - const result = _getNew(record, ""); - await _save(app,result); - } -}; - -const getDatabaseManager = databaseManager => ({ - createEmptyMasterDb: createEmptyMasterDb(databaseManager), - createEmptyInstanceDb: createEmptyInstanceDb(databaseManager), - getInstanceDbRootConfig: databaseManager.getInstanceDbRootConfig, - masterDatastoreConfig: getMasterDatastoreConfig(databaseManager), - getInstanceDatastoreConfig: getInstanceDatastoreConfig(databaseManager), -}); - -const getMasterDatastoreConfig = databaseManager => databaseManager.getDatastoreConfig('master'); - -const getInstanceDatastoreConfig = databaseManager => (applicationId, instanceId) => databaseManager.getDatastoreConfig( - applicationId, instanceId, -); - -const createEmptyMasterDb = databaseManager => async () => await databaseManager.createEmptyDb('master'); - -const createEmptyInstanceDb = databaseManager => async (applicationId, instanceId) => { - if (isNothing(applicationId)) { throw new Error('CreateDb: application id not supplied'); } - if (isNothing(instanceId)) { throw new Error('CreateDb: instance id not supplied'); } - - return await databaseManager.createEmptyDb( - applicationId, - instanceId, - ); -}; - -const getAppApis = async (store, behaviourSources = null, - cleanupTransactions = null, - getEpochTime = null, - crypto = null, - appDefinition = null) => { - - store = setupDatastore(store); - - if(!appDefinition) - appDefinition = await getApplicationDefinition(store)(); - - if(!behaviourSources) - behaviourSources = await getBehaviourSources(store); - - const eventAggregator = createEventAggregator(); - - const app = { - datastore:store, - crypto, - publish:eventAggregator.publish, - hierarchy:appDefinition.hierarchy, - actions:appDefinition.actions - }; - - const templateApi = getTemplateApi(app); - - app.cleanupTransactions = isSomething(cleanupTransactions) - ? cleanupTransactions - : async () => await cleanup(app); - - app.getEpochTime = isSomething(getEpochTime) - ? getEpochTime - : async () => (new Date()).getTime(); - - const recordApi = getRecordApi(app); - const collectionApi = getCollectionApi(app); - const indexApi = getIndexApi(app); - const authApi = getAuthApi(app); - const actionsApi = getActionsApi(app); - - const authenticateAs = async (username, password) => { - app.user = await authApi.authenticate(username, password); - }; - - const withFullAccess = () => - userWithFullAccess(app); - - const asUser = (user) => { - app.user = user; - }; - - let apis = { - recordApi, - templateApi, - collectionApi, - indexApi, - authApi, - actionsApi, - subscribe: eventAggregator.subscribe, - authenticateAs, - withFullAccess, - asUser - }; - - apis.actions = initialiseActions( - eventAggregator.subscribe, - behaviourSources, - appDefinition.actions, - appDefinition.triggers, - apis); - - - return apis; -}; - -const userWithFullAccess = (app) => { - app.user = { - name: "app", - permissions : generateFullPermissions(app), - isUser:false, - temp:false - }; - return app.user; -}; - -export default getAppApis; -export { index as common, events, eventsList, getActionsApi, getAppApis, getAuthApi, getCollectionApi, getDatabaseManager, getIndexApi, getRecordApi, getTemplateApi, hierarchy, initialiseData, setupDatastore, userWithFullAccess }; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVkaWJhc2UtY29yZS5lc20ubWpzIiwic291cmNlcyI6WyIuLi9zcmMvY29tbW9uL2V2ZW50cy5qcyIsIi4uL3NyYy9jb21tb24vZXJyb3JzLmpzIiwiLi4vc3JjL2NvbW1vbi9hcGlXcmFwcGVyLmpzIiwiLi4vc3JjL2NvbW1vbi9sb2NrLmpzIiwiLi4vc3JjL2NvbW1vbi9pbmRleC5qcyIsIi4uL3NyYy9jb21tb24vdmFsaWRhd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xldiAtIDE7XG5cbiAgICAgIGlmKHBhcmVudExldiA8IDApIHJldHVybiBmYWxzZTtcbiAgICAgIFxuICAgICAgaWYoaXNPbkxhc3RGb2xkZXIocGFyZW50TGV2KSkgeyBcbiAgICAgICAgcmV0dXJuIGF3YWl0IGdldE5leHRGb2xkZXIocGFyZW50TGV2KTtcbiAgICAgIH1cblxuICAgICAgY29uc3QgbmV3UG9zaXRpb24gPSBjdXJyZW50UG9zaXRpb25bcGFyZW50TGV2XSArIDE7XG4gICAgICBjdXJyZW50UG9zaXRpb25bcGFyZW50TGV2XSA9IG5ld1Bvc2l0aW9uO1xuICAgICAgXG4gICAgICBjb25zdCBuZXh0Rm9sZGVyID0gam9pbktleShcbiAgICAgICAgY3VycmVudEZvbGRlckNvbnRlbnRzW3BhcmVudExldl0ucGF0aCxcbiAgICAgICAgY3VycmVudEZvbGRlckNvbnRlbnRzW3BhcmVudExldl0uY29udGVudHNbbmV3UG9zaXRpb25dKTtcbiAgICAgIGN1cnJlbnRGb2xkZXJDb250ZW50c1tsZXZdLmNvbnRlbnRzID0gYXdhaXQgYXBwLmRhdGFzdG9yZS5nZXRGb2xkZXJDb250ZW50cyhcbiAgICAgICAgbmV4dEZvbGRlclxuICAgICAgKTtcbiAgICAgIGN1cnJlbnRGb2xkZXJDb250ZW50c1tsZXZdLnBhdGggPSBuZXh0Rm9sZGVyO1xuXG4gICAgICBpZihsZXYgIT09IHRvcExldmVsKSB7XG4gICAgICBcbiAgICAgICAgLy8gd2UganVzdCBhZHZhbmNlZCBhIHBhcmVudCBmb2xkZXIsIHNvIG5vdyBuZWVkIHRvXG4gICAgICAgIC8vIGRvIHRoZSBzYW1lIHRvIHRoZSBuZXh0IGxldmVsc1xuICAgICAgICBsZXQgbG9vcExldmVsID0gbGV2ICsgMTtcbiAgICAgICAgd2hpbGUobG9vcExldmVsIDw9IHRvcExldmVsKSB7XG4gICAgICAgICAgY29uc3QgbG9vcFBhcmVudExldmVsID0gbG9vcExldmVsLTE7X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RlciA9IGFzeW5jICgpID0+IHtcblxuICAgICAgaWYoIWhhc01vcmUpIHtcbiAgICAgICAgcmV0dXJuIGZpbmluc2hlZFJlc3VsdDtcbiAgICAgIH1cblxuICAgICAgaWYoIWhhc1N0YXJ0ZWQpIHtcbiAgICAgICAgaGFzTW9yZSA9IGF3YWl0IGZpcnN0Rm9sZGVyKCk7XG4gICAgICAgIGhhc1N0YXJ0ZWQgPSB0cnVlO1xuICAgICAgICByZXR1cm4gKHtcbiAgICAgICAgICByZXN1bHQ6IHtcbiAgICAgICAgICAgIGlkczogaWRzQ3VycmVudEZvbGRlcigpLFxuICAgICAgICAgICAgY29sbGVjdGlvbktleVxuICAgICAgICAgIH0sXG4gICAgICAgICAgZG9uZTogZmFsc2VcbiAgICAgICAgfSlcbiAgICAgIH1cblxuICAgICAgaGFzTW9yZSA9IGF3YWl0IGdldE5leHRGb2xkZXIoKTtcbiAgICAgIFxuICAgICAgcmV0dXJuICh7XG4gICAgICAgIHJlc3VsdDoge1xuICAgICAgICAgIGlkczogaGFzTW9yZSA/IGlkc0N1cnJlbnRGb2xkZXIoKSA6IFtdLFxuICAgICAgICAgIGNvbGxlY3Rpb25LZXlcbiAgICAgICAgfSxcbiAgICAgICAgZG9uZTogIWhhc01vcmVcbiAgICAgIH0pO1xuICAgIH1cblxuICAgIHJldHVybiBnZXRJZHNGcm9tQ3VycmVudGZvbGRlcjtcbiAgICBcbiAgfTtcblxuICBjb25zdCBhbmNlc3RvcnMgPSAkKGdldEZsYXR0ZW5lZEhpZXJhcmNoeShhcHAuaGllcmFyY2h5KSwgW1xuICAgIGZpbHRlcihpc0NvbGxlY3Rpb25SZWNvcmQpLFxuICAgIGZpbHRlcihuID0+IGlzQW5jZXN0b3IocmVjb3JkTm9kZSkobilcbiAgICAgICAgICAgICAgICAgICAgfHwgbi5ub2RlS2V5KCkgPT09IHJlY29yZE5vZGUubm9kZUtleSgpKSxcbiAgICBvcmRlckJ5KFtuID0+IG4ubm9kZUtleSgpLm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SA9PiB7XG4gICBcbiAgICBsZXQgX2Vycm9yZWQ7XG5cbiAgICBjb25zdCBfZXJyb3JIYW5kbGVyID0gZXJyID0+IHtcbiAgICAgICAgX2Vycm9yZWQgPSBlcnI7XG4gICAgfTtcblxuICAgIHN0cmVhbS5vbihcImVycm9yXCIsIF9lcnJvckhhbmRsZXIpO1xuICBcbiAgICBjb25zdCByZWFkID0gKHNpemUpID0+IHtcbiAgXG4gICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICBpZiAoX2Vycm9yZWQpIHtcbiAgICAgICAgICBjb25zdCBlcnIgPSBfZXJyb3JlZDtcbiAgICAgICAgICBfZXJyb3JlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICByZXR1cm4gcmVqZWN0KGVycilcbiAgICAgICAgfVxuICBcbiAgICAgICAgaWYgKCFzdHJlYW0ucmVhZGFibGUgfHwgc3RyZWFtLmNsb3NlZCB8fCBzdHJlYW0uZGVzdHJveWVkKSB7XG4gICAgICAgICAgcmV0dXJuIHJlc29sdmUoKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3QgcmVhZGFibGVIYW5kbGVyID0gKCkgPT4ge1xuICAgICAgICAgIGNvbnN0IGNodW5rID0gc3RyZWFtLnJlYWQoc2l6ZSk7XG4gIFxuICAgICAgICAgIGlmIChjaHVuaykge1xuICAgICAgICAgICAgcmVtb3ZlTGlzdGVuZXJzKCk7XG4gICAgICAgICAgICByZXNvbHZlKGNodW5rKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgXG4gICAgICAgIGNvbnN0IGNsb3NlSGFuZGxlciA9ICgpID0+IHtcbiAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgIH1cbiAgXG4gICAgICAgIGNvbnN0IGVuZEhhbmRsZXIgPSAoKSA9PiB7XG4gICAgICAgICAgcmVtb3ZlTGlzd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cbiAgdmFyIGJ5dGVzID0gW11cblxuICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgKytpKSB7XG4gICAgY29kZVBvaW50ID0gc3RyaW5nLmNoYXJDb2RlQXQoaSlcblxuICAgIC8vIGlzIHN1cnJvZ2F0ZSBjb21wb25lbnRcbiAgICBpZiAoY29kZVBvaW50ID4gMHhEN0ZGICYmIGNvZGVQb2ludCA8IDB4RTAwMCkge1xuICAgICAgLy8gbGFzdCBjaGFyIHdhcyBhIGxlYWRcbiAgICAgIGlmICghbGVhZFN1cnJvZ2F0ZSkge1xuICAgICAgICAvLyBubyBsZWFkIHlldFxuICAgICAgICBpZiAoY29kZVBvaW50ID4gMHhEQkZGKSB7XG4gICAgICAgICAgLy8gdW5leHBlY3RlZCB0cmFpbFxuICAgICAgICAgIGlmICgodW5pdHMgLT0gMykgPiAtMSkgYnl0ZXMucHVzaCgweEVGLCAweEJGLCAweEJEKVxuICAgICAgICAgIGNvbnRpbnVlXG4gICAgICAgIH0gZWxzZSBpZiAoaSArIDEgPT09IGxlbmd0aCkge1xuICAgICAgICAgIC8vIHVucGFpcmVkIGxlYWRcbiAgICAgICAgICBpZiAoKHVuaXRzIC09IDMpID4gLTEpIGJ5dGVzLnB1c2goMHhFRiwgMHhCRiwgMHhCRClcbiAgICAgICAgICBjb250aW51ZVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gdmFsaWQgbGVhZFxuICAgICAgICBsZWFkU3Vycm9nYXRlID0gY29kZVBvaW50XG5cbiAgICAgICAgY29udGludWVcbiAgICAgIH1cblxuICAgICAgLy8gMiBsZWFkcyBpbiBhIHJvd1xuICAgICAgaWYgKGNvZGVQb2ludCA8IDB4REMwMCkge1xuICAgICAgICBpZiAoKHVuaXRzIC09IDMpID4gLTEpIGJ5dGVzLnB1c2goMHhFRiwgMHhCRiwgMHhCRClcbiAgICAgICAgbGVhZFN1cnJvZ2F0ZSA9IGNvZGVQb2ludFxuICAgICAgICBjb250aW51ZVxuICAg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iAgICAgICAgICAgIGNvbnN0IHJlbW92ZWQgPSBmaW5kKGsgPT4gaW5kZXhlZEl0ZW0ua2V5ID09PSBrKShrZXlzVG9SZW1vdmUpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZihpc1NvbWV0aGluZyhyZW1vdmVkKSkgXG4gICAgICAgICAgICAgICAgcmV0dXJuIENPTlRJTlVFX1JFQURJTkdfUkVDT1JEUztcblxuICAgICAgICAgICAgaWYoaXNTb21ldGhpbmcodXBkYXRlZCkpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBzZXJpYWxpemVkSXRlbSA9ICBzZXJpYWxpemVJdGVtKHNjaGVtYSwgdXBkYXRlZCk7XG4gICAgICAgICAgICAgICAgYXdhaXQgd3JpdGUoc2VyaWFsaXplZEl0ZW0pO1xuICAgICAgICAgICAgICAgIHdyaXR0ZW5JdGVtcy5wdXNoKHVwZGF0ZWQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhd2FpdCB3cml0ZShcbiAgICAgICAgICAgICAgICAgICAgc2VyaWFsaXplSXRlbShzY2hlbWEsIGluZGV4ZWRJdGVtKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9IFxuXG4gICAgICAgICAgICByZXR1cm4gQ09OVElOVUVfUkVBRElOR19SRUNPUkRTO1xuXG4gICAgICAgIH0sXG4gICAgICAgIGFzeW5jIHRleHQgPT4gYXdhaXQgd3JpdGUodGV4dClcbiAgICApO1xuXG4gICAgaWYod3JpdHRlbkl0ZW1zLmxlbmd0aCAhPT0gaXRlbXNUb1dyaXRlLmxlbmd0aCkge1xuICAgICAgICBjb25zdCB0b0FkZCA9IGRpZmZlcmVuY2UoaXRlbXNUb1dyaXRlLCB3cml0dGVuSXRlbXMpO1xuICAgICAgICBmb3IobGV0IGFkZGVkIG9mIHRvQWRkKSB7XG4gICAgICAgICAgICBhd2FpdCB3cml0ZShcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVJdGVtK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gICAgICAgICAgIHN0YXR1cyA9IGF3YWl0IG9uR2V0SXRlbShcbiAgICAgICAgICAgICAgICAgICAgZGVzZXJpYWxpemVSb3coc2NoZW1hLCByb3dUZXh0KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgcm93VGV4dCA9IFwiXCI7XG4gICAgICAgICAgICAgICAgaWYoc3RhdHVzID09PSBSRUFEX1JFTUFJTklOR19URVhUKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGN1cnJlbnRDaGFySW5kZXgrKztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmKGN1cnJlbnRDaGFySW5kZXggPCB0ZXh0Lmxlbmd0aCAtMSkge1xuICAgICAgICAgICAgYXdhaXQgb25HZXRUZXh0KHRleHQuc3Vic3RyaW5nKGN1cnJlbnRDaGFySW5kZXggKyAxKSk7XG4gICAgICAgIH1cblxuICAgICAgICB0ZXh0ID0gYXdhaXQgcmVhZElucHV0KCk7XG4gICAgfVxuXG4gICAgYXdhaXQgcmVhZGFibGVTdHJlYW0uZGVzdHJveSgpO1xuXG59O1xuXG5jb25zdCBuZXdPdXRwdXRXcml0ZXIgPSAoZmx1c2hCb3VuZGFyeSwgd3JpdGFibGVTdHJlYW0pID0+IHtcbiAgICBcbiAgICBsZXQgY3VycmVudEJ1ZmZlciA9IG51bGw7XG5cbiAgICByZXR1cm4gYXN5bmMgKHRleHQpID0+IHtcblxuICAgICAgICBpZihpc1N0cmluZyh0ZXh0KSAmJiBjdXJyZW50QnVmZmVyID09PSBudWxsKVxuICAgICAgICAgICAgY3VycmVudEJ1ZmZlciA9IEJ1ZmZlci5mcm9tKHRleHQsIFwidXRmOFwiKTtcbiAgICAgICAgZWxzZSBpZihpc1N0cmluZyh0ZXh0KSlcbiAgICAgICAgICAgIGN1cnJlbnRCdWZmZXIgPSBCdWZmZXIuY29uY2F0KFtcbiAgICAg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AgICAgIGNvbnN0IHR5cGUgPSBnZXRUeXBlKGN1cnJlbnRQcm9wLnR5cGUpO1xuICAgICAgICBjb25zdCB2YWx1ZSA9IGN1cnJlbnRWYWx1ZVRleHQgPT09IFwiXCJcbiAgICAgICAgICAgICAgICAgICAgICA/IHR5cGUuZ2V0RGVmYXVsdFZhbHVlKClcbiAgICAgICAgICAgICAgICAgICAgICA6IHR5cGUuc2FmZVBhcnNlVmFsdWUoXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQpO1xuICAgICAgICBpdGVtW2N1cnJlbnRQcm9wLm5hbWVdID0gdmFsdWU7XG4gICAgfTtcbiAgICBcbiAgICB3aGlsZShjdXJyZW50UHJvcEluZGV4IDwgc2NoZW1hLmxlbmd0aCkge1xuXG4gICAgICAgIGlmKGN1cnJlbnRDaGFySW5kZXggPCByb3dUZXh0Lmxlbmd0aCkge1xuICAgICAgICAgICAgY29uc3QgY3VycmVudENoYXIgPSByb3dUZXh0W2N1cnJlbnRDaGFySW5kZXhdO1xuICAgICAgICAgICAgaWYoaXNFc2NhcGVkKSB7XG4gICAgICAgICAgICAgICAgaWYoY3VycmVudENoYXIgPT09IFwiclwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQgKz0gXCJcXHJcIjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50VmFsdWVUZXh0ICs9IGN1cnJlbnRDaGFyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpc0VzY2FwZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYoY3VycmVudENoYXIgPT09IFwiLFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldEN1cnJlbnRQcm9wKCk7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQgPSBcIlwiO1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50UHJvcEluZGV4Kys7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmKGN1cnJlbnRDaGFyID09PSBcIlxcXFxcIikge1xuICAgICAgICAgICAgICAgICAgICBpc0VzY2FwZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQgKz0gY3VycmVudENoYXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudENoYXJJbmRleCsrOyBcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQgPSBcIlwiO1xuICAgICAgICAgICAgc2V0Q3VycmVudFByb3AoKTtcbiAgICAgICAgICAgIGN1cnJlbnRQcm9wSW5kZXgrKztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBpdGVtO1xufTtcblxuZXhwb3J0IGNvbnN0IHNlcmlhbGl6ZUl0ZW0gPSAoc2NoZW1hLCBpdGVtKSAgPT4ge1xuXG4gICAgbGV0IHJvd1RleHQgPSBcIlwiXG5cbiAgICBmb3IobGV0IHByb3Agb2Ygc2NoZW1hKSB7XG4gICAgICAgIGNvbnN0IHR5cGUgPSBnZXRUeXBlKHByb3AudHlwZSk7XG4gICAgICAgIGNvbnN0IHZhbHVlID0gaGFzKHByb3AubmFtZSkoaXRlbSlcbiAgICAgICAgICAgICAgICAgICAgICA/IGl0ZW1bcHJvcC5uYW1lXVxuICAgICAgICAgICAgICAgICAgICAgIDogdHlwZS5nZXREZWZhdWx0VmFsdWUoKVxuICAgICAgICBcbiAgICAgICAgY29uc3QgdmFsU3RyID0gdHlwZS5zdHJpbmdpZnkodmFsdWUpO1xuXG4gICAgICAgIGZvcihsZXQgaSA9IDA7IGkgPCB2YWxTdHIubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnRDaGFyID0gdmFsU3RyW2ldO1xuICAgICAgICAgICAgaWYoY3VycmVudENoYXIgPT09IFwiLFwiIFxuICAgICAgICAgICAgICAgfHwgY3VycmVudENoYXIgPT09IFwiXFxyXCIgXG4gICAgICAgICAgICAgICB8fCBjdXJyZW50Q2hhciA9PT0gXCJcXFxcXCIpIHtcbiAgICAgICAgICAgICAgICByb3dUZXh0ICs9IFwiXFxcXFwiO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCJcXHJcIikge1xuICAgICAgICAgICAgICAgIHJvd1RleHQgKz0gXCJyXCI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJvd1RleHQgKz0gY3VycmVudENoYXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByb3dUZXh0ICs9IFwiLFwiO1xuICAgIH1cblxuICAgIHJvd1RleHQgKz0gXCJcXHJcIjtcbiAgICByZXR1cm4gcm93VGV4dDtcbn07IiwiaW1wb3J0IGx1bnIgZnJvbSAnbHVucic7XG5pbXBvcnQge3Byb21pc2VSZWFkYWJsZVN0cmVhbX0gZnJvbSBcIi4vcHJvbWlzZVJlYWRhYmxlU3RyZWFtXCI7XG5pbXBvcnQgeyBjcmVhdGVJbmRleEZpbGUgfSBmcm9tICcuL3NoYXJkaW5nJztcbmltcG9ydCB7IGdlbmVyYXRlU2NoZW1hIH0gZnJvbSAnLi9pbmRleFNjaGVtYUNyZWF0b3InO1xuaW1wb3J0IHsgZ2V0SW5kZXhSZWFkZXIsIENPTlRJTlVFX1JFQURJTkdfUkVDT1JEUyB9IGZyb20gJy4vc2VyaWFsaXplcic7XG5cbmV4cG9ydCBjb25zdCByZWFkSW5kZXggPSBhc3luYyAoaGllcmFyY2h5LCBkYXRhc3RvcmUsIGluZGV4LCBpbmRleGVkRGF0YUtleSkgPT4ge1xuICBjb25zdCByZWNvcmRzID0gW107XG4gIGNv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aW5kZXhOb2RlLm5vZGVLZXkoKSxcbiAgICAgICAgICByZWNvcmRLZXksIHJlY29yZENvdW50LFxuICAgICAgICApO1xuICAgICAgICByZWNvcmRDb3VudCsrO1xuICAgICAgfVxuXG4gICAgICBpZiAoaGFzQXBwbGljYWJsZURlY2VuZGFudChhcHAuaGllcmFyY2h5LCByZWNvcmROb2RlLCBpbmRleE5vZGUpKSB7XG4gICAgICAgIGZvciAoY29uc3QgY2hpbGRDb2xsZWN0aW9uTm9kZSBvZiByZWNvcmROb2RlLmNoaWxkcmVuKSB7XG4gICAgICAgICAgcmVjb3JkQ291bnQgPSBhd2FpdCBhcHBseUFsbERlY2VuZGFudFJlY29yZHMoXG4gICAgICAgICAgICBhcHAsXG4gICAgICAgICAgICBqb2luS2V5KHJlY29yZEtleSwgY2hpbGRDb2xsZWN0aW9uTm9kZS5jb2xsZWN0aW9uTmFtZSksXG4gICAgICAgICAgICBpbmRleE5vZGUsIGluZGV4S2V5LCBjdXJyZW50SW5kZXhlZERhdGEsXG4gICAgICAgICAgICBjdXJyZW50SW5kZXhlZERhdGFLZXksIHJlY29yZENvdW50LFxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbiAgbGV0IGFsbElkcyA9IGF3YWl0IGFsbElkc0l0ZXJhdG9yKCk7XG4gIHdoaWxlIChhbGxJZHMuZG9uZSA9PT0gZmFsc2UpIHtcbiAgICBhd2FpdCBjcmVhdGVUcmFuc2FjdGlvbnNGb3JJZHMoXG4gICAgICBhbGxJZHMucmVzdWx0LmNvbGxlY3Rpb25LZXksXG4gICAgICBhbGxJZHMucmVzdWx0LmlkcyxcbiAgICApO1xuICAgIGFsbElkcyA9IGF3YWl0IGFsbElkc0l0ZXJhdG9yKCk7XG4gIH1cblxuICByZXR1cm4gcmVjb3JkQ291bnQ7XG59O1xuKi9cblxuZXhwb3J0IGRlZmF1bHQgYnVpbGRJbmRleDtcbiIsImltcG9ydCB7IGhhcywga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ICAgICAgIH1cbiAgXG4gICAgICAgIHN0cmVhbS5vbmNlKFwiZXJyb3JcIiwgd3JpdGVFcnJvckhhbmRsZXIpO1xuICBcbiAgICAgICAgY29uc3QgY2FuV3JpdGUgPSBzdHJlYW0ud3JpdGUoY2h1bmspO1xuICBcbiAgICAgICAgc3RyZWFtLnJlbW92ZUxpc3RlbmVyKFwiZXJyb3JcIiwgd3JpdGVFcnJvckhhbmRsZXIpO1xuICBcbiAgICAgICAgaWYgKGNhbldyaXRlKSB7XG4gICAgICAgICAgaWYgKCFyZWplY3RlZCkge1xuICAgICAgICAgICAgcmVzb2x2ZShjaHVuay5sZW5ndGgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb25zdCBlcnJvckhhbmRsZXIgPSBlcnIgPT4ge1xuICAgICAgICAgICAgX2Vycm9yZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIHJlamVjdChlcnIpO1xuICAgICAgICAgIH1cbiAgXG4gICAgICAgICAgY29uc3QgZHJhaW5IYW5kbGVyID0gKCkgPT4ge1xuICAgICAgICAgICAgcmVtb3ZlTGlzdGVuZXJzKCk7XG4gICAgICAgICAgICByZXNvbHZlKGNodW5rLmxlbmd0aCk7XG4gICAgICAgICAgfVxuICBcbiAgICAgICAgICBjb25zdCBjbG9zZUhhbmRsZXIgPSAoKSA9PiB7XG4gICAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIHJlc29sdmUoY2h1bmsubGVuZ3RoKTtcbiAgICAgICAgICB9XG4gIFxuICAgICAgICAgIGNvbnN0IGZpbmlzaEhhbmRsZXIgPSAoKSA9PiB7XG4gICAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIHJlc29sdmUoY2h1bmsubGVuZ3RoKTtcbiAgICAgICAgICB9XG4gIFxuICAgICAgICAgIGNv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RpcixcbiAgICAgICAgICAgIGluZGV4Tm9kZS5uYW1lLFxuICAgICAgICAgICk7XG5cbiAgICAgICAgICBpZiAoIWluY2x1ZGVzKGluZGV4RGlyKShpbmRleERpcnMpKSB7IGluZGV4RGlycy5wdXNoKGluZGV4RGlyKTsgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gaW5kZXhEaXJzO1xuICAgIH1cblxuICAgIGNvbnN0IGluZGV4S2V5ID0gam9pbktleShcbiAgICAgIGdldEFjdHVhbEtleU9mUGFyZW50KFxuICAgICAgICBpbmRleE5vZGUucGFyZW50KCkubm9kZUtleSgpLFxuICAgICAgICB0LnJlY29yZC5rZXksXG4gICAgICApLFxuICAgICAgaW5kZXhOb2RlLm5hbWUsXG4gICAgKTtcblxuICAgIHJldHVybiBbZ2V0SW5kZXhEaXIoaGllcmFyY2h5LCBpbmRleEtleSldO1xuICB9O1xuXG4gIHJldHVybiAkKGJ1aWxkVHJhbnNhY3Rpb25zLCBbXG4gICAgbWFwKCh0KSA9PiB7XG4gICAgICBjb25zdCBtYXBwZWRSZWNvcmQgPSBldmFsdWF0ZSh0LnJlY29yZCkoaW5kZXhOb2RlKTtcbiAgICAgIGlmICghbWFwcGVkUmVjb3JkLnBhc3NlZEZpbHRlcikgcmV0dXJuIG51bGw7XG4gICAgICBjb25zdCBpbmRleERpcnMgPSBnZXRJbmRleERpcnModCk7XG4gICAgICByZXR1cm4gJChpbmRleERpcnMsIFtcbiAgICAgICAgbWFwKGluZGV4RGlyID0+ICh7XG4gICAgICAgICAgbWFwcGVkUmVjb3JkLFxuICAgICAgICAgIGluZGV4Tm9kZSxcbiAgICAgICAgICBpbmRleERpcixcbiAgICAgICAgICBpbmRleFNoYXJkS2V5OiBnZXRJbmRleGVkRGF0YUtleShcbiAgICAgICAgICAgIGluZGV4Tm9kZSxcbiAgICAgICAgICAgIGluZGV4RGlyLFxuICAgICAgICAgICAgbWFwcGVkUmVjb3JkLnJlc3VsdCxcbiAgICAg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QWtCLENBQUMsR0FBRyxDQUFDLENBQUM7O0lBRTVCLE1BQU0sTUFBTSxHQUFHLENBQUMsSUFBSSxLQUFLO1FBQ3JCLEdBQUcsQ0FBQyxJQUFJLEdBQUcsS0FBSTtLQUNsQixDQUFDOztJQUVGLElBQUksSUFBSSxHQUFHO1FBQ1AsU0FBUztRQUNULFdBQVc7UUFDWCxhQUFhO1FBQ2IsUUFBUTtRQUNSLE9BQU87UUFDUCxVQUFVO1FBQ1YsU0FBUyxFQUFFLGVBQWUsQ0FBQyxTQUFTO1FBQ3BDLGNBQWM7UUFDZCxjQUFjO1FBQ2QsTUFBTTtLQUNULENBQUM7O0lBRUYsSUFBSSxDQUFDLE9BQU8sR0FBRyxpQkFBaUI7UUFDNUIsZUFBZSxDQUFDLFNBQVM7UUFDekIsZ0JBQWdCO1FBQ2hCLGFBQWEsQ0FBQyxPQUFPO1FBQ3JCLGFBQWEsQ0FBQyxRQUFRO1FBQ3RCLElBQUksQ0FBQyxDQUFDOzs7SUFHVixPQUFPLElBQUksQ0FBQztDQUNmLENBQUM7O0FBRUYsQUFBWSxNQUFDLGtCQUFrQixHQUFHLENBQUMsR0FBRyxLQUFLO0lBQ3ZDLEdBQUcsQ0FBQyxJQUFJLEdBQUc7UUFDUCxJQUFJLEVBQUUsS0FBSztRQUNYLFdBQVcsR0FBRyx1QkFBdUIsQ0FBQyxHQUFHLENBQUM7UUFDMUMsTUFBTSxDQUFDLEtBQUs7UUFDWixJQUFJLENBQUMsS0FBSztNQUNiO0lBQ0QsT0FBTyxHQUFHLENBQUMsSUFBSSxDQUFDO0NBQ25COzs7OzsifQ== diff --git a/packages/core/dist/budibase-core.umd.js b/packages/core/dist/budibase-core.umd.js deleted file mode 100644 index 1af3ff91ec..0000000000 --- a/packages/core/dist/budibase-core.umd.js +++ /dev/null @@ -1,8296 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash/fp'), require('shortid'), require('lodash'), require('@nx-js/compiler-util'), require('lunr'), require('safe-buffer')) : - typeof define === 'function' && define.amd ? define(['exports', 'lodash/fp', 'shortid', 'lodash', '@nx-js/compiler-util', 'lunr', 'safe-buffer'], factory) : - (global = global || self, factory(global['@budibase/core'] = {}, global.fp, global.shortid, global._, global.compiler_util, global.lunr, global.safe_buffer)); -}(this, function (exports, fp, shortid, _, compilerUtil, lunr, safeBuffer) { 'use strict'; - - var ___default = 'default' in _ ? _['default'] : _; - lunr = lunr && lunr.hasOwnProperty('default') ? lunr['default'] : lunr; - - const commonPlus = extra => fp.union(['onBegin', 'onComplete', 'onError'])(extra); - - const common = () => commonPlus([]); - - const _events = { - recordApi: { - save: commonPlus([ - 'onInvalid', - 'onRecordUpdated', - 'onRecordCreated']), - delete: common(), - getContext: common(), - getNew: common(), - load: common(), - validate: common(), - uploadFile: common(), - downloadFile: common(), - }, - indexApi: { - buildIndex: common(), - listItems: common(), - delete: common(), - aggregates: common(), - }, - collectionApi: { - getAllowedRecordTypes: common(), - initialise: common(), - delete: common(), - }, - authApi: { - authenticate: common(), - authenticateTemporaryAccess: common(), - createTemporaryAccess: common(), - createUser: common(), - enableUser: common(), - disableUser: common(), - loadAccessLevels: common(), - getNewAccessLevel: common(), - getNewUser: common(), - getNewUserAuth: common(), - getUsers: common(), - saveAccessLevels: common(), - isAuthorized: common(), - changeMyPassword: common(), - setPasswordFromTemporaryCode: common(), - scorePassword: common(), - isValidPassword: common(), - validateUser: common(), - validateAccessLevels: common(), - setUserAccessLevels: common(), - }, - templateApi: { - saveApplicationHierarchy: common(), - saveActionsAndTriggers: common(), - }, - actionsApi: { - execute: common(), - }, - }; - - const _eventsList = []; - - const makeEvent = (area, method, name) => `${area}:${method}:${name}`; - - for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - _events[areaKey][methodKey] = fp.reduce((obj, s) => { - obj[s] = makeEvent(areaKey, methodKey, s); - return obj; - }, - {})(_events[areaKey][methodKey]); - } - } - - - for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - for (const name in _events[areaKey][methodKey]) { - _eventsList.push( - _events[areaKey][methodKey][name], - ); - } - } - } - - - const events = _events; - - const eventsList = _eventsList; - - class BadRequestError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 400; - } - } - - class UnauthorisedError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 401; - } - } - - class ForbiddenError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 403; - } - } - - class NotFoundError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 404; - } - } - - const apiWrapper = async (app, eventNamespace, isAuthorized, eventContext, func, ...params) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return; - } - - const startDate = Date.now(); - const elapsed = () => (Date.now() - startDate); - - try { - await app.publish( - eventNamespace.onBegin, - eventContext, - ); - - const result = await func(...params); - - await publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result; - } catch (error) { - await publishError(app, eventContext, eventNamespace, elapsed, error); - throw error; - } - }; - - const apiWrapperSync = (app, eventNamespace, isAuthorized, eventContext, func, ...params) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return; - } - - const startDate = Date.now(); - const elapsed = () => (Date.now() - startDate); - - try { - app.publish( - eventNamespace.onBegin, - eventContext, - ); - - const result = func(...params); - - publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result; - } catch (error) { - publishError(app, eventContext, eventNamespace, elapsed, error); - throw error; - } - }; - - const handleNotAuthorized = (app, eventContext, eventNamespace) => { - const err = new UnauthorisedError(`Unauthorized: ${eventNamespace}`); - publishError(app, eventContext, eventNamespace, () => 0, err); - throw err; - }; - - const pushCallStack = (app, eventNamespace, seedCallId) => { - const callId = shortid.generate(); - - const createCallStack = () => ({ - seedCallId: !fp.isUndefined(seedCallId) - ? seedCallId - : callId, - threadCallId: callId, - stack: [], - }); - - if (fp.isUndefined(app.calls)) { - app.calls = createCallStack(); - } - - app.calls.stack.push({ - namespace: eventNamespace, - callId, - }); - }; - - const popCallStack = (app) => { - app.calls.stack.pop(); - if (app.calls.stack.length === 0) { - delete app.calls; - } - }; - - const publishError = async (app, eventContext, eventNamespace, elapsed, err) => { - const ctx = fp.cloneDeep(eventContext); - ctx.error = err; - ctx.elapsed = elapsed(); - await app.publish( - eventNamespace.onError, - ctx, - ); - popCallStack(app); - }; - - const publishComplete = async (app, eventContext, eventNamespace, elapsed, result) => { - const endcontext = fp.cloneDeep(eventContext); - endcontext.result = result; - endcontext.elapsed = elapsed(); - await app.publish( - eventNamespace.onComplete, - endcontext, - ); - popCallStack(app); - return result; - }; - - const lockOverlapMilliseconds = 10; - - const getLock = async (app, lockFile, timeoutMilliseconds, maxLockRetries, retryCount = 0) => { - try { - const timeout = (await app.getEpochTime()) - + timeoutMilliseconds; - - const lock = { - timeout, - key: lockFile, - totalTimeout: timeoutMilliseconds, - }; - - await app.datastore.createFile( - lockFile, - getLockFileContent( - lock.totalTimeout, - lock.timeout, - ), - ); - - return lock; - } catch (e) { - if (retryCount == maxLockRetries) { return NO_LOCK; } - - const lock = parseLockFileContent( - lockFile, - await app.datastore.loadFile(lockFile), - ); - - const currentEpochTime = await app.getEpochTime(); - - if (currentEpochTime < lock.timeout) { - return NO_LOCK; - } - - try { - await app.datastore.deleteFile(lockFile); - } catch (_) { - //empty - } - - await sleepForRetry(); - - return await getLock( - app, lockFile, timeoutMilliseconds, - maxLockRetries, retryCount + 1, - ); - } - }; - - const getLockFileContent = (totalTimeout, epochTime) => `${totalTimeout}:${epochTime.toString()}`; - - const parseLockFileContent = (key, content) => $(content, [ - fp.split(':'), - parts => ({ - totalTimeout: new Number(parts[0]), - timeout: new Number(parts[1]), - key, - }), - ]); - - const releaseLock = async (app, lock) => { - const currentEpochTime = await app.getEpochTime(); - // only release if not timedout - if (currentEpochTime < (lock.timeout - lockOverlapMilliseconds)) { - try { - await app.datastore.deleteFile(lock.key); - } catch (_) { - //empty - } - } - }; - - const NO_LOCK = 'no lock'; - const isNolock = id => id === NO_LOCK; - - const sleepForRetry = () => new Promise(resolve => setTimeout(resolve, lockOverlapMilliseconds)); - - // this is the combinator function - const $$ = (...funcs) => arg => _.flow(funcs)(arg); - - // this is the pipe function - const $ = (arg, funcs) => $$(...funcs)(arg); - - const keySep = '/'; - const trimKeySep = str => _.trim(str, keySep); - const splitByKeySep = str => fp.split(keySep)(str); - const safeKey = key => _.replace(`${keySep}${trimKeySep(key)}`, `${keySep}${keySep}`, keySep); - const joinKey = (...strs) => { - const paramsOrArray = strs.length === 1 & fp.isArray(strs[0]) - ? strs[0] : strs; - return $(paramsOrArray, [ - fp.filter(s => !fp.isUndefined(s) - && !fp.isNull(s) - && s.toString().length > 0), - fp.join(keySep), - safeKey - ]); - }; - const splitKey = $$(trimKeySep, splitByKeySep); - const getDirFomKey = $$(splitKey, _.dropRight, p => joinKey(...p)); - const getFileFromKey = $$(splitKey, _.takeRight, _.head); - - const configFolder = `${keySep}.config`; - const fieldDefinitions = joinKey(configFolder, 'fields.json'); - const templateDefinitions = joinKey(configFolder, 'templates.json'); - const appDefinitionFile = joinKey(configFolder, 'appDefinition.json'); - const dirIndex = folderPath => joinKey(configFolder, 'dir', ...splitKey(folderPath), 'dir.idx'); - const getIndexKeyFromFileKey = $$(getDirFomKey, dirIndex); - - const ifExists = (val, exists, notExists) => (fp.isUndefined(val) - ? fp.isUndefined(notExists) ? (() => { })() : notExists() - : exists()); - - const getOrDefault = (val, defaultVal) => ifExists(val, () => val, () => defaultVal); - - const not = func => val => !func(val); - const isDefined = not(fp.isUndefined); - const isNonNull = not(fp.isNull); - const isNotNaN = not(fp.isNaN); - - const allTrue = (...funcArgs) => val => fp.reduce( - (result, conditionFunc) => (fp.isNull(result) || result == true) && conditionFunc(val), - null)(funcArgs); - - const anyTrue = (...funcArgs) => val => fp.reduce( - (result, conditionFunc) => result == true || conditionFunc(val), - null)(funcArgs); - - const insensitiveEquals = (str1, str2) => str1.trim().toLowerCase() === str2.trim().toLowerCase(); - - const isSomething = allTrue(isDefined, isNonNull, isNotNaN); - const isNothing = not(isSomething); - const isNothingOrEmpty = v => isNothing(v) || fp.isEmpty(v); - const somethingOrGetDefault = getDefaultFunc => val => (isSomething(val) ? val : getDefaultFunc()); - const somethingOrDefault = (val, defaultVal) => somethingOrGetDefault(fp.constant(defaultVal))(val); - - const mapIfSomethingOrDefault = (mapFunc, defaultVal) => val => (isSomething(val) ? mapFunc(val) : defaultVal); - - const mapIfSomethingOrBlank = mapFunc => mapIfSomethingOrDefault(mapFunc, ''); - - const none = predicate => collection => !fp.some(predicate)(collection); - - const all = predicate => collection => none(v => !predicate(v))(collection); - - const isNotEmpty = ob => !fp.isEmpty(ob); - const isNonEmptyArray = allTrue(fp.isArray, isNotEmpty); - const isNonEmptyString = allTrue(fp.isString, isNotEmpty); - const tryOr = failFunc => (func, ...args) => { - try { - return func.apply(null, ...args); - } catch (_) { - return failFunc(); - } - }; - - const tryAwaitOr = failFunc => async (func, ...args) => { - try { - return await func.apply(null, ...args); - } catch (_) { - return await failFunc(); - } - }; - - const defineError = (func, errorPrefix) => { - try { - return func(); - } catch (err) { - err.message = `${errorPrefix} : ${err.message}`; - throw err; - } - }; - - const tryOrIgnore = tryOr(() => { }); - const tryAwaitOrIgnore = tryAwaitOr(async () => { }); - const causesException = (func) => { - try { - func(); - return false; - } catch (e) { - return true; - } - }; - - const executesWithoutException = func => !causesException(func); - - const handleErrorWith = returnValInError => tryOr(fp.constant(returnValInError)); - - const handleErrorWithUndefined = handleErrorWith(undefined); - - const switchCase = (...cases) => (value) => { - const nextCase = () => _.head(cases)[0](value); - const nextResult = () => _.head(cases)[1](value); - - if (fp.isEmpty(cases)) return; // undefined - if (nextCase() === true) return nextResult(); - return switchCase(..._.tail(cases))(value); - }; - - const isValue = val1 => val2 => (val1 === val2); - const isOneOf = (...vals) => val => fp.includes(val)(vals); - const defaultCase = fp.constant(true); - const memberMatches = (member, match) => obj => match(obj[member]); - - - const StartsWith = searchFor => searchIn => _.startsWith(searchIn, searchFor); - - const contains = val => array => (_.findIndex(array, v => v === val) > -1); - - const getHashCode = (s) => { - let hash = 0; let i; let char; let - l; - if (s.length == 0) return hash; - for (i = 0, l = s.length; i < l; i++) { - char = s.charCodeAt(i); - hash = ((hash << 5) - hash) + char; - hash |= 0; // Convert to 32bit integer - } - - // converting to string, but dont want a "-" prefixed - if (hash < 0) { return `n${(hash * -1).toString()}`; } - return hash.toString(); - }; - - // thanks to https://blog.grossman.io/how-to-write-async-await-without-try-catch-blocks-in-javascript/ - const awEx = async (promise) => { - try { - const result = await promise; - return [undefined, result]; - } catch (error) { - return [error, undefined]; - } - }; - - const isSafeInteger = n => fp.isInteger(n) - && n <= Number.MAX_SAFE_INTEGER - && n >= 0 - Number.MAX_SAFE_INTEGER; - - const toDateOrNull = s => (fp.isNull(s) ? null - : fp.isDate(s) ? s : new Date(s)); - const toBoolOrNull = s => (fp.isNull(s) ? null - : s === 'true' || s === true); - const toNumberOrNull = s => (fp.isNull(s) ? null - : fp.toNumber(s)); - - const isArrayOfString = opts => fp.isArray(opts) && all(fp.isString)(opts); - - const pushAll = (target, items) => { - for(let i of items) target.push(i); - }; - - const pause = async duration => new Promise(res => setTimeout(res, duration)); - - const retry = async (fn, retries, delay, ...args) => { - try { - return await fn(...args); - } catch (err) { - if (retries > 1) { - return await pause(delay).then(async () => await retry(fn, (retries - 1), delay, ...args)); - } - throw err; - } - }; - - var index = { - ifExists, - getOrDefault, - isDefined, - isNonNull, - isNotNaN, - allTrue, - isSomething, - mapIfSomethingOrDefault, - mapIfSomethingOrBlank, - configFolder, - fieldDefinitions, - isNothing, - not, - switchCase, - defaultCase, - StartsWith, - contains, - templateDefinitions, - handleErrorWith, - handleErrorWithUndefined, - tryOr, - tryOrIgnore, - tryAwaitOr, - tryAwaitOrIgnore, - dirIndex, - keySep, - $, - $$, - getDirFomKey, - getFileFromKey, - splitKey, - somethingOrDefault, - getIndexKeyFromFileKey, - joinKey, - somethingOrGetDefault, - appDefinitionFile, - isValue, - all, - isOneOf, - memberMatches, - defineError, - anyTrue, - isNonEmptyArray, - causesException, - executesWithoutException, - none, - getHashCode, - awEx, - apiWrapper, - events, - eventsList, - isNothingOrEmpty, - isSafeInteger, - toNumber: fp.toNumber, - toDate: toDateOrNull, - toBool: toBoolOrNull, - isArrayOfString, - getLock, - NO_LOCK, - isNolock, - insensitiveEquals, - pause, - retry, - pushAll - }; - - const stringNotEmpty = s => isSomething(s) && s.trim().length > 0; - - const makerule = (field, error, isValid) => ({ field, error, isValid }); - - const validationError = (rule, item) => ({ ...rule, item }); - - const applyRuleSet = ruleSet => itemToValidate => $(ruleSet, [ - fp.map(applyRule(itemToValidate)), - fp.filter(isSomething), - ]); - - const applyRule = itemTovalidate => rule => (rule.isValid(itemTovalidate) - ? null - : validationError(rule, itemTovalidate)); - - const filterEval = 'FILTER_EVALUATE'; - const filterCompile = 'FILTER_COMPILE'; - const mapEval = 'MAP_EVALUATE'; - const mapCompile = 'MAP_COMPILE'; - - - const getEvaluateResult = () => ({ - isError: false, - passedFilter: true, - result: null, - }); - - const compileFilter = index => compilerUtil.compileExpression(index.filter); - - const compileMap = index => compilerUtil.compileCode(index.map); - - const passesFilter = (record, index) => { - const context = { record }; - if (!index.filter) return true; - - const compiledFilter = defineError( - () => compileFilter(index), - filterCompile, - ); - - return defineError( - () => compiledFilter(context), - filterEval, - ); - }; - - const mapRecord = (record, index) => { - const recordClone = fp.cloneDeep(record); - const context = { record: recordClone }; - - const map = index.map ? index.map : 'return {...record};'; - - const compiledMap = defineError( - () => compilerUtil.compileCode(map), - mapCompile, - ); - - const mapped = defineError( - () => compiledMap(context), - mapEval, - ); - - const mappedKeys = fp.keys(mapped); - for (let i = 0; i < mappedKeys.length; i++) { - const key = mappedKeys[i]; - mapped[key] = fp.isUndefined(mapped[key]) ? null : mapped[key]; - if (fp.isFunction(mapped[key])) { - delete mapped[key]; - } - } - - mapped.key = record.key; - mapped.sortKey = index.getSortKey - ? compilerUtil.compileCode(index.getSortKey)(context) - : record.id; - - return mapped; - }; - - const evaluate = record => (index) => { - const result = getEvaluateResult(); - - try { - result.passedFilter = passesFilter(record, index); - } catch (err) { - result.isError = true; - result.passedFilter = false; - result.result = err.message; - } - - if (!result.passedFilter) return result; - - try { - result.result = mapRecord(record, index); - } catch (err) { - result.isError = true; - result.result = err.message; - } - - return result; - }; - - const indexTypes = { reference: 'reference', ancestor: 'ancestor' }; - - const indexRuleSet = [ - makerule('map', 'index has no map function', - index => isNonEmptyString(index.map)), - makerule('map', "index's map function does not compile", - index => !isNonEmptyString(index.map) - || executesWithoutException(() => compileMap(index))), - makerule('filter', "index's filter function does not compile", - index => !isNonEmptyString(index.filter) - || executesWithoutException(() => compileFilter(index))), - makerule('name', 'must declare a name for index', - index => isNonEmptyString(index.name)), - makerule('name', 'there is a duplicate named index on this node', - index => fp.isEmpty(index.name) - || fp.countBy('name')(index.parent().indexes)[index.name] === 1), - makerule('indexType', 'reference index may only exist on a record node', - index => isRecord(index.parent()) - || index.indexType !== indexTypes.reference), - makerule('indexType', `index type must be one of: ${fp.join(', ')(fp.keys(indexTypes))}`, - index => fp.includes(index.indexType)(fp.keys(indexTypes))), - ]; - - const getFlattenedHierarchy = (appHierarchy, useCached = true) => { - if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { return appHierarchy.getFlattenedHierarchy(); } - - const flattenHierarchy = (currentNode, flattened) => { - flattened.push(currentNode); - if ((!currentNode.children - || currentNode.children.length === 0) - && (!currentNode.indexes - || currentNode.indexes.length === 0) - && (!currentNode.aggregateGroups - || currentNode.aggregateGroups.length === 0)) { - return flattened; - } - - const unionIfAny = l2 => l1 => fp.union(l1)(!l2 ? [] : l2); - - const children = $([], [ - unionIfAny(currentNode.children), - unionIfAny(currentNode.indexes), - unionIfAny(currentNode.aggregateGroups), - ]); - - for (const child of children) { - flattenHierarchy(child, flattened); - } - return flattened; - }; - - appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []); - return appHierarchy.getFlattenedHierarchy(); - }; - - const getLastPartInKey = key => fp.last(splitKey(key)); - - const getNodesInPath = appHierarchy => key => $(appHierarchy, [ - getFlattenedHierarchy, - fp.filter(n => new RegExp(`${n.pathRegx()}`).test(key)), - ]); - - const getExactNodeForKey = appHierarchy => key => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => new RegExp(`${n.pathRegx()}$`).test(key)), - ]); - - const getNodeForCollectionPath = appHierarchy => collectionKey => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => (isCollectionRecord(n) - && new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey))), - ]); - - const hasMatchingAncestor = ancestorPredicate => decendantNode => switchCase( - - [node => isNothing(node.parent()), - fp.constant(false)], - - [node => ancestorPredicate(node.parent()), - fp.constant(true)], - - [defaultCase, - node => hasMatchingAncestor(ancestorPredicate)(node.parent())], - - )(decendantNode); - - const getNode = (appHierarchy, nodeKey) => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => n.nodeKey() === nodeKey - || (isCollectionRecord(n) - && n.collectionNodeKey() === nodeKey)), - ]); - - const getCollectionNode = (appHierarchy, nodeKey) => $(appHierarchy, [ - getFlattenedHierarchy, - fp.find(n => (isCollectionRecord(n) - && n.collectionNodeKey() === nodeKey)), - ]); - - const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getExactNodeForKey(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) - ? getNode(appHierarchy, keyOrNodeKey) - : nodeByKey; - }; - - const getCollectionNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getNodeForCollectionPath(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) - ? getCollectionNode(appHierarchy, keyOrNodeKey) - : nodeByKey; - }; - - const isNode = (appHierarchy, key) => isSomething(getExactNodeForKey(appHierarchy)(key)); - - const getActualKeyOfParent = (parentNodeKey, actualChildKey) => - $(actualChildKey, [ - splitKey, - fp.take(splitKey(parentNodeKey).length), - ks => joinKey(...ks), - ]); - - const getParentKey = (key) => { - return $(key, [ - splitKey, - fp.take(splitKey(key).length - 1), - joinKey, - ]); - }; - - const isKeyAncestorOf = ancestorKey => decendantNode => hasMatchingAncestor(p => p.nodeKey() === ancestorKey)(decendantNode); - - const hasNoMatchingAncestors = parentPredicate => node => !hasMatchingAncestor(parentPredicate)(node); - - const findField = (recordNode, fieldName) => fp.find(f => f.name == fieldName)(recordNode.fields); - - const isAncestor = decendant => ancestor => isKeyAncestorOf(ancestor.nodeKey())(decendant); - - const isDecendant = ancestor => decendant => isAncestor(decendant)(ancestor); - - const getRecordNodeId = recordKey => $(recordKey, [ - splitKey, - fp.last, - getRecordNodeIdFromId, - ]); - - const getRecordNodeIdFromId = recordId => $(recordId, [fp.split('-'), fp.first, parseInt]); - - const getRecordNodeById = (hierarchy, recordId) => $(hierarchy, [ - getFlattenedHierarchy, - fp.find(n => isRecord(n) - && n.nodeId === getRecordNodeIdFromId(recordId)), - ]); - - const recordNodeIdIsAllowed = indexNode => nodeId => indexNode.allowedRecordNodeIds.length === 0 - || fp.includes(nodeId)(indexNode.allowedRecordNodeIds); - - const recordNodeIsAllowed = indexNode => recordNode => recordNodeIdIsAllowed(indexNode)(recordNode.nodeId); - - const getAllowedRecordNodesForIndex = (appHierarchy, indexNode) => { - const recordNodes = $(appHierarchy, [ - getFlattenedHierarchy, - fp.filter(isRecord), - ]); - - if (isGlobalIndex(indexNode)) { - return $(recordNodes, [ - fp.filter(recordNodeIsAllowed(indexNode)), - ]); - } - - if (isAncestorIndex(indexNode)) { - return $(recordNodes, [ - fp.filter(isDecendant(indexNode.parent())), - fp.filter(recordNodeIsAllowed(indexNode)), - ]); - } - - if (isReferenceIndex(indexNode)) { - return $(recordNodes, [ - fp.filter(n => fp.some(fieldReversesReferenceToIndex(indexNode))(n.fields)), - ]); - } - }; - - const getNodeFromNodeKeyHash = hierarchy => hash => $(hierarchy, [ - getFlattenedHierarchy, - fp.find(n => getHashCode(n.nodeKey()) === hash), - ]); - - const isRecord = node => isSomething(node) && node.type === 'record'; - const isSingleRecord = node => isRecord(node) && node.isSingle; - const isCollectionRecord = node => isRecord(node) && !node.isSingle; - const isIndex = node => isSomething(node) && node.type === 'index'; - const isaggregateGroup = node => isSomething(node) && node.type === 'aggregateGroup'; - const isShardedIndex = node => isIndex(node) && isNonEmptyString(node.getShardName); - const isRoot = node => isSomething(node) && node.isRoot(); - const isDecendantOfARecord = hasMatchingAncestor(isRecord); - const isGlobalIndex = node => isIndex(node) && isRoot(node.parent()); - const isReferenceIndex = node => isIndex(node) && node.indexType === indexTypes.reference; - const isAncestorIndex = node => isIndex(node) && node.indexType === indexTypes.ancestor; - - const fieldReversesReferenceToNode = node => field => field.type === 'reference' - && fp.intersection(field.typeOptions.reverseIndexNodeKeys)(fp.map(i => i.nodeKey())(node.indexes)) - .length > 0; - - const fieldReversesReferenceToIndex = indexNode => field => field.type === 'reference' - && fp.intersection(field.typeOptions.reverseIndexNodeKeys)([indexNode.nodeKey()]) - .length > 0; - - var hierarchy = { - getLastPartInKey, - getNodesInPath, - getExactNodeForKey, - hasMatchingAncestor, - getNode, - getNodeByKeyOrNodeKey, - isNode, - getActualKeyOfParent, - getParentKey, - isKeyAncestorOf, - hasNoMatchingAncestors, - findField, - isAncestor, - isDecendant, - getRecordNodeId, - getRecordNodeIdFromId, - getRecordNodeById, - recordNodeIdIsAllowed, - recordNodeIsAllowed, - getAllowedRecordNodesForIndex, - getNodeFromNodeKeyHash, - isRecord, - isCollectionRecord, - isIndex, - isaggregateGroup, - isShardedIndex, - isRoot, - isDecendantOfARecord, - isGlobalIndex, - isReferenceIndex, - isAncestorIndex, - fieldReversesReferenceToNode, - fieldReversesReferenceToIndex, - getFlattenedHierarchy, - }; - - const getSafeFieldParser = (tryParse, defaultValueFunctions) => (field, record) => { - if (fp.has(field.name)(record)) { - return getSafeValueParser(tryParse, defaultValueFunctions)(record[field.name]); - } - return defaultValueFunctions[field.getUndefinedValue](); - }; - - const getSafeValueParser = (tryParse, defaultValueFunctions) => (value) => { - const parsed = tryParse(value); - if (parsed.success) { - return parsed.value; - } - return defaultValueFunctions.default(); - }; - - const getNewValue = (tryParse, defaultValueFunctions) => (field) => { - const getInitialValue = fp.isUndefined(field) || fp.isUndefined(field.getInitialValue) - ? 'default' - : field.getInitialValue; - - return fp.has(getInitialValue)(defaultValueFunctions) - ? defaultValueFunctions[getInitialValue]() - : getSafeValueParser(tryParse, defaultValueFunctions)(getInitialValue); - }; - - const typeFunctions = specificFunctions => _.merge({ - value: fp.constant, - null: fp.constant(null), - }, specificFunctions); - - const validateTypeConstraints = validationRules => async (field, record, context) => { - const fieldValue = record[field.name]; - const validateRule = async r => (!await r.isValid(fieldValue, field.typeOptions, context) - ? r.getMessage(fieldValue, field.typeOptions) - : ''); - - const errors = []; - for (const r of validationRules) { - const err = await validateRule(r); - if (isNotEmpty(err)) errors.push(err); - } - - return errors; - }; - - const getDefaultOptions = fp.mapValues(v => v.defaultValue); - - const makerule$1 = (isValid, getMessage) => ({ isValid, getMessage }); - const parsedFailed = val => ({ success: false, value: val }); - const parsedSuccess = val => ({ success: true, value: val }); - const getDefaultExport = (name, tryParse, functions, options, validationRules, sampleValue, stringify) => ({ - getNew: getNewValue(tryParse, functions), - safeParseField: getSafeFieldParser(tryParse, functions), - safeParseValue: getSafeValueParser(tryParse, functions), - tryParse, - name, - getDefaultOptions: () => getDefaultOptions(fp.cloneDeep(options)), - optionDefinitions: options, - validateTypeConstraints: validateTypeConstraints(validationRules), - sampleValue, - stringify: val => (val === null || val === undefined - ? '' : stringify(val)), - getDefaultValue: functions.default, - }); - - const stringFunctions = typeFunctions({ - default: fp.constant(null), - }); - - const stringTryParse = switchCase( - [fp.isString, parsedSuccess], - [fp.isNull, parsedSuccess], - [defaultCase, v => parsedSuccess(v.toString())], - ); - - const options = { - maxLength: { - defaultValue: null, - isValid: n => n === null || isSafeInteger(n) && n > 0, - requirementDescription: 'max length must be null (no limit) or a greater than zero integer', - parse: toNumberOrNull, - }, - values: { - defaultValue: null, - isValid: v => v === null || (isArrayOfString(v) && v.length > 0 && v.length < 10000), - requirementDescription: "'values' must be null (no values) or an arry of at least one string", - parse: s => s, - }, - allowDeclaredValuesOnly: { - defaultValue: false, - isValid: fp.isBoolean, - requirementDescription: 'allowDeclaredValuesOnly must be true or false', - parse: toBoolOrNull, - }, - }; - - const typeConstraints = [ - makerule$1(async (val, opts) => val === null || opts.maxLength === null || val.length <= opts.maxLength, - (val, opts) => `value exceeds maximum length of ${opts.maxLength}`), - makerule$1(async (val, opts) => val === null - || opts.allowDeclaredValuesOnly === false - || fp.includes(val)(opts.values), - (val) => `"${val}" does not exist in the list of allowed values`), - ]; - - var string = getDefaultExport( - 'string', - stringTryParse, - stringFunctions, - options, - typeConstraints, - 'abcde', - str => str, - ); - - const boolFunctions = typeFunctions({ - default: fp.constant(null), - }); - - const boolTryParse = switchCase( - [fp.isBoolean, parsedSuccess], - [fp.isNull, parsedSuccess], - [isOneOf('true', '1', 'yes', 'on'), () => parsedSuccess(true)], - [isOneOf('false', '0', 'no', 'off'), () => parsedSuccess(false)], - [defaultCase, parsedFailed], - ); - - const options$1 = { - allowNulls: { - defaultValue: true, - isValid: fp.isBoolean, - requirementDescription: 'must be a true or false', - parse: toBoolOrNull, - }, - }; - - const typeConstraints$1 = [ - makerule$1(async (val, opts) => opts.allowNulls === true || val !== null, - () => 'field cannot be null'), - ]; - - var bool = getDefaultExport( - 'bool', boolTryParse, boolFunctions, - options$1, typeConstraints$1, true, JSON.stringify, - ); - - const numberFunctions = typeFunctions({ - default: fp.constant(null), - }); - - const parseStringtoNumberOrNull = (s) => { - const num = Number(s); - return isNaN(num) ? parsedFailed(s) : parsedSuccess(num); - }; - - const numberTryParse = switchCase( - [fp.isNumber, parsedSuccess], - [fp.isString, parseStringtoNumberOrNull], - [fp.isNull, parsedSuccess], - [defaultCase, parsedFailed], - ); - - const options$2 = { - maxValue: { - defaultValue: Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: 'must be a valid integer', - parse: toNumberOrNull, - }, - minValue: { - defaultValue: 0 - Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: 'must be a valid integer', - parse: toNumberOrNull, - }, - decimalPlaces: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, - }; - - const getDecimalPlaces = (val) => { - const splitDecimal = val.toString().split('.'); - if (splitDecimal.length === 1) return 0; - return splitDecimal[1].length; - }; - - const typeConstraints$2 = [ - makerule$1(async (val, opts) => val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => `value (${val.toString()}) must be greater than or equal to ${opts.minValue}`), - makerule$1(async (val, opts) => val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => `value (${val.toString()}) must be less than or equal to ${opts.minValue} options`), - makerule$1(async (val, opts) => val === null || opts.decimalPlaces >= getDecimalPlaces(val), - (val, opts) => `value (${val.toString()}) must have ${opts.decimalPlaces} decimal places or less`), - ]; - - var number = getDefaultExport( - 'number', - numberTryParse, - numberFunctions, - options$2, - typeConstraints$2, - 1, - num => num.toString(), - ); - - const dateFunctions = typeFunctions({ - default: fp.constant(null), - now: () => new Date(), - }); - - const isValidDate = d => d instanceof Date && !isNaN(d); - - const parseStringToDate = s => switchCase( - [isValidDate, parsedSuccess], - [defaultCase, parsedFailed], - )(new Date(s)); - - - const dateTryParse = switchCase( - [fp.isDate, parsedSuccess], - [fp.isString, parseStringToDate], - [fp.isNull, parsedSuccess], - [defaultCase, parsedFailed], - ); - - const options$3 = { - maxValue: { - defaultValue: new Date(32503680000000), - isValid: fp.isDate, - requirementDescription: 'must be a valid date', - parse: toDateOrNull, - }, - minValue: { - defaultValue: new Date(-8520336000000), - isValid: fp.isDate, - requirementDescription: 'must be a valid date', - parse: toDateOrNull, - }, - }; - - const typeConstraints$3 = [ - makerule$1(async (val, opts) => val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => `value (${val.toString()}) must be greater than or equal to ${opts.minValue}`), - makerule$1(async (val, opts) => val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => `value (${val.toString()}) must be less than or equal to ${opts.minValue} options`), - ]; - - var datetime = getDefaultExport( - 'datetime', - dateTryParse, - dateFunctions, - options$3, - typeConstraints$3, - new Date(1984, 4, 1), - date => JSON.stringify(date).replace(new RegExp('"', 'g'), ''), - ); - - const arrayFunctions = () => typeFunctions({ - default: fp.constant([]), - }); - - const mapToParsedArrary = type => $$( - fp.map(i => type.safeParseValue(i)), - parsedSuccess, - ); - - const arrayTryParse = type => switchCase( - [fp.isArray, mapToParsedArrary(type)], - [defaultCase, parsedFailed], - ); - - const typeName = type => `array<${type}>`; - - - const options$4 = { - maxLength: { - defaultValue: 10000, - isValid: isSafeInteger, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, - minLength: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: 'must be a positive integer', - parse: toNumberOrNull, - }, - }; - - const typeConstraints$4 = [ - makerule$1(async (val, opts) => val === null || val.length >= opts.minLength, - (val, opts) => `must choose ${opts.minLength} or more options`), - makerule$1(async (val, opts) => val === null || val.length <= opts.maxLength, - (val, opts) => `cannot choose more than ${opts.maxLength} options`), - ]; - - var array = type => getDefaultExport( - typeName(type.name), - arrayTryParse(type), - arrayFunctions(), - options$4, - typeConstraints$4, - [type.sampleValue], - JSON.stringify, - ); - - const referenceNothing = () => ({ key: '' }); - - const referenceFunctions = typeFunctions({ - default: referenceNothing, - }); - - const hasStringValue = (ob, path) => fp.has(path)(ob) - && fp.isString(ob[path]); - - const isObjectWithKey = v => fp.isObjectLike(v) - && hasStringValue(v, 'key'); - - const tryParseFromString = s => { - - try { - const asObj = JSON.parse(s); - if(isObjectWithKey) { - return parsedSuccess(asObj); - } - } - catch(_) { - // EMPTY - } - - return parsedFailed(s); - }; - - const referenceTryParse = v => switchCase( - [isObjectWithKey, parsedSuccess], - [fp.isString, tryParseFromString], - [fp.isNull, () => parsedSuccess(referenceNothing())], - [defaultCase, parsedFailed], - )(v); - - const options$5 = { - indexNodeKey: { - defaultValue: null, - isValid: isNonEmptyString, - requirementDescription: 'must be a non-empty string', - parse: s => s, - }, - displayValue: { - defaultValue: '', - isValid: isNonEmptyString, - requirementDescription: 'must be a non-empty string', - parse: s => s, - }, - reverseIndexNodeKeys: { - defaultValue: null, - isValid: v => isArrayOfString(v) && v.length > 0, - requirementDescription: 'must be a non-empty array of strings', - parse: s => s, - }, - }; - - const isEmptyString = s => fp.isString(s) && fp.isEmpty(s); - - const ensureReferenceExists = async (val, opts, context) => isEmptyString(val.key) - || await context.referenceExists(opts, val.key); - - const typeConstraints$5 = [ - makerule$1( - ensureReferenceExists, - (val, opts) => `"${val[opts.displayValue]}" does not exist in options list (key: ${val.key})`, - ), - ]; - - var reference = getDefaultExport( - 'reference', - referenceTryParse, - referenceFunctions, - options$5, - typeConstraints$5, - { key: 'key', value: 'value' }, - JSON.stringify, - ); - - const illegalCharacters = '*?\\/:<>|\0\b\f\v'; - - const isLegalFilename = (filePath) => { - const fn = fileName(filePath); - return fn.length <= 255 - && fp.intersection(fn.split(''))(illegalCharacters.split('')).length === 0 - && none(f => f === '..')(splitKey(filePath)); - }; - - const fileNothing = () => ({ relativePath: '', size: 0 }); - - const fileFunctions = typeFunctions({ - default: fileNothing, - }); - - const fileTryParse = v => switchCase( - [isValidFile, parsedSuccess], - [fp.isNull, () => parsedSuccess(fileNothing())], - [defaultCase, parsedFailed], - )(v); - - const fileName = filePath => $(filePath, [ - splitKey, - fp.last, - ]); - - const isValidFile = f => !fp.isNull(f) - && fp.has('relativePath')(f) && fp.has('size')(f) - && fp.isNumber(f.size) - && fp.isString(f.relativePath) - && isLegalFilename(f.relativePath); - - const options$6 = {}; - - const typeConstraints$6 = []; - - var file = getDefaultExport( - 'file', - fileTryParse, - fileFunctions, - options$6, - typeConstraints$6, - { relativePath: 'some_file.jpg', size: 1000 }, - JSON.stringify, - ); - - const allTypes = () => { - const basicTypes = { - string, number, datetime, bool, reference, file, - }; - - const arrays = $(basicTypes, [ - fp.keys, - fp.map((k) => { - const kvType = {}; - const concreteArray = array(basicTypes[k]); - kvType[concreteArray.name] = concreteArray; - return kvType; - }), - types => _.assign({}, ...types), - ]); - - return _.merge({}, basicTypes, arrays); - }; - - - const all$1 = allTypes(); - - const getType = (typeName) => { - if (!fp.has(typeName)(all$1)) throw new BadRequestError(`Do not recognise type ${typeName}`); - return all$1[typeName]; - }; - - const getSampleFieldValue = field => getType(field.type).sampleValue; - - const getNewFieldValue = field => getType(field.type).getNew(field); - - const safeParseField = (field, record) => getType(field.type).safeParseField(field, record); - - const validateFieldParse = (field, record) => (fp.has(field.name)(record) - ? getType(field.type).tryParse(record[field.name]) - : parsedSuccess(undefined)); // fields may be undefined by default - - const getDefaultOptions$1 = type => getType(type).getDefaultOptions(); - - const validateTypeConstraints$1 = async (field, record, context) => await getType(field.type).validateTypeConstraints(field, record, context); - - const detectType = (value) => { - if (fp.isString(value)) return string; - if (fp.isBoolean(value)) return bool; - if (fp.isNumber(value)) return number; - if (fp.isDate(value)) return datetime; - if (fp.isArray(value)) return array(detectType(value[0])); - if (fp.isObject(value) - && fp.has('key')(value) - && fp.has('value')(value)) return reference; - if (fp.isObject(value) - && fp.has('relativePath')(value) - && fp.has('size')(value)) return file; - - throw new BadRequestError(`cannot determine type: ${JSON.stringify(value)}`); - }; - - // 5 minutes - const tempCodeExpiryLength = 5 * 60 * 1000; - - const AUTH_FOLDER = '/.auth'; - const USERS_LIST_FILE = joinKey(AUTH_FOLDER, 'users.json'); - const userAuthFile = username => joinKey(AUTH_FOLDER, `auth_${username}.json`); - const USERS_LOCK_FILE = joinKey(AUTH_FOLDER, 'users_lock'); - const ACCESS_LEVELS_FILE = joinKey(AUTH_FOLDER, 'access_levels.json'); - const ACCESS_LEVELS_LOCK_FILE = joinKey(AUTH_FOLDER, 'access_levels_lock'); - - const permissionTypes = { - CREATE_RECORD: 'create record', - UPDATE_RECORD: 'update record', - READ_RECORD: 'read record', - DELETE_RECORD: 'delete record', - READ_INDEX: 'read index', - MANAGE_INDEX: 'manage index', - MANAGE_COLLECTION: 'manage collection', - WRITE_TEMPLATES: 'write templates', - CREATE_USER: 'create user', - SET_PASSWORD: 'set password', - CREATE_TEMPORARY_ACCESS: 'create temporary access', - ENABLE_DISABLE_USER: 'enable or disable user', - WRITE_ACCESS_LEVELS: 'write access levels', - LIST_USERS: 'list users', - LIST_ACCESS_LEVELS: 'list access levels', - EXECUTE_ACTION: 'execute action', - SET_USER_ACCESS_LEVELS: 'set user access levels', - }; - - const getUserByName = (users, name) => $(users, [ - fp.find(u => u.name.toLowerCase() === name.toLowerCase()), - ]); - - const stripUserOfSensitiveStuff = (user) => { - const stripped = fp.clone(user); - delete stripped.tempCode; - return stripped; - }; - - const parseTemporaryCode = fullCode => $(fullCode, [ - fp.split(':'), - parts => ({ - id: parts[1], - code: parts[2], - }), - ]); - - const isAuthorized = app => (permissionType, resourceKey) => apiWrapperSync( - app, - events.authApi.isAuthorized, - alwaysAuthorized, - { resourceKey, permissionType }, - _isAuthorized, app, permissionType, resourceKey, - ); - - const _isAuthorized = (app, permissionType, resourceKey) => { - if (!app.user) { - return false; - } - - const validType = $(permissionTypes, [ - fp.values, - fp.includes(permissionType), - ]); - - if (!validType) { - return false; - } - - const permMatchesResource = (userperm) => { - const nodeKey = isNothing(resourceKey) - ? null - : isNode(app.hierarchy, resourceKey) - ? getNodeByKeyOrNodeKey( - app.hierarchy, resourceKey, - ).nodeKey() - : resourceKey; - - return (userperm.type === permissionType) - && ( - isNothing(resourceKey) - || nodeKey === userperm.nodeKey - ); - }; - - return $(app.user.permissions, [ - fp.some(permMatchesResource), - ]); - }; - - const nodePermission = type => ({ - add: (nodeKey, accessLevel) => accessLevel.permissions.push({ type, nodeKey }), - isAuthorized: resourceKey => app => isAuthorized(app)(type, resourceKey), - isNode: true, - get: nodeKey => ({ type, nodeKey }), - }); - - const staticPermission = type => ({ - add: accessLevel => accessLevel.permissions.push({ type }), - isAuthorized: app => isAuthorized(app)(type), - isNode: false, - get: () => ({ type }), - }); - - const createRecord = nodePermission(permissionTypes.CREATE_RECORD); - - const updateRecord = nodePermission(permissionTypes.UPDATE_RECORD); - - const deleteRecord = nodePermission(permissionTypes.DELETE_RECORD); - - const readRecord = nodePermission(permissionTypes.READ_RECORD); - - const writeTemplates = staticPermission(permissionTypes.WRITE_TEMPLATES); - - const createUser = staticPermission(permissionTypes.CREATE_USER); - - const setPassword = staticPermission(permissionTypes.SET_PASSWORD); - - const readIndex = nodePermission(permissionTypes.READ_INDEX); - - const manageIndex = staticPermission(permissionTypes.MANAGE_INDEX); - - const manageCollection = staticPermission(permissionTypes.MANAGE_COLLECTION); - - const createTemporaryAccess = staticPermission(permissionTypes.CREATE_TEMPORARY_ACCESS); - - const enableDisableUser = staticPermission(permissionTypes.ENABLE_DISABLE_USER); - - const writeAccessLevels = staticPermission(permissionTypes.WRITE_ACCESS_LEVELS); - - const listUsers = staticPermission(permissionTypes.LIST_USERS); - - const listAccessLevels = staticPermission(permissionTypes.LIST_ACCESS_LEVELS); - - const setUserAccessLevels = staticPermission(permissionTypes.SET_USER_ACCESS_LEVELS); - - const executeAction = nodePermission(permissionTypes.EXECUTE_ACTION); - - const alwaysAuthorized = () => true; - - const permission = { - createRecord, - updateRecord, - deleteRecord, - readRecord, - writeTemplates, - createUser, - setPassword, - readIndex, - createTemporaryAccess, - enableDisableUser, - writeAccessLevels, - listUsers, - listAccessLevels, - manageIndex, - manageCollection, - executeAction, - setUserAccessLevels, - }; - - const getNew = app => (collectionKey, recordTypeName) => { - const recordNode = getRecordNode(app, collectionKey); - collectionKey=safeKey(collectionKey); - return apiWrapperSync( - app, - events.recordApi.getNew, - permission.createRecord.isAuthorized(recordNode.nodeKey()), - { collectionKey, recordTypeName }, - _getNew, recordNode, collectionKey, - ); - }; - - const _getNew = (recordNode, collectionKey) => constructRecord(recordNode, getNewFieldValue, collectionKey); - - const getRecordNode = (app, collectionKey) => { - collectionKey = safeKey(collectionKey); - return getNodeForCollectionPath(app.hierarchy)(collectionKey); - }; - - const getNewChild = app => (recordKey, collectionName, recordTypeName) => - getNew(app)(joinKey(recordKey, collectionName), recordTypeName); - - const constructRecord = (recordNode, getFieldValue, collectionKey) => { - const record = $(recordNode.fields, [ - fp.keyBy('name'), - fp.mapValues(getFieldValue), - ]); - - record.id = `${recordNode.nodeId}-${shortid.generate()}`; - record.key = isSingleRecord(recordNode) - ? joinKey(collectionKey, recordNode.name) - : joinKey(collectionKey, record.id); - record.isNew = true; - record.type = recordNode.name; - return record; - }; - - const allIdChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'; - - // this should never be changed - ever - // - existing databases depend on the order of chars this string - - /** - * folderStructureArray should return an array like - * - [1] = all records fit into one folder - * - [2] = all records fite into 2 folders - * - [64, 3] = all records fit into 64 * 3 folders - * - [64, 64, 10] = all records fit into 64 * 64 * 10 folder - * (there are 64 possible chars in allIsChars) - */ - const folderStructureArray = (recordNode) => { - - const totalFolders = Math.ceil(recordNode.estimatedRecordCount / 1000); - const folderArray = []; - let levelCount = 1; - while(64**levelCount < totalFolders) { - levelCount += 1; - folderArray.push(64); - } - - const parentFactor = (64**folderArray.length); - if(parentFactor < totalFolders) { - folderArray.push( - Math.ceil(totalFolders / parentFactor) - ); - } - - return folderArray; - - /* - const maxRecords = currentFolderPosition === 0 - ? RECORDS_PER_FOLDER - : currentFolderPosition * 64 * RECORDS_PER_FOLDER; - - if(maxRecords < recordNode.estimatedRecordCount) { - return folderStructureArray( - recordNode, - [...currentArray, 64], - currentFolderPosition + 1); - } else { - const childFolderCount = Math.ceil(recordNode.estimatedRecordCount / maxRecords ); - return [...currentArray, childFolderCount] - }*/ - }; - - - const getAllIdsIterator = app => async (collection_Key_or_NodeKey) => { - collection_Key_or_NodeKey = safeKey(collection_Key_or_NodeKey); - const recordNode = getCollectionNodeByKeyOrNodeKey( - app.hierarchy, - collection_Key_or_NodeKey, - ); - - const getAllIdsIteratorForCollectionKey = async (recordNode, collectionKey) => { - - const folderStructure = folderStructureArray(recordNode); - - let currentFolderContents = []; - let currentPosition = []; - - const collectionDir = getCollectionDir(app.hierarchy, collectionKey); - const basePath = joinKey( - collectionDir, recordNode.nodeId.toString()); - - - - // "folderStructure" determines the top, sharding folders - // we need to add one, for the collection root folder, which - // always exists - const levels = folderStructure.length + 1; - const topLevel = levels -1; - - - /* populate initial directory structure in form: - [ - {path: "/a", contents: ["b", "c", "d"]}, - {path: "/a/b", contents: ["e","f","g"]}, - {path: "/a/b/e", contents: ["1-abcd","2-cdef","3-efgh"]}, - ] - // stores contents on each parent level - // top level has ID folders - */ - const firstFolder = async () => { - - let folderLevel = 0; - - const lastPathHasContent = () => - folderLevel === 0 - || currentFolderContents[folderLevel - 1].contents.length > 0; - - - while (folderLevel <= topLevel && lastPathHasContent()) { - - let thisPath = basePath; - for(let lev = 0; lev < currentPosition.length; lev++) { - thisPath = joinKey( - thisPath, currentFolderContents[lev].contents[0]); - } - - const contentsThisLevel = - await app.datastore.getFolderContents(thisPath); - currentFolderContents.push({ - contents:contentsThisLevel, - path: thisPath - }); - - // should start as something like [0,0] - if(folderLevel < topLevel) - currentPosition.push(0); - - folderLevel+=1; - } - - return (currentPosition.length === levels - 1); - }; - - const isOnLastFolder = level => { - - const result = currentPosition[level] === currentFolderContents[level].contents.length - 1; - return result; - }; - - const getNextFolder = async (lev=undefined) => { - lev = fp.isUndefined(lev) ? topLevel : lev; - const parentLev = lev - 1; - - if(parentLev < 0) return false; - - if(isOnLastFolder(parentLev)) { - return await getNextFolder(parentLev); - } - - const newPosition = currentPosition[parentLev] + 1; - currentPosition[parentLev] = newPosition; - - const nextFolder = joinKey( - currentFolderContents[parentLev].path, - currentFolderContents[parentLev].contents[newPosition]); - currentFolderContents[lev].contents = await app.datastore.getFolderContents( - nextFolder - ); - currentFolderContents[lev].path = nextFolder; - - if(lev !== topLevel) { - - // we just advanced a parent folder, so now need to - // do the same to the next levels - let loopLevel = lev + 1; - while(loopLevel <= topLevel) { - const loopParentLevel = loopLevel-1; - - currentPosition[loopParentLevel] = 0; - const nextLoopFolder = joinKey( - currentFolderContents[loopParentLevel].path, - currentFolderContents[loopParentLevel].contents[0]); - currentFolderContents[loopLevel].contents = await app.datastore.getFolderContents( - nextLoopFolder - ); - currentFolderContents[loopLevel].path = nextLoopFolder; - loopLevel+=1; - } - } - - // true ==has more ids... (just loaded more) - return true; - }; - - - const idsCurrentFolder = () => - currentFolderContents[currentFolderContents.length - 1].contents; - - const fininshedResult = ({ done: true, result: { ids: [], collectionKey } }); - - let hasStarted = false; - let hasMore = true; - const getIdsFromCurrentfolder = async () => { - - if(!hasMore) { - return fininshedResult; - } - - if(!hasStarted) { - hasMore = await firstFolder(); - hasStarted = true; - return ({ - result: { - ids: idsCurrentFolder(), - collectionKey - }, - done: false - }) - } - - hasMore = await getNextFolder(); - - return ({ - result: { - ids: hasMore ? idsCurrentFolder() : [], - collectionKey - }, - done: !hasMore - }); - }; - - return getIdsFromCurrentfolder; - - }; - - const ancestors = $(getFlattenedHierarchy(app.hierarchy), [ - fp.filter(isCollectionRecord), - fp.filter(n => isAncestor(recordNode)(n) - || n.nodeKey() === recordNode.nodeKey()), - fp.orderBy([n => n.nodeKey().length], ['asc']), - ]); // parents first - - const traverseForIteraterators = async (parentRecordKey = '', currentNodeIndex = 0) => { - const currentNode = ancestors[currentNodeIndex]; - const currentCollectionKey = joinKey( - parentRecordKey, - currentNode.collectionName, - ); - if (currentNode.nodeKey() === recordNode.nodeKey()) { - return [ - await getAllIdsIteratorForCollectionKey( - currentNode, - currentCollectionKey, - )]; - } - const allIterators = []; - const currentIterator = await getAllIdsIteratorForCollectionKey( - currentNode, - currentCollectionKey, - ); - - let ids = await currentIterator(); - while (ids.done === false) { - for (const id of ids.result.ids) { - allIterators.push( - await traverseForIteraterators( - joinKey(currentCollectionKey, id), - currentNodeIndex + 1, - ), - ); - } - - ids = await currentIterator(); - } - - return fp.flatten(allIterators); - }; - - const iteratorsArray = await traverseForIteraterators(); - let currentIteratorIndex = 0; - return async () => { - if (iteratorsArray.length === 0) { return { done: true, result: [] }; } - const innerResult = await iteratorsArray[currentIteratorIndex](); - if (!innerResult.done) { return innerResult; } - if (currentIteratorIndex == iteratorsArray.length - 1) { - return { done: true, result: innerResult.result }; - } - currentIteratorIndex++; - return { done: false, result: innerResult.result }; - }; - }; - - const getRecordInfo = (hierarchy, key) => { - const recordNode = getExactNodeForKey(hierarchy)(key); - const pathInfo = getRecordDirectory(recordNode, key); - const dir = joinKey(pathInfo.base, ...pathInfo.subdirs); - - return { - recordJson: recordJson(dir), - files: files(dir), - child:(name) => joinKey(dir, name), - key: safeKey(key), - recordNode, pathInfo, dir - }; - }; - - const getCollectionDir = (hierarchy, collectionKey) => { - const recordNode = getNodeForCollectionPath(hierarchy)(collectionKey); - const dummyRecordKey = joinKey(collectionKey, "1-abcd"); - const pathInfo = getRecordDirectory(recordNode, dummyRecordKey); - return pathInfo.base; - }; - - const recordJson = (dir) => - joinKey(dir, "record.json"); - - const files = (dir) => - joinKey(dir, "files"); - - const getRecordDirectory = (recordNode, key) => { - const id = getFileFromKey(key); - - const traverseParentKeys = (n, parents=[]) => { - if(isRoot(n)) return parents; - const k = getActualKeyOfParent(n.nodeKey(), key); - const thisNodeDir = { - node:n, - relativeDir: joinKey( - recordRelativeDirectory(n, getFileFromKey(k))) - }; - return traverseParentKeys( - n.parent(), - [thisNodeDir, ...parents]); - }; - - const parentDirs = $(recordNode.parent(), [ - traverseParentKeys, - fp.reduce((key, item) => { - return joinKey(key, item.node.collectionName, item.relativeDir) - }, keySep) - ]); - - const subdirs = isSingleRecord(recordNode) - ? [] - : recordRelativeDirectory(recordNode, id); - const base = isSingleRecord(recordNode) - ? joinKey(parentDirs, recordNode.name) - : joinKey(parentDirs, recordNode.collectionName); - - return ({ - subdirs, base - }); - }; - - const recordRelativeDirectory = (recordNode, id) => { - const folderStructure = folderStructureArray(recordNode); - const strippedId = id.substring(recordNode.nodeId.toString().length + 1); - const subfolders = $(folderStructure, [ - fp.reduce((result, currentCount) => { - result.folders.push( - folderForChar(strippedId[result.level], currentCount) - ); - return {level:result.level+1, folders:result.folders}; - }, {level:0, folders:[]}), - f => f.folders, - fp.filter(f => !!f) - ]); - - return [recordNode.nodeId.toString(), ...subfolders, id] - }; - - const folderForChar = (char, folderCount) => - folderCount === 1 ? "" - : $(folderCount, [ - idFoldersForFolderCount, - fp.find(f => f.includes(char)) - ]); - - const idFoldersForFolderCount = (folderCount) => { - const charRangePerShard = 64 / folderCount; - const idFolders = []; - let index = 0; - let currentIdsShard = ''; - while (index < 64) { - currentIdsShard += allIdChars[index]; - if ((index + 1) % charRangePerShard === 0) { - idFolders.push(currentIdsShard); - currentIdsShard = ''; - } - index++; - } - - return idFolders; - }; - - const load = app => async key => { - key = safeKey(key); - return apiWrapper( - app, - events.recordApi.load, - permission.readRecord.isAuthorized(key), - { key }, - _load, app, key, - ); - }; - - const _loadFromInfo = async (app, recordInfo, keyStack = []) => { - const key = recordInfo.key; - const {recordNode, recordJson} = recordInfo; - const storedData = await app.datastore.loadJson(recordJson); - - const loadedRecord = $(recordNode.fields, [ - fp.keyBy('name'), - fp.mapValues(f => safeParseField(f, storedData)), - ]); - - const newKeyStack = [...keyStack, key]; - - const references = $(recordNode.fields, [ - fp.filter(f => f.type === 'reference' - && isNonEmptyString(loadedRecord[f.name].key) - && !fp.includes(loadedRecord[f.name].key)(newKeyStack)), - fp.map(f => ({ - promise: _load(app, loadedRecord[f.name].key, newKeyStack), - index: getNode(app.hierarchy, f.typeOptions.indexNodeKey), - field: f, - })), - ]); - - if (references.length > 0) { - const refRecords = await Promise.all( - fp.map(p => p.promise)(references), - ); - - for (const ref of references) { - loadedRecord[ref.field.name] = mapRecord( - refRecords[references.indexOf(ref)], - ref.index, - ); - } - } - - loadedRecord.transactionId = storedData.transactionId; - loadedRecord.isNew = false; - loadedRecord.key = key; - loadedRecord.id = $(key, [splitKey, fp.last]); - loadedRecord.type = recordNode.name; - return loadedRecord; - }; - - const _load = async (app, key, keyStack = []) => - _loadFromInfo( - app, - getRecordInfo(app.hierarchy, key), - keyStack); - - // adapted from https://github.com/dex4er/js-promise-readable - // thanks :) - - const promiseReadableStream = stream => { - - let _errored; - - const _errorHandler = err => { - _errored = err; - }; - - stream.on("error", _errorHandler); - - const read = (size) => { - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err) - } - - if (!stream.readable || stream.closed || stream.destroyed) { - return resolve(); - } - - const readableHandler = () => { - const chunk = stream.read(size); - - if (chunk) { - removeListeners(); - resolve(chunk); - } - }; - - const closeHandler = () => { - removeListeners(); - resolve(); - }; - - const endHandler = () => { - removeListeners(); - resolve(); - }; - - const errorHandler = (err) => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const removeListeners = () => { - stream.removeListener("close", closeHandler); - stream.removeListener("error", errorHandler); - stream.removeListener("end", endHandler); - stream.removeListener("readable", readableHandler); - }; - - stream.on("close", closeHandler); - stream.on("end", endHandler); - stream.on("error", errorHandler); - stream.on("readable", readableHandler); - - readableHandler(); - }); - }; - - - const destroy = () => { - if (stream) { - if (_errorHandler) { - stream.removeListener("error", _errorHandler); - } - if (typeof stream.destroy === "function") { - stream.destroy(); - } - } - }; - - return {read, destroy, stream}; - }; - - const getIndexedDataKey = (indexNode, indexDir, record) => { - - const getShardName = (indexNode, record) => { - const shardNameFunc = compilerUtil.compileCode(indexNode.getShardName); - try { - return shardNameFunc({ record }); - } catch(e) { - const errorDetails = `shardCode: ${indexNode.getShardName} :: record: ${JSON.stringify(record)} :: `; - e.message = "Error running index shardname func: " + errorDetails + e.message; - throw e; - } - }; - - const shardName = isNonEmptyString(indexNode.getShardName) - ? `${getShardName(indexNode, record)}.csv` - : 'index.csv'; - - return joinKey(indexDir, shardName); - }; - - const getShardKeysInRange = async (app, indexNode, indexDir, startRecord = null, endRecord = null) => { - const startShardName = !startRecord - ? null - : shardNameFromKey( - getIndexedDataKey( - indexNode, - indexDir, - startRecord, - ), - ); - - const endShardName = !endRecord - ? null - : shardNameFromKey( - getIndexedDataKey( - indexNode, - indexDir, - endRecord, - ), - ); - - return $(await getShardMap(app.datastore, indexDir), [ - fp.filter(k => (startRecord === null || k >= startShardName) - && (endRecord === null || k <= endShardName)), - fp.map(k => joinKey(indexDir, `${k}.csv`)), - ]); - }; - - const ensureShardNameIsInShardMap = async (store, indexDir, indexedDataKey) => { - const map = await getShardMap(store, indexDir); - const shardName = shardNameFromKey(indexedDataKey); - if (!fp.includes(shardName)(map)) { - map.push(shardName); - await writeShardMap(store, indexDir, map); - } - }; - - const getShardMap = async (datastore, indexDir) => { - const shardMapKey = getShardMapKey(indexDir); - try { - return await datastore.loadJson(shardMapKey); - } catch (_) { - await datastore.createJson(shardMapKey, []); - return []; - } - }; - - const writeShardMap = async (datastore, indexDir, shardMap) => await datastore.updateJson( - getShardMapKey(indexDir), - shardMap, - ); - - const getShardMapKey = indexDir => joinKey(indexDir, 'shardMap.json'); - - const getUnshardedIndexDataKey = indexDir => joinKey(indexDir, 'index.csv'); - - const createIndexFile = async (datastore, indexedDataKey, index) => { - if (isShardedIndex(index)) { - const indexDir = getParentKey(indexedDataKey); - const shardMap = await getShardMap(datastore, indexDir); - shardMap.push( - shardNameFromKey(indexedDataKey), - ); - await writeShardMap(datastore, indexDir, shardMap); - } - await datastore.createFile(indexedDataKey, ''); - }; - - const shardNameFromKey = key => $(key, [ - splitKey, - fp.last, - ]).replace('.csv', ''); - - const getIndexKey_BasedOnDecendant = (decendantKey, indexNode) => { - if (isGlobalIndex(indexNode)) { return `${indexNode.nodeKey()}`; } - - const indexedDataParentKey = getActualKeyOfParent( - indexNode.parent().nodeKey(), - decendantKey, - ); - - return joinKey( - indexedDataParentKey, - indexNode.name, - ); - }; - - const generateSchema = (hierarchy, indexNode) => { - const recordNodes = getAllowedRecordNodesForIndex(hierarchy, indexNode); - const mappedRecords = $(recordNodes, [ - fp.map(n => mapRecord(createSampleRecord(n), indexNode)), - ]); - - // always has record key and sort key - const schema = { - sortKey: all$1.string, - key: all$1.string, - }; - - const fieldsHas = fp.has(schema); - const setField = (fieldName, value) => { - if (value === null || value === undefined) { return; } - - const thisType = detectType(value); - if (fieldsHas(fieldName)) { - if (schema[fieldName] !== thisType) { - schema[fieldName] = all$1.string; - } - } else { - schema[fieldName] = thisType; - } - }; - - for (const mappedRec of mappedRecords) { - for (const f in mappedRec) { - setField(f, mappedRec[f]); - } - } - - // returing an array of {name, type} - return $(schema, [ - fp.keys, - fp.map(k => ({ name: k, type: schema[k].name })), - fp.filter(s => s.name !== 'sortKey'), - fp.orderBy('name', ['desc']), // reverse aplha - fp.concat([{ name: 'sortKey', type: all$1.string.name }]), // sortKey on end - fp.reverse, // sortKey first, then rest are alphabetical - ]); - }; - - const createSampleRecord = recordNode => constructRecord( - recordNode, - getSampleFieldValue, - recordNode.parent().nodeKey(), - ); - - var global$1 = (typeof global !== "undefined" ? global : - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : {}); - - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - var inited = false; - function init () { - inited = true; - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; - } - - function toByteArray (b64) { - if (!inited) { - init(); - } - var i, j, l, tmp, placeHolders, arr; - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0; - - // base64 is 4/3 + up to two characters of the original data - arr = new Arr(len * 3 / 4 - placeHolders); - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len; - - var L = 0; - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]; - arr[L++] = (tmp >> 16) & 0xFF; - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[L++] = tmp & 0xFF; - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[L++] = (tmp >> 8) & 0xFF; - arr[L++] = tmp & 0xFF; - } - - return arr - } - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] - } - - function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]); - output.push(tripletToBase64(tmp)); - } - return output.join('') - } - - function fromByteArray (uint8) { - if (!inited) { - init(); - } - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var output = ''; - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - output += lookup[tmp >> 2]; - output += lookup[(tmp << 4) & 0x3F]; - output += '=='; - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]); - output += lookup[tmp >> 10]; - output += lookup[(tmp >> 4) & 0x3F]; - output += lookup[(tmp << 2) & 0x3F]; - output += '='; - } - - parts.push(output); - - return parts.join('') - } - - function read (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) - } - - function write (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; - } - - var toString = {}.toString; - - var isArray = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; - }; - - var INSPECT_MAX_BYTES = 50; - - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ - Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined - ? global$1.TYPED_ARRAY_SUPPORT - : true; - - function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff - } - - function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length); - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length); - } - that.length = length; - } - - return that - } - - /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) - } - - Buffer.poolSize = 8192; // not used by this implementation - - // TODO: Legacy, not needed anymore. Remove in next major version. - Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype; - return arr - }; - - function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) - } - - /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) - }; - - if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype; - Buffer.__proto__ = Uint8Array; - } - - function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } - } - - function alloc (that, size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) - } - - /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) - }; - - function allocUnsafe (that, size) { - assertSize(size); - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0; - } - } - return that - } - - /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) - }; - - function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0; - that = createBuffer(that, length); - - var actual = that.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual); - } - - return that - } - - function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0; - that = createBuffer(that, length); - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255; - } - return that - } - - function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength; // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array); - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset); - } else { - array = new Uint8Array(array, byteOffset, length); - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array; - that.__proto__ = Buffer.prototype; - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array); - } - return that - } - - function fromObject (that, obj) { - if (internalIsBuffer(obj)) { - var len = checked(obj.length) | 0; - that = createBuffer(that, len); - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len); - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') - } - - function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 - } - Buffer.isBuffer = isBuffer; - function internalIsBuffer (b) { - return !!(b != null && b._isBuffer) - } - - Buffer.compare = function compare (a, b) { - if (!internalIsBuffer(a) || !internalIsBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length; - var y = b.length; - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } - }; - - Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - var buffer = Buffer.allocUnsafe(length); - var pos = 0; - for (i = 0; i < list.length; ++i) { - var buf = list[i]; - if (!internalIsBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos); - pos += buf.length; - } - return buffer - }; - - function byteLength (string, encoding) { - if (internalIsBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string; - } - - var len = string.length; - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - - function slowToString (encoding, start, end) { - var loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } - } - - // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect - // Buffer instances. - Buffer.prototype._isBuffer = true; - - function swap (b, n, m) { - var i = b[n]; - b[n] = b[m]; - b[m] = i; - } - - Buffer.prototype.swap16 = function swap16 () { - var len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this - }; - - Buffer.prototype.swap32 = function swap32 () { - var len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this - }; - - Buffer.prototype.swap64 = function swap64 () { - var len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this - }; - - Buffer.prototype.toString = function toString () { - var length = this.length | 0; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) - }; - - Buffer.prototype.equals = function equals (b) { - if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 - }; - - Buffer.prototype.inspect = function inspect () { - var str = ''; - var max = INSPECT_MAX_BYTES; - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' '); - if (this.length > max) str += ' ... '; - } - return '' - }; - - Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!internalIsBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - var x = thisEnd - thisStart; - var y = end - start; - var len = Math.min(x, y); - - var thisCopy = this.slice(thisStart, thisEnd); - var targetCopy = target.slice(start, end); - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000; - } - byteOffset = +byteOffset; // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (internalIsBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') - } - - function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1; - var arrLength = arr.length; - var valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i; - if (dir) { - var foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - var found = true; - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 - } - - Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 - }; - - Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) - }; - - Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) - }; - - function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - var remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - // must be an even number of digits - var strLen = string.length; - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2; - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16); - if (isNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i - } - - function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) - } - - function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) - } - - function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) - } - - function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) - } - - function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) - } - - Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0; - if (isFinite(length)) { - length = length | 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - var loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - - Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } - }; - - function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return fromByteArray(buf) - } else { - return fromByteArray(buf.slice(start, end)) - } - } - - function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - var res = []; - - var i = start; - while (i < end) { - var firstByte = buf[i]; - var codePoint = null; - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) - } - - // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - var MAX_ARGUMENTS_LENGTH = 0x1000; - - function decodeCodePointsArray (codePoints) { - var len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = ''; - var i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res - } - - function asciiSlice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret - } - - function latin1Slice (buf, start, end) { - var ret = ''; - end = Math.min(buf.length, end); - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret - } - - function hexSlice (buf, start, end) { - var len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - var out = ''; - for (var i = start; i < end; ++i) { - out += toHex(buf[i]); - } - return out - } - - function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end); - var res = ''; - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res - } - - Buffer.prototype.slice = function slice (start, end) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - var newBuf; - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end); - newBuf.__proto__ = Buffer.prototype; - } else { - var sliceLen = end - start; - newBuf = new Buffer(sliceLen, undefined); - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start]; - } - } - - return newBuf - }; - - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') - } - - Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val - }; - - Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - var val = this[offset + --byteLength]; - var mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val - }; - - Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] - }; - - Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) - }; - - Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] - }; - - Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) - }; - - Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) - }; - - Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var val = this[offset]; - var mul = 1; - var i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - var i = byteLength; - var mul = 1; - var val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) - }; - - Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length); - var val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - }; - - Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) - }; - - Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, true, 23, 4) - }; - - Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length); - return read(this, offset, false, 23, 4) - }; - - Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, true, 52, 8) - }; - - Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length); - return read(this, offset, false, 52, 8) - }; - - function checkInt (buf, value, offset, ext, max, min) { - if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') - } - - Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var mul = 1; - var i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - byteLength = byteLength | 0; - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - var i = byteLength - 1; - var mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - this[offset] = (value & 0xff); - return offset + 1 - }; - - function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8; - } - } - - Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 - }; - - Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 - }; - - function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1; - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff; - } - } - - Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 - }; - - Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 - }; - - Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = 0; - var mul = 1; - var sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - var i = byteLength - 1; - var mul = 1; - var sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - } else { - objectWriteUInt16(this, value, offset, true); - } - return offset + 2 - }; - - Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - } else { - objectWriteUInt16(this, value, offset, false); - } - return offset + 2 - }; - - Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - } else { - objectWriteUInt32(this, value, offset, true); - } - return offset + 4 - }; - - Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset | 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); - if (value < 0) value = 0xffffffff + value + 1; - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - } else { - objectWriteUInt32(this, value, offset, false); - } - return offset + 4 - }; - - function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') - } - - function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 - } - - Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) - }; - - function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 - } - - Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) - }; - - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - var len = end - start; - var i; - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start]; - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start]; - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ); - } - - return len - }; - - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (val.length === 1) { - var code = val.charCodeAt(0); - if (code < 256) { - val = code; - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255; - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - var i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - var bytes = internalIsBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()); - var len = bytes.length; - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this - }; - - // HELPER FUNCTIONS - // ================ - - var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g; - - function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str - } - - function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') - } - - function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) - } - - function utf8ToBytes (string, units) { - units = units || Infinity; - var codePoint; - var length = string.length; - var leadSurrogate = null; - var bytes = []; - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes - } - - function asciiToBytes (str) { - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray - } - - function utf16leToBytes (str, units) { - var c, hi, lo; - var byteArray = []; - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray - } - - - function base64ToBytes (str) { - return toByteArray(base64clean(str)) - } - - function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i - } - - function isnan (val) { - return val !== val // eslint-disable-line no-self-compare - } - - - // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence - // The _isBuffer check is for Safari 5-7 support, because it's missing - // Object.prototype.constructor. Remove this eventually - function isBuffer(obj) { - return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj)) - } - - function isFastBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) - } - - // For Node v0.10 support. Remove this eventually. - function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0)) - } - - // Copyright Joyent, Inc. and other Node contributors. - var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - }; - - - function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } - } - - // StringDecoder provides an interface for efficiently splitting a series of - // buffers into a series of JS strings without breaking apart multi-byte - // characters. CESU-8 is handled as part of the UTF-8 encoding. - // - // @TODO Handling all encodings inside a single object makes it very difficult - // to reason about this code, so it should be split up in the future. - // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code - // points as used by CESU-8. - function StringDecoder(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; - } - - // write decodes the given buffer and returns it as JS string that is - // guaranteed to not contain any partial multi-byte characters. Any partial - // character found at the end of the buffer is buffered up, and will be - // returned when calling write again with the remaining bytes. - // - // Note: Converting a Buffer containing an orphan surrogate to a String - // currently works, but converting a String to a Buffer (via `new Buffer`, or - // Buffer#write) will replace incomplete surrogates with the unicode - // replacement character. See https://codereview.chromium.org/121173009/ . - StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; - }; - - // detectIncompleteChar determines if there is an incomplete UTF-8 character at - // the end of the given buffer. If so, it sets this.charLength to the byte - // length that character, and sets this.charReceived to the number of bytes - // that are available for this character. - StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; - }; - - StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; - }; - - function passThroughWrite(buffer) { - return buffer.toString(this.encoding); - } - - function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; - } - - function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; - } - - const BUFFER_MAX_BYTES = 524288; // 0.5Mb - - const CONTINUE_READING_RECORDS = "CONTINUE_READING"; - const READ_REMAINING_TEXT = "READ_REMAINING"; - const CANCEL_READ = "CANCEL"; - - const getIndexWriter = (hierarchy, indexNode, readableStream, writableStream, end) => { - const schema = generateSchema(hierarchy, indexNode); - - return ({ - read: read$1(readableStream, schema), - updateIndex: updateIndex(readableStream, writableStream, schema) - }); - }; - - const getIndexReader = (hierarchy, indexNode, readableStream) => - read$1( - readableStream, - generateSchema(hierarchy, indexNode) - ); - - const updateIndex = (readableStream, writableStream, schema) => async (itemsToWrite, keysToRemove) => { - const write = newOutputWriter(BUFFER_MAX_BYTES, writableStream); - const writtenItems = []; - await read$1(readableStream, schema)( - async indexedItem => { - const updated = fp.find(i => indexedItem.key === i.key)(itemsToWrite); - const removed = fp.find(k => indexedItem.key === k)(keysToRemove); - - if(isSomething(removed)) - return CONTINUE_READING_RECORDS; - - if(isSomething(updated)) { - const serializedItem = serializeItem(schema, updated); - await write(serializedItem); - writtenItems.push(updated); - } else { - await write( - serializeItem(schema, indexedItem) - ); - } - - return CONTINUE_READING_RECORDS; - - }, - async text => await write(text) - ); - - if(writtenItems.length !== itemsToWrite.length) { - const toAdd = fp.difference(itemsToWrite, writtenItems); - for(let added of toAdd) { - await write( - serializeItem(schema, added) - ); - } - } else if(writtenItems.length === 0) { - // potentially are no records - await write(""); - } - - await write(); - await writableStream.end(); - }; - - const read$1 = (readableStream, schema) => async (onGetItem, onGetText) => { - const readInput = newInputReader(readableStream); - let text = await readInput(); - let status = CONTINUE_READING_RECORDS; - while(text.length > 0) { - - if(status === READ_REMAINING_TEXT) { - await onGetText(text); - continue; - } - - if(status === CANCEL_READ) { - return; - } - - let rowText = ""; - let currentCharIndex=0; - for(let currentChar of text) { - rowText += currentChar; - if(currentChar === "\r") { - status = await onGetItem( - deserializeRow(schema, rowText) - ); - rowText = ""; - if(status === READ_REMAINING_TEXT) { - break; - } - } - currentCharIndex++; - } - - if(currentCharIndex < text.length -1) { - await onGetText(text.substring(currentCharIndex + 1)); - } - - text = await readInput(); - } - - await readableStream.destroy(); - - }; - - const newOutputWriter = (flushBoundary, writableStream) => { - - let currentBuffer = null; - - return async (text) => { - - if(fp.isString(text) && currentBuffer === null) - currentBuffer = safeBuffer.Buffer.from(text, "utf8"); - else if(fp.isString(text)) - currentBuffer = safeBuffer.Buffer.concat([ - currentBuffer, - safeBuffer.Buffer.from(text, "utf8") - ]); - - if(currentBuffer !== null && - (currentBuffer.length > flushBoundary - || !fp.isString(text))) { - - await writableStream.write(currentBuffer); - currentBuffer = null; - } - } - }; - - const newInputReader = (readableStream) => { - - const decoder = new StringDecoder('utf8'); - let remainingBytes = []; - - return async () => { - - let nextBytesBuffer = await readableStream.read(BUFFER_MAX_BYTES); - const remainingBuffer = safeBuffer.Buffer.from(remainingBytes); - - if(!nextBytesBuffer) nextBytesBuffer = safeBuffer.Buffer.from([]); - - const moreToRead = nextBytesBuffer.length === BUFFER_MAX_BYTES; - - const buffer = safeBuffer.Buffer.concat( - [remainingBuffer, nextBytesBuffer], - remainingBuffer.length + nextBytesBuffer.length); - - const text = decoder.write(buffer); - remainingBytes = decoder.end(buffer); - - if(!moreToRead && remainingBytes.length > 0) { - // if for any reason, we have remaining bytes at the end - // of the stream, just discard - dont see why this should - // ever happen, but if it does, it could cause a stack overflow - remainingBytes = []; - } - - return text; - }; - }; - - const deserializeRow = (schema, rowText) => { - let currentPropIndex = 0; - let currentCharIndex = 0; - let currentValueText = ""; - let isEscaped = false; - const item = {}; - - const setCurrentProp = () => { - const currentProp = schema[currentPropIndex]; - const type = getType(currentProp.type); - const value = currentValueText === "" - ? type.getDefaultValue() - : type.safeParseValue( - currentValueText); - item[currentProp.name] = value; - }; - - while(currentPropIndex < schema.length) { - - if(currentCharIndex < rowText.length) { - const currentChar = rowText[currentCharIndex]; - if(isEscaped) { - if(currentChar === "r") { - currentValueText += "\r"; - } else { - currentValueText += currentChar; - } - isEscaped = false; - } else { - if(currentChar === ",") { - setCurrentProp(); - currentValueText = ""; - currentPropIndex++; - } else if(currentChar === "\\") { - isEscaped = true; - } else { - currentValueText += currentChar; - } - } - currentCharIndex++; - } else { - currentValueText = ""; - setCurrentProp(); - currentPropIndex++; - } - } - - return item; - }; - - const serializeItem = (schema, item) => { - - let rowText = ""; - - for(let prop of schema) { - const type = getType(prop.type); - const value = fp.has(prop.name)(item) - ? item[prop.name] - : type.getDefaultValue(); - - const valStr = type.stringify(value); - - for(let i = 0; i < valStr.length; i++) { - const currentChar = valStr[i]; - if(currentChar === "," - || currentChar === "\r" - || currentChar === "\\") { - rowText += "\\"; - } - - if(currentChar === "\r") { - rowText += "r"; - } else { - rowText += currentChar; - } - } - - rowText += ","; - } - - rowText += "\r"; - return rowText; - }; - - const readIndex$1 = async (hierarchy, datastore, index, indexedDataKey) => { - const records = []; - const doRead = iterateIndex( - async item => { - records.push(item); - return CONTINUE_READING_RECORDS; - }, - async () => records - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); - }; - - const searchIndex = async (hierarchy, datastore, index, indexedDataKey, searchPhrase) => { - const records = []; - const schema = generateSchema(hierarchy, index); - const doRead = iterateIndex( - async item => { - const idx = lunr(function () { - this.ref('key'); - for (const field of schema) { - this.field(field.name); - } - this.add(item); - }); - const searchResults = idx.search(searchPhrase); - if (searchResults.length === 1) { - item._searchResult = searchResults[0]; - records.push(item); - } - return CONTINUE_READING_RECORDS; - }, - async () => records - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); - }; - - const iterateIndex = (onGetItem, getFinalResult) => async (hierarchy, datastore, index, indexedDataKey) => { - try { - const readableStream = promiseReadableStream( - await datastore.readableFileStream(indexedDataKey) - ); - - const read = getIndexReader(hierarchy, index, readableStream); - await read(onGetItem); - return getFinalResult(); - } catch (e) { - if (await datastore.exists(indexedDataKey)) { - throw e; - } else { - await createIndexFile( - datastore, - indexedDataKey, - index, - ); - } - return []; - } - }; - - const getIndexDir = (hierarchy, indexKey) => { - - const parentKey = getParentKey(indexKey); - - if(parentKey === "") return indexKey; - if(parentKey === keySep) return indexKey; - - const recordInfo = getRecordInfo( - hierarchy, - parentKey); - - return recordInfo.child( - getLastPartInKey(indexKey)); - }; - - const listItems = app => async (indexKey, options) => { - indexKey = safeKey(indexKey); - return apiWrapper( - app, - events.indexApi.listItems, - permission.readIndex.isAuthorized(indexKey), - { indexKey, options }, - _listItems, app, indexKey, options, - ); - }; - - const defaultOptions = { rangeStartParams: null, rangeEndParams: null, searchPhrase: null }; - - const _listItems = async (app, indexKey, options = defaultOptions) => { - const { searchPhrase, rangeStartParams, rangeEndParams } = $({}, [ - fp.merge(options), - fp.merge(defaultOptions), - ]); - - const getItems = async indexedDataKey => (isNonEmptyString(searchPhrase) - ? await searchIndex( - app.hierarchy, - app.datastore, - indexNode, - indexedDataKey, - searchPhrase, - ) - : await readIndex$1( - app.hierarchy, - app.datastore, - indexNode, - indexedDataKey, - )); - - indexKey = safeKey(indexKey); - const indexNode = getExactNodeForKey(app.hierarchy)(indexKey); - const indexDir = getIndexDir(app.hierarchy, indexKey); - - if (!isIndex(indexNode)) { throw new Error('supplied key is not an index'); } - - if (isShardedIndex(indexNode)) { - const shardKeys = await getShardKeysInRange( - app, indexNode, indexDir, rangeStartParams, rangeEndParams, - ); - const items = []; - for (const k of shardKeys) { - items.push(await getItems(k)); - } - return fp.flatten(items); - } - return await getItems( - getUnshardedIndexDataKey(indexDir), - ); - }; - - const getContext = app => recordKey => { - recordKey = safeKey(recordKey); - return apiWrapperSync( - app, - events.recordApi.getContext, - permission.readRecord.isAuthorized(recordKey), - { recordKey }, - _getContext, app, recordKey, - ); - }; - - const _getContext = (app, recordKey) => { - recordKey = safeKey(recordKey); - const recordNode = getExactNodeForKey(app.hierarchy)(recordKey); - - const cachedReferenceIndexes = {}; - - const lazyLoadReferenceIndex = async (typeOptions) => { - if (!fp.has(typeOptions.indexNodeKey)(cachedReferenceIndexes)) { - cachedReferenceIndexes[typeOptions.indexNodeKey] = { - typeOptions, - data: await readReferenceIndex( - app, recordKey, typeOptions, - ), - }; - } - - return cachedReferenceIndexes[typeOptions.indexNodeKey]; - }; - - const getTypeOptions = typeOptions_or_fieldName => (fp.isString(typeOptions_or_fieldName) - ? findField(recordNode, typeOptions_or_fieldName) - .typeOptions - : typeOptions_or_fieldName); - - return { - referenceExists: async (typeOptions_or_fieldName, key) => { - const typeOptions = getTypeOptions(typeOptions_or_fieldName); - const { data } = await lazyLoadReferenceIndex(typeOptions); - return fp.some(i => i.key === key)(data); - }, - referenceOptions: async (typeOptions_or_fieldName) => { - const typeOptions = getTypeOptions(typeOptions_or_fieldName); - const { data } = await lazyLoadReferenceIndex(typeOptions); - return data; - }, - recordNode, - }; - }; - - const readReferenceIndex = async (app, recordKey, typeOptions) => { - const indexNode = getNode(app.hierarchy, typeOptions.indexNodeKey); - const indexKey = isGlobalIndex(indexNode) - ? indexNode.nodeKey() - : getIndexKey_BasedOnDecendant( - recordKey, indexNode, - ); - - const items = await listItems(app)(indexKey); - return $(items, [ - fp.map(i => ({ - key: i.key, - value: i[typeOptions.displayValue], - })), - ]); - }; - - const fieldParseError = (fieldName, value) => ({ - fields: [fieldName], - message: `Could not parse field ${fieldName}:${value}`, - }); - - const validateAllFieldParse = (record, recordNode) => $(recordNode.fields, [ - fp.map(f => ({ name: f.name, parseResult: validateFieldParse(f, record) })), - fp.reduce((errors, f) => { - if (f.parseResult.success) return errors; - errors.push( - fieldParseError(f.name, f.parseResult.value), - ); - return errors; - }, []), - ]); - - const validateAllTypeConstraints = async (record, recordNode, context) => { - const errors = []; - for (const field of recordNode.fields) { - $(await validateTypeConstraints$1(field, record, context), [ - fp.filter(isNonEmptyString), - fp.map(m => ({ message: m, fields: [field.name] })), - fp.each(e => errors.push(e)), - ]); - } - return errors; - }; - - const runRecordValidationRules = (record, recordNode) => { - const runValidationRule = (rule) => { - const isValid = compilerUtil.compileExpression(rule.expressionWhenValid); - const expressionContext = { record, _: ___default }; - return (isValid(expressionContext) - ? { valid: true } - : ({ - valid: false, - fields: rule.invalidFields, - message: rule.messageWhenInvalid, - })); - }; - - return $(recordNode.validationRules, [ - fp.map(runValidationRule), - fp.flatten, - fp.filter(r => r.valid === false), - fp.map(r => ({ fields: r.fields, message: r.message })), - ]); - }; - - const validate = app => async (record, context) => { - context = isNothing(context) - ? _getContext(app, record.key) - : context; - - const recordNode = getExactNodeForKey(app.hierarchy)(record.key); - const fieldParseFails = validateAllFieldParse(record, recordNode); - - // non parsing would cause further issues - exit here - if (!fp.isEmpty(fieldParseFails)) { return ({ isValid: false, errors: fieldParseFails }); } - - const recordValidationRuleFails = runRecordValidationRules(record, recordNode); - const typeContraintFails = await validateAllTypeConstraints(record, recordNode, context); - - if (fp.isEmpty(fieldParseFails) - && fp.isEmpty(recordValidationRuleFails) - && fp.isEmpty(typeContraintFails)) { - return ({ isValid: true, errors: [] }); - } - - return ({ - isValid: false, - errors: ___default.union(fieldParseFails, typeContraintFails, recordValidationRuleFails), - }); - }; - - const ensureCollectionIsInitialised = async (datastore, node, dir) => { - if (!await datastore.exists(dir)) { - await datastore.createFolder(dir); - await datastore.createFolder(joinKey(dir, node.nodeId)); - } - }; - - const initialiseRootCollections = async (datastore, hierarchy) => { - const rootCollectionRecord = allTrue( - n => isRoot(n.parent()), - isCollectionRecord, - ); - - const flathierarchy = getFlattenedHierarchy(hierarchy); - - const collectionRecords = $(flathierarchy, [ - fp.filter(rootCollectionRecord), - ]); - - for (const col of collectionRecords) { - await ensureCollectionIsInitialised( - datastore, - col, - col.collectionPathRegx() - ); - } - }; - - const initialiseChildCollections = async (app, recordInfo) => { - const childCollectionRecords = $(recordInfo.recordNode, [ - n => n.children, - fp.filter(isCollectionRecord), - ]); - - for (const child of childCollectionRecords) { - await ensureCollectionIsInitialised( - app.datastore, - child, - recordInfo.child(child.collectionName), - ); - } - }; - - const TRANSACTIONS_FOLDER = `${keySep}.transactions`; - const LOCK_FILENAME = 'lock'; - const LOCK_FILE_KEY = joinKey( - TRANSACTIONS_FOLDER, LOCK_FILENAME, - ); - const idSep = '$'; - - const isOfType = typ => trans => trans.transactionType === typ; - - const CREATE_RECORD_TRANSACTION = 'create'; - const UPDATE_RECORD_TRANSACTION = 'update'; - const DELETE_RECORD_TRANSACTION = 'delete'; - const BUILD_INDEX_TRANSACTION = 'build'; - - const isUpdate = isOfType(UPDATE_RECORD_TRANSACTION); - const isDelete = isOfType(DELETE_RECORD_TRANSACTION); - const isCreate = isOfType(CREATE_RECORD_TRANSACTION); - const isBuildIndex = isOfType(BUILD_INDEX_TRANSACTION); - - const keyToFolderName = nodeKey => getHashCode(nodeKey); - - const getTransactionId = (recordId, transactionType, uniqueId) => - `${recordId}${idSep}${transactionType}${idSep}${uniqueId}`; - - const buildIndexFolder = '.BUILD-'; - const nodeKeyHashFromBuildFolder = folder => folder.replace(buildIndexFolder, ''); - - const isBuildIndexFolder = key => getLastPartInKey(key).startsWith(buildIndexFolder); - - const IndexNodeKeyFolder = indexNodeKey => joinKey( - TRANSACTIONS_FOLDER, - buildIndexFolder + keyToFolderName(indexNodeKey), - ); - - const IndexNodeKeyBatchFolder = (indexNodeKey, count) => - joinKey(IndexNodeKeyFolder(indexNodeKey), Math.floor(count / BUILDINDEX_BATCH_COUNT).toString()); - - const BUILDINDEX_BATCH_COUNT = 1000; - const timeoutMilliseconds = 30 * 1000; // 30 secs - const maxLockRetries = 1; - - const transactionForCreateRecord = async (app, record) => await transaction( - app.datastore, CREATE_RECORD_TRANSACTION, - record.key, { record }, - getTransactionKey_Records, - ); - - const transactionForUpdateRecord = async (app, oldRecord, newRecord) => await transaction( - app.datastore, UPDATE_RECORD_TRANSACTION, - newRecord.key, { oldRecord, record: newRecord }, - getTransactionKey_Records, - ); - - const transactionForDeleteRecord = async (app, record) => await transaction( - app.datastore, DELETE_RECORD_TRANSACTION, - record.key, { record }, - getTransactionKey_Records, - ); - - const transactionForBuildIndex = async (app, indexNodeKey, recordKey, count) => { - const transactionFolder = IndexNodeKeyBatchFolder(indexNodeKey, count); - if (count % BUILDINDEX_BATCH_COUNT === 0) { - await app.datastore.createFolder(transactionFolder); - } - - return await transaction( - app.datastore, BUILD_INDEX_TRANSACTION, - recordKey, { recordKey }, - id => joinKey(transactionFolder, id), - ); - }; - - const createBuildIndexFolder = async (datastore, indexNodeKey) => await datastore.createFolder( - IndexNodeKeyFolder(indexNodeKey), - ); - - const getTransactionKey_Records = id => joinKey(TRANSACTIONS_FOLDER, id); - - const transaction = async (datastore, transactionType, recordKey, data, getTransactionKey) => { - const recordId = getLastPartInKey(recordKey); - const uniqueId = shortid.generate(); - const id = getTransactionId( - recordId, transactionType, uniqueId, - ); - - const key = getTransactionKey(id); - - const trans = { - transactionType, - recordKey, - ...data, - id, - }; - - await datastore.createJson( - key, trans, - ); - - return trans; - }; - - const initialiseIndex = async (datastore, dir, index) => { - const indexDir = joinKey(dir, index.name); - - await datastore.createFolder(indexDir); - - if (isShardedIndex(index)) { - await datastore.createFile( - getShardMapKey(indexDir), - '[]', - ); - } else { - await createIndexFile( - datastore, - getUnshardedIndexDataKey(indexDir), - index, - ); - } - }; - - const save = app => async (record, context) => apiWrapper( - app, - events.recordApi.save, - record.isNew - ? permission.createRecord.isAuthorized(record.key) - : permission.updateRecord.isAuthorized(record.key), { record }, - _save, app, record, context, false, - ); - - - const _save = async (app, record, context, skipValidation = false) => { - const recordClone = fp.cloneDeep(record); - if (!skipValidation) { - const validationResult = await validate(app)(recordClone, context); - if (!validationResult.isValid) { - await app.publish(events.recordApi.save.onInvalid, { record, validationResult }); - throw new BadRequestError(`Save : Record Invalid : ${ - JSON.stringify(validationResult.errors)}`); - } - } - - const recordInfo = getRecordInfo(app.hierarchy, record.key); - const { - recordNode, pathInfo, - recordJson, files, - } = recordInfo; - - if (recordClone.isNew) { - - if(!recordNode) - throw new Error("Cannot find node for " + record.key); - - const transaction = await transactionForCreateRecord( - app, recordClone, - ); - recordClone.transactionId = transaction.id; - await createRecordFolderPath(app.datastore, pathInfo); - await app.datastore.createFolder(files); - await app.datastore.createJson(recordJson, recordClone); - await initialiseReverseReferenceIndexes(app, recordInfo); - await initialiseAncestorIndexes(app, recordInfo); - await initialiseChildCollections(app, recordInfo); - await app.publish(events.recordApi.save.onRecordCreated, { - record: recordClone, - }); - } else { - const oldRecord = await _loadFromInfo(app, recordInfo); - const transaction = await transactionForUpdateRecord( - app, oldRecord, recordClone, - ); - recordClone.transactionId = transaction.id; - await app.datastore.updateJson( - recordJson, - recordClone, - ); - await app.publish(events.recordApi.save.onRecordUpdated, { - old: oldRecord, - new: recordClone, - }); - } - - await app.cleanupTransactions(); - - const returnedClone = fp.cloneDeep(recordClone); - returnedClone.isNew = false; - return returnedClone; - }; - - const initialiseAncestorIndexes = async (app, recordInfo) => { - for (const index of recordInfo.recordNode.indexes) { - const indexKey = recordInfo.child(index.name); - if (!await app.datastore.exists(indexKey)) { - await initialiseIndex(app.datastore, recordInfo.dir, index); - } - } - }; - - const initialiseReverseReferenceIndexes = async (app, recordInfo) => { - - const indexNodes = $(fieldsThatReferenceThisRecord(app, recordInfo.recordNode), [ - fp.map(f => $(f.typeOptions.reverseIndexNodeKeys, [ - fp.map(n => getNode( - app.hierarchy, - n, - )), - ])), - fp.flatten, - ]); - - for (const indexNode of indexNodes) { - await initialiseIndex( - app.datastore, recordInfo.dir, indexNode, - ); - } - }; - - const fieldsThatReferenceThisRecord = (app, recordNode) => $(app.hierarchy, [ - getFlattenedHierarchy, - fp.filter(isRecord), - fp.map(n => n.fields), - fp.flatten, - fp.filter(fieldReversesReferenceToNode(recordNode)), - ]); - - const createRecordFolderPath = async (datastore, pathInfo) => { - - const recursiveCreateFolder = async (subdirs, dirsThatNeedCreated=undefined) => { - - // iterate backwards through directory hierachy - // until we get to a folder that exists, then create the rest - // e.g - // - some/folder/here - // - some/folder - // - some - const thisFolder = joinKey(pathInfo.base, ...subdirs); - - if(await datastore.exists(thisFolder)) { - - let creationFolder = thisFolder; - for(let nextDir of (dirsThatNeedCreated || []) ) { - creationFolder = joinKey(creationFolder, nextDir); - await datastore.createFolder(creationFolder); - } - - } else if(!dirsThatNeedCreated || dirsThatNeedCreated.length > 0) { - - dirsThatNeedCreated = !dirsThatNeedCreated - ? [] - :dirsThatNeedCreated; - - await recursiveCreateFolder( - fp.take(subdirs.length - 1)(subdirs), - [...fp.takeRight(1)(subdirs), ...dirsThatNeedCreated] - ); - } - }; - - await recursiveCreateFolder(pathInfo.subdirs); - - return joinKey(pathInfo.base, ...pathInfo.subdirs); - - }; - - const deleteCollection = (app, disableCleanup = false) => async key => apiWrapper( - app, - events.collectionApi.delete, - permission.manageCollection.isAuthorized, - { key }, - _deleteCollection, app, key, disableCleanup, - ); - - /* - const recordNode = getCollectionNode(app.hierarchy, key); - - */ - - const _deleteCollection = async (app, key, disableCleanup) => { - key = safeKey(key); - const collectionDir = getCollectionDir(app.hierarchy, key); - await deleteRecords(app, key); - await deleteCollectionFolder(app, collectionDir); - if (!disableCleanup) { await app.cleanupTransactions(); } - }; - - const deleteCollectionFolder = async (app, dir) => - await app.datastore.deleteFolder(dir); - - const deleteRecords = async (app, key) => { - - const iterate = await getAllIdsIterator(app)(key); - - let ids = await iterate(); - while (!ids.done) { - if (ids.result.collectionKey === key) { - for (const id of ids.result.ids) { - await _deleteRecord( - app, - joinKey(key, id), - true, - ); - } - } - - ids = await iterate(); - } - }; - - const deleteRecord$1 = (app, disableCleanup = false) => async key => { - key = safeKey(key); - return apiWrapper( - app, - events.recordApi.delete, - permission.deleteRecord.isAuthorized(key), - { key }, - _deleteRecord, app, key, disableCleanup, - ); - }; - - // called deleteRecord because delete is a keyword - const _deleteRecord = async (app, key, disableCleanup) => { - const recordInfo = getRecordInfo(app.hierarchy, key); - key = recordInfo.key; - const node = getExactNodeForKey(app.hierarchy)(key); - - const record = await _load(app, key); - await transactionForDeleteRecord(app, record); - - for (const collectionRecord of node.children) { - const collectionKey = joinKey( - key, collectionRecord.collectionName, - ); - await _deleteCollection(app, collectionKey, true); - } - - await app.datastore.deleteFolder(recordInfo.dir); - - if (!disableCleanup) { await app.cleanupTransactions(); } - }; - - const uploadFile = app => async (recordKey, readableStream, relativeFilePath) => apiWrapper( - app, - events.recordApi.uploadFile, - permission.updateRecord.isAuthorized(recordKey), - { recordKey, readableStream, relativeFilePath }, - _uploadFile, app, recordKey, readableStream, relativeFilePath, - ); - - const _uploadFile = async (app, recordKey, readableStream, relativeFilePath) => { - if (isNothing(recordKey)) { throw new BadRequestError('Record Key not supplied'); } - if (isNothing(relativeFilePath)) { throw new BadRequestError('file path not supplied'); } - if (!isLegalFilename(relativeFilePath)) { throw new BadRequestError('Illegal filename'); } - - const recordInfo = getRecordInfo(app.hierarchy, recordKey); - const record = await _loadFromInfo(app, recordInfo); - - const fullFilePath = safeGetFullFilePath( - recordInfo.dir, relativeFilePath, - ); - - const tempFilePath = `${fullFilePath}_${shortid.generate()}.temp`; - - const outputStream = await app.datastore.writableFileStream( - tempFilePath, - ); - - return new Promise((resolve,reject) => { - readableStream.pipe(outputStream); - outputStream.on('error', reject); - outputStream.on('finish', resolve); - }) - .then(() => app.datastore.getFileSize(tempFilePath)) - .then(size => { - const isExpectedFileSize = checkFileSizeAgainstFields( - app, record, relativeFilePath, size - ); - if (!isExpectedFileSize) { throw new BadRequestError(`Fields for ${relativeFilePath} do not have expected size: ${join(',')(incorrectFields)}`); } - - }) - .then(() => tryAwaitOrIgnore(app.datastore.deleteFile, fullFilePath)) - .then(() => app.datastore.renameFile(tempFilePath, fullFilePath)); - - }; - - const checkFileSizeAgainstFields = (app, record, relativeFilePath, expectedSize) => { - const recordNode = getExactNodeForKey(app.hierarchy)(record.key); - - const incorrectFileFields = $(recordNode.fields, [ - fp.filter(f => f.type === 'file' - && record[f.name].relativePath === relativeFilePath - && record[f.name].size !== expectedSize), - fp.map(f => f.name), - ]); - - const incorrectFileArrayFields = $(recordNode.fields, [ - fp.filter(a => a.type === 'array' - && $(record[a.name], [ - fp.some(f => record[f.name].relativePath === relativeFilePath - && record[f.name].size !== expectedSize), - ])), - fp.map(f => f.name), - ]); - - const incorrectFields = [ - ...incorrectFileFields, - ...incorrectFileArrayFields, - ]; - - if (incorrectFields.length > 0) { - return false; - } - - return true; - }; - - const safeGetFullFilePath = (recordDir, relativeFilePath) => { - const naughtyUser = () => { throw new ForbiddenError('naughty naughty'); }; - - if (relativeFilePath.startsWith('..')) naughtyUser(); - - const pathParts = splitKey(relativeFilePath); - - if (fp.includes('..')(pathParts)) naughtyUser(); - - const recordKeyParts = splitKey(recordDir); - - const fullPathParts = [ - ...recordKeyParts, - 'files', - ...fp.filter(p => p !== '.')(pathParts), - ]; - - return joinKey(fullPathParts); - }; - - const downloadFile = app => async (recordKey, relativePath) => apiWrapper( - app, - events.recordApi.uploadFile, - permission.readRecord.isAuthorized(recordKey), - { recordKey, relativePath },//remove dupe key 'recordKey' from object - _downloadFile, app, recordKey, relativePath, - ); - - - const _downloadFile = async (app, recordKey, relativePath) => { - if (isNothing(recordKey)) { throw new BadRequestError('Record Key not supplied'); } - if (isNothing(relativePath)) { throw new BadRequestError('file path not supplied'); } - - const {dir} = getRecordInfo(app.hierarchy, recordKey); - return await app.datastore.readableFileStream( - safeGetFullFilePath( - dir, relativePath, - ), - ); - }; - - const customId = app => (nodeName, id) => { - const node = $(app.hierarchy, [ - getFlattenedHierarchy, - fp.find(n => n.name === nodeName), - ]); - - if (!node) throw new NotFoundError(`Cannot find node ${nodeName}`); - - return `${node.nodeId}-${id}`; - }; - - const setCustomId = app => (record, id) => { - record.id = customId(app)(record.type, id); - - const keyParts = splitKey(record.key); - - record.key = $(keyParts, [ - fp.take(keyParts.length - 1), - fp.union([record.id]), - joinKey, - ]); - - return record; - }; - - const api = app => ({ - getNew: getNew(app), - getNewChild: getNewChild(app), - save: save(app), - load: load(app), - delete: deleteRecord$1(app, false), - validate: validate(app), - getContext: getContext(app), - uploadFile: uploadFile(app), - downloadFile: downloadFile(app), - customId: customId(app), - setCustomId: setCustomId(app), - }); - - - const getRecordApi = app => api(app); - - const getAllowedRecordTypes = app => key => apiWrapperSync( - app, - events.collectionApi.getAllowedRecordTypes, - alwaysAuthorized, - { key }, - _getAllowedRecordTypes, app, key, - ); - - const _getAllowedRecordTypes = (app, key) => { - key = safeKey(key); - const node = getNodeForCollectionPath(app.hierarchy)(key); - return isNothing(node) ? [] : [node.name]; - }; - - const getCollectionApi = app => ({ - getAllowedRecordTypes: getAllowedRecordTypes(app), - getAllIdsIterator: getAllIdsIterator(app), - delete: deleteCollection(app), - }); - - /** rebuilds an index - * @param {object} app - the application container - * @param {string} indexNodeKey - node key of the index, which the index belongs to - */ - const buildIndex = app => async indexNodeKey => apiWrapper( - app, - events.indexApi.buildIndex, - permission.manageIndex.isAuthorized, - { indexNodeKey }, - _buildIndex, app, indexNodeKey, - ); - - const _buildIndex = async (app, indexNodeKey) => { - const indexNode = getNode(app.hierarchy, indexNodeKey); - - await createBuildIndexFolder(app.datastore, indexNodeKey); - - if (!isIndex(indexNode)) { throw new BadRequestError('BuildIndex: must supply an indexnode'); } - - if (indexNode.indexType === 'reference') { - await buildReverseReferenceIndex( - app, indexNode, - ); - } else { - await buildHeirarchalIndex( - app, indexNode, - ); - } - - await app.cleanupTransactions(); - }; - - const buildReverseReferenceIndex = async (app, indexNode) => { - // Iterate through all referencING records, - // and update referenced index for each record - let recordCount = 0; - const referencingNodes = $(app.hierarchy, [ - getFlattenedHierarchy, - fp.filter(n => isRecord(n) - && fp.some(fieldReversesReferenceToIndex(indexNode))(n.fields)), - ]); - - const createTransactionsForReferencingNode = async (referencingNode) => { - const iterateReferencingNodes = await getAllIdsIterator(app)(referencingNode.collectionNodeKey()); - - let referencingIdIterator = await iterateReferencingNodes(); - while (!referencingIdIterator.done) { - const { result } = referencingIdIterator; - for (const id of result.ids) { - const recordKey = joinKey(result.collectionKey, id); - await transactionForBuildIndex(app, indexNode.nodeKey(), recordKey, recordCount); - recordCount++; - } - referencingIdIterator = await iterateReferencingNodes(); - } - }; - - for (const referencingNode of referencingNodes) { - await createTransactionsForReferencingNode(referencingNode); - } - }; - - /* - const getAllowedParentCollectionNodes = (hierarchy, indexNode) => $(getAllowedRecordNodesForIndex(hierarchy, indexNode), [ - map(n => n.parent()), - ]); - */ - - const buildHeirarchalIndex = async (app, indexNode) => { - let recordCount = 0; - - const createTransactionsForIds = async (collectionKey, ids) => { - for (const recordId of ids) { - const recordKey = joinKey(collectionKey, recordId); - - const recordNode = getRecordNodeById( - app.hierarchy, - recordId, - ); - - if (recordNodeApplies(indexNode)(recordNode)) { - await transactionForBuildIndex( - app, indexNode.nodeKey(), - recordKey, recordCount, - ); - recordCount++; - } - } - }; - - - const collectionRecords = getAllowedRecordNodesForIndex(app.hierarchy, indexNode); - - for (const targetCollectionRecordNode of collectionRecords) { - const allIdsIterator = await getAllIdsIterator(app)(targetCollectionRecordNode.collectionNodeKey()); - - let allIds = await allIdsIterator(); - while (allIds.done === false) { - await createTransactionsForIds( - allIds.result.collectionKey, - allIds.result.ids, - ); - allIds = await allIdsIterator(); - } - } - - return recordCount; - }; - - // const chooseChildRecordNodeByKey = (collectionNode, recordId) => find(c => recordId.startsWith(c.nodeId))(collectionNode.children); - - const recordNodeApplies = indexNode => recordNode => fp.includes(recordNode.nodeId)(indexNode.allowedRecordNodeIds); - - const aggregates = app => async (indexKey, rangeStartParams = null, rangeEndParams = null) => apiWrapper( - app, - events.indexApi.aggregates, - permission.readIndex.isAuthorized(indexKey), - { indexKey, rangeStartParams, rangeEndParams }, - _aggregates, app, indexKey, rangeStartParams, rangeEndParams, - ); - - const _aggregates = async (app, indexKey, rangeStartParams, rangeEndParams) => { - indexKey = safeKey(indexKey); - const indexNode = getExactNodeForKey(app.hierarchy)(indexKey); - const indexDir = getIndexDir(app.hierarchy, indexKey); - - if (!isIndex(indexNode)) { throw new BadRequestError('supplied key is not an index'); } - - if (isShardedIndex(indexNode)) { - const shardKeys = await getShardKeysInRange( - app, indexNode, indexDir, rangeStartParams, rangeEndParams, - ); - let aggregateResult = null; - for (const k of shardKeys) { - const shardResult = await getAggregates(app.hierarchy, app.datastore, indexNode, k); - if (aggregateResult === null) { - aggregateResult = shardResult; - } else { - aggregateResult = mergeShardAggregate( - aggregateResult, - shardResult, - ); - } - } - return aggregateResult; - } - return await getAggregates( - app.hierarchy, - app.datastore, - indexNode, - getUnshardedIndexDataKey(indexDir), - ); - }; - - const mergeShardAggregate = (totals, shard) => { - const mergeGrouping = (tot, shr) => { - tot.count += shr.count; - for (const aggName in tot) { - if (aggName === 'count') continue; - const totagg = tot[aggName]; - const shragg = shr[aggName]; - totagg.sum += shragg.sum; - totagg.max = totagg.max > shragg.max - ? totagg.max - : shragg.max; - totagg.min = totagg.min < shragg.min - ? totagg.min - : shragg.min; - totagg.mean = totagg.sum / tot.count; - } - return tot; - }; - - for (const aggGroupDef in totals) { - for (const grouping in shard[aggGroupDef]) { - const groupingTotal = totals[aggGroupDef][grouping]; - totals[aggGroupDef][grouping] = fp.isUndefined(groupingTotal) - ? shard[aggGroupDef][grouping] - : mergeGrouping( - totals[aggGroupDef][grouping], - shard[aggGroupDef][grouping], - ); - } - } - - return totals; - }; - - const getAggregates = async (hierarchy, datastore, index, indexedDataKey) => { - const aggregateResult = {}; - const doRead = iterateIndex( - async item => { - applyItemToAggregateResult( - index, aggregateResult, item, - ); - return CONTINUE_READING_RECORDS; - }, - async () => aggregateResult - ); - - return await doRead(hierarchy, datastore, index, indexedDataKey); - }; - - - const applyItemToAggregateResult = (indexNode, result, item) => { - const getInitialAggregateResult = () => ({ - sum: 0, mean: null, max: null, min: null, - }); - - const applyAggregateResult = (agg, existing, count) => { - const value = compilerUtil.compileCode(agg.aggregatedValue)({ record: item }); - - if (!fp.isNumber(value)) return existing; - - existing.sum += value; - existing.max = value > existing.max || existing.max === null - ? value - : existing.max; - existing.min = value < existing.min || existing.min === null - ? value - : existing.min; - existing.mean = existing.sum / count; - return existing; - }; - - for (const aggGroup of indexNode.aggregateGroups) { - if (!fp.has(aggGroup.name)(result)) { - result[aggGroup.name] = {}; - } - - const thisGroupResult = result[aggGroup.name]; - - if (isNonEmptyString(aggGroup.condition)) { - if (!compilerUtil.compileExpression(aggGroup.condition)({ record: item })) { - continue; - } - } - - let group = isNonEmptyString(aggGroup.groupBy) - ? compilerUtil.compileCode(aggGroup.groupBy)({ record: item }) - : 'all'; - if (!isNonEmptyString(group)) { - group = '(none)'; - } - - if (!fp.has(group)(thisGroupResult)) { - thisGroupResult[group] = { count: 0 }; - for (const agg of aggGroup.aggregates) { - thisGroupResult[group][agg.name] = getInitialAggregateResult(); - } - } - - thisGroupResult[group].count++; - - for (const agg of aggGroup.aggregates) { - const existingValues = thisGroupResult[group][agg.name]; - thisGroupResult[group][agg.name] = applyAggregateResult( - agg, existingValues, - thisGroupResult[group].count, - ); - } - } - }; - - const getIndexApi = app => ({ - listItems: listItems(app), - buildIndex: buildIndex(app), - aggregates: aggregates(app), - }); - - const createNodeErrors = { - indexCannotBeParent: 'Index template cannot be a parent', - allNonRootNodesMustHaveParent: 'Only the root node may have no parent', - indexParentMustBeRecordOrRoot: 'An index may only have a record or root as a parent', - aggregateParentMustBeAnIndex: 'aggregateGroup parent must be an index', - }; - - const pathRegxMaker = node => () => node.nodeKey().replace(/{id}/g, '[a-zA-Z0-9_-]+'); - - const nodeKeyMaker = node => () => switchCase( - - [n => isRecord(n) && !isSingleRecord(n), - n => joinKey( - node.parent().nodeKey(), - node.collectionName, - `${n.nodeId}-{id}`, - )], - - [isRoot, - fp.constant('/')], - - [defaultCase, - n => joinKey(node.parent().nodeKey(), n.name)], - - )(node); - - - const validate$1 = parent => (node) => { - if (isIndex(node) - && isSomething(parent) - && !isRoot(parent) - && !isRecord(parent)) { - throw new BadRequestError(createNodeErrors.indexParentMustBeRecordOrRoot); - } - - if (isaggregateGroup(node) - && isSomething(parent) - && !isIndex(parent)) { - throw new BadRequestError(createNodeErrors.aggregateParentMustBeAnIndex); - } - - if (isNothing(parent) && !isRoot(node)) { throw new BadRequestError(createNodeErrors.allNonRootNodesMustHaveParent); } - - return node; - }; - - const construct = parent => (node) => { - node.nodeKey = nodeKeyMaker(node); - node.pathRegx = pathRegxMaker(node); - node.parent = fp.constant(parent); - node.isRoot = () => isNothing(parent) - && node.name === 'root' - && node.type === 'root'; - if (isCollectionRecord(node)) { - node.collectionNodeKey = () => joinKey( - parent.nodeKey(), node.collectionName, - ); - node.collectionPathRegx = () => joinKey( - parent.pathRegx(), node.collectionName, - ); - } - return node; - }; - - const addToParent = (obj) => { - const parent = obj.parent(); - if (isSomething(parent)) { - if (isIndex(obj)) - // Q: why are indexes not children ? - // A: because they cannot have children of their own. - { - parent.indexes.push(obj); - } - else if (isaggregateGroup(obj)) - { - parent.aggregateGroups.push(obj); - } else { - parent.children.push(obj); - } - - if (isRecord(obj)) { - const defaultIndex = _.find( - parent.indexes, - i => i.name === `${parent.name}_index`, - ); - if (defaultIndex) { - defaultIndex.allowedRecordNodeIds.push(obj.nodeId); - } - } - } - return obj; - }; - - const constructNode = (parent, obj) => $(obj, [ - construct(parent), - validate$1(parent), - addToParent, - ]); - - const getNodeId = (parentNode) => { - // this case is handled better elsewhere - if (!parentNode) return null; - const findRoot = n => (isRoot(n) ? n : findRoot(n.parent())); - const root = findRoot(parentNode); - - return ($(root, [ - getFlattenedHierarchy, - fp.map(n => n.nodeId), - fp.max]) + 1); - }; - - const constructHierarchy = (node, parent) => { - construct(parent)(node); - if (node.indexes) { - _.each(node.indexes, - child => constructHierarchy(child, node)); - } - if (node.aggregateGroups) { - _.each(node.aggregateGroups, - child => constructHierarchy(child, node)); - } - if (node.children && node.children.length > 0) { - _.each(node.children, - child => constructHierarchy(child, node)); - } - if (node.fields) { - _.each(node.fields, - f => _.each(f.typeOptions, (val, key) => { - const def = all$1[f.type].optionDefinitions[key]; - if (!def) { - // unknown typeOption - delete f.typeOptions[key]; - } else { - f.typeOptions[key] = def.parse(val); - } - })); - } - return node; - }; - - - const getNewRootLevel = () => construct()({ - name: 'root', - type: 'root', - children: [], - pathMaps: [], - indexes: [], - nodeId: 0, - }); - - const _getNewRecordTemplate = (parent, name, createDefaultIndex, isSingle) => { - const node = constructNode(parent, { - name, - type: 'record', - fields: [], - children: [], - validationRules: [], - nodeId: getNodeId(parent), - indexes: [], - estimatedRecordCount: isRecord(parent) ? 500 : 1000000, - collectionName: '', - isSingle, - }); - - if (createDefaultIndex) { - const defaultIndex = getNewIndexTemplate(parent); - defaultIndex.name = `${name}_index`; - defaultIndex.allowedRecordNodeIds.push(node.nodeId); - } - - return node; - }; - - const getNewRecordTemplate = (parent, name = '', createDefaultIndex = true) => _getNewRecordTemplate(parent, name, createDefaultIndex, false); - - const getNewSingleRecordTemplate = parent => _getNewRecordTemplate(parent, '', false, true); - - const getNewIndexTemplate = (parent, type = 'ancestor') => constructNode(parent, { - name: '', - type: 'index', - map: 'return {...record};', - filter: '', - indexType: type, - getShardName: '', - getSortKey: 'record.id', - aggregateGroups: [], - allowedRecordNodeIds: [], - nodeId: getNodeId(parent), - }); - - const getNewAggregateGroupTemplate = index => constructNode(index, { - name: '', - type: 'aggregateGroup', - groupBy: '', - aggregates: [], - condition: '', - nodeId: getNodeId(index), - }); - - const getNewAggregateTemplate = (set) => { - const aggregatedValue = { - name: '', - aggregatedValue: '', - }; - set.aggregates.push(aggregatedValue); - return aggregatedValue; - }; - - const fieldErrors = { - AddFieldValidationFailed: 'Add field validation: ', - }; - - const allowedTypes = () => fp.keys(all$1); - - const getNewField = type => ({ - name: '', // how field is referenced internally - type, - typeOptions: getDefaultOptions$1(type), - label: '', // how field is displayed - getInitialValue: 'default', // function that gets value when initially created - getUndefinedValue: 'default', // function that gets value when field undefined on record - }); - - const fieldRules = allFields => [ - makerule('name', 'field name is not set', - f => isNonEmptyString(f.name)), - makerule('type', 'field type is not set', - f => isNonEmptyString(f.type)), - makerule('label', 'field label is not set', - f => isNonEmptyString(f.label)), - makerule('getInitialValue', 'getInitialValue function is not set', - f => isNonEmptyString(f.getInitialValue)), - makerule('getUndefinedValue', 'getUndefinedValue function is not set', - f => isNonEmptyString(f.getUndefinedValue)), - makerule('name', 'field name is duplicated', - f => isNothingOrEmpty(f.name) - || fp.countBy('name')(allFields)[f.name] === 1), - makerule('type', 'type is unknown', - f => isNothingOrEmpty(f.type) - || fp.some(t => f.type === t)(allowedTypes())), - ]; - - const typeOptionsRules = (field) => { - const type = all$1[field.type]; - if (isNothing(type)) return []; - - const def = optName => type.optionDefinitions[optName]; - - return $(field.typeOptions, [ - fp.keys, - fp.filter(o => isSomething(def(o)) - && isSomething(def(o).isValid)), - fp.map(o => makerule( - `typeOptions.${o}`, - `${def(o).requirementDescription}`, - field => def(o).isValid(field.typeOptions[o]), - )), - ]); - }; - - const validateField = allFields => (field) => { - const everySingleField = fp.includes(field)(allFields) ? allFields : [...allFields, field]; - return applyRuleSet([...fieldRules(everySingleField), ...typeOptionsRules(field)])(field); - }; - - const validateAllFields = recordNode => $(recordNode.fields, [ - fp.map(validateField(recordNode.fields)), - fp.flatten, - ]); - - const addField = (recordTemplate, field) => { - if (isNothingOrEmpty(field.label)) { - field.label = field.name; - } - const validationMessages = validateField([...recordTemplate.fields, field])(field); - if (validationMessages.length > 0) { - const errors = fp.map(m => m.error)(validationMessages); - throw new BadRequestError(`${fieldErrors.AddFieldValidationFailed} ${errors.join(', ')}`); - } - recordTemplate.fields.push(field); - }; - - const getNewRecordValidationRule = (invalidFields, - messageWhenInvalid, - expressionWhenValid) => ({ - invalidFields, messageWhenInvalid, expressionWhenValid, - }); - - const getStaticValue = switchCase( - [fp.isNumber, v => v.toString()], - [fp.isBoolean, v => v.toString()], - [fp.defaultCase, v => `'${v}'`], - ); - - const commonRecordValidationRules = ({ - - fieldNotEmpty: fieldName => getNewRecordValidationRule( - [fieldName], - `${fieldName} is empty`, - `!_.isEmpty(record['${fieldName}'])`, - ), - - fieldBetween: (fieldName, min, max) => getNewRecordValidationRule( - [fieldName], - `${fieldName} must be between ${min.toString()} and ${max.toString()}`, - `record['${fieldName}'] >= ${getStaticValue(min)} && record['${fieldName}'] <= ${getStaticValue(max)} `, - ), - - fieldGreaterThan: (fieldName, min, max) => getNewRecordValidationRule( - [fieldName], - `${fieldName} must be greater than ${min.toString()} and ${max.toString()}`, - `record['${fieldName}'] >= ${getStaticValue(min)} `, - ), - }); - - const addRecordValidationRule = recordNode => rule => recordNode.validationRules.push(rule); - - const createTrigger = () => ({ - actionName: '', - eventName: '', - // function, has access to event context, - // returns object that is used as parameter to action - // only used if triggered by event - optionsCreator: '', - // action runs if true, - // has access to event context - condition: '', - }); - - const createAction = () => ({ - name: '', - behaviourSource: '', - // name of function in actionSource - behaviourName: '', - // parameter passed into behaviour. - // any other parms passed at runtime e.g. - // by trigger, or manually, will be merged into this - initialOptions: {}, - }); - - const aggregateRules = [ - makerule('name', 'choose a name for the aggregate', - a => isNonEmptyString(a.name)), - makerule('aggregatedValue', 'aggregatedValue does not compile', - a => fp.isEmpty(a.aggregatedValue) - || executesWithoutException( - () => compilerUtil.compileCode(a.aggregatedValue), - )), - ]; - - const validateAggregate = aggregate => applyRuleSet(aggregateRules)(aggregate); - - const validateAllAggregates = all => $(all, [ - fp.map(validateAggregate), - fp.flatten, - ]); - - const ruleSet = (...sets) => fp.constant(fp.flatten([...sets])); - - const commonRules = [ - makerule('name', 'node name is not set', - node => stringNotEmpty(node.name)), - makerule('type', 'node type not recognised', - anyTrue(isRecord, isRoot, isIndex, isaggregateGroup)), - ]; - - const recordRules = [ - makerule('fields', 'no fields have been added to the record', - node => isNonEmptyArray(node.fields)), - makerule('validationRules', "validation rule is missing a 'messageWhenValid' member", - node => fp.every(r => fp.has('messageWhenInvalid')(r))(node.validationRules)), - makerule('validationRules', "validation rule is missing a 'expressionWhenValid' member", - node => fp.every(r => fp.has('expressionWhenValid')(r))(node.validationRules)), - ]; - - - const aggregateGroupRules = [ - makerule('condition', 'condition does not compile', - a => fp.isEmpty(a.condition) - || executesWithoutException( - () => compilerUtil.compileExpression(a.condition), - )), - ]; - - const getRuleSet = node => switchCase( - - [isRecord, ruleSet( - commonRules, - recordRules, - )], - - [isIndex, ruleSet( - commonRules, - indexRuleSet, - )], - - [isaggregateGroup, ruleSet( - commonRules, - aggregateGroupRules, - )], - - [defaultCase, ruleSet(commonRules, [])], - )(node); - - const validateNode = node => applyRuleSet(getRuleSet(node))(node); - - const validateAll = (appHierarchy) => { - const flattened = getFlattenedHierarchy( - appHierarchy, - ); - - const duplicateNameRule = makerule( - 'name', 'node names must be unique under shared parent', - n => fp.filter(f => f.parent() === n.parent() - && f.name === n.name)(flattened).length === 1, - ); - - const duplicateNodeKeyErrors = $(flattened, [ - fp.map(n => applyRuleSet([duplicateNameRule])(n)), - fp.filter(isSomething), - fp.flatten, - ]); - - const fieldErrors = $(flattened, [ - fp.filter(isRecord), - fp.map(validateAllFields), - fp.flatten, - ]); - - const aggregateErrors = $(flattened, [ - fp.filter(isaggregateGroup), - fp.map(s => validateAllAggregates( - s.aggregates, - )), - fp.flatten, - ]); - - return $(flattened, [ - fp.map(validateNode), - fp.flatten, - fp.union(duplicateNodeKeyErrors), - fp.union(fieldErrors), - fp.union(aggregateErrors), - ]); - }; - - const actionRules = [ - makerule('name', 'action must have a name', - a => isNonEmptyString(a.name)), - makerule('behaviourName', 'must supply a behaviour name to the action', - a => isNonEmptyString(a.behaviourName)), - makerule('behaviourSource', 'must supply a behaviour source for the action', - a => isNonEmptyString(a.behaviourSource)), - ]; - - const duplicateActionRule = makerule('', 'action name must be unique', () => {}); - - const validateAction = action => applyRuleSet(actionRules)(action); - - - const validateActions = (allActions) => { - const duplicateActions = $(allActions, [ - fp.filter(a => fp.filter(a2 => a2.name === a.name)(allActions).length > 1), - fp.map(a => validationError(duplicateActionRule, a)), - ]); - - const errors = $(allActions, [ - fp.map(validateAction), - fp.flatten, - fp.union(duplicateActions), - fp.uniqBy('name'), - ]); - - return errors; - }; - - const triggerRules = actions => ([ - makerule('actionName', 'must specify an action', - t => isNonEmptyString(t.actionName)), - makerule('eventName', 'must specify and event', - t => isNonEmptyString(t.eventName)), - makerule('actionName', 'specified action not supplied', - t => !t.actionName - || fp.some(a => a.name === t.actionName)(actions)), - makerule('eventName', 'invalid Event Name', - t => !t.eventName - || fp.includes(t.eventName)(eventsList)), - makerule('optionsCreator', 'Options Creator does not compile - check your expression', - (t) => { - if (!t.optionsCreator) return true; - try { - compilerUtil.compileCode(t.optionsCreator); - return true; - } catch (_) { return false; } - }), - makerule('condition', 'Trigger condition does not compile - check your expression', - (t) => { - if (!t.condition) return true; - try { - compilerUtil.compileExpression(t.condition); - return true; - } catch (_) { return false; } - }), - ]); - - const validateTrigger = (trigger, allActions) => { - const errors = applyRuleSet(triggerRules(allActions))(trigger); - - return errors; - }; - - const validateTriggers = (triggers, allActions) => $(triggers, [ - fp.map(t => validateTrigger(t, allActions)), - fp.flatten, - ]); - - const getApplicationDefinition = datastore => async () => { - const exists = await datastore.exists(appDefinitionFile); - - if (!exists) throw new Error('Application definition does not exist'); - - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.hierarchy = constructHierarchy( - appDefinition.hierarchy, - ); - return appDefinition; - }; - - const saveApplicationHierarchy = app => async hierarchy => apiWrapper( - app, - events.templateApi.saveApplicationHierarchy, - permission.writeTemplates.isAuthorized, - { hierarchy }, - _saveApplicationHierarchy, app.datastore, hierarchy, - ); - - - const _saveApplicationHierarchy = async (datastore, hierarchy) => { - const validationErrors = await validateAll(hierarchy); - if (validationErrors.length > 0) { - throw new Error(`Hierarchy is invalid: ${_.join( - validationErrors.map(e => `${e.item.nodeKey ? e.item.nodeKey() : ''} : ${e.error}`), - ',', - )}`); - } - - if (await datastore.exists(appDefinitionFile)) { - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.hierarchy = hierarchy; - await datastore.updateJson(appDefinitionFile, appDefinition); - } else { - await datastore.createFolder('/.config'); - const appDefinition = { actions: [], triggers: [], hierarchy }; - await datastore.createJson(appDefinitionFile, appDefinition); - } - }; - - const saveActionsAndTriggers = app => async (actions, triggers) => apiWrapper( - app, - events.templateApi.saveActionsAndTriggers, - permission.writeTemplates.isAuthorized, - { actions, triggers }, - _saveActionsAndTriggers, app.datastore, actions, triggers, - ); - - const _saveActionsAndTriggers = async (datastore, actions, triggers) => { - if (await datastore.exists(appDefinitionFile)) { - const appDefinition = await datastore.loadJson(appDefinitionFile); - appDefinition.actions = actions; - appDefinition.triggers = triggers; - - const actionValidErrs = fp.map(e => e.error)(validateActions(actions)); - - if (actionValidErrs.length > 0) { - throw new BadRequestError(`Actions are invalid: ${_.join(actionValidErrs, ', ')}`); - } - - const triggerValidErrs = fp.map(e => e.error)(validateTriggers(triggers, actions)); - - if (triggerValidErrs.length > 0) { - throw new BadRequestError(`Triggers are invalid: ${_.join(triggerValidErrs, ', ')}`); - } - - await datastore.updateJson(appDefinitionFile, appDefinition); - } else { - throw new BadRequestError('Cannot save actions: Application definition does not exist'); - } - }; - - const getBehaviourSources = async (datastore) => { - await datastore.loadFile('/.config/behaviourSources.js'); - }; - - const api$1 = app => ({ - - getApplicationDefinition: getApplicationDefinition(app.datastore), - saveApplicationHierarchy: saveApplicationHierarchy(app), - saveActionsAndTriggers: saveActionsAndTriggers(app), - getBehaviourSources: () => getBehaviourSources(app.datastore), - getNewRootLevel, - constructNode, - getNewIndexTemplate, - getNewRecordTemplate, - getNewField, - validateField, - addField, - fieldErrors, - getNewRecordValidationRule, - commonRecordValidationRules, - addRecordValidationRule, - createAction, - createTrigger, - validateActions, - validateTrigger, - getNewAggregateGroupTemplate, - getNewAggregateTemplate, - constructHierarchy, - getNewSingleRecordTemplate, - allTypes: all$1, - validateNode, - validateAll, - validateTriggers, - }); - - - const getTemplateApi = app => api$1(app); - - const getUsers = app => async () => apiWrapper( - app, - events.authApi.getUsers, - permission.listUsers.isAuthorized, - {}, - _getUsers, app, - ); - - const _getUsers = async app => $(await app.datastore.loadJson(USERS_LIST_FILE), [ - fp.map(stripUserOfSensitiveStuff), - ]); - - const loadAccessLevels = app => async () => apiWrapper( - app, - events.authApi.loadAccessLevels, - permission.listAccessLevels.isAuthorized, - {}, - _loadAccessLevels, app, - ); - - const _loadAccessLevels = async app => await app.datastore.loadJson(ACCESS_LEVELS_FILE); - - const dummyHash = '$argon2i$v=19$m=4096,t=3,p=1$UZRo409UYBGjHJS3CV6Uxw$rU84qUqPeORFzKYmYY0ceBLDaPO+JWSH4PfNiKXfIKk'; - - const authenticate = app => async (username, password) => apiWrapper( - app, - events.authApi.authenticate, - alwaysAuthorized, - { username, password }, - _authenticate, app, username, password, - ); - - const _authenticate = async (app, username, password) => { - if (isNothingOrEmpty(username) || isNothingOrEmpty(password)) { return null; } - - const allUsers = await _getUsers(app); - let user = getUserByName( - allUsers, - username, - ); - - const notAUser = 'not-a-user'; - // continue with non-user - so time to verify remains consistent - // with verification of a valid user - if (!user || !user.enabled) { user = notAUser; } - - let userAuth; - try { - userAuth = await app.datastore.loadJson( - userAuthFile(username), - ); - } catch (_) { - userAuth = { accessLevels: [], passwordHash: dummyHash }; - } - - const permissions = await buildUserPermissions(app, user.accessLevels); - - const verified = await app.crypto.verify( - userAuth.passwordHash, - password, - ); - - if (user === notAUser) { return null; } - - return verified - ? { - ...user, permissions, temp: false, isUser: true, - } - : null; - }; - - const authenticateTemporaryAccess = app => async (tempAccessCode) => { - if (isNothingOrEmpty(tempAccessCode)) { return null; } - - const temp = parseTemporaryCode(tempAccessCode); - let user = $(await _getUsers(app), [ - fp.find(u => u.temporaryAccessId === temp.id), - ]); - - const notAUser = 'not-a-user'; - if (!user || !user.enabled) { user = notAUser; } - - let userAuth; - try { - userAuth = await app.datastore.loadJson( - userAuthFile(user.name), - ); - } catch (e) { - userAuth = { - temporaryAccessHash: dummyHash, - temporaryAccessExpiryEpoch: (await app.getEpochTime() + 10000), - }; - } - - if (userAuth.temporaryAccessExpiryEpoch < await app.getEpochTime()) { user = notAUser; } - - const tempCode = !temp.code ? shortid.generate() : temp.code; - const verified = await app.crypto.verify( - userAuth.temporaryAccessHash, - tempCode, - ); - - if (user === notAUser) { return null; } - - return verified - ? { - ...user, - permissions: [], - temp: true, - isUser: true, - } - : null; - }; - - const buildUserPermissions = async (app, userAccessLevels) => { - const allAccessLevels = await _loadAccessLevels(app); - - return $(allAccessLevels.levels, [ - fp.filter(l => fp.some(ua => l.name === ua)(userAccessLevels)), - fp.map(l => l.permissions), - fp.flatten, - ]); - }; - - const createTemporaryAccess$1 = app => async userName => apiWrapper( - app, - events.authApi.createTemporaryAccess, - alwaysAuthorized, - { userName }, - _createTemporaryAccess, app, userName, - ); - - const _createTemporaryAccess = async (app, userName) => { - const tempCode = await getTemporaryCode(app); - - const lock = await getLock( - app, USERS_LOCK_FILE, 1000, 2, - ); - - if (isNolock(lock)) { throw new Error('Unable to create temporary access, could not get lock - try again'); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - - const user = getUserByName(users, userName); - user.temporaryAccessId = tempCode.temporaryAccessId; - - await app.datastore.updateJson( - USERS_LIST_FILE, - users, - ); - } finally { - await releaseLock(app, lock); - } - - const userAuth = await app.datastore.loadJson( - userAuthFile(userName), - ); - userAuth.temporaryAccessHash = tempCode.temporaryAccessHash; - - userAuth.temporaryAccessExpiryEpoch = tempCode.temporaryAccessExpiryEpoch; - - await app.datastore.updateJson( - userAuthFile(userName), - userAuth, - ); - - return tempCode.tempCode; - }; - - const getTemporaryCode = async (app) => { - const tempCode = shortid.generate() - + shortid.generate() - + shortid.generate() - + shortid.generate(); - - const tempId = shortid.generate(); - - return { - temporaryAccessHash: await app.crypto.hash( - tempCode, - ), - temporaryAccessExpiryEpoch: - (await app.getEpochTime()) + tempCodeExpiryLength, - tempCode: `tmp:${tempId}:${tempCode}`, - temporaryAccessId: tempId, - }; - }; - - const userRules = allUsers => [ - makerule('name', 'username must be set', - u => isNonEmptyString(u.name)), - makerule('accessLevels', 'user must have at least one access level', - u => u.accessLevels.length > 0), - makerule('name', 'username must be unique', - u => fp.filter(u2 => insensitiveEquals(u2.name, u.name))(allUsers).length === 1), - makerule('accessLevels', 'access levels must only contain stings', - u => all(isNonEmptyString)(u.accessLevels)), - ]; - - const validateUser = () => (allusers, user) => applyRuleSet(userRules(allusers))(user); - - const getNewUser = app => () => apiWrapperSync( - app, - events.authApi.getNewUser, - permission.createUser.isAuthorized, - {}, - _getNewUser, app, - ); - - const _getNewUser = () => ({ - name: '', - accessLevels: [], - enabled: true, - temporaryAccessId: '', - }); - - const getNewUserAuth = app => () => apiWrapperSync( - app, - events.authApi.getNewUserAuth, - permission.createUser.isAuthorized, - {}, - _getNewUserAuth, app, - ); - - const _getNewUserAuth = () => ({ - passwordHash: '', - temporaryAccessHash: '', - temporaryAccessExpiryEpoch: 0, - }); - - const isValidPassword = app => password => apiWrapperSync( - app, - events.authApi.isValidPassword, - alwaysAuthorized, - { password }, - _isValidPassword, app, password, - ); - - const _isValidPassword = (app, password) => scorePassword(password).score > 30; - - const changeMyPassword = app => async (currentPw, newpassword) => apiWrapper( - app, - events.authApi.changeMyPassword, - alwaysAuthorized, - { currentPw, newpassword }, - _changeMyPassword, app, currentPw, newpassword, - ); - - const _changeMyPassword = async (app, currentPw, newpassword) => { - const existingAuth = await app.datastore.loadJson( - userAuthFile(app.user.name), - ); - - if (isSomething(existingAuth.passwordHash)) { - const verified = await app.crypto.verify( - existingAuth.passwordHash, - currentPw, - ); - - if (verified) { - await await doSet( - app, existingAuth, - app.user.name, newpassword, - ); - return true; - } - } - - return false; - }; - - const setPasswordFromTemporaryCode = app => async (tempCode, newpassword) => apiWrapper( - app, - events.authApi.setPasswordFromTemporaryCode, - alwaysAuthorized, - { tempCode, newpassword }, - _setPasswordFromTemporaryCode, app, tempCode, newpassword, - ); - - - const _setPasswordFromTemporaryCode = async (app, tempCode, newpassword) => { - const currentTime = await app.getEpochTime(); - - const temp = parseTemporaryCode(tempCode); - - const user = $(await _getUsers(app), [ - fp.find(u => u.temporaryAccessId === temp.id), - ]); - - if (!user) { return false; } - - const existingAuth = await app.datastore.loadJson( - userAuthFile(user.name), - ); - - if (isSomething(existingAuth.temporaryAccessHash) - && existingAuth.temporaryAccessExpiryEpoch > currentTime) { - const verified = await app.crypto.verify( - existingAuth.temporaryAccessHash, - temp.code, - ); - - if (verified) { - await doSet( - app, existingAuth, - user.name, newpassword, - ); - return true; - } - } - - return false; - }; - - const doSet = async (app, auth, username, newpassword) => { - auth.temporaryAccessHash = ''; - auth.temporaryAccessExpiryEpoch = 0; - auth.passwordHash = await app.crypto.hash( - newpassword, - ); - await app.datastore.updateJson( - userAuthFile(username), - auth, - ); - }; - - const scorePassword = app => password => apiWrapperSync( - app, - events.authApi.scorePassword, - alwaysAuthorized, - { password }, - _scorePassword, password, - ); - - const _scorePassword = (password) => { - // from https://stackoverflow.com/questions/948172/password-strength-meter - // thank you https://stackoverflow.com/users/46617/tm-lv - - let score = 0; - if (!password) { return score; } - - // award every unique letter until 5 repetitions - const letters = new Object(); - for (let i = 0; i < password.length; i++) { - letters[password[i]] = (letters[password[i]] || 0) + 1; - score += 5.0 / letters[password[i]]; - } - - // bonus points for mixing it up - const variations = { - digits: /\d/.test(password), - lower: /[a-z]/.test(password), - upper: /[A-Z]/.test(password), - nonWords: /\W/.test(password), - }; - - let variationCount = 0; - for (const check in variations) { - variationCount += (variations[check] == true) ? 1 : 0; - } - score += (variationCount - 1) * 10; - - const strengthText = score > 80 - ? 'strong' - : score > 60 - ? 'good' - : score >= 30 - ? 'weak' - : 'very weak'; - - return { - score: parseInt(score), - strengthText, - }; - }; - - const createUser$1 = app => async (user, password = null) => apiWrapper( - app, - events.authApi.createUser, - permission.createUser.isAuthorized, - { user, password }, - _createUser, app, user, password, - ); - - const _createUser = async (app, user, password = null) => { - const lock = await getLock( - app, USERS_LOCK_FILE, 1000, 2, - ); - - if (isNolock(lock)) { throw new Error('Unable to create user, could not get lock - try again'); } - - const users = await app.datastore.loadJson(USERS_LIST_FILE); - - const userErrors = validateUser()([...users, user], user); - if (userErrors.length > 0) { throw new BadRequestError(`User is invalid. ${fp.join('; ')(userErrors)}`); } - - const { auth, tempCode, temporaryAccessId } = await getAccess( - app, password, - ); - user.tempCode = tempCode; - user.temporaryAccessId = temporaryAccessId; - - if (fp.some(u => insensitiveEquals(u.name, user.name))(users)) { - throw new BadRequestError('User already exists'); - } - - users.push( - stripUserOfSensitiveStuff(user), - ); - - await app.datastore.updateJson( - USERS_LIST_FILE, - users, - ); - - try { - await app.datastore.createJson( - userAuthFile(user.name), - auth, - ); - } catch (_) { - await app.datastore.updateJson( - userAuthFile(user.name), - auth, - ); - } - - await releaseLock(app, lock); - - return user; - }; - - const getAccess = async (app, password) => { - const auth = getNewUserAuth(app)(); - - if (isNonEmptyString(password)) { - if (isValidPassword(password)) { - auth.passwordHash = await app.crypto.hash(password); - auth.temporaryAccessHash = ''; - auth.temporaryAccessId = ''; - auth.temporaryAccessExpiryEpoch = 0; - return { auth }; - } - throw new BadRequestError('Password does not meet requirements'); - } else { - const tempAccess = await getTemporaryCode(app); - auth.temporaryAccessHash = tempAccess.temporaryAccessHash; - auth.temporaryAccessExpiryEpoch = tempAccess.temporaryAccessExpiryEpoch; - auth.passwordHash = ''; - return ({ - auth, - tempCode: tempAccess.tempCode, - temporaryAccessId: tempAccess.temporaryAccessId, - }); - } - }; - - const enableUser = app => async username => apiWrapper( - app, - events.authApi.enableUser, - permission.enableDisableUser.isAuthorized, - { username }, - _enableUser, app, username, - ); - - const disableUser = app => async username => apiWrapper( - app, - events.authApi.disableUser, - permission.enableDisableUser.isAuthorized, - { username }, - _disableUser, app, username, - ); - - const _enableUser = async (app, username) => await toggleUser(app, username, true); - - const _disableUser = async (app, username) => await toggleUser(app, username, false); - - const toggleUser = async (app, username, enabled) => { - const lock = await getLock(app, USERS_LOCK_FILE, 1000, 1, 0); - - const actionName = enabled ? 'enable' : 'disable'; - - if (isNolock(lock)) { throw new Error(`Could not ${actionName} user - cannot get lock`); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - const user = getUserByName(users, username); - if (!user) { throw new NotFoundError(`Could not find user to ${actionName}`); } - - if (user.enabled === !enabled) { - user.enabled = enabled; - await app.datastore.updateJson(USERS_LIST_FILE, users); - } - } finally { - releaseLock(app, lock); - } - }; - - const getNewAccessLevel = () => () => ({ - name: '', - permissions: [], - default:false - }); - - const isAllowedType = t => $(permissionTypes, [ - fp.values, - fp.includes(t), - ]); - - const isRecordOrIndexType = t => fp.some(p => p === t)([ - permissionTypes.CREATE_RECORD, - permissionTypes.UPDATE_RECORD, - permissionTypes.DELETE_RECORD, - permissionTypes.READ_RECORD, - permissionTypes.READ_INDEX, - permissionTypes.EXECUTE_ACTION, - ]); - - - const permissionRules = app => ([ - makerule('type', 'type must be one of allowed types', - p => isAllowedType(p.type)), - makerule('nodeKey', 'record and index permissions must include a valid nodeKey', - p => (!isRecordOrIndexType(p.type)) - || isSomething(getNode(app.hierarchy, p.nodeKey))), - ]); - - const applyPermissionRules = app => applyRuleSet(permissionRules(app)); - - const accessLevelRules = allLevels => ([ - makerule('name', 'name must be set', - l => isNonEmptyString(l.name)), - makerule('name', 'access level names must be unique', - l => fp.isEmpty(l.name) - || fp.filter(a => insensitiveEquals(l.name, a.name))(allLevels).length === 1), - ]); - - const applyLevelRules = allLevels => applyRuleSet(accessLevelRules(allLevels)); - - const validateAccessLevel = app => (allLevels, level) => { - const errs = $(level.permissions, [ - fp.map(applyPermissionRules(app)), - fp.flatten, - fp.concat( - applyLevelRules(allLevels)(level), - ), - ]); - - return errs; - }; - - const validateAccessLevels = app => allLevels => apiWrapperSync( - app, - events.authApi.validateAccessLevels, - alwaysAuthorized, - { allLevels }, - _validateAccessLevels, app, allLevels, - ); - - const _validateAccessLevels = (app, allLevels) => $(allLevels, [ - fp.map(l => validateAccessLevel(app)(allLevels, l)), - fp.flatten, - fp.uniqWith((x, y) => x.field === y.field - && x.item === y.item - && x.error === y.error), - ]); - - const saveAccessLevels = app => async accessLevels => apiWrapper( - app, - events.authApi.saveAccessLevels, - permission.writeAccessLevels.isAuthorized, - { accessLevels }, - _saveAccessLevels, app, accessLevels, - ); - - const _saveAccessLevels = async (app, accessLevels) => { - const validationErrors = validateAccessLevels(app)(accessLevels.levels); - if (validationErrors.length > 0) { - const errs = $(validationErrors, [ - fp.map(e => e.error), - fp.join(', '), - ]); - throw new Error( - `Access Levels Invalid: ${errs}`, - ); - } - - const lock = await getLock( - app, ACCESS_LEVELS_LOCK_FILE, 2000, 2, - ); - - if (isNolock(lock)) { throw new Error('Could not get lock to save access levels'); } - - try { - const existing = await app.datastore.loadJson(ACCESS_LEVELS_FILE); - if (existing.version !== accessLevels.version) { throw new Error('Access levels have already been updated, since you loaded'); } - - accessLevels.version++; - - app.datastore.updateJson(ACCESS_LEVELS_FILE, accessLevels); - } finally { - await releaseLock(app, lock); - } - }; - - const generateFullPermissions = (app) => { - const allNodes = getFlattenedHierarchy(app.hierarchy); - const accessLevel = { permissions: [] }; - - const recordNodes = $(allNodes, [ - fp.filter(isRecord), - ]); - - for (const n of recordNodes) { - permission.createRecord.add(n.nodeKey(), accessLevel); - permission.updateRecord.add(n.nodeKey(), accessLevel); - permission.deleteRecord.add(n.nodeKey(), accessLevel); - permission.readRecord.add(n.nodeKey(), accessLevel); - } - - const indexNodes = $(allNodes, [ - fp.filter(isIndex), - ]); - - for (const n of indexNodes) { - permission.readIndex.add(n.nodeKey(), accessLevel); - } - - for (const a of fp.keys(app.actions)) { - permission.executeAction.add(a, accessLevel); - } - - $(permission, [ - fp.values, - fp.filter(p => !p.isNode), - fp.each(p => p.add(accessLevel)), - ]); - - return accessLevel.permissions; - }; - - const setUserAccessLevels$1 = app => async (userName, accessLevels) => apiWrapper( - app, - events.authApi.setUserAccessLevels, - permission.setUserAccessLevels.isAuthorized, - { userName, accessLevels }, - _setUserAccessLevels, app, userName, accessLevels, - ); - - const _setUserAccessLevels = async (app, username, accessLevels) => { - const lock = await getLock(app, USERS_LOCK_FILE, 1000, 1, 0); - - const actualAccessLevels = $( - await app.datastore.loadJson(ACCESS_LEVELS_FILE), - [ - l => l.levels, - fp.map(l => l.name), - ], - ); - - const missing = fp.difference(accessLevels)(actualAccessLevels); - if (missing.length > 0) { - throw new Error(`Invalid access levels supplied: ${fp.join(', ', missing)}`); - } - - if (isNolock(lock)) { throw new Error('Could set user access levels cannot get lock'); } - - try { - const users = await app.datastore.loadJson(USERS_LIST_FILE); - const user = getUserByName(users, username); - if (!user) { throw new NotFoundError(`Could not find user with ${username}`); } - - user.accessLevels = accessLevels; - await app.datastore.updateJson(USERS_LIST_FILE, users); - } finally { - releaseLock(app, lock); - } - }; - - const getAuthApi = app => ({ - authenticate: authenticate(app), - authenticateTemporaryAccess: authenticateTemporaryAccess(app), - createTemporaryAccess: createTemporaryAccess$1(app), - createUser: createUser$1(app), - loadAccessLevels: loadAccessLevels(app), - enableUser: enableUser(app), - disableUser: disableUser(app), - getNewAccessLevel: getNewAccessLevel(), - getNewUser: getNewUser(app), - getNewUserAuth: getNewUserAuth(app), - getUsers: getUsers(app), - saveAccessLevels: saveAccessLevels(app), - isAuthorized: isAuthorized(app), - changeMyPassword: changeMyPassword(app), - setPasswordFromTemporaryCode: setPasswordFromTemporaryCode(app), - scorePassword, - isValidPassword: isValidPassword(app), - validateUser: validateUser(), - validateAccessLevels: validateAccessLevels(app), - generateFullPermissions: () => generateFullPermissions(app), - setUserAccessLevels: setUserAccessLevels$1(app), - }); - - const executeAction$1 = app => (actionName, options) => { - apiWrapperSync( - app, - events.actionsApi.execute, - permission.executeAction.isAuthorized(actionName), - { actionName, options }, - app.actions[actionName], options, - ); - }; - - const _executeAction = (behaviourSources, action, options) => behaviourSources[action.behaviourSource][action.behaviourName](options); - - const getActionsApi = app => ({ - execute: executeAction$1(app), - }); - - const publish = handlers => async (eventName, context = {}) => { - if (!fp.has(eventName)(handlers)) return; - - for (const handler of handlers[eventName]) { - await handler(eventName, context); - } - }; - - const subscribe = handlers => (eventName, handler) => { - if (!fp.has(eventName)(handlers)) { - handlers[eventName] = []; - } - handlers[eventName].push(handler); - }; - - const createEventAggregator = () => { - const handlers = {}; - const eventAggregator = ({ - publish: publish(handlers), - subscribe: subscribe(handlers), - }); - return eventAggregator; - }; - - const createJson = originalCreateFile => async (key, obj, retries = 2, delay = 100) => await retry(originalCreateFile, retries, delay, key, JSON.stringify(obj)); - - const createNewFile = originalCreateFile => async (path, content, retries = 2, delay = 100) => await retry(originalCreateFile, retries, delay, path, content); - - const loadJson = datastore => async (key, retries = 3, delay = 100) => { - try { - return await retry(JSON.parse, retries, delay, await datastore.loadFile(key)); - } catch (err) { - const newErr = new NotFoundError(err.message); - newErr.stack = err.stack; - throw(newErr); - } - }; - - const updateJson = datastore => async (key, obj, retries = 3, delay = 100) => { - try { - return await retry(datastore.updateFile, retries, delay, key, JSON.stringify(obj)); - } catch (err) { - const newErr = new NotFoundError(err.message); - newErr.stack = err.stack; - throw(newErr); - } - }; - - const setupDatastore = (datastore) => { - const originalCreateFile = datastore.createFile; - datastore.loadJson = loadJson(datastore); - datastore.createJson = createJson(originalCreateFile); - datastore.updateJson = updateJson(datastore); - datastore.createFile = createNewFile(originalCreateFile); - if (datastore.createEmptyDb) { delete datastore.createEmptyDb; } - return datastore; - }; - - const compileCode = code => { - let func; - - try { - func = compilerUtil.compileCode(code); - } catch(e) { - e.message = `Error compiling code : ${code} : ${e.message}`; - throw e; - } - - return func; - }; - - const compileExpression = code => { - let func; - - try { - func = compilerUtil.compileExpression(code); - } catch(e) { - e.message = `Error compiling expression : ${code} : ${e.message}`; - throw e; - } - - return func; - }; - - const initialiseActions = (subscribe, behaviourSources, actions, triggers, apis) => { - validateSources(behaviourSources, actions); - subscribeTriggers(subscribe, behaviourSources, actions, triggers, apis); - return createActionsCollection(behaviourSources, actions); - }; - - const createActionsCollection = (behaviourSources, actions) => $(actions, [ - fp.reduce((all, a) => { - all[a.name] = opts => _executeAction(behaviourSources, a, opts); - return all; - }, {}), - ]); - - const subscribeTriggers = (subscribe, behaviourSources, actions, triggers, apis) => { - const createOptions = (optionsCreator, eventContext) => { - if (!optionsCreator) return {}; - const create = compileCode(optionsCreator); - return create({ context: eventContext, apis }); - }; - - const shouldRunTrigger = (trigger, eventContext) => { - if (!trigger.condition) return true; - const shouldRun = compileExpression(trigger.condition); - return shouldRun({ context: eventContext }); - }; - - for (let trig of triggers) { - subscribe(trig.eventName, async (ev, ctx) => { - if (shouldRunTrigger(trig, ctx)) { - await _executeAction( - behaviourSources, - fp.find(a => a.name === trig.actionName)(actions), - createOptions(trig.optionsCreator, ctx), - ); - } - }); - } - }; - - const validateSources = (behaviourSources, actions) => { - const declaredSources = $(actions, [ - fp.uniqBy(a => a.behaviourSource), - fp.map(a => a.behaviourSource), - ]); - - const suppliedSources = fp.keys(behaviourSources); - - const missingSources = fp.difference( - declaredSources, suppliedSources, - ); - - if (missingSources.length > 0) { - throw new BadRequestError(`Declared behaviour sources are not supplied: ${fp.join(', ', missingSources)}`); - } - - const missingBehaviours = $(actions, [ - fp.filter(a => !fp.isFunction(behaviourSources[a.behaviourSource][a.behaviourName])), - fp.map(a => `Action: ${a.name} : ${a.behaviourSource}.${a.behaviourName}`), - ]); - - if (missingBehaviours.length > 0) { - throw new NotFoundError(`Missing behaviours: could not find behaviour functions: ${fp.join(', ', missingBehaviours)}`); - } - }; - - const retrieve = async (app) => { - const transactionFiles = await app.datastore.getFolderContents( - TRANSACTIONS_FOLDER, - ); - - let transactions = []; - - if (fp.some(isBuildIndexFolder)(transactionFiles)) { - const buildIndexFolder = fp.find(isBuildIndexFolder)(transactionFiles); - - transactions = await retrieveBuildIndexTransactions( - app, - joinKey(TRANSACTIONS_FOLDER, buildIndexFolder), - ); - } - - if (transactions.length > 0) return transactions; - - return await retrieveStandardTransactions( - app, transactionFiles, - ); - }; - - const retrieveBuildIndexTransactions = async (app, buildIndexFolder) => { - const childFolders = await app.datastore.getFolderContents(buildIndexFolder); - if (childFolders.length === 0) { - // cleanup - await app.datastore.deleteFolder(buildIndexFolder); - return []; - } - - const getTransactionFiles = async (childFolderIndex = 0) => { - if (childFolderIndex >= childFolders.length) return []; - - const childFolderKey = joinKey(buildIndexFolder, childFolders[childFolderIndex]); - const files = await app.datastore.getFolderContents( - childFolderKey, - ); - - if (files.length === 0) { - await app.datastore.deleteFolder(childFolderKey); - return await getTransactionFiles(childFolderIndex + 1); - } - - return { childFolderKey, files }; - }; - - const transactionFiles = await getTransactionFiles(); - - if (transactionFiles.files.length === 0) return []; - - const transactions = $(transactionFiles.files, [ - fp.map(parseTransactionId), - ]); - - for (const t of transactions) { - const transactionContent = await app.datastore.loadJson( - joinKey( - transactionFiles.childFolderKey, - t.fullId, - ), - ); - t.record = await _load(app, transactionContent.recordKey); - } - - transactions.indexNode = $(buildIndexFolder, [ - getLastPartInKey, - nodeKeyHashFromBuildFolder, - getNodeFromNodeKeyHash(app.hierarchy), - ]); - - transactions.folderKey = transactionFiles.childFolderKey; - - return transactions; - }; - - const retrieveStandardTransactions = async (app, transactionFiles) => { - const transactionIds = $(transactionFiles, [ - fp.filter(f => f !== LOCK_FILENAME - && !isBuildIndexFolder(f)), - fp.map(parseTransactionId), - ]); - - const transactionIdsByRecord = $(transactionIds, [ - fp.groupBy('recordId'), - ]); - - const dedupedTransactions = []; - - const verify = async (t) => { - if (t.verified === true) return t; - - const id = getTransactionId( - t.recordId, - t.transactionType, - t.uniqueId, - ); - - const transaction = await app.datastore.loadJson( - joinKey(TRANSACTIONS_FOLDER, id), - ); - - if (isDelete(t)) { - t.record = transaction.record; - t.verified = true; - return t; - } - - const rec = await _load( - app, - transaction.recordKey, - ); - if (rec.transactionId === id) { - t.record = rec; - if (transaction.oldRecord) { t.oldRecord = transaction.oldRecord; } - t.verified = true; - } else { - t.verified = false; - } - - return t; - }; - - const pickOne = async (trans, forType) => { - const transForType = fp.filter(forType)(trans); - if (transForType.length === 1) { - const t = await verify(transForType[0]); - return (t.verified === true ? t : null); - } - for (let t of transForType) { - t = await verify(t); - if (t.verified === true) { return t; } - } - - return null; - }; - - for (const recordId in transactionIdsByRecord) { - const transIdsForRecord = transactionIdsByRecord[recordId]; - if (transIdsForRecord.length === 1) { - const t = await verify(transIdsForRecord[0]); - if (t.verified) { dedupedTransactions.push(t); } - continue; - } - if (fp.some(isDelete)(transIdsForRecord)) { - const t = await verify(fp.find(isDelete)(transIdsForRecord)); - if (t.verified) { dedupedTransactions.push(t); } - continue; - } - if (fp.some(isUpdate)(transIdsForRecord)) { - const upd = await pickOne(transIdsForRecord, isUpdate); - if (isSomething(upd) && upd.verified) { dedupedTransactions.push(upd); } - continue; - } - if (fp.some(isCreate)(transIdsForRecord)) { - const cre = await pickOne(transIdsForRecord, isCreate); - if (isSomething(cre)) { dedupedTransactions.push(cre); } - continue; - } - } - - const duplicates = $(transactionIds, [ - fp.filter(t => none(ddt => ddt.uniqueId === t.uniqueId)(dedupedTransactions)), - ]); - - - const deletePromises = fp.map(t => app.datastore.deleteFile( - joinKey( - TRANSACTIONS_FOLDER, - getTransactionId( - t.recordId, - t.transactionType, - t.uniqueId, - ), - ), - ))(duplicates); - - await Promise.all(deletePromises); - - return dedupedTransactions; - }; - - const parseTransactionId = (id) => { - const splitId = fp.split(idSep)(id); - return ({ - recordId: splitId[0], - transactionType: splitId[1], - uniqueId: splitId[2], - fullId: id, - }); - }; - - const getRelevantAncestorIndexes = (hierarchy, record) => { - const key = record.key; - const keyParts = splitKey(key); - const nodeId = getRecordNodeId(key); - - const flatHierarchy = _.orderBy(getFlattenedHierarchy(hierarchy), - [node => node.pathRegx().length], - ['desc']); - - const makeindexNodeAndDir_ForAncestorIndex = (indexNode, parentRecordDir) => makeIndexNodeAndDir(indexNode, joinKey(parentRecordDir, indexNode.name)); - - const traverseAncestorIndexesInPath = () => fp.reduce((acc, part) => { - const currentIndexKey = joinKey(acc.lastIndexKey, part); - acc.lastIndexKey = currentIndexKey; - const testPathRegx = p => new RegExp(`${p.pathRegx()}$`).test(currentIndexKey); - const nodeMatch = fp.find(testPathRegx)(flatHierarchy); - - if (isNothing(nodeMatch)) { return acc; } - - if (!isRecord(nodeMatch) - || nodeMatch.indexes.length === 0) { return acc; } - - const indexes = $(nodeMatch.indexes, [ - fp.filter(i => i.indexType === indexTypes.ancestor - && (i.allowedRecordNodeIds.length === 0 - || fp.includes(nodeId)(i.allowedRecordNodeIds))), - ]); - - const currentRecordDir = getRecordInfo(hierarchy, currentIndexKey).dir; - - fp.each(v => acc.nodesAndKeys.push( - makeindexNodeAndDir_ForAncestorIndex(v, currentRecordDir), - ))(indexes); - - return acc; - }, { lastIndexKey: '', nodesAndKeys: [] })(keyParts).nodesAndKeys; - - const rootIndexes = $(flatHierarchy, [ - fp.filter(n => isGlobalIndex(n) && recordNodeIdIsAllowed(n)(nodeId)), - fp.map(i => makeIndexNodeAndDir( - i, - getIndexDir(hierarchy, i.nodeKey()))), - ]); - - return fp.union(traverseAncestorIndexesInPath())(rootIndexes); - }; - - const getRelevantReverseReferenceIndexes = (hierarchy, record) => $(record.key, [ - getExactNodeForKey(hierarchy), - n => n.fields, - fp.filter(f => f.type === 'reference' - && isSomething(record[f.name]) - && isNonEmptyString(record[f.name].key)), - fp.map(f => $(f.typeOptions.reverseIndexNodeKeys, [ - fp.map(n => ({ - recordNode: getNode(hierarchy, n), - field: f, - })), - ])), - fp.flatten, - fp.map(n => makeIndexNodeAndDir( - n.recordNode, - joinKey( - getRecordInfo(hierarchy, record[n.field.name].key).dir, - n.recordNode.name), - )), - ]); - - const makeIndexNodeAndDir = (indexNode, indexDir) => ({ indexNode, indexDir }); - - // adapted from https://github.com/dex4er/js-promise-writable - // Thank you :) - const promiseWriteableStream = stream => { - - let _errored; - - const _errorHandler = err => { - _errored = err; - }; - - stream.on("error", _errorHandler); - - const write = chunk => { - let rejected = false; - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err); - } - - if (!stream.writable || stream.closed || stream.destroyed) { - return reject(new Error("write after end")); - } - - const writeErrorHandler = err => { - _errored = undefined; - rejected = true; - reject(err); - }; - - stream.once("error", writeErrorHandler); - - const canWrite = stream.write(chunk); - - stream.removeListener("error", writeErrorHandler); - - if (canWrite) { - if (!rejected) { - resolve(chunk.length); - } - } else { - const errorHandler = err => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const drainHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const closeHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const finishHandler = () => { - removeListeners(); - resolve(chunk.length); - }; - - const removeListeners = () => { - stream.removeListener("close", closeHandler); - stream.removeListener("drain", drainHandler); - stream.removeListener("error", errorHandler); - stream.removeListener("finish", finishHandler); - }; - - stream.on("close", closeHandler); - stream.on("drain", drainHandler); - stream.on("error", errorHandler); - stream.on("finish", finishHandler); - } - }) - }; - - const end = () => { - - return new Promise((resolve, reject) => { - if (_errored) { - const err = _errored; - _errored = undefined; - return reject(err); - } - - if (!stream.writable || stream.closed || stream.destroyed) { - return resolve(); - } - - const finishHandler = () => { - removeListeners(); - resolve(); - }; - - const errorHandler = (err) => { - _errored = undefined; - removeListeners(); - reject(err); - }; - - const removeListeners = () => { - stream.removeListener("error", errorHandler); - stream.removeListener("finish", finishHandler); - }; - - stream.on("finish", finishHandler); - stream.on("error", errorHandler); - - stream.end(); - }) - }; - - return {write, end}; - }; - - const applyToShard = async (hierarchy, store, indexDir, - indexNode, indexShardKey, recordsToWrite, keysToRemove) => { - const createIfNotExists = recordsToWrite.length > 0; - const writer = await getWriter(hierarchy, store, indexDir, indexShardKey, indexNode, createIfNotExists); - if (writer === SHARD_DELETED) return; - - await writer.updateIndex(recordsToWrite, keysToRemove); - await swapTempFileIn(store, indexShardKey); - }; - - const SHARD_DELETED = 'SHARD_DELETED'; - const getWriter = async (hierarchy, store, indexDir, indexedDataKey, indexNode, createIfNotExists) => { - let readableStream = null; - - if (isShardedIndex(indexNode)) { - await ensureShardNameIsInShardMap(store, indexDir, indexedDataKey); - if(!await store.exists(indexedDataKey)) { - if (await store.exists(getParentKey(indexedDataKey))) { - await store.createFile(indexedDataKey, ""); - } else { - return SHARD_DELETED; - } - } - } - - try { - - readableStream = promiseReadableStream( - await store.readableFileStream(indexedDataKey) - ); - - } catch (e) { - - if (await store.exists(indexedDataKey)) { - throw e; - } else { - if (createIfNotExists) { - if(await store.exists(getParentKey(indexedDataKey))) { - await store.createFile(indexedDataKey, ''); - } else { - return SHARD_DELETED; - } - } else { - return SHARD_DELETED; - } - - readableStream = promiseReadableStream( - await store.readableFileStream(indexedDataKey) - ); - - } - } - - const writableStream = promiseWriteableStream( - await store.writableFileStream(indexedDataKey + ".temp") - ); - - return getIndexWriter( - hierarchy, indexNode, - readableStream, writableStream - ); - }; - - const swapTempFileIn = async (store, indexedDataKey, isRetry = false) => { - const tempFile = `${indexedDataKey}.temp`; - try { - await store.deleteFile(indexedDataKey); - } catch (e) { - // ignore failure, incase it has not been created yet - - // if parent folder does not exist, assume that this index - // should not be there - if(!await store.exists(getParentKey(indexedDataKey))) { - return; - } - } - try { - await store.renameFile(tempFile, indexedDataKey); - } catch (e) { - // retrying in case delete failure was for some other reason - if (!isRetry) { - await swapTempFileIn(store, indexedDataKey, true); - } else { - throw new Error("Failed to swap in index filed: " + e.message); - } - } - }; - - const executeTransactions = app => async (transactions) => { - const recordsByShard = mappedRecordsByIndexShard(app.hierarchy, transactions); - - for (const shard of fp.keys(recordsByShard)) { - await applyToShard( - app.hierarchy, app.datastore, - recordsByShard[shard].indexDir, - recordsByShard[shard].indexNode, - shard, - recordsByShard[shard].writes, - recordsByShard[shard].removes, - ); - } - }; - - const mappedRecordsByIndexShard = (hierarchy, transactions) => { - const updates = getUpdateTransactionsByShard( - hierarchy, transactions, - ); - - const created = getCreateTransactionsByShard( - hierarchy, transactions, - ); - const deletes = getDeleteTransactionsByShard( - hierarchy, transactions, - ); - - const indexBuild = getBuildIndexTransactionsByShard( - hierarchy, - transactions, - ); - - const toRemove = [ - ...deletes, - ...updates.toRemove, - ]; - - const toWrite = [ - ...created, - ...updates.toWrite, - ...indexBuild, - ]; - - const transByShard = {}; - - const initialiseShard = (t) => { - if (fp.isUndefined(transByShard[t.indexShardKey])) { - transByShard[t.indexShardKey] = { - writes: [], - removes: [], - indexDir: t.indexDir, - indexNodeKey: t.indexNode.nodeKey(), - indexNode: t.indexNode, - }; - } - }; - - for (const trans of toWrite) { - initialiseShard(trans); - transByShard[trans.indexShardKey].writes.push( - trans.mappedRecord.result, - ); - } - - for (const trans of toRemove) { - initialiseShard(trans); - transByShard[trans.indexShardKey].removes.push( - trans.mappedRecord.result.key, - ); - } - - return transByShard; - }; - - const getUpdateTransactionsByShard = (hierarchy, transactions) => { - const updateTransactions = $(transactions, [fp.filter(isUpdate)]); - - const evaluateIndex = (record, indexNodeAndPath) => { - const mappedRecord = evaluate(record)(indexNodeAndPath.indexNode); - return ({ - mappedRecord, - indexNode: indexNodeAndPath.indexNode, - indexDir: indexNodeAndPath.indexDir, - indexShardKey: getIndexedDataKey( - indexNodeAndPath.indexNode, - indexNodeAndPath.indexDir, - mappedRecord.result, - ), - }); - }; - - const getIndexNodesToApply = indexFilter => (t, indexes) => $(indexes, [ - fp.map(n => ({ - old: evaluateIndex(t.oldRecord, n), - new: evaluateIndex(t.record, n), - })), - fp.filter(indexFilter), - ]); - - const toRemoveFilter = (n, isUnreferenced) => n.old.mappedRecord.passedFilter === true - && (n.new.mappedRecord.passedFilter === false - || isUnreferenced); - - const toAddFilter = (n, isNewlyReferenced) => (n.old.mappedRecord.passedFilter === false - || isNewlyReferenced) - && n.new.mappedRecord.passedFilter === true; - - const toUpdateFilter = n => n.new.mappedRecord.passedFilter === true - && n.old.mappedRecord.passedFilter === true - && !fp.isEqual(n.old.mappedRecord.result, - n.new.mappedRecord.result); - - const toRemove = []; - const toWrite = []; - - for (const t of updateTransactions) { - const ancestorIdxs = getRelevantAncestorIndexes( - hierarchy, t.record, - ); - - const referenceChanges = diffReverseRefForUpdate( - hierarchy, t.oldRecord, t.record, - ); - - // old records to remove (filtered out) - const filteredOut_toRemove = _.union( - getIndexNodesToApply(toRemoveFilter)(t, ancestorIdxs), - // still referenced - check filter - getIndexNodesToApply(toRemoveFilter)(t, referenceChanges.notChanged), - // un referenced - remove if in there already - getIndexNodesToApply(n => toRemoveFilter(n, true))(t, referenceChanges.unReferenced), - ); - - // new records to add (filtered in) - const filteredIn_toAdd = _.union( - getIndexNodesToApply(toAddFilter)(t, ancestorIdxs), - // newly referenced - check filter - getIndexNodesToApply(n => toAddFilter(n, true))(t, referenceChanges.newlyReferenced), - // reference unchanged - rerun filter in case something else changed - getIndexNodesToApply(toAddFilter)(t, referenceChanges.notChanged), - ); - - const changed = _.union( - getIndexNodesToApply(toUpdateFilter)(t, ancestorIdxs), - // still referenced - recheck filter - getIndexNodesToApply(toUpdateFilter)(t, referenceChanges.notChanged), - ); - - const shardKeyChanged = $(changed, [ - fp.filter(c => c.old.indexShardKey !== c.new.indexShardKey), - ]); - - const changedInSameShard = $(shardKeyChanged, [ - fp.difference(changed), - ]); - - for (const res of shardKeyChanged) { - fp.pull(res)(changed); - filteredOut_toRemove.push(res); - filteredIn_toAdd.push(res); - } - - toRemove.push( - $(filteredOut_toRemove, [ - fp.map(i => i.old), - ]), - ); - - toWrite.push( - $(filteredIn_toAdd, [ - fp.map(i => i.new), - ]), - ); - - toWrite.push( - $(changedInSameShard, [ - fp.map(i => i.new), - ]), - ); - } - - return ({ - toRemove: fp.flatten(toRemove), - toWrite: fp.flatten(toWrite), - }); - }; - - const getBuildIndexTransactionsByShard = (hierarchy, transactions) => { - const buildTransactions = $(transactions, [fp.filter(isBuildIndex)]); - if (!isNonEmptyArray(buildTransactions)) return []; - const indexNode = transactions.indexNode; - - const getIndexDirs = (t) => { - if (isGlobalIndex(indexNode)) { - return [indexNode.nodeKey()]; - } - - if (isReferenceIndex(indexNode)) { - const recordNode = getExactNodeForKey(hierarchy)(t.record.key); - const refFields = $(recordNode.fields, [ - fp.filter(fieldReversesReferenceToIndex(indexNode)), - ]); - const indexDirs = []; - for (const refField of refFields) { - const refValue = t.record[refField.name]; - if (isSomething(refValue) - && isNonEmptyString(refValue.key)) { - const indexDir = joinKey( - getRecordInfo(hierarchy, refValue.key).dir, - indexNode.name, - ); - - if (!fp.includes(indexDir)(indexDirs)) { indexDirs.push(indexDir); } - } - } - return indexDirs; - } - - const indexKey = joinKey( - getActualKeyOfParent( - indexNode.parent().nodeKey(), - t.record.key, - ), - indexNode.name, - ); - - return [getIndexDir(hierarchy, indexKey)]; - }; - - return $(buildTransactions, [ - fp.map((t) => { - const mappedRecord = evaluate(t.record)(indexNode); - if (!mappedRecord.passedFilter) return null; - const indexDirs = getIndexDirs(t); - return $(indexDirs, [ - fp.map(indexDir => ({ - mappedRecord, - indexNode, - indexDir, - indexShardKey: getIndexedDataKey( - indexNode, - indexDir, - mappedRecord.result, - ), - })), - ]); - }), - fp.flatten, - fp.filter(isSomething), - ]); - }; - - const get_Create_Delete_TransactionsByShard = pred => (hierarchy, transactions) => { - const createTransactions = $(transactions, [fp.filter(pred)]); - - const getIndexNodesToApply = (t, indexes) => $(indexes, [ - fp.map((n) => { - const mappedRecord = evaluate(t.record)(n.indexNode); - return ({ - mappedRecord, - indexNode: n.indexNode, - indexDir: n.indexDir, - indexShardKey: getIndexedDataKey( - n.indexNode, - n.indexDir, - mappedRecord.result, - ), - }); - }), - fp.filter(n => n.mappedRecord.passedFilter), - ]); - - const allToApply = []; - - for (const t of createTransactions) { - const ancestorIdxs = getRelevantAncestorIndexes(hierarchy, t.record); - const reverseRef = getRelevantReverseReferenceIndexes(hierarchy, t.record); - - allToApply.push( - getIndexNodesToApply(t, ancestorIdxs), - ); - allToApply.push( - getIndexNodesToApply(t, reverseRef), - ); - } - - return fp.flatten(allToApply); - }; - - const getDeleteTransactionsByShard = get_Create_Delete_TransactionsByShard(isDelete); - - const getCreateTransactionsByShard = get_Create_Delete_TransactionsByShard(isCreate); - - const diffReverseRefForUpdate = (appHierarchy, oldRecord, newRecord) => { - const oldIndexes = getRelevantReverseReferenceIndexes( - appHierarchy, oldRecord, - ); - const newIndexes = getRelevantReverseReferenceIndexes( - appHierarchy, newRecord, - ); - - const unReferenced = fp.differenceBy( - i => i.indexDir, - oldIndexes, newIndexes, - ); - - const newlyReferenced = fp.differenceBy( - i => i.indexDir, - newIndexes, oldIndexes, - ); - - const notChanged = fp.intersectionBy( - i => i.indexDir, - newIndexes, oldIndexes, - ); - - return { - unReferenced, - newlyReferenced, - notChanged, - }; - }; - - const cleanup = async (app) => { - const lock = await getTransactionLock(app); - if (isNolock(lock)) return; - - try { - const transactions = await retrieve(app); - if (transactions.length > 0) { - await executeTransactions(app)(transactions); - - const folder = transactions.folderKey - ? transactions.folderKey - : TRANSACTIONS_FOLDER; - - const deleteFiles = $(transactions, [ - fp.map(t => joinKey( - folder, - getTransactionId( - t.recordId, t.transactionType, - t.uniqueId, - ), - )), - fp.map(app.datastore.deleteFile), - ]); - - await Promise.all(deleteFiles); - } - } finally { - await releaseLock(app, lock); - } - }; - - const getTransactionLock = async app => await getLock( - app, LOCK_FILE_KEY, - timeoutMilliseconds, maxLockRetries, - ); - - const initialiseData = async (datastore, applicationDefinition, accessLevels) => { - await datastore.createFolder(configFolder); - await datastore.createJson(appDefinitionFile, applicationDefinition); - - await initialiseRootCollections(datastore, applicationDefinition.hierarchy); - await initialiseRootIndexes(datastore, applicationDefinition.hierarchy); - - await datastore.createFolder(TRANSACTIONS_FOLDER); - - await datastore.createFolder(AUTH_FOLDER); - - await datastore.createJson(USERS_LIST_FILE, []); - - await datastore.createJson( - ACCESS_LEVELS_FILE, - accessLevels ? accessLevels : { version: 0, levels: [] }); - - await initialiseRootSingleRecords(datastore, applicationDefinition.hierarchy); - }; - - const initialiseRootIndexes = async (datastore, hierarchy) => { - const flathierarchy = getFlattenedHierarchy(hierarchy); - const globalIndexes = $(flathierarchy, [ - fp.filter(isGlobalIndex), - ]); - - for (const index of globalIndexes) { - if (!await datastore.exists(index.nodeKey())) { - await initialiseIndex(datastore, '', index); - } - } - }; - - const initialiseRootSingleRecords = async (datastore, hierarchy) => { - const app = { - publish:()=>{}, - cleanupTransactions: () => {}, - datastore, hierarchy - }; - - const flathierarchy = getFlattenedHierarchy(hierarchy); - const singleRecords = $(flathierarchy, [ - fp.filter(isSingleRecord), - ]); - - for (let record of singleRecords) { - await datastore.createFolder(record.nodeKey()); - const result = _getNew(record, ""); - await _save(app,result); - } - }; - - const getDatabaseManager = databaseManager => ({ - createEmptyMasterDb: createEmptyMasterDb(databaseManager), - createEmptyInstanceDb: createEmptyInstanceDb(databaseManager), - getInstanceDbRootConfig: databaseManager.getInstanceDbRootConfig, - masterDatastoreConfig: getMasterDatastoreConfig(databaseManager), - getInstanceDatastoreConfig: getInstanceDatastoreConfig(databaseManager), - }); - - const getMasterDatastoreConfig = databaseManager => databaseManager.getDatastoreConfig('master'); - - const getInstanceDatastoreConfig = databaseManager => (applicationId, instanceId) => databaseManager.getDatastoreConfig( - applicationId, instanceId, - ); - - const createEmptyMasterDb = databaseManager => async () => await databaseManager.createEmptyDb('master'); - - const createEmptyInstanceDb = databaseManager => async (applicationId, instanceId) => { - if (isNothing(applicationId)) { throw new Error('CreateDb: application id not supplied'); } - if (isNothing(instanceId)) { throw new Error('CreateDb: instance id not supplied'); } - - return await databaseManager.createEmptyDb( - applicationId, - instanceId, - ); - }; - - const getAppApis = async (store, behaviourSources = null, - cleanupTransactions = null, - getEpochTime = null, - crypto = null, - appDefinition = null) => { - - store = setupDatastore(store); - - if(!appDefinition) - appDefinition = await getApplicationDefinition(store)(); - - if(!behaviourSources) - behaviourSources = await getBehaviourSources(store); - - const eventAggregator = createEventAggregator(); - - const app = { - datastore:store, - crypto, - publish:eventAggregator.publish, - hierarchy:appDefinition.hierarchy, - actions:appDefinition.actions - }; - - const templateApi = getTemplateApi(app); - - app.cleanupTransactions = isSomething(cleanupTransactions) - ? cleanupTransactions - : async () => await cleanup(app); - - app.getEpochTime = isSomething(getEpochTime) - ? getEpochTime - : async () => (new Date()).getTime(); - - const recordApi = getRecordApi(app); - const collectionApi = getCollectionApi(app); - const indexApi = getIndexApi(app); - const authApi = getAuthApi(app); - const actionsApi = getActionsApi(app); - - const authenticateAs = async (username, password) => { - app.user = await authApi.authenticate(username, password); - }; - - const withFullAccess = () => - userWithFullAccess(app); - - const asUser = (user) => { - app.user = user; - }; - - let apis = { - recordApi, - templateApi, - collectionApi, - indexApi, - authApi, - actionsApi, - subscribe: eventAggregator.subscribe, - authenticateAs, - withFullAccess, - asUser - }; - - apis.actions = initialiseActions( - eventAggregator.subscribe, - behaviourSources, - appDefinition.actions, - appDefinition.triggers, - apis); - - - return apis; - }; - - const userWithFullAccess = (app) => { - app.user = { - name: "app", - permissions : generateFullPermissions(app), - isUser:false, - temp:false - }; - return app.user; - }; - - exports.common = index; - exports.default = getAppApis; - exports.events = events; - exports.eventsList = eventsList; - exports.getActionsApi = getActionsApi; - exports.getAppApis = getAppApis; - exports.getAuthApi = getAuthApi; - exports.getCollectionApi = getCollectionApi; - exports.getDatabaseManager = getDatabaseManager; - exports.getIndexApi = getIndexApi; - exports.getRecordApi = getRecordApi; - exports.getTemplateApi = getTemplateApi; - exports.hierarchy = hierarchy; - exports.initialiseData = initialiseData; - exports.setupDatastore = setupDatastore; - exports.userWithFullAccess = userWithFullAccess; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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mVudEZvbGRlckNvbnRlbnRzW2ZvbGRlckxldmVsIC0gMV0uY29udGVudHMubGVuZ3RoID4gMDtcblxuXG4gICAgICB3aGlsZSAoZm9sZGVyTGV2ZWwgPD0gdG9wTGV2ZWwgJiYgbGFzdFBhdGhIYXNDb250ZW50KCkpIHtcblxuICAgICAgICBsZXQgdGhpc1BhdGggPSBiYXNlUGF0aDtcbiAgICAgICAgZm9yKGxldCBsZXYgPSAwOyBsZXYgPCBjdXJyZW50UG9zaXRpb24ubGVuZ3RoOyBsZXYrKykge1xuICAgICAgICAgIHRoaXNQYXRoID0gam9pbktleShcbiAgICAgICAgICAgIHRoaXNQYXRoLCBjdXJyZW50Rm9sZGVyQ29udGVudHNbbGV2XS5jb250ZW50c1swXSk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjb250ZW50c1RoaXNMZXZlbCA9IFxuICAgICAgICAgIGF3YWl0IGFwcC5kYXRhc3RvcmUuZ2V0Rm9sZGVyQ29udGVudHModGhpc1BhdGgpO1xuICAgICAgICBjdXJyZW50Rm9sZGVyQ29udGVudHMucHVzaCh7XG4gICAgICAgICAgICBjb250ZW50czpjb250ZW50c1RoaXNMZXZlbCwgXG4gICAgICAgICAgICBwYXRoOiB0aGlzUGF0aFxuICAgICAgICB9KTsgICBcblxuICAgICAgICAvLyBzaG91bGQgc3RhcnQgYXMgc29tZXRoaW5nIGxpa2UgWzAsMF1cbiAgICAgICAgaWYoZm9sZGVyTGV2ZWwgPCB0b3BMZXZlbClcbiAgICAgICAgICBjdXJyZW50UG9zaXRpb24ucHVzaCgwKTsgXG5cbiAgICAgICAgZm9sZGVyTGV2ZWwrPTE7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiAoY3VycmVudFBvc2l0aW9uLmxlbmd0aCA9PT0gbGV2ZWxzIC0gMSk7XG4gICAgfSAgXG5cbiAgICBjb25zdCBpc09uTGFzdEZvbGRlciA9IGxldmVsID0+IHtcbiAgICAgIFxuICAgICAgY29uc3QgcmVzdW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Rm9sZGVyID0gKCkgPT4gXG4gICAgICBjdXJyZW50Rm9sZGVyQ29udGVudHNbY3VycmVudEZvbGRlckNvbnRlbnRzLmxlbmd0aCAtIDFdLmNvbnRlbnRzO1xuXG4gICAgY29uc3QgZmluaW5zaGVkUmVzdWx0ID0gKHsgZG9uZTogdHJ1ZSwgcmVzdWx0OiB7IGlkczogW10sIGNvbGxlY3Rpb25LZXkgfSB9KTtcblxuICAgIGxldCBoYXNTdGFydGVkID0gZmFsc2U7XG4gICAgbGV0IGhhc01vcmUgPSB0cnVlO1xuICAgIGNvbnN0IGdldElkc0Zyb21DdXJyZW50Zm9sZGVyID0gYXN5bmMgKCkgPT4ge1xuXG4gICAgICBpZighaGFzTW9yZSkge1xuICAgICAgICByZXR1cm4gZmluaW5zaGVkUmVzdWx0O1xuICAgICAgfVxuXG4gICAgICBpZighaGFzU3RhcnRlZCkge1xuICAgICAgICBoYXNNb3JlID0gYXdhaXQgZmlyc3RGb2xkZXIoKTtcbiAgICAgICAgaGFzU3RhcnRlZCA9IHRydWU7XG4gICAgICAgIHJldHVybiAoe1xuICAgICAgICAgIHJlc3VsdDoge1xuICAgICAgICAgICAgaWRzOiBpZHNDdXJyZW50Rm9sZGVyKCksXG4gICAgICAgICAgICBjb2xsZWN0aW9uS2V5XG4gICAgICAgICAgfSxcbiAgICAgICAgICBkb25lOiBmYWxzZVxuICAgICAgICB9KVxuICAgICAgfVxuXG4gICAgICBoYXNNb3JlID0gYXdhaXQgZ2V0TmV4dEZvbGRlcigpO1xuICAgICAgXG4gICAgICByZXR1cm4gKHtcbiAgICAgICAgcmVzdWx0OiB7XG4gICAgICAgICAgaWRzOiBoYXNNb3JlID8gaWRzQ3VycmVudEZvbGRlcigpIDogW10sXG4gICAgICAgICAgY29sbGVjdGlvbktleVxuICAgICAgICB9LFxuICAgICAgICBkb25lOiAhaGFzTW9yZVxuICAgICAgfSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGdldElkc0Zyb21DdXJyZW50Z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bmV3T3V0cHV0V3JpdGVyKEJVRkZFUl9NQVhfQllURVMsIHdyaXRhYmxlU3RyZWFtKTtcbiAgICBjb25zdCB3cml0dGVuSXRlbXMgPSBbXTsgXG4gICAgYXdhaXQgcmVhZChyZWFkYWJsZVN0cmVhbSwgc2NoZW1hKShcbiAgICAgICAgYXN5bmMgaW5kZXhlZEl0ZW0gPT4ge1xuICAgICAgICAgICAgY29uc3QgdXBkYXRlZCA9IGZpbmQoaSA9PiBpbmRleGVkSXRlbS5rZXkgPT09IGkua2V5KShpdGVtc1RvV3JpdGUpO1xuICAgICAgICAgICAgY29uc3QgcmVtb3ZlZCA9IGZpbmQoayA9PiBpbmRleGVkSXRlbS5rZXkgPT09IGspKGtleXNUb1JlbW92ZSk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGlmKGlzU29tZXRoaW5nKHJlbW92ZWQpKSBcbiAgICAgICAgICAgICAgICByZXR1cm4gQ09OVElOVUVfUkVBRElOR19SRUNPUkRTO1xuXG4gICAgICAgICAgICBpZihpc1NvbWV0aGluZyh1cGRhdGVkKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNlcmlhbGl6ZWRJdGVtID0gIHNlcmlhbGl6ZUl0ZW0oc2NoZW1hLCB1cGRhdGVkKTtcbiAgICAgICAgICAgICAgICBhd2FpdCB3cml0ZShzZXJpYWxpemVkSXRlbSk7XG4gICAgICAgICAgICAgICAgd3JpdHRlbkl0ZW1zLnB1c2godXBkYXRlZCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGF3YWl0IHdyaXRlKFxuICAgICAgICAgICAgICAgICAgICBzZXJpYWxpemVJdGVtKHNjaGVtYSwgaW5kZXhlZEl0ZW0pXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0gXG5cbiAgICAgICAgICAgIHJldHVybiBDT05USU5VRV9SRUFESU5HX1JFQ09SRFM7XG5cbiAgICAgICAgfSxcbiAgICAgICAgYXN5bmMgdGV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gICBpZihzdGF0dXMgPT09IENBTkNFTF9SRUFEKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgcm93VGV4dCA9IFwiXCI7XG4gICAgICAgIGxldCBjdXJyZW50Q2hhckluZGV4PTA7XG4gICAgICAgIGZvcihsZXQgY3VycmVudENoYXIgb2YgdGV4dCkge1xuICAgICAgICAgICAgcm93VGV4dCArPSBjdXJyZW50Q2hhcjtcbiAgICAgICAgICAgIGlmKGN1cnJlbnRDaGFyID09PSBcIlxcclwiKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gYXdhaXQgb25HZXRJdGVtKFxuICAgICAgICAgICAgICAgICAgICBkZXNlcmlhbGl6ZVJvdyhzY2hlbWEsIHJvd1RleHQpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICByb3dUZXh0ID0gXCJcIjtcbiAgICAgICAgICAgICAgICBpZihzdGF0dXMgPT09IFJFQURfUkVNQUlOSU5HX1RFWFQpIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY3VycmVudENoYXJJbmRleCsrO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYoY3VycmVudENoYXJJbmRleCA8IHRleHQubGVuZ3RoIC0xKSB7XG4gICAgICAgICAgICBhd2FpdCBvbkdldFRleHQodGV4dC5zdWJzdHJpbmcoY3VycmVudENoYXJJbmRleCArIDEpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRleHQgPSBhd2FpdCByZWFkSW5wdXQoKTtcbiAgICB9XG5cbiAgICBhd2FpdCByZWFkYWJsZVN0cmVhbS5kZXN0cm95KCk7XG5cbn07XG5cbmNvbnN0IG5ld091dHB1dFdyaXRlciA9IChmbHVzaEJvdW5kYXJ5LCB3cml0YWJsZVN0cmVhbSkgPT4ge1xuICAgIFxuICAgIGxldCBjdXJyZW50QnVmZmVyID0gbn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9PiB7XG4gICAgbGV0IGN1cnJlbnRQcm9wSW5kZXggPSAwO1xuICAgIGxldCBjdXJyZW50Q2hhckluZGV4ID0gMDtcbiAgICBsZXQgY3VycmVudFZhbHVlVGV4dCA9IFwiXCI7XG4gICAgbGV0IGlzRXNjYXBlZCA9IGZhbHNlO1xuICAgIGNvbnN0IGl0ZW0gPSB7fTtcblxuICAgIGNvbnN0IHNldEN1cnJlbnRQcm9wID0gKCkgPT4ge1xuICAgICAgICBjb25zdCBjdXJyZW50UHJvcCA9IHNjaGVtYVtjdXJyZW50UHJvcEluZGV4XTtcbiAgICAgICAgY29uc3QgdHlwZSA9IGdldFR5cGUoY3VycmVudFByb3AudHlwZSk7XG4gICAgICAgIGNvbnN0IHZhbHVlID0gY3VycmVudFZhbHVlVGV4dCA9PT0gXCJcIlxuICAgICAgICAgICAgICAgICAgICAgID8gdHlwZS5nZXREZWZhdWx0VmFsdWUoKVxuICAgICAgICAgICAgICAgICAgICAgIDogdHlwZS5zYWZlUGFyc2VWYWx1ZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCk7XG4gICAgICAgIGl0ZW1bY3VycmVudFByb3AubmFtZV0gPSB2YWx1ZTtcbiAgICB9O1xuICAgIFxuICAgIHdoaWxlKGN1cnJlbnRQcm9wSW5kZXggPCBzY2hlbWEubGVuZ3RoKSB7XG5cbiAgICAgICAgaWYoY3VycmVudENoYXJJbmRleCA8IHJvd1RleHQubGVuZ3RoKSB7XG4gICAgICAgICAgICBjb25zdCBjdXJyZW50Q2hhciA9IHJvd1RleHRbY3VycmVudENoYXJJbmRleF07XG4gICAgICAgICAgICBpZihpc0VzY2FwZWQpIHtcbiAgICAgICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCJyXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCArPSBcIlxcclwiO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRWYWx1ZVRleHQgKz0gY3VycmVudENoYXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlzRXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCIsXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0Q3VycmVudFByb3AoKTtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCA9IFwiXCI7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQcm9wSW5kZXgrKztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYoY3VycmVudENoYXIgPT09IFwiXFxcXFwiKSB7XG4gICAgICAgICAgICAgICAgICAgIGlzRXNjYXBlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCArPSBjdXJyZW50Q2hhcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjdXJyZW50Q2hhckluZGV4Kys7IFxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY3VycmVudFZhbHVlVGV4dCA9IFwiXCI7XG4gICAgICAgICAgICBzZXRDdXJyZW50UHJvcCgpO1xuICAgICAgICAgICAgY3VycmVudFByb3BJbmRleCsrO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGl0ZW07XG59O1xuXG5leHBvcnQgY29uc3Qgc2VyaWFsaXplSXRlbSA9IChzY2hlbWEsIGl0ZW0pICA9PiB7XG5cbiAgICBsZXQgcm93VGV4dCA9IFwiXCJcblxuICAgIGZvcihsZXQgcHJvcCBvZiBzY2hlbWEpIHtcbiAgICAgICAgY29uc3QgdHlwZSA9IGdldFR5cGUocHJvcC50eXBlKTtcbiAgICAgICAgY29uc3QgdmFsdWUgPSBoYXMocHJvcC5uYW1lKShpdGVtKVxuICAgICAgICAgICAgICAgICAgICAgID8gaXRlbVtwcm9wLm5hbWVdXG4gICAgICAgICAgICAgICAgICAgICAgOiB0eXBlLmdldERlZmF1bHRWYWx1ZSgpXG4gICAgICAgIFxuICAgICAgICBjb25zdCB2YWxTdHIgPSB0eXBlLnN0cmluZ2lmeSh2YWx1ZSk7XG5cbiAgICAgICAgZm9yKGxldCBpID0gMDsgaSA8IHZhbFN0ci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgY29uc3QgY3VycmVudENoYXIgPSB2YWxTdHJbaV07XG4gICAgICAgICAgICBpZihjdXJyZW50Q2hhciA9PT0gXCIsXCIgXG4gICAgICAgICAgICAgICB8fCBjdXJyZW50Q2hhciA9PT0gXCJcXHJcIiBcbiAgICAgICAgICAgICAgIHx8IGN1cnJlbnRDaGFyID09PSBcIlxcXFxcIikge1xuICAgICAgICAgICAgICAgIHJvd1RleHQgKz0gXCJcXFxcXCI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmKGN1cnJlbnRDaGFyID09PSBcIlxcclwiKSB7XG4gICAgICAgICAgICAgICAgcm93VGV4dCArPSBcInJcIjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcm93VGV4dCArPSBjdXJyZW50Q2hhcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJvd1RleHQgKz0gXCIsXCI7XG4gICAgfVxuXG4gICAgcm93VGV4dCArPSBcIlxcclwiO1xuICAgIHJldHVybiByb3dUZXh0O1xufTsiLCJpbXBvcnQgbHVuciBmcm9tICdsdW5yJztcbmltcG9ydCB7cHJvbWlzZVJlYWRhYmxlU3RyZWFtfSBmcm9tIFwiLi9wcm9taXNlUmVhZGFibGVTdHJlYW1cIjtcbmltcG9ydCB7IGNyZWF0ZUluZGV4RmlsZSB9IGZyb20gJy4vc2hhcmRpbmcnO1xuaW1wb3J0IHsgZ2VuZX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V3IEVycm9yKFwid3JpdGUgYWZ0ZXIgZW5kXCIpKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgY29uc3Qgd3JpdGVFcnJvckhhbmRsZXIgPSBlcnIgPT4ge1xuICAgICAgICAgIF9lcnJvcmVkID0gdW5kZWZpbmVkO1xuICAgICAgICAgIHJlamVjdGVkID0gdHJ1ZTtcbiAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgfVxuICBcbiAgICAgICAgc3RyZWFtLm9uY2UoXCJlcnJvclwiLCB3cml0ZUVycm9ySGFuZGxlcik7XG4gIFxuICAgICAgICBjb25zdCBjYW5Xcml0ZSA9IHN0cmVhbS53cml0ZShjaHVuayk7XG4gIFxuICAgICAgICBzdHJlYW0ucmVtb3ZlTGlzdGVuZXIoXCJlcnJvclwiLCB3cml0ZUVycm9ySGFuZGxlcik7XG4gIFxuICAgICAgICBpZiAoY2FuV3JpdGUpIHtcbiAgICAgICAgICBpZiAoIXJlamVjdGVkKSB7XG4gICAgICAgICAgICByZXNvbHZlKGNodW5rLmxlbmd0aCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNvbnN0IGVycm9ySGFuZGxlciA9IGVyciA9PiB7XG4gICAgICAgICAgICBfZXJyb3JlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgICAgfVxuICBcbiAgICAgICAgICBjb25zdCBkcmFpbkhhbmRsZXIgPSAoKSA9PiB7XG4gICAgICAgICAgICByZW1vdmVMaXN0ZW5lcnMoKTtcbiAgICAgICAgICAgIHJlc29sdmUoY2h1bmsubGVuZ3RoKTtcbiAgICAgICAgICB9XG4gIFxuICAgICAgICAgIGNvbnN0IGNsb3NlSGFuZGxlciA9ICgpID0+IHtcbiAgICAgICAgICAgIHJlbW92ZUxpc3RlbmVycygpO1xuICAgICAgICAgICAgcmVzb2x2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FRLGNBQWM7RUFDdEIsUUFBUSxjQUFjO0VBQ3RCLFFBQVEsTUFBTTtFQUNkLEtBQUssQ0FBQzs7RUFFTixJQUFJLElBQUksQ0FBQyxPQUFPLEdBQUcsaUJBQWlCO0VBQ3BDLFFBQVEsZUFBZSxDQUFDLFNBQVM7RUFDakMsUUFBUSxnQkFBZ0I7RUFDeEIsUUFBUSxhQUFhLENBQUMsT0FBTztFQUM3QixRQUFRLGFBQWEsQ0FBQyxRQUFRO0VBQzlCLFFBQVEsSUFBSSxDQUFDLENBQUM7OztFQUdkLElBQUksT0FBTyxJQUFJLENBQUM7RUFDaEIsQ0FBQyxDQUFDOztBQUVGLEFBQVksUUFBQyxrQkFBa0IsR0FBRyxDQUFDLEdBQUcsS0FBSztFQUMzQyxJQUFJLEdBQUcsQ0FBQyxJQUFJLEdBQUc7RUFDZixRQUFRLElBQUksRUFBRSxLQUFLO0VBQ25CLFFBQVEsV0FBVyxHQUFHLHVCQUF1QixDQUFDLEdBQUcsQ0FBQztFQUNsRCxRQUFRLE1BQU0sQ0FBQyxLQUFLO0VBQ3BCLFFBQVEsSUFBSSxDQUFDLEtBQUs7RUFDbEIsTUFBSztFQUNMLElBQUksT0FBTyxHQUFHLENBQUMsSUFBSSxDQUFDO0VBQ3BCLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ== diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index eb1eafb60e..67a0b8b14d 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -59,7 +59,7 @@ export default { external: [ "lodash", "lodash/fp", "date-fns", "lunr", "safe-buffer", "shortid", - "@nx-js/compiler-util" + "@nx-js/compiler-util", "bcryptjs" ] }; diff --git a/packages/server/appPackages/testApp/yarn.lock b/packages/server/appPackages/testApp/yarn.lock index 47cc20a767..6471f44f81 100644 --- a/packages/server/appPackages/testApp/yarn.lock +++ b/packages/server/appPackages/testApp/yarn.lock @@ -3,22 +3,28 @@ "@budibase/client@file:../../../client": - version "0.0.15" + version "0.0.16" dependencies: "@nx-js/compiler-util" "^2.0.0" + bcryptjs "^2.4.3" lodash "^4.17.15" lunr "^2.3.5" shortid "^2.2.8" svelte "^3.9.2" "@budibase/standard-components@file:../../../standard-components": - version "0.0.15" + version "0.0.16" "@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== +bcryptjs@^2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb" + integrity sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms= + lodash@^4.17.15: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index c99e0e0cf7..f4ad571cdd 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -131,29 +131,6 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@budibase/client@^0.0.16": - version "0.0.16" - resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.0.16.tgz#4eef9373816448e99cafd2714f417c6610af5e69" - integrity sha512-fx4ptePj7+IehM37xdNPHdu5jEUgAFmDx23jI0yb4sI6Z5U4gxH10FZYyoJ/A9KdzmShsIfgrmudV5ffvoehdg== - dependencies: - "@nx-js/compiler-util" "^2.0.0" - lodash "^4.17.15" - lunr "^2.3.5" - shortid "^2.2.8" - svelte "^3.9.2" - -"@budibase/core@^0.0.16": - version "0.0.16" - resolved "https://registry.yarnpkg.com/@budibase/core/-/core-0.0.16.tgz#efff16876f906b2aa59803c3312ec7593664b623" - integrity sha512-DvzfurHHp9KkSjkvbGbKsVczR5ne38bMLRA2hHEJxAmC0Tshld06cEq7HMy2BmPb6kaC1URYHlFs/gPhW2cSFQ== - dependencies: - "@nx-js/compiler-util" "^2.0.0" - 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.3" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" @@ -322,11 +299,6 @@ path-to-regexp "^1.1.1" urijs "^1.19.0" -"@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== - "@types/babel__core@^7.1.0": version "7.1.2" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" @@ -1073,11 +1045,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" @@ -2785,7 +2752,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.15: +lodash@^4.17.11, lodash@^4.17.13: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -2810,11 +2777,6 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -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@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -2976,11 +2938,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.8" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.8.tgz#2dbb0224231b246e3b4c819de7bfea6384dabf08" - integrity sha512-g1z+n5s26w0TGKh7gjn7HCqurNKMZWzH08elXzh/gM/csQHd/UqDV6uxMghQYg9IvqRPm1QpeMk50YMofHvEjQ== - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -3816,13 +3773,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" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -4100,11 +4050,6 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" -svelte@^3.9.2: - version "3.16.7" - resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.16.7.tgz#9ade80a4bbbac95595c676dd817222f632fa2c07" - integrity sha512-egrva1UklB1n7KAv179IhDpQzMGAvubJUlOQ9PitmmZmAfrCUEgrQnx2vPxn2s+mGV3aYegXvJ/yQ35N2SfnYQ== - symbol-tree@^3.2.2: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"