From 0c373a9fb4691f16805c1657306f4e9fae72ab41 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Thu, 1 Oct 2020 16:55:17 +0100 Subject: [PATCH 01/15] fix: view filter handle bool, number & date --- .../database/DataTable/popovers/Filter.svelte | 17 ++++++++++++----- .../src/api/controllers/view/viewBuilder.js | 5 ++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index e7ecdcb8b6..ad602768b0 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -81,11 +81,18 @@ function isMultipleChoice(field) { return ( - viewModel.schema[field].constraints && - viewModel.schema[field].constraints.inclusion && - viewModel.schema[field].constraints.inclusion.length + (viewModel.schema[field].constraints && + viewModel.schema[field].constraints.inclusion && + viewModel.schema[field].constraints.inclusion.length) || + viewModel.schema[field].type === "boolean" ) } + + function fieldOptions(field) { + return viewModel.schema[field].type === "string" + ? viewModel.schema[field].constraints.inclusion + : [true, false] + }
@@ -126,8 +133,8 @@ {#if filter.key && isMultipleChoice(filter.key)} {:else} diff --git a/packages/server/src/api/controllers/view/viewBuilder.js b/packages/server/src/api/controllers/view/viewBuilder.js index 6ac3fdb0f2..036f68ecc6 100644 --- a/packages/server/src/api/controllers/view/viewBuilder.js +++ b/packages/server/src/api/controllers/view/viewBuilder.js @@ -61,8 +61,11 @@ function parseFilterExpression(filters) { `doc["${filter.key}"].${TOKEN_MAP[filter.condition]}("${filter.value}")` ) } else { + const value = + typeof filter.value == "string" ? `"${filter.value}"` : filter.value + expression.push( - `doc["${filter.key}"] ${TOKEN_MAP[filter.condition]} "${filter.value}"` + `doc["${filter.key}"] ${TOKEN_MAP[filter.condition]} ${value}` ) } } From 2d80b2be3d216c1bf000d743e5780a2db848d195 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Thu, 1 Oct 2020 17:07:53 +0100 Subject: [PATCH 02/15] Added datepicker to view filters --- .../components/database/DataTable/popovers/Filter.svelte | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index ad602768b0..ca3cb57bdd 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -6,6 +6,7 @@ Icon, Input, Select, + DatePicker, } from "@budibase/bbui" import { backendUiStore } from "builderStore" import { notifier } from "builderStore/store/notifications" @@ -93,6 +94,10 @@ ? viewModel.schema[field].constraints.inclusion : [true, false] } + + function isDate(field) { + return viewModel.schema[field].type === "datetime" + }
@@ -137,6 +142,10 @@ {/each} + {:else if filter.key && isDate(filter.key)} + {:else} Date: Thu, 1 Oct 2020 17:34:25 +0100 Subject: [PATCH 03/15] fix: View filter - handle change of field type --- .../database/DataTable/popovers/Filter.svelte | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte index ca3cb57bdd..ac3a9c4e95 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Filter.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Filter.svelte @@ -98,6 +98,22 @@ function isDate(field) { return viewModel.schema[field].type === "datetime" } + + function isNumber(field) { + return viewModel.schema[field].type === "number" + } + + const fieldChanged = filter => ev => { + // reset if type changed + if ( + filter.key && + ev.target.value && + viewModel.schema[filter.key].type !== + viewModel.schema[ev.target.value].type + ) { + filter.value = "" + } + }
@@ -124,7 +140,11 @@ {/each} {/if} - {#each fields as field} @@ -138,6 +158,7 @@ {#if filter.key && isMultipleChoice(filter.key)} {:else} Date: Thu, 1 Oct 2020 21:03:22 +0100 Subject: [PATCH 04/15] Calculate: stats is only option - remove select --- .../database/DataTable/popovers/Calculate.svelte | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte b/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte index a736ff61e8..ca5b9cefd7 100644 --- a/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte +++ b/packages/builder/src/components/database/DataTable/popovers/Calculate.svelte @@ -34,6 +34,7 @@ ) function saveView() { + if (!view.calculation) view.calculation = "stats" backendUiStore.actions.views.save(view) notifier.success(`View ${view.name} saved.`) analytics.captureEvent("Added View Calculate", { field: view.field }) @@ -50,14 +51,15 @@
Calculate
-

The

+ +

The statistics of

From 3e1e865bb4a2abca3d2eb8367c620615da0ecc38 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 2 Oct 2020 14:14:58 +0100 Subject: [PATCH 07/15] record value coersion - untested --- packages/server/src/api/controllers/record.js | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/packages/server/src/api/controllers/record.js b/packages/server/src/api/controllers/record.js index 2626667ef3..508a2210b6 100644 --- a/packages/server/src/api/controllers/record.js +++ b/packages/server/src/api/controllers/record.js @@ -33,6 +33,8 @@ exports.patch = async function(ctx) { const model = await db.get(record.modelId) const patchfields = ctx.request.body + coersceRecordValues(record, model) + for (let key in patchfields) { if (!model.schema[key]) continue record[key] = patchfields[key] @@ -71,6 +73,8 @@ exports.save = async function(ctx) { const model = await db.get(record.modelId) + coersceRecordValues(record, model) + const validateResult = await validate({ record, model, @@ -218,3 +222,52 @@ async function validate({ instanceId, modelId, record, model }) { } return { valid: Object.keys(errors).length === 0, errors } } + +function coersceRecordValues(record, model) { + for (let [key, value] of Object.entries(record)) { + const field = model.schema[key] + if (!field) continue + const mapping = Object.prototype.hasOwnProperty.call( + TYPE_TRANSFORM_MAP, + value + ) + ? TYPE_TRANSFORM_MAP[field.type][value] + : TYPE_TRANSFORM_MAP[field.type].parse + + record[key] = typeof mapping === "function" ? mapping(value) : mapping + } +} + +const TYPE_TRANSFORM_MAP = { + string: { + "": "", + [null]: "", + [undefined]: undefined, + parse: s => s.toString(), + }, + number: { + "": null, + [undefined]: undefined, + parse: n => parseFloat(n), + }, + datetime: { + "": null, + [undefined]: undefined, + [null]: null, + parse: d => new Date(d).getTime(), + }, + attachments: { + [null]: [], + [undefined]: undefined, + parse: a => a, + }, + boolean: { + [null]: null, + [undefined]: undefined, + parse: b => { + if (b === "false") return false + if (b === "true") return true + return b + }, + }, +} From 267e8e39aadb2136c85e615909a654808d57399d Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 5 Oct 2020 17:28:23 +0100 Subject: [PATCH 08/15] Coerse record fields, to be a bit more tolerant of data input --- .../builder/src/constants/backend/index.js | 10 +- packages/server/src/api/controllers/record.js | 19 ++-- .../src/api/routes/tests/couchTestUtils.js | 4 +- .../src/api/routes/tests/record.spec.js | 91 ++++++++++++++++++- 4 files changed, 108 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index 45de862a98..8cf9f12230 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -6,7 +6,7 @@ export const FIELDS = { constraints: { type: "string", length: {}, - presence: { allowEmpty: true }, + presence: false, }, }, NUMBER: { @@ -15,7 +15,7 @@ export const FIELDS = { type: "number", constraints: { type: "number", - presence: { allowEmpty: true }, + presence: false, numericality: { greaterThanOrEqualTo: "", lessThanOrEqualTo: "" }, }, }, @@ -25,7 +25,7 @@ export const FIELDS = { type: "boolean", constraints: { type: "boolean", - presence: { allowEmpty: true }, + presence: false, }, }, // OPTIONS: { @@ -44,7 +44,7 @@ export const FIELDS = { constraints: { type: "string", length: {}, - presence: { allowEmpty: true }, + presence: false, datetime: { latest: "", earliest: "", @@ -57,7 +57,7 @@ export const FIELDS = { type: "attachment", constraints: { type: "array", - presence: { allowEmpty: true }, + presence: false, }, }, // LINKED_FIELDS: { diff --git a/packages/server/src/api/controllers/record.js b/packages/server/src/api/controllers/record.js index 508a2210b6..586bb81074 100644 --- a/packages/server/src/api/controllers/record.js +++ b/packages/server/src/api/controllers/record.js @@ -33,7 +33,7 @@ exports.patch = async function(ctx) { const model = await db.get(record.modelId) const patchfields = ctx.request.body - coersceRecordValues(record, model) + coerceRecordValues(record, model) for (let key in patchfields) { if (!model.schema[key]) continue @@ -73,7 +73,7 @@ exports.save = async function(ctx) { const model = await db.get(record.modelId) - coersceRecordValues(record, model) + coerceRecordValues(record, model) const validateResult = await validate({ record, @@ -223,12 +223,12 @@ async function validate({ instanceId, modelId, record, model }) { return { valid: Object.keys(errors).length === 0, errors } } -function coersceRecordValues(record, model) { +function coerceRecordValues(record, model) { for (let [key, value] of Object.entries(record)) { const field = model.schema[key] if (!field) continue const mapping = Object.prototype.hasOwnProperty.call( - TYPE_TRANSFORM_MAP, + TYPE_TRANSFORM_MAP[field.type], value ) ? TYPE_TRANSFORM_MAP[field.type][value] @@ -243,10 +243,11 @@ const TYPE_TRANSFORM_MAP = { "": "", [null]: "", [undefined]: undefined, - parse: s => s.toString(), + parse: s => s, }, number: { "": null, + [null]: null, [undefined]: undefined, parse: n => parseFloat(n), }, @@ -254,19 +255,21 @@ const TYPE_TRANSFORM_MAP = { "": null, [undefined]: undefined, [null]: null, - parse: d => new Date(d).getTime(), + parse: d => d, }, - attachments: { + attachment: { + "": [], [null]: [], [undefined]: undefined, parse: a => a, }, boolean: { + "": null, [null]: null, [undefined]: undefined, parse: b => { - if (b === "false") return false if (b === "true") return true + if (b === "false") return false return b }, }, diff --git a/packages/server/src/api/routes/tests/couchTestUtils.js b/packages/server/src/api/routes/tests/couchTestUtils.js index a22a2a427f..56462837dd 100644 --- a/packages/server/src/api/routes/tests/couchTestUtils.js +++ b/packages/server/src/api/routes/tests/couchTestUtils.js @@ -46,13 +46,13 @@ exports.createModel = async (request, appId, instanceId, model) => { key: "name", schema: { name: { - type: "text", + type: "string", constraints: { type: "string", }, }, description: { - type: "text", + type: "string", constraints: { type: "string", }, diff --git a/packages/server/src/api/routes/tests/record.spec.js b/packages/server/src/api/routes/tests/record.spec.js index 1944499e0f..1b0381a924 100644 --- a/packages/server/src/api/routes/tests/record.spec.js +++ b/packages/server/src/api/routes/tests/record.spec.js @@ -38,7 +38,7 @@ describe("/records", () => { const createRecord = async r => await request - .post(`/api/${model._id}/records`) + .post(`/api/${r ? r.modelId : record.modelId}/records`) .send(r || record) .set(defaultHeaders(app._id, instance._id)) .expect('Content-Type', /json/) @@ -152,6 +152,95 @@ describe("/records", () => { .expect('Content-Type', /json/) .expect(404) }) + + it("record values are coerced", async () => { + const str = {type:"string", constraints: { type: "string", presence: false }} + const attachment = {type:"attachment", constraints: { type: "array", presence: false }} + const bool = {type:"boolean", constraints: { type: "boolean", presence: false }} + const number = {type:"number", constraints: { type: "number", presence: false }} + const datetime = {type:"datetime", constraints: { type: "string", presence: false, datetime: {earliest:"", latest: ""} }} + + model = await createModel(request, app._id, instance._id, { + name: "TestModel2", + type: "model", + key: "name", + schema: { + name: str, + stringUndefined: str, + stringNull: str, + stringString: str, + numberEmptyString: number, + numberNull: number, + numberUndefined: number, + numberString: number, + datetimeEmptyString: datetime, + datetimeNull: datetime, + datetimeUndefined: datetime, + datetimeString: datetime, + datetimeDate: datetime, + boolNull: bool, + boolEmpty: bool, + boolUndefined: bool, + boolString: bool, + boolBool: bool, + attachmentNull : attachment, + attachmentUndefined : attachment, + attachmentEmpty : attachment, + }, + }) + + record = { + name: "Test Record", + stringUndefined: undefined, + stringNull: null, + stringString: "i am a string", + numberEmptyString: "", + numberNull: null, + numberUndefined: undefined, + numberString: "123", + numberNumber: 123, + datetimeEmptyString: "", + datetimeNull: null, + datetimeUndefined: undefined, + datetimeString: "1984-04-20T00:00:00.000Z", + datetimeDate: new Date("1984-04-20"), + boolNull: null, + boolEmpty: "", + boolUndefined: undefined, + boolString: "true", + boolBool: true, + modelId: model._id, + attachmentNull : null, + attachmentUndefined : undefined, + attachmentEmpty : "", + } + + const id = (await createRecord(record)).body._id + + const saved = (await loadRecord(id)).body + + expect(saved.stringUndefined).toBe(undefined) + expect(saved.stringNull).toBe("") + expect(saved.stringString).toBe("i am a string") + expect(saved.numberEmptyString).toBe(null) + expect(saved.numberNull).toBe(null) + expect(saved.numberUndefined).toBe(undefined) + expect(saved.numberString).toBe(123) + expect(saved.numberNumber).toBe(123) + expect(saved.datetimeEmptyString).toBe(null) + expect(saved.datetimeNull).toBe(null) + expect(saved.datetimeUndefined).toBe(undefined) + expect(saved.datetimeString).toBe(new Date(record.datetimeString).toISOString()) + expect(saved.datetimeDate).toBe(record.datetimeDate.toISOString()) + expect(saved.boolNull).toBe(null) + expect(saved.boolEmpty).toBe(null) + expect(saved.boolUndefined).toBe(undefined) + expect(saved.boolString).toBe(true) + expect(saved.boolBool).toBe(true) + expect(saved.attachmentNull).toEqual([]) + expect(saved.attachmentUndefined).toBe(undefined) + expect(saved.attachmentEmpty).toEqual([]) + }) }) describe("patch", () => { From 775aa0e92c097f11b267dc6e776e5d875544d43b Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 5 Oct 2020 17:28:44 +0100 Subject: [PATCH 09/15] Metrics - event props not populating correctly --- .../DataTable/modals/CreateEditColumn.svelte | 19 ++++++++++--------- .../nav/ModelNavigator/CreateTable.svelte | 2 +- .../components/start/CreateAppModal.svelte | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte index 270e4b6e25..1e5e23823c 100644 --- a/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/database/DataTable/modals/CreateEditColumn.svelte @@ -24,11 +24,7 @@ } let originalName = field.name - - $: required = - field.constraints && - field.constraints.presence && - !field.constraints.presence.allowEmpty + $: required = field && field.constraints && field.constraints.presence async function saveColumn() { backendUiStore.update(state => { @@ -50,6 +46,14 @@ field.type = type field.constraints = constraints } + + const getPresence = required => (required ? { allowEmpty: false } : false) + + const requiredChanged = ev => { + const req = ev.target.checked + field.constraints.presence = req ? { allowEmpty: false } : false + required = req + }
@@ -68,10 +72,7 @@
- (field.constraints.presence.allowEmpty = required)} /> +
{#if field.type === 'string' && field.constraints} diff --git a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte index 3c05b0de00..0f4b604166 100644 --- a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte +++ b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte @@ -18,9 +18,9 @@ }) notifier.success(`Table ${name} created successfully.`) $goto(`./model/${model._id}`) + analytics.captureEvent("Table Created", { name }) name = "" dropdown.hide() - analytics.captureEvent("Table Created", { name }) } const onClosed = () => { diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 84ddd9f8ec..2aa7097685 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -145,7 +145,7 @@ }) const appJson = await appResp.json() analytics.captureEvent("App Created", { - name, + name: $createAppStore.values.applicationName, appId: appJson._id, }) From e4d4e2cd1c6d07c6720b7a9dc0e61e4c46891912 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 5 Oct 2020 17:41:16 +0100 Subject: [PATCH 10/15] API Key - Changed placholder to instruct Command V (as the right-click menu does not work in electron) --- packages/builder/src/components/start/Steps/API.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/start/Steps/API.svelte b/packages/builder/src/components/start/Steps/API.svelte index 5f7a6d71f8..d954330d64 100644 --- a/packages/builder/src/components/start/Steps/API.svelte +++ b/packages/builder/src/components/start/Steps/API.svelte @@ -11,7 +11,7 @@ on:input={() => (blurred.api = true)} label="API Key" name="apiKey" - placeholder="Enter your API Key" + placeholder="Use command-V to paste your API Key" type="password" error={blurred.api && validationErrors.apiKey} /> Get API Key From c0e008181d860eee2ceb967e3898f5c962f964d5 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 5 Oct 2020 20:58:07 +0100 Subject: [PATCH 11/15] broken tests --- packages/server/src/api/routes/tests/model.spec.js | 2 +- packages/server/src/api/routes/tests/view.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/routes/tests/model.spec.js b/packages/server/src/api/routes/tests/model.spec.js index 23214b95c3..a0b5185000 100644 --- a/packages/server/src/api/routes/tests/model.spec.js +++ b/packages/server/src/api/routes/tests/model.spec.js @@ -180,7 +180,7 @@ describe("/models", () => { key: "name", schema: { name: { - type: "text", + type: "string", constraints: { type: "string", }, diff --git a/packages/server/src/api/routes/tests/view.spec.js b/packages/server/src/api/routes/tests/view.spec.js index ac8ade122f..d4bdee1283 100644 --- a/packages/server/src/api/routes/tests/view.spec.js +++ b/packages/server/src/api/routes/tests/view.spec.js @@ -69,13 +69,13 @@ describe("/views", () => { filters: [], schema: { name: { - type: "text", + type: "string", constraints: { type: "string" }, }, description: { - type: "text", + type: "string", constraints: { type: "string" }, From b51942f0f8743ffdb02e5f0701ba7b99309c2283 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 5 Oct 2020 21:15:10 +0100 Subject: [PATCH 12/15] broken test --- packages/builder/cypress/integration/createView.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index 3ccf4d5cfd..81af40c7f7 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -47,8 +47,9 @@ context('Create a View', () => { it('creates a stats calculation view based on age', () => { cy.contains("Calculate").click() - cy.get(".menu-container").find("select").first().select("Statistics") - cy.get(".menu-container").find("select").eq(1).select("age") + // we may reinstate this - have commented this dropdown for now as there is only one option + //cy.get(".menu-container").find("select").first().select("Statistics") + cy.get(".menu-container").find("select").eq(0).select("age") cy.contains("Save").click() cy.get("thead th").should(($headers) => { expect($headers).to.have.length(7) From b9108f013d5527e4a22dc8b818abd02f06d8d0d4 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 5 Oct 2020 21:21:00 +0100 Subject: [PATCH 13/15] missing dependency --- packages/server/package.json | 1 + packages/server/yarn.lock | 328 ++++++++++++++++++++++++++++++++++- 2 files changed, 324 insertions(+), 5 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 1875e44285..0b4d282aaf 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,6 +71,7 @@ "pino-pretty": "^4.0.0", "pouchdb": "^7.2.1", "pouchdb-all-dbs": "^1.0.2", + "pouchdb-replication-stream": "^1.2.9", "sharp": "^0.26.0", "squirrelly": "^7.5.0", "tar-fs": "^2.1.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index de283385a8..d05266756a 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -172,6 +172,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@budibase/client@^0.1.23": + version "0.1.23" + resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.1.23.tgz#d72d2b26ff3a2d99f2b6c1b71020b1136880937d" + integrity sha512-pZdwdCq5kKLZfZYxasIHBNnqu3BFFrqJLxXMFs0K9ddCVZ0UNons59nn73nFGbeRgNVdWp6yyW71XyMQr8NOEw== + dependencies: + deep-equal "^2.0.1" + mustache "^4.0.1" + regexparam "^1.3.0" + "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -867,6 +876,11 @@ array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -925,6 +939,13 @@ atomic-sleep@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" +available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" + integrity sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ== + dependencies: + array-filter "^1.0.0" + aws-sdk@^2.706.0: version "2.706.0" resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.706.0.tgz#09f65e9a91ecac5a635daf934082abae30eca953" @@ -1725,6 +1746,26 @@ decompress@^4.2.1: pify "^2.3.0" strip-dirs "^2.0.0" +deep-equal@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.4.tgz#6b0b407a074666033169df3acaf128e1c6f3eab6" + integrity sha512-BUfaXrVoCfgkOQY/b09QdO9L3XNoF2XH0A3aY9IQwQL/ZjLOe8FQgCNVl1wiolhsFo8kFdO9zdPViCPbmaJA5w== + dependencies: + es-abstract "^1.18.0-next.1" + es-get-iterator "^1.1.0" + is-arguments "^1.0.4" + is-date-object "^1.0.2" + is-regex "^1.1.1" + isarray "^2.0.5" + object-is "^1.1.3" + object-keys "^1.1.1" + object.assign "^4.1.1" + regexp.prototype.flags "^1.3.0" + side-channel "^1.0.3" + which-boxed-primitive "^1.0.1" + which-collection "^1.0.1" + which-typed-array "^1.1.2" + deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -2073,6 +2114,54 @@ es-abstract@^1.17.0-next.1, es-abstract@^1.17.2, es-abstract@^1.17.5: string.prototype.trimleft "^2.1.1" string.prototype.trimright "^2.1.1" +es-abstract@^1.17.4: + version "1.17.7" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.7.tgz#a4de61b2f66989fc7421676c1cb9787573ace54c" + integrity sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-abstract@^1.18.0-next.0, es-abstract@^1.18.0-next.1: + version "1.18.0-next.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0-next.1.tgz#6e3a0a4bda717e5023ab3b8e90bec36108d22c68" + integrity sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA== + dependencies: + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + is-callable "^1.2.2" + is-negative-zero "^2.0.0" + is-regex "^1.1.1" + object-inspect "^1.8.0" + object-keys "^1.1.1" + object.assign "^4.1.1" + string.prototype.trimend "^1.0.1" + string.prototype.trimstart "^1.0.1" + +es-get-iterator@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.0.tgz#bb98ad9d6d63b31aacdc8f89d5d0ee57bcb5b4c8" + integrity sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ== + dependencies: + es-abstract "^1.17.4" + has-symbols "^1.0.1" + is-arguments "^1.0.4" + is-map "^2.0.1" + is-set "^2.0.1" + is-string "^1.0.5" + isarray "^2.0.5" + es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -3112,6 +3201,11 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" +is-arguments@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" + integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3121,12 +3215,22 @@ is-arrayish@^0.3.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== +is-bigint@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.0.tgz#73da8c33208d00f130e9b5e15d23eac9215601c4" + integrity sha512-t5mGUXC/xRheCK431ylNiSkGGpBp8bHENBcENTkDT6ppwPzEVxNGZRvgvmOEfbWkFhA7D2GEuE2mmQTr78sl2g== + is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" dependencies: binary-extensions "^2.0.0" +is-boolean-object@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e" + integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ== + is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -3135,6 +3239,11 @@ is-callable@^1.1.4, is-callable@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" +is-callable@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.2.tgz#c7c6715cd22d4ddb48d3e19970223aceabb080d9" + integrity sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA== + is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -3157,7 +3266,7 @@ is-data-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-date-object@^1.0.1: +is-date-object@^1.0.1, is-date-object@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.2.tgz#bda736f2cd8fd06d32844e7743bfa7494c3bfd7e" @@ -3227,15 +3336,30 @@ is-installed-globally@^0.3.1: global-dirs "^2.0.1" is-path-inside "^3.0.1" +is-map@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" + integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== + is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= +is-negative-zero@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.0.tgz#9553b121b0fac28869da9ed459e20c7543788461" + integrity sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE= + is-npm@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d" +is-number-object@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" + integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -3276,15 +3400,32 @@ is-regex@^1.0.5: dependencies: has "^1.0.3" +is-regex@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.1.tgz#c6f98aacc546f6cec5468a07b7b153ab564a57b9" + integrity sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg== + dependencies: + has-symbols "^1.0.1" + is-retry-allowed@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== +is-set@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.1.tgz#d1604afdab1724986d30091575f54945da7e5f43" + integrity sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA== + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-string@^1.0.4, is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + is-symbol@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" @@ -3299,10 +3440,30 @@ is-type-of@^1.0.0: is-class-hotfix "~0.0.6" isstream "~0.1.2" +is-typed-array@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.3.tgz#a4ff5a5e672e1a55f99c7f54e59597af5c1df04d" + integrity sha512-BSYUBOK/HJibQ30wWkWold5txYwMUXQct9YHAQJr8fSwvZoiglcqB0pd7vEN23+Tsi9IUEjztdOSzl4qLVYGTQ== + dependencies: + available-typed-arrays "^1.0.0" + es-abstract "^1.17.4" + foreach "^2.0.5" + has-symbols "^1.0.1" + is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-weakmap@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== + +is-weakset@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83" + integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw== + is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -3323,6 +3484,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isbinaryfile@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.6.tgz#edcb62b224e2b4710830b67498c8e4e5a4d2610b" @@ -4180,6 +4346,13 @@ lie@3.0.4: inline-process-browser "^1.0.0" unreachable-branch-transform "^0.3.0" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha1-mkNrLMd0bKWd56QfpGmz77dr2H4= + dependencies: + immediate "~3.0.5" + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -4242,6 +4415,11 @@ lodash.once@^4.0.0: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" +lodash.pick@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= + lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -4504,6 +4682,16 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +ndjson@^1.4.3: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ndjson/-/ndjson-1.5.0.tgz#ae603b36b134bcec347b452422b0bf98d5832ec8" + integrity sha1-rmA7NrE0vOw0e0UkIrC/mNWDLsg= + dependencies: + json-stringify-safe "^5.0.1" + minimist "^1.2.0" + split2 "^2.1.0" + through2 "^2.0.3" + negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -4668,6 +4856,19 @@ object-inspect@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" +object-inspect@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0" + integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA== + +object-is@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.3.tgz#2e3b9e65560137455ee3bd62aec4d90a2ea1cc81" + integrity sha512-teyqLvFWzLkq5B9ki8FVWA902UER2qkxmdA4nLf+wjOLAWgxzCWZNCxpDq9MvE8MmhWNr+I8w3BN49Vx36Y6Xg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -4687,6 +4888,16 @@ object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" +object.assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.1.tgz#303867a666cdd41936ecdedfb1f8f3e32a478cdd" + integrity sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.18.0-next.0" + has-symbols "^1.0.1" + object-keys "^1.1.1" + object.getownpropertydescriptors@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" @@ -4974,6 +5185,14 @@ posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" +pouch-stream@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/pouch-stream/-/pouch-stream-0.4.1.tgz#0c6d8475c9307677627991a2f079b301c3b89bdd" + integrity sha1-DG2EdckwdndieZGi8HmzAcO4m90= + dependencies: + inherits "^2.0.1" + readable-stream "^1.0.27-1" + pouchdb-adapter-leveldb-core@7.2.1: version "7.2.1" resolved "https://registry.yarnpkg.com/pouchdb-adapter-leveldb-core/-/pouchdb-adapter-leveldb-core-7.2.1.tgz#71bf2a05755689e2b05e78e796003a18ebf65a69" @@ -5061,6 +5280,26 @@ pouchdb-promise@5.4.3: dependencies: lie "3.0.4" +pouchdb-promise@^6.0.4: + version "6.4.3" + resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-6.4.3.tgz#74516f4acf74957b54debd0fb2c0e5b5a68ca7b3" + integrity sha512-ruJaSFXwzsxRHQfwNHjQfsj58LBOY1RzGzde4PM5CWINZwFjCQAhZwfMrch2o/0oZT6d+Xtt0HTWhq35p3b0qw== + dependencies: + lie "3.1.1" + +pouchdb-replication-stream@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/pouchdb-replication-stream/-/pouchdb-replication-stream-1.2.9.tgz#aa4fa5d8f52df4825392f18e07c7e11acffc650a" + integrity sha1-qk+l2PUt9IJTkvGOB8fhGs/8ZQo= + dependencies: + argsarray "0.0.1" + inherits "^2.0.3" + lodash.pick "^4.0.0" + ndjson "^1.4.3" + pouch-stream "^0.4.0" + pouchdb-promise "^6.0.4" + through2 "^2.0.0" + pouchdb-utils@7.2.1: version "7.2.1" resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-7.2.1.tgz#5dec1c53c8ecba717e5762311e9a1def2d4ebf9c" @@ -5321,7 +5560,17 @@ readable-stream@1.0.33: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.0, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5: +readable-stream@^1.0.27-1: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.0, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" dependencies: @@ -5374,6 +5623,19 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexp.prototype.flags@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" + integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.0-next.1" + +regexparam@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f" + integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== + regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -5692,6 +5954,14 @@ shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" +side-channel@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.3.tgz#cdc46b057550bbab63706210838df5d4c19519c3" + integrity sha512-A6+ByhlLkksFoUepsGxfj5x1gTSrs+OydsRptUxeNCabQpCFUvcwIczgOigI8vhY/OJCnPnyE9rGiwgvr9cS1g== + dependencies: + es-abstract "^1.18.0-next.0" + object-inspect "^1.8.0" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" @@ -5877,6 +6147,13 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" +split2@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + integrity sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== + dependencies: + through2 "^2.0.2" + split2@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/split2/-/split2-3.1.1.tgz#c51f18f3e06a8c4469aaab487687d8d956160bb6" @@ -5981,7 +6258,7 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.trimend@^1.0.0: +string.prototype.trimend@^1.0.0, string.prototype.trimend@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz#85812a6b847ac002270f5808146064c995fb6913" dependencies: @@ -6004,7 +6281,7 @@ string.prototype.trimright@^2.1.1: es-abstract "^1.17.5" string.prototype.trimend "^1.0.0" -string.prototype.trimstart@^1.0.0: +string.prototype.trimstart@^1.0.0, string.prototype.trimstart@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz#14af6d9f34b053f7cfc89b72f8f2ee14b9039a54" dependencies: @@ -6234,6 +6511,14 @@ through2@^0.6.2, through2@^0.6.5: readable-stream ">=1.0.33-1 <1.1.0-0" xtend ">=4.0.0 <4.1.0-0" +through2@^2.0.0, through2@^2.0.2, through2@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + through@^2.3.6, through@^2.3.8, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -6611,6 +6896,27 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +which-boxed-primitive@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz#cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1" + integrity sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ== + dependencies: + is-bigint "^1.0.0" + is-boolean-object "^1.0.0" + is-number-object "^1.0.3" + is-string "^1.0.4" + is-symbol "^1.0.2" + +which-collection@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" + integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + dependencies: + is-map "^2.0.1" + is-set "^2.0.1" + is-weakmap "^2.0.1" + is-weakset "^2.0.1" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -6620,6 +6926,18 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= +which-typed-array@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.2.tgz#e5f98e56bda93e3dac196b01d47c1156679c00b2" + integrity sha512-KT6okrd1tE6JdZAy3o2VhMoYPh3+J6EMZLyrxBQsZflI1QCZIxMrIYLkosd8Twf+YfknVIHmYQPgJt238p8dnQ== + dependencies: + available-typed-arrays "^1.0.2" + es-abstract "^1.17.5" + foreach "^2.0.5" + function-bind "^1.1.1" + has-symbols "^1.0.1" + is-typed-array "^1.1.3" + which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -6724,7 +7042,7 @@ xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0: +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" From ed8371c41fdc7e78716ff94c561c692c542e5e95 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Tue, 6 Oct 2020 21:37:10 +0100 Subject: [PATCH 14/15] a few changes from code review --- packages/server/src/api/controllers/record.js | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/packages/server/src/api/controllers/record.js b/packages/server/src/api/controllers/record.js index 354380a620..58327d0d2f 100644 --- a/packages/server/src/api/controllers/record.js +++ b/packages/server/src/api/controllers/record.js @@ -1,6 +1,7 @@ const CouchDB = require("../../db") const validateJs = require("validate.js") const { getRecordParams, generateRecordID } = require("../../db/utils") +const { cloneDeep } = require("lodash") const MODEL_VIEW_BEGINS_WITH = "all_model:" @@ -31,11 +32,11 @@ validateJs.extend(validateJs.validators.datetime, { exports.patch = async function(ctx) { const db = new CouchDB(ctx.user.instanceId) - const record = await db.get(ctx.params.id) + let record = await db.get(ctx.params.id) const model = await db.get(record.modelId) const patchfields = ctx.request.body - coerceRecordValues(record, model) + record = coerceRecordValues(record, model) for (let key in patchfields) { if (!model.schema[key]) continue @@ -66,7 +67,7 @@ exports.patch = async function(ctx) { exports.save = async function(ctx) { const db = new CouchDB(ctx.user.instanceId) - const record = ctx.request.body + let record = ctx.request.body record.modelId = ctx.params.modelId if (!record._rev && !record._id) { @@ -75,7 +76,7 @@ exports.save = async function(ctx) { const model = await db.get(record.modelId) - coerceRecordValues(record, model) + record = coerceRecordValues(record, model) const validateResult = await validate({ record, @@ -236,19 +237,20 @@ async function validate({ instanceId, modelId, record, model }) { return { valid: Object.keys(errors).length === 0, errors } } -function coerceRecordValues(record, model) { +function coerceRecordValues(rec, model) { + const record = cloneDeep(rec) for (let [key, value] of Object.entries(record)) { const field = model.schema[key] if (!field) continue - const mapping = Object.prototype.hasOwnProperty.call( - TYPE_TRANSFORM_MAP[field.type], - value - ) - ? TYPE_TRANSFORM_MAP[field.type][value] - : TYPE_TRANSFORM_MAP[field.type].parse - record[key] = typeof mapping === "function" ? mapping(value) : mapping + // eslint-disable-next-line no-prototype-builtins + if (TYPE_TRANSFORM_MAP[field.type].hasOwnProperty(value)) { + record[key] = TYPE_TRANSFORM_MAP[field.type][value] + } else if (TYPE_TRANSFORM_MAP[field.type].parse) { + record[key] = TYPE_TRANSFORM_MAP[field.type].parse(value) + } } + return record } const TYPE_TRANSFORM_MAP = { @@ -256,7 +258,6 @@ const TYPE_TRANSFORM_MAP = { "": "", [null]: "", [undefined]: undefined, - parse: s => s, }, number: { "": null, @@ -268,22 +269,17 @@ const TYPE_TRANSFORM_MAP = { "": null, [undefined]: undefined, [null]: null, - parse: d => d, }, attachment: { "": [], [null]: [], [undefined]: undefined, - parse: a => a, }, boolean: { "": null, [null]: null, [undefined]: undefined, - parse: b => { - if (b === "true") return true - if (b === "false") return false - return b - }, + true: true, + false: false, }, } From 46cd413c58540efe92179902be9d34eb85561770 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Tue, 6 Oct 2020 21:45:12 +0100 Subject: [PATCH 15/15] removed .orig files --- .../DataTable/ModelDataTable.svelte.orig | 217 ------------------ .../ModelNavigator/CreateTable.svelte.orig | 117 ---------- 2 files changed, 334 deletions(-) delete mode 100644 packages/builder/src/components/database/DataTable/ModelDataTable.svelte.orig delete mode 100644 packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte.orig diff --git a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte.orig b/packages/builder/src/components/database/DataTable/ModelDataTable.svelte.orig deleted file mode 100644 index 54191842fe..0000000000 --- a/packages/builder/src/components/database/DataTable/ModelDataTable.svelte.orig +++ /dev/null @@ -1,217 +0,0 @@ - - -
-
-

- {$backendUiStore.selectedModel.name} - {#if loading} -
- -
- {/if} -

-
- - {#if Object.keys($backendUiStore.selectedModel.schema).length > 0} - - - - {/if} -
-
- - - - - {#each headers as header} - - {/each} - - - - {#if paginatedData.length === 0} -
No Data.
- {/if} - {#each paginatedData as row} - - - {#each headers as header} - - {/each} - - {/each} - -
-
Edit
-
- -
- - - {#if schema[header].type === 'link'} - - {:else if schema[header].type === 'attachment'} - - {:else}{getOr('', header, row)}{/if} -
- -
- - diff --git a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte.orig b/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte.orig deleted file mode 100644 index a7dd428610..0000000000 --- a/packages/builder/src/components/nav/ModelNavigator/CreateTable.svelte.orig +++ /dev/null @@ -1,117 +0,0 @@ - - -
- -
- -
-
Create Table
- - - - - -
-
-
- -
-
- -
-
-
- -