diff --git a/packages/builder/src/components/backend/DatasourceNavigator/icons/BigQuery.svelte b/packages/builder/src/components/backend/DatasourceNavigator/icons/BigQuery.svelte new file mode 100644 index 00000000000..1cdddfe44ad --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/icons/BigQuery.svelte @@ -0,0 +1,17 @@ + + + + + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js b/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js index 6d43258f453..d44890f59a7 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js +++ b/packages/builder/src/components/backend/DatasourceNavigator/icons/index.js @@ -16,6 +16,7 @@ import Firebase from "./Firebase.svelte" import Redis from "./Redis.svelte" import Snowflake from "./Snowflake.svelte" import Custom from "./Custom.svelte" +import BigQuery from "./BigQuery.svelte" const ICONS = { BUDIBASE: Budibase, @@ -36,6 +37,7 @@ const ICONS = { REDIS: Redis, SNOWFLAKE: Snowflake, CUSTOM: Custom, + BIG_QUERY: BigQuery, } export default ICONS diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index 28ce35d9f70..9c59612e416 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -183,6 +183,7 @@ export const IntegrationTypes = { FIRESTORE: "FIRESTORE", REDIS: "REDIS", SNOWFLAKE: "SNOWFLAKE", + BIG_QUERY: "BIG_QUERY", } export const IntegrationNames = { @@ -203,6 +204,7 @@ export const IntegrationNames = { [IntegrationTypes.FIRESTORE]: "Firestore", [IntegrationTypes.REDIS]: "Redis", [IntegrationTypes.SNOWFLAKE]: "Snowflake", + [IntegrationTypes.BIG_QUERY]: "Big Query", } export const SchemaTypeOptions = [ diff --git a/packages/builder/src/constants/index.js b/packages/builder/src/constants/index.js index 4e2ca37b9ce..49d431cff67 100644 --- a/packages/builder/src/constants/index.js +++ b/packages/builder/src/constants/index.js @@ -22,6 +22,7 @@ export const IntegrationNames = { ARANGODB: "ArangoDB", ORACLE: "Oracle", GOOGLE_SHEETS: "Google Sheets", + BIG_QUERY: "Big Query", } // fields on the user table that cannot be edited diff --git a/packages/server/package.json b/packages/server/package.json index 896d920045a..a6f36122539 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -85,6 +85,7 @@ "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", + "@google-cloud/bigquery": "^6.0.2", "@google-cloud/firestore": "5.0.2", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/server/src/integrations/bigQuery.ts b/packages/server/src/integrations/bigQuery.ts new file mode 100644 index 00000000000..39d0557554e --- /dev/null +++ b/packages/server/src/integrations/bigQuery.ts @@ -0,0 +1,169 @@ +import { + DatasourceFieldType, + Integration, + QueryType, + SqlQuery, + Table, +} from "@budibase/types" + +import { BigQuery, BigQueryOptions } from "@google-cloud/bigquery" + +const SCHEMA: Integration = { + docs: "https://cloud.google.com/bigquery/docs", + datasource: { + projectId: { + type: DatasourceFieldType.STRING, + required: true, + }, + datasetId: { + type: DatasourceFieldType.STRING, + required: true, + }, + apiEndpoint: { + type: DatasourceFieldType.STRING, + required: false, + }, + email: { + type: DatasourceFieldType.STRING, + required: true, + }, + privateKey: { + type: DatasourceFieldType.STRING, + required: true, + }, + }, + query: { + create: { + type: QueryType.SQL, + }, + read: { + type: QueryType.SQL, + }, + update: { + type: QueryType.SQL, + }, + delete: { + type: QueryType.SQL, + }, + }, + friendlyName: "BigQuery", + type: "Relational", + description: + "BigQuery is a serverless, cost-effective and multicloud data warehouse designed to help you turn big data into valuable business insights.", +} + +interface BigQueryConfig extends BigQueryOptions { + projectId: string + datasetId: string + apiEndpoint?: string + email: string + privateKey: string +} + +type RawRow = { + [key: string]: any +} + +type CoercedFieldValue = string | Date | null + +type CoercedRow = { + [key: string]: CoercedFieldValue +} + +class BigQueryIntegration { + private client: any + private static readonly BIG_QUERY_SCOPES = [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/drive", + ] + private readonly datasetId: string + constructor(config: BigQueryConfig) { + this.client = new BigQuery({ + projectId: config.projectId, + apiEndpoint: config.apiEndpoint ? config.apiEndpoint : undefined, + credentials: { + client_email: config.email, + private_key: config.privateKey?.replace(/\\n/g, "\n"), + }, + scopes: BigQueryIntegration.BIG_QUERY_SCOPES, + }) + + this.datasetId = config.datasetId + + this.createDatasetIfDoesNotExist() + this.buildSchema("hello", {}) + } + + async createDatasetIfDoesNotExist() { + // TODO: To prevent a race condition, try to create dataset first, only + // return if error creating because it already exists. + try { + const existingDataset = await this.client.dataset(this.datasetId).get() + if (!existingDataset) { + await this.client.createDataset(this.datasetId) + } + } catch (err: any) { + throw err?.message.split(":")[1] || err?.message + } + } + + async internalQuery(query: SqlQuery) { + try { + return await this.client.createQueryJob(query.sql) + } catch (err: any) { + throw err?.message.split(":")[1] || err?.message + } + } + + async create(query: SqlQuery) { + return this.internalQuery(query) + } + + async read(query: SqlQuery) { + const [job] = await this.internalQuery(query) + const [rows] = await job.getQueryResults() + rows.forEach((row: any) => { + console.log(row) + }) + return rows.map((row: RawRow) => this.coerceRow(row)) + } + + async update(query: SqlQuery) { + return this.internalQuery(query) + } + + async delete(query: SqlQuery) { + return this.internalQuery(query) + } + + async buildSchema(datasourceId: string, entities: Record) { + // fetch all existing tables + // const dataset = this.client.dataset(this.datasetId) + // const tables = await dataset.getTables() + } + + coerceRow(row: RawRow): CoercedRow { + return Object.keys(row).reduce((newRow: CoercedRow, key: string) => { + newRow[key] = this.coerceValue(row[key]) + return newRow + }, {}) + } + + coerceValue(v: any): CoercedFieldValue { + // TODO: Add support for all Bigquery types (e.g. BigQueryTimestamp). + if (v === null || v === undefined) { + return null + } else if (typeof v.value === "function") { + return v.value() + } else if (typeof v === "string") { + return v + } else { + return "UNSUPPORTED" + } + } +} + +export default { + schema: SCHEMA, + integration: BigQueryIntegration, +} diff --git a/packages/server/src/integrations/index.ts b/packages/server/src/integrations/index.ts index 007b7e91e62..8fc61a48b9d 100644 --- a/packages/server/src/integrations/index.ts +++ b/packages/server/src/integrations/index.ts @@ -13,6 +13,7 @@ import googlesheets from "./googlesheets" import firebase from "./firebase" import redis from "./redis" import snowflake from "./snowflake" +import bigQuery from "./bigQuery" import { getPlugins } from "../api/controllers/plugin" import { SourceName, Integration, PluginType } from "@budibase/types" import { getDatasourcePlugin } from "../utilities/fileSystem" @@ -34,6 +35,7 @@ const DEFINITIONS: { [key: string]: Integration } = { [SourceName.FIRESTORE]: firebase.schema, [SourceName.REDIS]: redis.schema, [SourceName.SNOWFLAKE]: snowflake.schema, + [SourceName.BIG_QUERY]: bigQuery.schema, } const INTEGRATIONS: { [key: string]: any } = { @@ -53,6 +55,7 @@ const INTEGRATIONS: { [key: string]: any } = { [SourceName.REDIS]: redis.integration, [SourceName.FIRESTORE]: firebase.integration, [SourceName.SNOWFLAKE]: snowflake.integration, + [SourceName.BIG_QUERY]: bigQuery.integration, } // optionally add oracle integration if the oracle binary can be installed diff --git a/packages/server/src/integrations/tests/bigQuery.spec.js b/packages/server/src/integrations/tests/bigQuery.spec.js new file mode 100644 index 00000000000..74f3cd8db09 --- /dev/null +++ b/packages/server/src/integrations/tests/bigQuery.spec.js @@ -0,0 +1,31 @@ +const bigQuery = require("@google-cloud/bigquery") +const BigQueryIntegration = require("../bigQuery") +jest.mock("@google-cloud/bigquery") + +class TestConfiguration { + constructor(config = {}) { + this.integration = new BigQueryIntegration.integration(config) + } +} + +describe("BigQuery Integration", () => { + let config + + beforeEach(() => { + config = new TestConfiguration({ + projectId: 'projectId', + email: 'someEmail@gmail.com', + privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDUzve3Eqp3PRFN\nzcNkzPSNn2v3pUzuuaC1M8T073Qox7XQ3uDzjZ57Ne29y08p6qiJbLyOyAANrtuU\n6pzMS3zUs7+joP9WmX1WszdzKZB2aI6++cAwtbNo+A3TS4ybCfyJH+UG0QkMQ6Q3\npyQH+qs5Q3/B3OaQtgvcrhm0xA7ZE/tE3HrpIWkGGYO7peFctfft/ZT6PF4SGAc/\nTxovLX/+tPbMOcyVpBhB+Sq+AH00yIHFFDRMVrS7pMK++4A3YSQn/8d2yLjrp/jB\nRGUMzKYpMMP9Fr5G3CI9iLBL4cY8Qlqf7ktgat1xem4n9wX9DF3vGdLSN9KEATyz\nCSL6lpbtAgMBAAECggEAGxA5G4yhpilbfoAI9dRE04/vLJ7WglOUFwc+6IFdTeRc\nAHSfugmMGpI4qlblOejwRw3Piv7vVs4iebU+fJKrDOfRGs+aOVqqwHBpQFmMWCqi\n4LGlWex5pQNKytDEUGE8PvoR58SEuI0PoM4+PE+KH+2wHSjpH4UvTADOHxmB4+Q1\ntQlbAfuWUvg8PuEfEzo9F1ilhiklHuZc1ut6OAtdD80BooLd+Tl27kdJhvQAHInZ\njJCnD0/XuK8dgZyzSxjT1exNLSYsAXdeEWXb33dMz+MBzMqD3jXXdBCpOByubLGs\nsj50Tuf/BHc/i4TbnCuDRHX7JDJB6UEBuiHwI8p/cQKBgQD0pbn5xl3tasIEbhCn\n02UKDHpW7HnrqC+ElYwoVyfv6LGQfuCVEIfj9JbRhrTjh0OdPlMSa3ALsrN3z0Qe\nDxKFeMlEnrnfg2WpNGe7X0PIhbTkzDtNJePqxMCXmBOUh40RA2L+XV2Lswgn71uk\nfnd3UW+A/CY0+I/tgufqD7DjuQKBgQDerwNLwcKwromKucxkPGEHoid7tMFwpWug\n3QQqTHJyXQ59bjbYsqH7VSIY49MV1FhOYBPA9Mrcj0hdqn3+edKnQwM+WXfI4MK3\nd/o/wpmskIXBreQhKzzQr0CdvTEwkr+4CXUXfn00HqumoSacc8/gfSkUiZ7btoIw\nLR1UFB0O1QKBgHjs+fI2VPMnk+MwrFboLMc8x7Pzi4gqR+KXMQI3omv5bttne4by\n9th8a5gBp6PXllpBFjrClE2T9RXBg4AAHz2OKJ4cfu+2OSfb2XJKcmzJelKliKJn\nmjLPMgs8hmEiZ14DeIkWiUimI9/pdjjmshJuVFlDSXdhbXMPA6c0PlExAoGAcaWy\nMeyeVxuMmJ9AX/usrX+lVO4oNzxFVKDXqlq/ofw6E+u21Bs+rg2BzGAhb6eitcU0\n76o/CheaICuOB9zWlISP2DdC+eMznPz/W6EOWtKbYQBFSGRPslVuzdIrk5WhgORa\nvPXSIlJw2iaulPRKKFDYMWIXEBzyDnJH4IwvVE0CgYEA5XvZi5fsDh+zOnAvGmbH\n6amOgdLAQEXzyuFk7Q3bqPWzE5IbHu7dESC6V6vt3XXcrgi49fLa1YUuuLkJGlq9\nE3i0KGunR1jBlG86wZAgEYBZ+v8lqptflVR+UUNNTWzicH7EOtbn+3P9BrrU29aw\n6XXUZWEqYg4s54aQd/L1Ggs=\n-----END PRIVATE KEY-----\n' + }) + }) + + it("calls the read method with the correct params", async () => { + const sql = "select * from users;" + await config.integration.read({ + sql + }) + expect(bigQuery.createQueryJob).toHaveBeenCalledWith(sql) + }) + + + }) diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index d89a21f0d35..3bf7f688559 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1330,6 +1330,39 @@ pump "^3.0.0" secure-json-parse "^2.1.0" +"@google-cloud/bigquery@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@google-cloud/bigquery/-/bigquery-6.0.2.tgz#84af7fb4d3eb3f439c2ed29dc24b837c05c3a13e" + integrity sha512-P9e8MHL/1Hlkowkxoc0+N9USICEhuCOaNPr02xib8xUCn8HevhZz15TkZEHurGBMdyKwm2dJpoxVmHTE7sXdSQ== + dependencies: + "@google-cloud/common" "^4.0.0" + "@google-cloud/paginator" "^4.0.0" + "@google-cloud/promisify" "^3.0.0" + arrify "^2.0.1" + big.js "^6.0.0" + duplexify "^4.0.0" + extend "^3.0.2" + is "^3.3.0" + p-event "^4.1.0" + readable-stream "^4.0.0" + stream-events "^1.0.5" + uuid "^8.0.0" + +"@google-cloud/common@^4.0.0": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@google-cloud/common/-/common-4.0.2.tgz#2b34ad6213c42de081c3d633ab26381cbf17a421" + integrity sha512-LgUoPQq1CNzMAtqnIJLetj7hlzZUS+CG9mBuZthqek6+eGu3PsH2IuEbbtLSUgPZNgOgi/fWGWpbNPP7wgjF0A== + dependencies: + "@google-cloud/projectify" "^3.0.0" + "@google-cloud/promisify" "^3.0.0" + arrify "^2.0.1" + duplexify "^4.1.1" + ent "^2.2.0" + extend "^3.0.2" + google-auth-library "^8.0.2" + retry-request "^5.0.0" + teeny-request "^8.0.0" + "@google-cloud/firestore@5.0.2": version "5.0.2" resolved "https://registry.yarnpkg.com/@google-cloud/firestore/-/firestore-5.0.2.tgz#36923fde45987f928a220d347f341c5602f9e340" @@ -1340,6 +1373,24 @@ google-gax "^2.24.1" protobufjs "^6.8.6" +"@google-cloud/paginator@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@google-cloud/paginator/-/paginator-4.0.0.tgz#9c3e01544717aecb9a922b4269ff298f30a0f1bb" + integrity sha512-wNmCZl+2G2DmgT/VlF+AROf80SoaC/CwS8trwmjNaq26VRNK8yPbU5F/Vy+R9oDAGKWQU2k8+Op5H4kFJVXFaQ== + dependencies: + arrify "^2.0.0" + extend "^3.0.2" + +"@google-cloud/projectify@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@google-cloud/projectify/-/projectify-3.0.0.tgz#302b25f55f674854dce65c2532d98919b118a408" + integrity sha512-HRkZsNmjScY6Li8/kb70wjGlDDyLkVk3KvoEo9uIoxSjYLJasGiCch9+PqRVDOCGUFvEIqyogl+BeqILL4OJHA== + +"@google-cloud/promisify@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@google-cloud/promisify/-/promisify-3.0.0.tgz#5cd6941fc30c4acac18051706aa5af96069bd3e3" + integrity sha512-91ArYvRgXWb73YvEOBMmOcJc0bDRs5yiVHnqkwoG0f3nm7nZuipllz6e7BvFESBvjkDTBC0zMD8QxedUwNLc1A== + "@grpc/grpc-js@~1.6.0": version "1.6.7" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.6.7.tgz#4c4fa998ff719fe859ac19fe977fdef097bb99aa" @@ -2582,6 +2633,11 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -3667,7 +3723,7 @@ array.prototype.reduce@^1.0.4: es-array-method-boxes-properly "^1.0.0" is-string "^1.0.7" -arrify@^2.0.0: +arrify@^2.0.0, arrify@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== @@ -4084,6 +4140,11 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== +big.js@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.1.tgz#7205ce763efb17c2e41f26f121c420c6a7c2744f" + integrity sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ== + bignumber.js@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-2.4.0.tgz#838a992da9f9d737e0f4b2db0be62bb09dd0c5e8" @@ -5451,7 +5512,7 @@ duplexer3@^0.1.4: resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" integrity sha512-CEj8FwwNA4cVH2uFCoHUrmojhYh1vmCdOaneKJXwkeY1i9jnlslVo9dx+hQ5Hl9GnH/Bwy/IjxAyOePyPKYnzA== -duplexify@^4.0.0: +duplexify@^4.0.0, duplexify@^4.1.1: version "4.1.2" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== @@ -5626,6 +5687,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" @@ -6746,6 +6812,16 @@ gaxios@^4.0.0: is-stream "^2.0.0" node-fetch "^2.6.7" +gaxios@^5.0.0, gaxios@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-5.0.1.tgz#50fc76a2d04bc1700ed8c3ff1561e52255dfc6e0" + integrity sha512-keK47BGKHyyOVQxgcUaSaFvr3ehZYAlvhvpHXy0YB2itzZef+GqZR8TBsfVRWghdwlKrYsn+8L8i3eblF7Oviw== + dependencies: + extend "^3.0.2" + https-proxy-agent "^5.0.0" + is-stream "^2.0.0" + node-fetch "^2.6.7" + gcp-metadata@^4.2.0: version "4.3.1" resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-4.3.1.tgz#fb205fe6a90fef2fd9c85e6ba06e5559ee1eefa9" @@ -6754,6 +6830,14 @@ gcp-metadata@^4.2.0: gaxios "^4.0.0" json-bigint "^1.0.0" +gcp-metadata@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-5.0.0.tgz#a00f999f60a4461401e7c515f8a3267cfb401ee7" + integrity sha512-gfwuX3yA3nNsHSWUL4KG90UulNiq922Ukj3wLTrcnX33BB7PwB1o0ubR8KVvXu9nJH+P5w1j2SQSNNqto+H0DA== + dependencies: + gaxios "^5.0.0" + json-bigint "^1.0.0" + generate-function@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" @@ -7032,6 +7116,21 @@ google-auth-library@^7.14.0: jws "^4.0.0" lru-cache "^6.0.0" +google-auth-library@^8.0.2: + version "8.5.1" + resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-8.5.1.tgz#83f78f93833e62f41c885bea601c4a5654934dd9" + integrity sha512-7jNMDRhenfw2HLfL9m0ZP/Jw5hzXygfSprzBdypG3rZ+q2gIUbVC/osrFB7y/Z5dkrUr1mnLoDNlerF+p6VXZA== + dependencies: + arrify "^2.0.0" + base64-js "^1.3.0" + ecdsa-sig-formatter "^1.0.11" + fast-text-encoding "^1.0.0" + gaxios "^5.0.0" + gcp-metadata "^5.0.0" + gtoken "^6.1.0" + jws "^4.0.0" + lru-cache "^6.0.0" + google-auth-library@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-0.10.0.tgz#6e15babee85fd1dd14d8d128a295b6838d52136e" @@ -7075,6 +7174,13 @@ google-p12-pem@^3.1.3: dependencies: node-forge "^1.3.1" +google-p12-pem@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-4.0.1.tgz#82841798253c65b7dc2a4e5fe9df141db670172a" + integrity sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ== + dependencies: + node-forge "^1.3.1" + google-spreadsheet@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/google-spreadsheet/-/google-spreadsheet-3.2.0.tgz#ce8aa75c15705aa950ad52b091a6fc4d33dcb329" @@ -7157,6 +7263,15 @@ gtoken@^5.0.4: google-p12-pem "^3.1.3" jws "^4.0.0" +gtoken@^6.1.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-6.1.1.tgz#29ebf3e6893719176d180f5694f1cad525ce3c04" + integrity sha512-HPM4VzzPEGxjQ7T2xLrdSYBs+h1c0yHAUiN+8RHPDoiZbndlpg9Sx3SjWcrTt9+N3FHsSABEpjvdQVan5AAuZQ== + dependencies: + gaxios "^5.0.1" + google-p12-pem "^4.0.0" + jws "^4.0.0" + handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" @@ -7378,6 +7493,15 @@ http-proxy-agent@^4.0.1: agent-base "6" debug "4" +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -8041,6 +8165,11 @@ is-yarn-global@^0.3.0: resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232" integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw== +is@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/is/-/is-3.3.0.tgz#61cff6dd3c4193db94a3d62582072b44e5645d79" + integrity sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg== + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -10873,6 +11002,13 @@ p-event@^2.1.0: dependencies: p-timeout "^2.0.1" +p-event@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-4.2.0.tgz#af4b049c8acd91ae81083ebd1e6f5cae2044c1b5" + integrity sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ== + dependencies: + p-timeout "^3.1.0" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -10921,7 +11057,7 @@ p-timeout@^2.0.1: dependencies: p-finally "^1.0.0" -p-timeout@^3.2.0: +p-timeout@^3.1.0, p-timeout@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== @@ -11969,6 +12105,13 @@ readable-stream@^2.0.0, readable-stream@^2.3.0, readable-stream@^2.3.5, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.1.0.tgz#280d0a29f559d3fb684a277254e02b6f61ae0631" + integrity sha512-sVisi3+P2lJ2t0BPbpK629j8wRW06yKGJUcaLAGXPAUhyUxVJm7VsCTit1PFgT4JHUDMrGNR+ZjSKpzGaRF3zw== + dependencies: + abort-controller "^3.0.0" + readable-stream@~0.0.2: version "0.0.4" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-0.0.4.tgz#f32d76e3fb863344a548d79923007173665b3b8d" @@ -12357,6 +12500,14 @@ retry-request@^4.0.0: debug "^4.1.1" extend "^3.0.2" +retry-request@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/retry-request/-/retry-request-5.0.1.tgz#c6be2a4a36f1554ba3251fa8fd945af26ee0e9ec" + integrity sha512-lxFKrlBt0OZzCWh/V0uPEN0vlr3OhdeXnpeY5OES+ckslm791Cb1D5P7lJUSnY7J5hiCjcyaUGmzCnIGDCUBig== + dependencies: + debug "^4.1.1" + extend "^3.0.2" + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -13056,6 +13207,13 @@ stream-chopper@^3.0.1: dependencies: readable-stream "^3.0.6" +stream-events@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.5.tgz#bbc898ec4df33a4902d892333d47da9bf1c406d5" + integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg== + dependencies: + stubs "^3.0.0" + stream-shift@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" @@ -13224,6 +13382,11 @@ strip-outer@^1.0.0: dependencies: escape-string-regexp "^1.0.2" +stubs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" + integrity sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw== + style-loader@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" @@ -13502,6 +13665,17 @@ tedious@^6.6.2: readable-stream "^3.4.0" sprintf-js "^1.1.2" +teeny-request@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-8.0.1.tgz#cd9ceb4fec107521daa707db6fae3c01847f0858" + integrity sha512-q1yTwqoS5aH1pjur3kBbI+wFpiAswdVirHMB3pYT5x/B0d+ulYdrruB/xVtbTEaxJemHu5aTbh11rsOLlFk/ZQ== + dependencies: + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.0" + node-fetch "^2.6.1" + stream-events "^1.0.5" + uuid "^8.0.0" + terminal-link@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" @@ -14221,7 +14395,7 @@ uuid@8.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.1.0.tgz#6f1536eb43249f473abc6bd58ff983da1ca30d8d" integrity sha512-CI18flHDznR0lq54xBycOVmphdCYnQLKn8abKn7PXUiKUGdEd+/l9LWNJmugXel4hXq7S+RMNl34ecyC9TntWg== -uuid@8.3.2, uuid@^8.3.0, uuid@^8.3.2: +uuid@8.3.2, uuid@^8.0.0, uuid@^8.3.0, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== diff --git a/packages/string-templates/yarn.lock b/packages/string-templates/yarn.lock index dc7e8f18529..8e71e59912c 100644 --- a/packages/string-templates/yarn.lock +++ b/packages/string-templates/yarn.lock @@ -568,15 +568,6 @@ magic-string "^0.25.7" resolve "^1.17.0" -"@rollup/plugin-inject@^4.0.0": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-4.0.4.tgz#fbeee66e9a700782c4f65c8b0edbafe58678fbc2" - integrity sha512-4pbcU4J/nS+zuHk+c+OL3WtmEQhqxlZ9uqfjQMQDOHOPld7PsCd8k5LWs8h5wjwJN7MgnAn768F2sDxEP4eNFQ== - dependencies: - "@rollup/pluginutils" "^3.1.0" - estree-walker "^2.0.1" - magic-string "^0.25.7" - "@rollup/plugin-json@^4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" @@ -3796,13 +3787,6 @@ rollup-plugin-node-resolve@^5.2.0: resolve "^1.11.1" rollup-pluginutils "^2.8.1" -rollup-plugin-polyfill-node@^0.10.2: - version "0.10.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.10.2.tgz#b2128646851fcb9475ddfd5bc22ca1a8c568738d" - integrity sha512-5GMywXiLiuQP6ZzED/LO/Q0HyDi2W6b8VN+Zd3oB0opIjyRs494Me2ZMaqKWDNbGiW4jvvzl6L2n4zRgxS9cSQ== - dependencies: - "@rollup/plugin-inject" "^4.0.0" - rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" diff --git a/packages/types/src/sdk/datasources.ts b/packages/types/src/sdk/datasources.ts index 970613b322e..48d7696920c 100644 --- a/packages/types/src/sdk/datasources.ts +++ b/packages/types/src/sdk/datasources.ts @@ -51,6 +51,7 @@ export enum SourceName { FIRESTORE = "FIRESTORE", REDIS = "REDIS", SNOWFLAKE = "SNOWFLAKE", + BIG_QUERY = "BIG_QUERY", UNKNOWN = "unknown", }