Merge remote-tracking branch 'origin/develop' into feature/app-user-onboarding-ux
This commit is contained in:
commit
a5c6dbe4ae
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/backend-core",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase backend core libraries used in server and worker",
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
|
@ -24,7 +24,7 @@
|
|||
"dependencies": {
|
||||
"@budibase/nano": "10.1.1",
|
||||
"@budibase/pouchdb-replication-stream": "1.2.10",
|
||||
"@budibase/types": "2.3.18-alpha.14",
|
||||
"@budibase/types": "2.3.18-alpha.16",
|
||||
"@shopify/jest-koa-mocks": "5.0.1",
|
||||
"@techpass/passport-openidconnect": "0.3.2",
|
||||
"aws-cloudfront-sign": "2.2.0",
|
||||
|
|
|
@ -154,11 +154,29 @@ export async function getGoogleConfig(): Promise<
|
|||
GoogleInnerConfig | undefined
|
||||
> {
|
||||
const config = await getGoogleConfigDoc()
|
||||
if (config) {
|
||||
return config.config
|
||||
return config?.config
|
||||
}
|
||||
|
||||
export async function getGoogleDatasourceConfig(): Promise<
|
||||
GoogleInnerConfig | undefined
|
||||
> {
|
||||
if (!env.SELF_HOSTED) {
|
||||
// always use the env vars in cloud
|
||||
return getDefaultGoogleConfig()
|
||||
}
|
||||
|
||||
// Use google fallback configuration from env variables
|
||||
// prefer the config in self-host
|
||||
let config = await getGoogleConfig()
|
||||
|
||||
// fallback to env vars
|
||||
if (!config || !config.activated) {
|
||||
config = getDefaultGoogleConfig()
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
export function getDefaultGoogleConfig(): GoogleInnerConfig | undefined {
|
||||
if (environment.GOOGLE_CLIENT_ID && environment.GOOGLE_CLIENT_SECRET) {
|
||||
return {
|
||||
clientID: environment.GOOGLE_CLIENT_ID!,
|
||||
|
|
|
@ -12,7 +12,8 @@ type Passport = {
|
|||
}
|
||||
|
||||
async function fetchGoogleCreds() {
|
||||
const config = await configs.getGoogleConfig()
|
||||
let config = await configs.getGoogleDatasourceConfig()
|
||||
|
||||
if (!config) {
|
||||
throw new Error("No google configuration found")
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"module": "dist/bbui.es.js",
|
||||
|
@ -38,7 +38,7 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
||||
"@budibase/string-templates": "2.3.18-alpha.14",
|
||||
"@budibase/string-templates": "2.3.18-alpha.16",
|
||||
"@spectrum-css/accordion": "3.0.24",
|
||||
"@spectrum-css/actionbutton": "1.0.1",
|
||||
"@spectrum-css/actiongroup": "1.0.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"license": "GPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -58,10 +58,10 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.3.18-alpha.14",
|
||||
"@budibase/client": "2.3.18-alpha.14",
|
||||
"@budibase/frontend-core": "2.3.18-alpha.14",
|
||||
"@budibase/string-templates": "2.3.18-alpha.14",
|
||||
"@budibase/bbui": "2.3.18-alpha.16",
|
||||
"@budibase/client": "2.3.18-alpha.16",
|
||||
"@budibase/frontend-core": "2.3.18-alpha.16",
|
||||
"@budibase/string-templates": "2.3.18-alpha.16",
|
||||
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
||||
"@fortawesome/free-brands-svg-icons": "^6.2.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
||||
|
|
|
@ -192,13 +192,13 @@
|
|||
editableColumn.name = originalName
|
||||
}
|
||||
|
||||
function deleteColumn() {
|
||||
async function deleteColumn() {
|
||||
try {
|
||||
editableColumn.name = deleteColName
|
||||
if (editableColumn.name === $tables.selected.primaryDisplay) {
|
||||
notifications.error("You cannot delete the display column")
|
||||
} else {
|
||||
tables.deleteField(editableColumn)
|
||||
await tables.deleteField(editableColumn)
|
||||
notifications.success(`Column ${editableColumn.name} deleted.`)
|
||||
confirmDeleteDialog.hide()
|
||||
hide()
|
||||
|
|
|
@ -131,24 +131,25 @@
|
|||
isEqual(providers.google?.config, originalGoogleDoc?.config)
|
||||
? (googleSaveButtonDisabled = true)
|
||||
: (googleSaveButtonDisabled = false)
|
||||
|
||||
// delete the callback url which is never saved to the oidc
|
||||
// config doc, to ensure an accurate comparison
|
||||
delete providers.oidc?.config.configs[0].callbackURL
|
||||
|
||||
isEqual(providers.oidc?.config, originalOidcDoc?.config)
|
||||
? (oidcSaveButtonDisabled = true)
|
||||
: (oidcSaveButtonDisabled = false)
|
||||
}
|
||||
|
||||
// Create a flag so that it will only try to save completed forms
|
||||
$: partialGoogle =
|
||||
providers.google?.config?.clientID || providers.google?.config?.clientSecret
|
||||
$: partialOidc =
|
||||
providers.oidc?.config?.configs[0].configUrl ||
|
||||
providers.oidc?.config?.configs[0].clientID ||
|
||||
providers.oidc?.config?.configs[0].clientSecret
|
||||
$: googleComplete =
|
||||
$: googleComplete = !!(
|
||||
providers.google?.config?.clientID && providers.google?.config?.clientSecret
|
||||
$: oidcComplete =
|
||||
)
|
||||
|
||||
$: oidcComplete = !!(
|
||||
providers.oidc?.config?.configs[0].configUrl &&
|
||||
providers.oidc?.config?.configs[0].clientID &&
|
||||
providers.oidc?.config?.configs[0].clientSecret
|
||||
)
|
||||
|
||||
const onFileSelected = e => {
|
||||
let fileName = e.target.files[0].name
|
||||
|
@ -159,74 +160,88 @@
|
|||
|
||||
async function toggleIsSSOEnforced() {
|
||||
const value = $organisation.isSSOEnforced
|
||||
await organisation.save({ isSSOEnforced: !value })
|
||||
try {
|
||||
await organisation.save({ isSSOEnforced: !value })
|
||||
} catch (e) {
|
||||
notifications.error(e.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function save(docs) {
|
||||
let calls = []
|
||||
// Only if the user has provided an image, upload it
|
||||
async function saveConfig(config) {
|
||||
// Delete unsupported fields
|
||||
delete config.createdAt
|
||||
delete config.updatedAt
|
||||
return API.saveConfig(config)
|
||||
}
|
||||
|
||||
async function saveOIDCLogo() {
|
||||
if (image) {
|
||||
let data = new FormData()
|
||||
data.append("file", image)
|
||||
calls.push(
|
||||
API.uploadOIDCLogo({
|
||||
name: image.name,
|
||||
data,
|
||||
})
|
||||
await API.uploadOIDCLogo({
|
||||
name: image.name,
|
||||
data,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function saveOIDC() {
|
||||
if (!oidcComplete) {
|
||||
notifications.error(
|
||||
`Please fill in all required ${ConfigTypes.OIDC} fields`
|
||||
)
|
||||
return
|
||||
}
|
||||
docs.forEach(element => {
|
||||
// Delete unsupported fields
|
||||
delete element.createdAt
|
||||
delete element.updatedAt
|
||||
|
||||
const { activated } = element.config
|
||||
const oidc = providers.oidc
|
||||
|
||||
if (element.type === ConfigTypes.OIDC) {
|
||||
// Add a UUID here so each config is distinguishable when it arrives at the login page
|
||||
for (let config of element.config.configs) {
|
||||
if (!config.uuid) {
|
||||
config.uuid = Helpers.uuid()
|
||||
}
|
||||
// Callback urls shouldn't be included
|
||||
delete config.callbackURL
|
||||
}
|
||||
if ((partialOidc || activated) && !oidcComplete) {
|
||||
notifications.error(
|
||||
`Please fill in all required ${ConfigTypes.OIDC} fields`
|
||||
)
|
||||
} else if (oidcComplete || !activated) {
|
||||
calls.push(API.saveConfig(element))
|
||||
// Turn the save button grey when clicked
|
||||
oidcSaveButtonDisabled = true
|
||||
originalOidcDoc = cloneDeep(providers.oidc)
|
||||
}
|
||||
// Add a UUID here so each config is distinguishable when it arrives at the login page
|
||||
for (let config of oidc.config.configs) {
|
||||
if (!config.uuid) {
|
||||
config.uuid = Helpers.uuid()
|
||||
}
|
||||
if (element.type === ConfigTypes.Google) {
|
||||
if ((partialGoogle || activated) && !googleComplete) {
|
||||
notifications.error(
|
||||
`Please fill in all required ${ConfigTypes.Google} fields`
|
||||
)
|
||||
} else if (googleComplete || !activated) {
|
||||
calls.push(API.saveConfig(element))
|
||||
googleSaveButtonDisabled = true
|
||||
originalGoogleDoc = cloneDeep(providers.google)
|
||||
}
|
||||
}
|
||||
})
|
||||
if (calls.length) {
|
||||
Promise.all(calls)
|
||||
.then(data => {
|
||||
data.forEach(res => {
|
||||
providers[res.type]._rev = res._rev
|
||||
providers[res.type]._id = res._id
|
||||
})
|
||||
notifications.success(`Settings saved`)
|
||||
})
|
||||
.catch(() => {
|
||||
notifications.error("Failed to update auth settings")
|
||||
})
|
||||
// Callback urls shouldn't be included
|
||||
delete config.callbackURL
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await saveConfig(oidc)
|
||||
providers[res.type]._rev = res._rev
|
||||
providers[res.type]._id = res._id
|
||||
await saveOIDCLogo()
|
||||
notifications.success(`Settings saved`)
|
||||
} catch (e) {
|
||||
notifications.error(e.message)
|
||||
return
|
||||
}
|
||||
|
||||
// Turn the save button grey when clicked
|
||||
oidcSaveButtonDisabled = true
|
||||
originalOidcDoc = cloneDeep(providers.oidc)
|
||||
}
|
||||
|
||||
async function saveGoogle() {
|
||||
if (!googleComplete) {
|
||||
notifications.error(
|
||||
`Please fill in all required ${ConfigTypes.Google} fields`
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const google = providers.google
|
||||
|
||||
try {
|
||||
const res = await saveConfig(google)
|
||||
providers[res.type]._rev = res._rev
|
||||
providers[res.type]._id = res._id
|
||||
notifications.success(`Settings saved`)
|
||||
} catch (e) {
|
||||
notifications.error(e.message)
|
||||
return
|
||||
}
|
||||
|
||||
googleSaveButtonDisabled = true
|
||||
originalGoogleDoc = cloneDeep(providers.google)
|
||||
}
|
||||
|
||||
let defaultScopes = ["profile", "email", "offline_access"]
|
||||
|
@ -266,7 +281,7 @@
|
|||
if (!googleDoc?._id) {
|
||||
providers.google = {
|
||||
type: ConfigTypes.Google,
|
||||
config: { activated: true },
|
||||
config: { activated: false },
|
||||
}
|
||||
originalGoogleDoc = cloneDeep(googleDoc)
|
||||
} else {
|
||||
|
@ -310,7 +325,7 @@
|
|||
if (!oidcDoc?._id) {
|
||||
providers.oidc = {
|
||||
type: ConfigTypes.OIDC,
|
||||
config: { configs: [{ activated: true, scopes: defaultScopes }] },
|
||||
config: { configs: [{ activated: false, scopes: defaultScopes }] },
|
||||
}
|
||||
} else {
|
||||
originalOidcDoc = cloneDeep(oidcDoc)
|
||||
|
@ -413,7 +428,7 @@
|
|||
<Button
|
||||
disabled={googleSaveButtonDisabled}
|
||||
cta
|
||||
on:click={() => save([providers.google])}
|
||||
on:click={() => saveGoogle()}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
|
@ -575,11 +590,7 @@
|
|||
</div>
|
||||
</Layout>
|
||||
<div>
|
||||
<Button
|
||||
disabled={oidcSaveButtonDisabled}
|
||||
cta
|
||||
on:click={() => save([providers.oidc])}
|
||||
>
|
||||
<Button disabled={oidcSaveButtonDisabled} cta on:click={() => saveOIDC()}>
|
||||
Save
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { writable, get } from "svelte/store"
|
||||
import { API } from "api"
|
||||
import { auth } from "stores/portal"
|
||||
import _ from "lodash"
|
||||
|
||||
const DEFAULT_CONFIG = {
|
||||
platformUrl: "",
|
||||
|
@ -26,14 +27,14 @@ export function createOrganisationStore() {
|
|||
|
||||
async function save(config) {
|
||||
// Delete non-persisted fields
|
||||
const storeConfig = get(store)
|
||||
const storeConfig = _.cloneDeep(get(store))
|
||||
delete storeConfig.oidc
|
||||
delete storeConfig.google
|
||||
delete storeConfig.oidcCallbackUrl
|
||||
delete storeConfig.googleCallbackUrl
|
||||
await API.saveConfig({
|
||||
type: "settings",
|
||||
config: { ...get(store), ...config },
|
||||
config: { ...storeConfig, ...config },
|
||||
})
|
||||
await init()
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
|
@ -26,9 +26,9 @@
|
|||
"outputPath": "build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/backend-core": "2.3.18-alpha.14",
|
||||
"@budibase/string-templates": "2.3.18-alpha.14",
|
||||
"@budibase/types": "2.3.18-alpha.14",
|
||||
"@budibase/backend-core": "2.3.18-alpha.16",
|
||||
"@budibase/string-templates": "2.3.18-alpha.16",
|
||||
"@budibase/types": "2.3.18-alpha.16",
|
||||
"axios": "0.21.2",
|
||||
"chalk": "4.1.0",
|
||||
"cli-progress": "3.11.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"license": "MPL-2.0",
|
||||
"module": "dist/budibase-client.js",
|
||||
"main": "dist/budibase-client.js",
|
||||
|
@ -19,9 +19,9 @@
|
|||
"dev:builder": "rollup -cw"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.3.18-alpha.14",
|
||||
"@budibase/frontend-core": "2.3.18-alpha.14",
|
||||
"@budibase/string-templates": "2.3.18-alpha.14",
|
||||
"@budibase/bbui": "2.3.18-alpha.16",
|
||||
"@budibase/frontend-core": "2.3.18-alpha.16",
|
||||
"@budibase/string-templates": "2.3.18-alpha.16",
|
||||
"@spectrum-css/button": "^3.0.3",
|
||||
"@spectrum-css/card": "^3.0.3",
|
||||
"@spectrum-css/divider": "^1.0.3",
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@budibase/frontend-core",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase frontend core libraries used in builder and client",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
"svelte": "src/index.js",
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "2.3.18-alpha.14",
|
||||
"@budibase/bbui": "2.3.18-alpha.16",
|
||||
"lodash": "^4.17.21",
|
||||
"svelte": "^3.46.2"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/sdk",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase Public API SDK",
|
||||
"author": "Budibase",
|
||||
"license": "MPL-2.0",
|
||||
|
|
|
@ -172,6 +172,9 @@ module FetchMock {
|
|||
),
|
||||
ok: true,
|
||||
})
|
||||
} else if (url === "https://www.googleapis.com/oauth2/v4/token") {
|
||||
// any valid response
|
||||
return json({})
|
||||
} else if (url.includes("failonce.com")) {
|
||||
failCount++
|
||||
if (failCount === 1) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase Web Server",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -43,11 +43,11 @@
|
|||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-parser": "10.0.3",
|
||||
"@budibase/backend-core": "2.3.18-alpha.14",
|
||||
"@budibase/client": "2.3.18-alpha.14",
|
||||
"@budibase/pro": "2.3.18-alpha.14",
|
||||
"@budibase/string-templates": "2.3.18-alpha.14",
|
||||
"@budibase/types": "2.3.18-alpha.14",
|
||||
"@budibase/backend-core": "2.3.18-alpha.16",
|
||||
"@budibase/client": "2.3.18-alpha.16",
|
||||
"@budibase/pro": "2.3.18-alpha.16",
|
||||
"@budibase/string-templates": "2.3.18-alpha.16",
|
||||
"@budibase/types": "2.3.18-alpha.16",
|
||||
"@bull-board/api": "3.7.0",
|
||||
"@bull-board/koa": "3.9.4",
|
||||
"@elastic/elasticsearch": "7.10.0",
|
||||
|
|
|
@ -11,8 +11,8 @@ import { OAuth2Client } from "google-auth-library"
|
|||
import { buildExternalTableId } from "./utils"
|
||||
import { DataSourceOperation, FieldTypes } from "../constants"
|
||||
import { GoogleSpreadsheet } from "google-spreadsheet"
|
||||
import fetch from "node-fetch"
|
||||
import { configs, HTTPError } from "@budibase/backend-core"
|
||||
const fetch = require("node-fetch")
|
||||
|
||||
interface GoogleSheetsConfig {
|
||||
spreadsheetId: string
|
||||
|
@ -111,7 +111,7 @@ const SCHEMA: Integration = {
|
|||
|
||||
class GoogleSheetsIntegration implements DatasourcePlus {
|
||||
private readonly config: GoogleSheetsConfig
|
||||
private client: any
|
||||
private client: GoogleSpreadsheet
|
||||
public tables: Record<string, Table> = {}
|
||||
public schemaErrors: Record<string, string> = {}
|
||||
|
||||
|
@ -172,7 +172,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
async connect() {
|
||||
try {
|
||||
// Initialise oAuth client
|
||||
let googleConfig = await configs.getGoogleConfig()
|
||||
let googleConfig = await configs.getGoogleDatasourceConfig()
|
||||
if (!googleConfig) {
|
||||
throw new HTTPError("Google config not found", 400)
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
|
||||
async buildSchema(datasourceId: string) {
|
||||
await this.connect()
|
||||
const sheets = await this.client.sheetsByIndex
|
||||
const sheets = this.client.sheetsByIndex
|
||||
const tables: Record<string, Table> = {}
|
||||
for (let sheet of sheets) {
|
||||
// must fetch rows to determine schema
|
||||
|
@ -286,7 +286,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
async updateTable(table?: any) {
|
||||
try {
|
||||
await this.connect()
|
||||
const sheet = await this.client.sheetsByTitle[table.name]
|
||||
const sheet = this.client.sheetsByTitle[table.name]
|
||||
await sheet.loadHeaderRow()
|
||||
|
||||
if (table._rename) {
|
||||
|
@ -300,10 +300,17 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
}
|
||||
await sheet.setHeaderRow(headers)
|
||||
} else {
|
||||
let newField = Object.keys(table.schema).find(
|
||||
const updatedHeaderValues = [...sheet.headerValues]
|
||||
|
||||
const newField = Object.keys(table.schema).find(
|
||||
key => !sheet.headerValues.includes(key)
|
||||
)
|
||||
await sheet.setHeaderRow([...sheet.headerValues, newField])
|
||||
|
||||
if (newField) {
|
||||
updatedHeaderValues.push(newField)
|
||||
}
|
||||
|
||||
await sheet.setHeaderRow(updatedHeaderValues)
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Error updating table in google sheets", err)
|
||||
|
@ -314,7 +321,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
async deleteTable(sheet: any) {
|
||||
try {
|
||||
await this.connect()
|
||||
const sheetToDelete = await this.client.sheetsByTitle[sheet]
|
||||
const sheetToDelete = this.client.sheetsByTitle[sheet]
|
||||
return await sheetToDelete.delete()
|
||||
} catch (err) {
|
||||
console.error("Error deleting table in google sheets", err)
|
||||
|
@ -325,7 +332,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
async create(query: { sheet: string; row: any }) {
|
||||
try {
|
||||
await this.connect()
|
||||
const sheet = await this.client.sheetsByTitle[query.sheet]
|
||||
const sheet = this.client.sheetsByTitle[query.sheet]
|
||||
const rowToInsert =
|
||||
typeof query.row === "string" ? JSON.parse(query.row) : query.row
|
||||
const row = await sheet.addRow(rowToInsert)
|
||||
|
@ -341,7 +348,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
async read(query: { sheet: string }) {
|
||||
try {
|
||||
await this.connect()
|
||||
const sheet = await this.client.sheetsByTitle[query.sheet]
|
||||
const sheet = this.client.sheetsByTitle[query.sheet]
|
||||
const rows = await sheet.getRows()
|
||||
const headerValues = sheet.headerValues
|
||||
const response = []
|
||||
|
@ -360,7 +367,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
async update(query: { sheet: string; rowIndex: number; row: any }) {
|
||||
try {
|
||||
await this.connect()
|
||||
const sheet = await this.client.sheetsByTitle[query.sheet]
|
||||
const sheet = this.client.sheetsByTitle[query.sheet]
|
||||
const rows = await sheet.getRows()
|
||||
const row = rows[query.rowIndex]
|
||||
if (row) {
|
||||
|
@ -384,7 +391,7 @@ class GoogleSheetsIntegration implements DatasourcePlus {
|
|||
|
||||
async delete(query: { sheet: string; rowIndex: number }) {
|
||||
await this.connect()
|
||||
const sheet = await this.client.sheetsByTitle[query.sheet]
|
||||
const sheet = this.client.sheetsByTitle[query.sheet]
|
||||
const rows = await sheet.getRows()
|
||||
const row = rows[query.rowIndex]
|
||||
if (row) {
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
import type { GoogleSpreadsheetWorksheet } from "google-spreadsheet"
|
||||
|
||||
jest.mock("google-auth-library")
|
||||
const { OAuth2Client } = require("google-auth-library")
|
||||
|
||||
const setCredentialsMock = jest.fn()
|
||||
const getAccessTokenMock = jest.fn()
|
||||
|
||||
OAuth2Client.mockImplementation(() => {
|
||||
return {
|
||||
setCredentials: setCredentialsMock,
|
||||
getAccessToken: getAccessTokenMock,
|
||||
}
|
||||
})
|
||||
|
||||
jest.mock("google-spreadsheet")
|
||||
const { GoogleSpreadsheet } = require("google-spreadsheet")
|
||||
|
||||
const sheetsByTitle: { [title: string]: GoogleSpreadsheetWorksheet } = {}
|
||||
|
||||
GoogleSpreadsheet.mockImplementation(() => {
|
||||
return {
|
||||
useOAuth2Client: jest.fn(),
|
||||
loadInfo: jest.fn(),
|
||||
sheetsByTitle,
|
||||
}
|
||||
})
|
||||
|
||||
import { structures } from "@budibase/backend-core/tests"
|
||||
import TestConfiguration from "../../tests/utilities/TestConfiguration"
|
||||
import GoogleSheetsIntegration from "../googlesheets"
|
||||
import { FieldType, Table, TableSchema } from "../../../../types/src/documents"
|
||||
|
||||
describe("Google Sheets Integration", () => {
|
||||
let integration: any,
|
||||
config = new TestConfiguration()
|
||||
|
||||
beforeEach(async () => {
|
||||
integration = new GoogleSheetsIntegration.integration({
|
||||
spreadsheetId: "randomId",
|
||||
auth: {
|
||||
appId: "appId",
|
||||
accessToken: "accessToken",
|
||||
refreshToken: "refreshToken",
|
||||
},
|
||||
})
|
||||
await config.init()
|
||||
})
|
||||
|
||||
function createBasicTable(name: string, columns: string[]): Table {
|
||||
return {
|
||||
name,
|
||||
schema: {
|
||||
...columns.reduce((p, c) => {
|
||||
p[c] = {
|
||||
name: c,
|
||||
type: FieldType.STRING,
|
||||
constraints: {
|
||||
type: "string",
|
||||
},
|
||||
}
|
||||
return p
|
||||
}, {} as TableSchema),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
function createSheet({
|
||||
headerValues,
|
||||
}: {
|
||||
headerValues: string[]
|
||||
}): GoogleSpreadsheetWorksheet {
|
||||
return {
|
||||
// to ignore the unmapped fields
|
||||
...({} as any),
|
||||
loadHeaderRow: jest.fn(),
|
||||
headerValues,
|
||||
setHeaderRow: jest.fn(),
|
||||
}
|
||||
}
|
||||
|
||||
describe("update table", () => {
|
||||
test("adding a new field will be adding a new header row", async () => {
|
||||
await config.doInContext(structures.uuid(), async () => {
|
||||
const tableColumns = ["name", "description", "new field"]
|
||||
const table = createBasicTable(structures.uuid(), tableColumns)
|
||||
|
||||
const sheet = createSheet({ headerValues: ["name", "description"] })
|
||||
sheetsByTitle[table.name] = sheet
|
||||
await integration.updateTable(table)
|
||||
|
||||
expect(sheet.loadHeaderRow).toBeCalledTimes(1)
|
||||
expect(sheet.setHeaderRow).toBeCalledTimes(1)
|
||||
expect(sheet.setHeaderRow).toBeCalledWith(tableColumns)
|
||||
})
|
||||
})
|
||||
|
||||
test("removing an existing field will not remove the data from the spreadsheet", async () => {
|
||||
await config.doInContext(structures.uuid(), async () => {
|
||||
const tableColumns = ["name"]
|
||||
const table = createBasicTable(structures.uuid(), tableColumns)
|
||||
|
||||
const sheet = createSheet({
|
||||
headerValues: ["name", "description", "location"],
|
||||
})
|
||||
sheetsByTitle[table.name] = sheet
|
||||
await integration.updateTable(table)
|
||||
|
||||
expect(sheet.loadHeaderRow).toBeCalledTimes(1)
|
||||
expect(sheet.setHeaderRow).toBeCalledTimes(1)
|
||||
expect(sheet.setHeaderRow).toBeCalledWith([
|
||||
"name",
|
||||
"description",
|
||||
"location",
|
||||
])
|
||||
|
||||
// No undefineds are sent
|
||||
expect((sheet.setHeaderRow as any).mock.calls[0][0]).toHaveLength(3)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
|
@ -1278,14 +1278,14 @@
|
|||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@budibase/backend-core@2.3.18-alpha.14":
|
||||
version "2.3.18-alpha.14"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.18-alpha.14.tgz#84c10d5840a61437c77c62cb27aa52a48ebea34c"
|
||||
integrity sha512-8MlNAJNFhct4CwN49wu7EBZJQyToSnUlhZeBlvv94AQxKF6iTzTq40CoNIMCv69nzbeTbDw/ImG7dPW8kBHjpg==
|
||||
"@budibase/backend-core@2.3.18-alpha.16":
|
||||
version "2.3.18-alpha.16"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.18-alpha.16.tgz#dc4eb1a84283d96e9d0814647cff6a985e204ede"
|
||||
integrity sha512-oxca+tBXCqr713lH+MLKvY0K/i+yCS5W+sJmMR2jlCfBBEULhPBRcBnyNhUEQsszqcZDiHI4Svy1a50BryDCsQ==
|
||||
dependencies:
|
||||
"@budibase/nano" "10.1.1"
|
||||
"@budibase/pouchdb-replication-stream" "1.2.10"
|
||||
"@budibase/types" "2.3.18-alpha.14"
|
||||
"@budibase/types" "2.3.18-alpha.16"
|
||||
"@shopify/jest-koa-mocks" "5.0.1"
|
||||
"@techpass/passport-openidconnect" "0.3.2"
|
||||
aws-cloudfront-sign "2.2.0"
|
||||
|
@ -1367,6 +1367,31 @@
|
|||
svelte-flatpickr "^3.2.3"
|
||||
svelte-portal "^1.0.0"
|
||||
|
||||
"@budibase/handlebars-helpers@^0.11.8":
|
||||
version "0.11.8"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.8.tgz#6953d29673a8c5c407e096c0a84890465c7ce841"
|
||||
integrity sha512-ggWJUt0GqsHFAEup5tlWlcrmYML57nKhpNGGLzVsqXVYN8eVmf3xluYmmMe7fDYhQH0leSprrdEXmsdFQF3HAQ==
|
||||
dependencies:
|
||||
array-sort "^1.0.0"
|
||||
define-property "^2.0.2"
|
||||
extend-shallow "^3.0.2"
|
||||
for-in "^1.0.2"
|
||||
get-object "^0.2.0"
|
||||
get-value "^3.0.1"
|
||||
handlebars "^4.7.7"
|
||||
handlebars-utils "^1.0.6"
|
||||
has-value "^2.0.2"
|
||||
helper-md "^0.2.2"
|
||||
html-tag "^2.0.0"
|
||||
is-even "^1.0.0"
|
||||
is-glob "^4.0.1"
|
||||
kind-of "^6.0.3"
|
||||
micromatch "^3.1.5"
|
||||
relative "^3.0.2"
|
||||
striptags "^3.1.1"
|
||||
to-gfm-code-block "^0.1.1"
|
||||
year "^0.2.1"
|
||||
|
||||
"@budibase/nano@10.1.1":
|
||||
version "10.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/nano/-/nano-10.1.1.tgz#36ccda4d9bb64b5ee14dd2b27a295b40739b1038"
|
||||
|
@ -1392,18 +1417,20 @@
|
|||
pouchdb-promise "^6.0.4"
|
||||
through2 "^2.0.0"
|
||||
|
||||
"@budibase/pro@2.3.18-alpha.14":
|
||||
version "2.3.18-alpha.14"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.18-alpha.14.tgz#037045c7c315c23d2981abdcd35fb18bc1a4727d"
|
||||
integrity sha512-15OFi/Kycp8lYTP424fMoF1l+l3M/0pcDOHpkn0sHix4KhQz2mnqE2iu3k1FR/w9tpPEGHwdd4++BHiDw6h1ZQ==
|
||||
"@budibase/pro@2.3.18-alpha.16":
|
||||
version "2.3.18-alpha.16"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.18-alpha.16.tgz#239ccee2469d7465cec859c22ae39abf0d9cc4ec"
|
||||
integrity sha512-sGgZ5gTMFVtkU0GZF0ApVTAB1uw1twL/2v5vXYzrIzfJKL2Ehcsrg8d3JwlaF6S7bOzOOaNa90cuGgvXQ1TzTw==
|
||||
dependencies:
|
||||
"@budibase/backend-core" "2.3.18-alpha.14"
|
||||
"@budibase/types" "2.3.18-alpha.14"
|
||||
"@budibase/backend-core" "2.3.18-alpha.16"
|
||||
"@budibase/string-templates" "2.3.18-alpha.14"
|
||||
"@budibase/types" "2.3.18-alpha.16"
|
||||
"@koa/router" "8.0.8"
|
||||
bull "4.10.1"
|
||||
joi "17.6.0"
|
||||
jsonwebtoken "8.5.1"
|
||||
lru-cache "^7.14.1"
|
||||
memorystream "^0.3.1"
|
||||
node-fetch "^2.6.1"
|
||||
|
||||
"@budibase/standard-components@^0.9.139":
|
||||
|
@ -1424,10 +1451,22 @@
|
|||
svelte-apexcharts "^1.0.2"
|
||||
svelte-flatpickr "^3.1.0"
|
||||
|
||||
"@budibase/types@2.3.18-alpha.14":
|
||||
"@budibase/string-templates@2.3.18-alpha.14":
|
||||
version "2.3.18-alpha.14"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.18-alpha.14.tgz#3fa32f0b262169c4c8679f38f5e0e321f43f54dc"
|
||||
integrity sha512-mkp0GAqB7zAeLSNV8//dBjSH9dP9z8Q/Sxv29zlExKAxBHlUcYIB442QZJ8Z2V8Tzb+DlRIK7SLTG622cfyUgg==
|
||||
resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-2.3.18-alpha.14.tgz#c3b8d45ced321088c76bcda4efd7e9c7635a2788"
|
||||
integrity sha512-xamfugDHgvzupe3EkvTY7ymXn9cRxb61nKaap52NsQQl8Zby2W2qJNVBNnuSnhnkQQeF5EatIFgGni+yBDchtQ==
|
||||
dependencies:
|
||||
"@budibase/handlebars-helpers" "^0.11.8"
|
||||
dayjs "^1.10.4"
|
||||
handlebars "^4.7.6"
|
||||
handlebars-utils "^1.0.6"
|
||||
lodash "^4.17.20"
|
||||
vm2 "^3.9.4"
|
||||
|
||||
"@budibase/types@2.3.18-alpha.16":
|
||||
version "2.3.18-alpha.16"
|
||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.18-alpha.16.tgz#e4613c482ee7fc0ff099190ba3c7432fd6a3efce"
|
||||
integrity sha512-nltKX5erHad2vM6SEv2tYLWCztEtV4bjXrmB8lbkTcf6iD0gjXB280vGkE4gOBdeOmBXXP39GxVc30e7ugw5GA==
|
||||
|
||||
"@bull-board/api@3.7.0":
|
||||
version "3.7.0"
|
||||
|
@ -4230,7 +4269,7 @@ arg@^4.1.0:
|
|||
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
|
||||
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
|
||||
|
||||
argparse@^1.0.7:
|
||||
argparse@^1.0.10, argparse@^1.0.7:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||
|
@ -4277,6 +4316,15 @@ array-equal@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
|
||||
integrity sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA==
|
||||
|
||||
array-sort@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a"
|
||||
integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg==
|
||||
dependencies:
|
||||
default-compare "^1.0.0"
|
||||
get-value "^2.0.6"
|
||||
kind-of "^5.0.2"
|
||||
|
||||
array-union@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
|
||||
|
@ -4420,6 +4468,13 @@ atomic-sleep@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b"
|
||||
integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==
|
||||
|
||||
autolinker@~0.28.0:
|
||||
version "0.28.1"
|
||||
resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-0.28.1.tgz#0652b491881879f0775dace0cdca3233942a4e47"
|
||||
integrity sha512-zQAFO1Dlsn69eXaO6+7YZc+v84aquQKbwpzCE3L0stj56ERn9hutFxPopViLjo9G+rWwjozRhgS5KJ25Xy19cQ==
|
||||
dependencies:
|
||||
gulp-header "^1.7.1"
|
||||
|
||||
available-typed-arrays@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
|
||||
|
@ -5500,6 +5555,13 @@ concat-map@0.0.1:
|
|||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
concat-with-sourcemaps@*:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e"
|
||||
integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==
|
||||
dependencies:
|
||||
source-map "^0.6.1"
|
||||
|
||||
condense-newlines@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/condense-newlines/-/condense-newlines-0.2.1.tgz#3de985553139475d32502c83b02f60684d24c55f"
|
||||
|
@ -5941,6 +6003,13 @@ deepmerge@^4.2.2:
|
|||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
|
||||
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
|
||||
|
||||
default-compare@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f"
|
||||
integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ==
|
||||
dependencies:
|
||||
kind-of "^5.0.2"
|
||||
|
||||
default-shell@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/default-shell/-/default-shell-1.0.1.tgz#752304bddc6174f49eb29cb988feea0b8813c8bc"
|
||||
|
@ -6417,6 +6486,11 @@ enhanced-resolve@^5.9.3:
|
|||
graceful-fs "^4.2.4"
|
||||
tapable "^2.2.0"
|
||||
|
||||
ent@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d"
|
||||
integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==
|
||||
|
||||
entities@~2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
|
||||
|
@ -7617,6 +7691,14 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1:
|
|||
has "^1.0.3"
|
||||
has-symbols "^1.0.3"
|
||||
|
||||
get-object@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/get-object/-/get-object-0.2.0.tgz#d92ff7d5190c64530cda0543dac63a3d47fe8c0c"
|
||||
integrity sha512-7P6y6k6EzEFmO/XyUyFlXm1YLJy9xeA1x/grNV8276abX5GuwUtYgKFkRFkLixw4hf4Pz9q2vgv/8Ar42R0HuQ==
|
||||
dependencies:
|
||||
is-number "^2.0.2"
|
||||
isobject "^0.2.0"
|
||||
|
||||
get-package-type@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a"
|
||||
|
@ -7679,6 +7761,13 @@ get-value@^2.0.3, get-value@^2.0.6:
|
|||
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
|
||||
integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==
|
||||
|
||||
get-value@^3.0.0, get-value@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-value/-/get-value-3.0.1.tgz#5efd2a157f1d6a516d7524e124ac52d0a39ef5a8"
|
||||
integrity sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA==
|
||||
dependencies:
|
||||
isobject "^3.0.1"
|
||||
|
||||
getopts@2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/getopts/-/getopts-2.3.0.tgz#71e5593284807e03e2427449d4f6712a268666f4"
|
||||
|
@ -7966,7 +8055,24 @@ gtoken@^5.0.4:
|
|||
google-p12-pem "^3.1.3"
|
||||
jws "^4.0.0"
|
||||
|
||||
handlebars@^4.7.7:
|
||||
gulp-header@^1.7.1:
|
||||
version "1.8.12"
|
||||
resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-1.8.12.tgz#ad306be0066599127281c4f8786660e705080a84"
|
||||
integrity sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ==
|
||||
dependencies:
|
||||
concat-with-sourcemaps "*"
|
||||
lodash.template "^4.4.0"
|
||||
through2 "^2.0.0"
|
||||
|
||||
handlebars-utils@^1.0.6:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/handlebars-utils/-/handlebars-utils-1.0.6.tgz#cb9db43362479054782d86ffe10f47abc76357f9"
|
||||
integrity sha512-d5mmoQXdeEqSKMtQQZ9WkiUcO1E3tPbWxluCK9hVgIDPzQa9WsKo3Lbe/sGflTe7TomHEeZaOgwIkyIr1kfzkw==
|
||||
dependencies:
|
||||
kind-of "^6.0.0"
|
||||
typeof-article "^0.1.1"
|
||||
|
||||
handlebars@^4.7.6, handlebars@^4.7.7:
|
||||
version "4.7.7"
|
||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
|
||||
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
|
||||
|
@ -8060,6 +8166,14 @@ has-value@^1.0.0:
|
|||
has-values "^1.0.0"
|
||||
isobject "^3.0.0"
|
||||
|
||||
has-value@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/has-value/-/has-value-2.0.2.tgz#d0f12e8780ba8e90e66ad1a21c707fdb67c25658"
|
||||
integrity sha512-ybKOlcRsK2MqrM3Hmz/lQxXHZ6ejzSPzpNabKB45jb5qDgJvKPa3SdapTsTLwEb9WltgWpOmNax7i+DzNOk4TA==
|
||||
dependencies:
|
||||
get-value "^3.0.0"
|
||||
has-values "^2.0.1"
|
||||
|
||||
has-values@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
|
||||
|
@ -8073,6 +8187,13 @@ has-values@^1.0.0:
|
|||
is-number "^3.0.0"
|
||||
kind-of "^4.0.0"
|
||||
|
||||
has-values@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/has-values/-/has-values-2.0.1.tgz#3876200ff86d8a8546a9264a952c17d5fc17579d"
|
||||
integrity sha512-+QdH3jOmq9P8GfdjFg0eJudqx1FqU62NQJ4P16rOEHeRdl7ckgwn6uqQjzYE0ZoHVV/e5E2esuJ5Gl5+HUW19w==
|
||||
dependencies:
|
||||
kind-of "^6.0.2"
|
||||
|
||||
has-yarn@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77"
|
||||
|
@ -8085,6 +8206,16 @@ has@^1.0.3:
|
|||
dependencies:
|
||||
function-bind "^1.1.1"
|
||||
|
||||
helper-md@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/helper-md/-/helper-md-0.2.2.tgz#c1f59d7e55bbae23362fd8a0e971607aec69d41f"
|
||||
integrity sha512-49TaQzK+Ic7ZVTq4i1UZxRUJEmAilTk8hz7q4I0WNUaTclLR8ArJV5B3A1fe1xF2HtsDTr2gYKLaVTof/Lt84Q==
|
||||
dependencies:
|
||||
ent "^2.2.0"
|
||||
extend-shallow "^2.0.1"
|
||||
fs-exists-sync "^0.1.0"
|
||||
remarkable "^1.6.2"
|
||||
|
||||
hexoid@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18"
|
||||
|
@ -8119,6 +8250,14 @@ html-escaper@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
|
||||
integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
|
||||
|
||||
html-tag@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/html-tag/-/html-tag-2.0.0.tgz#36c3bc8d816fd30b570d5764a497a641640c2fed"
|
||||
integrity sha512-XxzooSo6oBoxBEUazgjdXj7VwTn/iSTSZzTYKzYY6I916tkaYzypHxy+pbVU1h+0UQ9JlVf5XkNQyxOAiiQO1g==
|
||||
dependencies:
|
||||
is-self-closing "^1.0.1"
|
||||
kind-of "^6.0.0"
|
||||
|
||||
http-assert@^1.3.0:
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.5.0.tgz#c389ccd87ac16ed2dfa6246fd73b926aa00e6b8f"
|
||||
|
@ -8595,6 +8734,13 @@ is-docker@^2.0.0, is-docker@^2.1.1:
|
|||
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
|
||||
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
|
||||
|
||||
is-even@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-even/-/is-even-1.0.0.tgz#76b5055fbad8d294a86b6a949015e1c97b717c06"
|
||||
integrity sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg==
|
||||
dependencies:
|
||||
is-odd "^0.1.2"
|
||||
|
||||
is-extendable@^0.1.0, is-extendable@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
|
||||
|
@ -8701,6 +8847,13 @@ is-number-object@^1.0.4:
|
|||
dependencies:
|
||||
has-tostringtag "^1.0.0"
|
||||
|
||||
is-number@^2.0.2:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
|
||||
integrity sha512-QUzH43Gfb9+5yckcrSA0VBDwEtDUchrk4F6tfJZQuNzDJbEDB9cZNzSfXGQ1jqmdDY/kl41lUOWM9syA8z8jlg==
|
||||
dependencies:
|
||||
kind-of "^3.0.2"
|
||||
|
||||
is-number@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
|
||||
|
@ -8723,6 +8876,13 @@ is-object@^1.0.1:
|
|||
resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf"
|
||||
integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==
|
||||
|
||||
is-odd@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-0.1.2.tgz#bc573b5ce371ef2aad6e6f49799b72bef13978a7"
|
||||
integrity sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw==
|
||||
dependencies:
|
||||
is-number "^3.0.0"
|
||||
|
||||
is-path-inside@^3.0.2:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
|
||||
|
@ -8763,6 +8923,13 @@ is-retry-allowed@^2.2.0:
|
|||
resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz#88f34cbd236e043e71b6932d09b0c65fb7b4d71d"
|
||||
integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==
|
||||
|
||||
is-self-closing@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-self-closing/-/is-self-closing-1.0.1.tgz#5f406b527c7b12610176320338af0fa3896416e4"
|
||||
integrity sha512-E+60FomW7Blv5GXTlYee2KDrnG6srxF7Xt1SjrhWUGUEsTFIqY/nq2y3DaftCsgUMdh89V07IVfhY9KIJhLezg==
|
||||
dependencies:
|
||||
self-closing-tags "^1.0.1"
|
||||
|
||||
is-shared-array-buffer@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79"
|
||||
|
@ -8878,6 +9045,11 @@ isexe@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
|
||||
|
||||
isobject@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-0.2.0.tgz#a3432192f39b910b5f02cc989487836ec70aa85e"
|
||||
integrity sha512-VaWq6XYAsbvM0wf4dyBO7WH9D7GosB7ZZlqrawI9BBiTMINBeCyqSKBa35m870MY3O4aM31pYyZi9DfGrYMJrQ==
|
||||
|
||||
isobject@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
|
||||
|
@ -10072,7 +10244,7 @@ keyv@^3.0.0:
|
|||
dependencies:
|
||||
json-buffer "3.0.0"
|
||||
|
||||
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
|
||||
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0:
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
|
||||
integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==
|
||||
|
@ -10086,12 +10258,12 @@ kind-of@^4.0.0:
|
|||
dependencies:
|
||||
is-buffer "^1.1.5"
|
||||
|
||||
kind-of@^5.0.0:
|
||||
kind-of@^5.0.0, kind-of@^5.0.2:
|
||||
version "5.1.0"
|
||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
|
||||
integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==
|
||||
|
||||
kind-of@^6.0.0, kind-of@^6.0.2:
|
||||
kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3:
|
||||
version "6.0.3"
|
||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
|
||||
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
|
||||
|
@ -10518,6 +10690,11 @@ locate-path@^5.0.0:
|
|||
dependencies:
|
||||
p-locate "^4.1.0"
|
||||
|
||||
lodash._reinterpolate@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
|
||||
integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==
|
||||
|
||||
lodash.camelcase@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
|
||||
|
@ -10628,6 +10805,21 @@ lodash.sortby@^4.7.0:
|
|||
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
|
||||
integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==
|
||||
|
||||
lodash.template@^4.4.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab"
|
||||
integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==
|
||||
dependencies:
|
||||
lodash._reinterpolate "^3.0.0"
|
||||
lodash.templatesettings "^4.0.0"
|
||||
|
||||
lodash.templatesettings@^4.0.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33"
|
||||
integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==
|
||||
dependencies:
|
||||
lodash._reinterpolate "^3.0.0"
|
||||
|
||||
lodash.uniq@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
||||
|
@ -10643,7 +10835,7 @@ lodash.xor@^4.5.0:
|
|||
resolved "https://registry.yarnpkg.com/lodash.xor/-/lodash.xor-4.5.0.tgz#4d48ed7e98095b0632582ba714d3ff8ae8fb1db6"
|
||||
integrity sha512-sVN2zimthq7aZ5sPGXnSz32rZPuqcparVW50chJQe+mzTYV+IsxSsl/2gnkWWE2Of7K3myBQBqtLKOUEHJKRsQ==
|
||||
|
||||
lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.3:
|
||||
lodash@4.17.21, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
@ -10875,7 +11067,7 @@ memory-pager@^1.0.2:
|
|||
resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5"
|
||||
integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==
|
||||
|
||||
memorystream@0.3.1:
|
||||
memorystream@0.3.1, memorystream@^0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
|
||||
integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==
|
||||
|
@ -10900,7 +11092,7 @@ methods@^1.1.2:
|
|||
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
|
||||
integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==
|
||||
|
||||
micromatch@^3.1.10, micromatch@^3.1.4:
|
||||
micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.5:
|
||||
version "3.1.10"
|
||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
|
||||
integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==
|
||||
|
@ -13096,6 +13288,21 @@ relative-microtime@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/relative-microtime/-/relative-microtime-2.0.0.tgz#cceed2af095ecd72ea32011279c79e5fcc7de29b"
|
||||
integrity sha512-l18ha6HEZc+No/uK4GyAnNxgKW7nvEe35IaeN54sShMojtqik2a6GbTyuiezkjpPaqP874Z3lW5ysBo5irz4NA==
|
||||
|
||||
relative@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/relative/-/relative-3.0.2.tgz#0dcd8ec54a5d35a3c15e104503d65375b5a5367f"
|
||||
integrity sha512-Q5W2qeYtY9GbiR8z1yHNZ1DGhyjb4AnLEjt8iE6XfcC1QIu+FAtj3HQaO0wH28H1mX6cqNLvAqWhP402dxJGyA==
|
||||
dependencies:
|
||||
isobject "^2.0.0"
|
||||
|
||||
remarkable@^1.6.2:
|
||||
version "1.7.4"
|
||||
resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.4.tgz#19073cb960398c87a7d6546eaa5e50d2022fcd00"
|
||||
integrity sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg==
|
||||
dependencies:
|
||||
argparse "^1.0.10"
|
||||
autolinker "~0.28.0"
|
||||
|
||||
remove-trailing-separator@^1.0.1:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
|
||||
|
@ -13444,6 +13651,11 @@ seek-bzip@^1.0.5:
|
|||
dependencies:
|
||||
commander "^2.8.1"
|
||||
|
||||
self-closing-tags@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/self-closing-tags/-/self-closing-tags-1.0.1.tgz#6c5fa497994bb826b484216916371accee490a5d"
|
||||
integrity sha512-7t6hNbYMxM+VHXTgJmxwgZgLGktuXtVVD5AivWzNTdJBM4DBjnDKDzkf2SrNjihaArpeJYNjxkELBu1evI4lQA==
|
||||
|
||||
semver-compare@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
|
||||
|
@ -14232,6 +14444,11 @@ strip-outer@^1.0.0:
|
|||
dependencies:
|
||||
escape-string-regexp "^1.0.2"
|
||||
|
||||
striptags@^3.1.1:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.2.0.tgz#cc74a137db2de8b0b9a370006334161f7dd67052"
|
||||
integrity sha512-g45ZOGzHDMe2bdYMdIvdAfCQkCTDMGBazSw1ypMowwGIee7ZQ5dU0rBJ8Jqgl+jAKIv4dbeE1jscZq9wid1Tkw==
|
||||
|
||||
style-loader@^3.3.1:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575"
|
||||
|
@ -14716,6 +14933,11 @@ to-fast-properties@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
|
||||
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
|
||||
|
||||
to-gfm-code-block@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/to-gfm-code-block/-/to-gfm-code-block-0.1.1.tgz#25d045a5fae553189e9637b590900da732d8aa82"
|
||||
integrity sha512-LQRZWyn8d5amUKnfR9A9Uu7x9ss7Re8peuWR2gkh1E+ildOfv2aF26JpuDg8JtvCduu5+hOrMIH+XstZtnagqg==
|
||||
|
||||
to-json-schema@0.2.5:
|
||||
version "0.2.5"
|
||||
resolved "https://registry.yarnpkg.com/to-json-schema/-/to-json-schema-0.2.5.tgz#ef3c3f11ad64460dcfbdbafd0fd525d69d62a98f"
|
||||
|
@ -14984,6 +15206,13 @@ typedarray-to-buffer@^3.1.5:
|
|||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typeof-article@^0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/typeof-article/-/typeof-article-0.1.1.tgz#9f07e733c3fbb646ffa9e61c08debacd460e06af"
|
||||
integrity sha512-Vn42zdX3FhmUrzEmitX3iYyLb+Umwpmv8fkZRIknYh84lmdrwqZA5xYaoKiIj2Rc5i/5wcDrpUmZcbk1U51vTw==
|
||||
dependencies:
|
||||
kind-of "^3.1.0"
|
||||
|
||||
typeof@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/typeof/-/typeof-1.0.0.tgz#9c84403f2323ae5399167275497638ea1d2f2440"
|
||||
|
@ -15344,6 +15573,14 @@ vm2@3.9.11:
|
|||
acorn "^8.7.0"
|
||||
acorn-walk "^8.2.0"
|
||||
|
||||
vm2@^3.9.4:
|
||||
version "3.9.14"
|
||||
resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.14.tgz#964042b474cf1e6e4f475a39144773cdb9deb734"
|
||||
integrity sha512-HgvPHYHeQy8+QhzlFryvSteA4uQLBCOub02mgqdR+0bN/akRZ48TGB1v0aCv7ksyc0HXx16AZtMHKS38alc6TA==
|
||||
dependencies:
|
||||
acorn "^8.7.0"
|
||||
acorn-walk "^8.2.0"
|
||||
|
||||
vuvuzela@1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/vuvuzela/-/vuvuzela-1.0.3.tgz#3be145e58271c73ca55279dd851f12a682114b0b"
|
||||
|
@ -15905,6 +16142,11 @@ yauzl@^2.4.2:
|
|||
buffer-crc32 "~0.2.3"
|
||||
fd-slicer "~1.1.0"
|
||||
|
||||
year@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/year/-/year-0.2.1.tgz#4083ae520a318b23ec86037f3000cb892bdf9bb0"
|
||||
integrity sha512-9GnJUZ0QM4OgXuOzsKNzTJ5EOkums1Xc+3YQXp+Q+UxFjf7zLucp9dQ8QMIft0Szs1E1hUiXFim1OYfEKFq97w==
|
||||
|
||||
ylru@^1.2.0:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.3.2.tgz#0de48017473275a4cbdfc83a1eaf67c01af8a785"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/types",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase types",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
|
@ -36,6 +36,9 @@ export interface SettingsConfig extends Config {
|
|||
config: SettingsInnerConfig
|
||||
}
|
||||
|
||||
export type SSOConfigType = ConfigType.GOOGLE | ConfigType.OIDC
|
||||
export type SSOConfig = GoogleInnerConfig | OIDCInnerConfig
|
||||
|
||||
export interface GoogleInnerConfig {
|
||||
clientID: string
|
||||
clientSecret: string
|
||||
|
@ -60,6 +63,10 @@ export interface OIDCStrategyConfiguration {
|
|||
callbackURL: string
|
||||
}
|
||||
|
||||
export interface OIDCConfigs {
|
||||
configs: OIDCInnerConfig[]
|
||||
}
|
||||
|
||||
export interface OIDCInnerConfig {
|
||||
configUrl: string
|
||||
clientID: string
|
||||
|
@ -72,9 +79,7 @@ export interface OIDCInnerConfig {
|
|||
}
|
||||
|
||||
export interface OIDCConfig extends Config {
|
||||
config: {
|
||||
configs: OIDCInnerConfig[]
|
||||
}
|
||||
config: OIDCConfigs
|
||||
}
|
||||
|
||||
export interface OIDCWellKnownConfig {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "2.3.18-alpha.14",
|
||||
"version": "2.3.18-alpha.16",
|
||||
"description": "Budibase background service",
|
||||
"main": "src/index.ts",
|
||||
"repository": {
|
||||
|
@ -36,10 +36,10 @@
|
|||
"author": "Budibase",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@budibase/backend-core": "2.3.18-alpha.14",
|
||||
"@budibase/pro": "2.3.18-alpha.14",
|
||||
"@budibase/string-templates": "2.3.18-alpha.14",
|
||||
"@budibase/types": "2.3.18-alpha.14",
|
||||
"@budibase/backend-core": "2.3.18-alpha.16",
|
||||
"@budibase/pro": "2.3.18-alpha.16",
|
||||
"@budibase/string-templates": "2.3.18-alpha.16",
|
||||
"@budibase/types": "2.3.18-alpha.16",
|
||||
"@koa/router": "8.0.8",
|
||||
"@sentry/node": "6.17.7",
|
||||
"@techpass/passport-openidconnect": "0.3.2",
|
||||
|
|
|
@ -17,10 +17,15 @@ import {
|
|||
Ctx,
|
||||
GetPublicOIDCConfigResponse,
|
||||
GetPublicSettingsResponse,
|
||||
GoogleInnerConfig,
|
||||
isGoogleConfig,
|
||||
isOIDCConfig,
|
||||
isSettingsConfig,
|
||||
isSMTPConfig,
|
||||
OIDCConfigs,
|
||||
SettingsInnerConfig,
|
||||
SSOConfig,
|
||||
SSOConfigType,
|
||||
UserCtx,
|
||||
} from "@budibase/types"
|
||||
import * as pro from "@budibase/pro"
|
||||
|
@ -119,6 +124,61 @@ const getEventFns = async (config: Config, existing?: Config) => {
|
|||
return fns
|
||||
}
|
||||
|
||||
type SSOConfigs = { [key in SSOConfigType]: SSOConfig | undefined }
|
||||
|
||||
async function getSSOConfigs(): Promise<SSOConfigs> {
|
||||
const google = await configs.getGoogleConfig()
|
||||
const oidc = await configs.getOIDCConfig()
|
||||
return {
|
||||
[ConfigType.GOOGLE]: google,
|
||||
[ConfigType.OIDC]: oidc,
|
||||
}
|
||||
}
|
||||
|
||||
async function hasActivatedConfig(ssoConfigs?: SSOConfigs) {
|
||||
if (!ssoConfigs) {
|
||||
ssoConfigs = await getSSOConfigs()
|
||||
}
|
||||
return !!Object.values(ssoConfigs).find(c => c?.activated)
|
||||
}
|
||||
|
||||
async function verifySettingsConfig(config: SettingsInnerConfig) {
|
||||
if (config.isSSOEnforced) {
|
||||
const valid = await hasActivatedConfig()
|
||||
if (!valid) {
|
||||
throw new Error("Cannot enforce SSO without an activated configuration")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function verifySSOConfig(type: SSOConfigType, config: SSOConfig) {
|
||||
const settings = await configs.getSettingsConfig()
|
||||
if (settings.isSSOEnforced && !config.activated) {
|
||||
// config is being saved as deactivated
|
||||
// ensure there is at least one other activated sso config
|
||||
const ssoConfigs = await getSSOConfigs()
|
||||
|
||||
// overwrite the config being updated
|
||||
// to reflect the desired state
|
||||
ssoConfigs[type] = config
|
||||
|
||||
const activated = await hasActivatedConfig(ssoConfigs)
|
||||
if (!activated) {
|
||||
throw new Error(
|
||||
"Configuration cannot be deactivated while SSO is enforced"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function verifyGoogleConfig(config: GoogleInnerConfig) {
|
||||
await verifySSOConfig(ConfigType.GOOGLE, config)
|
||||
}
|
||||
|
||||
async function verifyOIDCConfig(config: OIDCConfigs) {
|
||||
await verifySSOConfig(ConfigType.OIDC, config.configs[0])
|
||||
}
|
||||
|
||||
export async function save(ctx: UserCtx<Config>) {
|
||||
const body = ctx.request.body
|
||||
const type = body.type
|
||||
|
@ -133,10 +193,19 @@ export async function save(ctx: UserCtx<Config>) {
|
|||
|
||||
try {
|
||||
// verify the configuration
|
||||
switch (config.type) {
|
||||
switch (type) {
|
||||
case ConfigType.SMTP:
|
||||
await email.verifyConfig(config)
|
||||
break
|
||||
case ConfigType.SETTINGS:
|
||||
await verifySettingsConfig(config)
|
||||
break
|
||||
case ConfigType.GOOGLE:
|
||||
await verifyGoogleConfig(config)
|
||||
break
|
||||
case ConfigType.OIDC:
|
||||
await verifyOIDCConfig(config)
|
||||
break
|
||||
}
|
||||
} catch (err: any) {
|
||||
ctx.throw(400, err)
|
||||
|
|
|
@ -34,8 +34,8 @@ function settingValidation() {
|
|||
function googleValidation() {
|
||||
// prettier-ignore
|
||||
return Joi.object({
|
||||
clientID: Joi.when('activated', { is: true, then: Joi.string().required() }),
|
||||
clientSecret: Joi.when('activated', { is: true, then: Joi.string().required() }),
|
||||
clientID: Joi.string().required(),
|
||||
clientSecret: Joi.string().required(),
|
||||
activated: Joi.boolean().required(),
|
||||
}).unknown(true)
|
||||
}
|
||||
|
@ -45,12 +45,12 @@ function oidcValidation() {
|
|||
return Joi.object({
|
||||
configs: Joi.array().items(
|
||||
Joi.object({
|
||||
clientID: Joi.when('activated', { is: true, then: Joi.string().required() }),
|
||||
clientSecret: Joi.when('activated', { is: true, then: Joi.string().required() }),
|
||||
configUrl: Joi.when('activated', { is: true, then: Joi.string().required() }),
|
||||
clientID: Joi.string().required(),
|
||||
clientSecret: Joi.string().required(),
|
||||
configUrl: Joi.string().required(),
|
||||
logo: Joi.string().allow("", null),
|
||||
name: Joi.string().allow("", null),
|
||||
uuid: Joi.when('activated', { is: true, then: Joi.string().required() }),
|
||||
uuid: Joi.string().required(),
|
||||
activated: Joi.boolean().required(),
|
||||
scopes: Joi.array().optional()
|
||||
})
|
||||
|
|
|
@ -203,7 +203,7 @@ export async function sendEmail(
|
|||
* @param {object} config an SMTP configuration - this is based on the nodemailer API.
|
||||
* @return {Promise<boolean>} returns true if the configuration is valid.
|
||||
*/
|
||||
export async function verifyConfig(config: any) {
|
||||
export async function verifyConfig(config: SMTPInnerConfig) {
|
||||
const transport = createSMTPTransport(config)
|
||||
await transport.verify()
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue