From 13abf2d92bb2ebce19a5dac44ab3c555fee8172a Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 19 Sep 2024 16:09:19 -0700 Subject: [PATCH] FDC: Upgrade to v1beta (#8485) --- packages/data-connect/package.json | 2 +- packages/data-connect/src/util/url.ts | 2 +- .../test/dataconnect/connector/connector.yaml | 2 +- .../test/dataconnect/dataconnect.yaml | 3 ++- packages/data-connect/test/unit/userAgent.test.ts | 4 ++-- .../emulators/dataconnect-emulator.ts | 8 ++++---- yarn.lock | 15 --------------- 7 files changed, 11 insertions(+), 25 deletions(-) diff --git a/packages/data-connect/package.json b/packages/data-connect/package.json index ce7a98f167a..ba697fb9a76 100644 --- a/packages/data-connect/package.json +++ b/packages/data-connect/package.json @@ -35,7 +35,7 @@ "dev": "rollup -c -w", "test": "run-p --npm-path npm test:emulator", "test:ci": "node ../../scripts/run_tests_in_ci.js -s test:emulator", - "test:all": "npm run test:unit", + "test:all": "run-p --npm-path npm lint test:unit", "test:browser": "karma start --single-run", "test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", "test:unit": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/unit/**/*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js", diff --git a/packages/data-connect/src/util/url.ts b/packages/data-connect/src/util/url.ts index 3cef50ae648..b979ec19eb5 100644 --- a/packages/data-connect/src/util/url.ts +++ b/packages/data-connect/src/util/url.ts @@ -37,7 +37,7 @@ export function urlBuilder( 'Incorrect type for port passed in!' ); } - return `${baseUrl}/v1alpha/projects/${project}/locations/${location}/services/${service}/connectors/${connector}`; + return `${baseUrl}/v1beta/projects/${project}/locations/${location}/services/${service}/connectors/${connector}`; } export function addToken(url: string, apiKey?: string): string { if (!apiKey) { diff --git a/packages/data-connect/test/dataconnect/connector/connector.yaml b/packages/data-connect/test/dataconnect/connector/connector.yaml index 3779c6a3700..064d9c2c184 100644 --- a/packages/data-connect/test/dataconnect/connector/connector.yaml +++ b/packages/data-connect/test/dataconnect/connector/connector.yaml @@ -3,4 +3,4 @@ authMode: "PUBLIC" generate: javascriptSdk: outputDir: "./gen/web" - jsPackageName: "@movie-app-ssr/movies" + package: "@movie-app-ssr/movies" diff --git a/packages/data-connect/test/dataconnect/dataconnect.yaml b/packages/data-connect/test/dataconnect/dataconnect.yaml index 1931e7eb963..442e98e5592 100644 --- a/packages/data-connect/test/dataconnect/dataconnect.yaml +++ b/packages/data-connect/test/dataconnect/dataconnect.yaml @@ -1,5 +1,6 @@ -specVersion: "v1alpha" +specVersion: "v1beta" serviceId: "dataconnect" +location: "us-west2" schema: source: "./schema" datasource: diff --git a/packages/data-connect/test/unit/userAgent.test.ts b/packages/data-connect/test/unit/userAgent.test.ts index a42fd06f817..d218969fb75 100644 --- a/packages/data-connect/test/unit/userAgent.test.ts +++ b/packages/data-connect/test/unit/userAgent.test.ts @@ -54,7 +54,7 @@ describe('User Agent Tests', () => { // @ts-ignore await executeQuery(queryRef(dc, '')).catch(() => {}); expect(fakeFetchImpl).to.be.calledWithMatch( - 'https://firebasedataconnect.googleapis.com/v1alpha/projects/p/locations/l/services/s/connectors/c:executeQuery', + 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { ['X-Goog-Api-Client']: 'gl-js/ fire/' + SDK_VERSION + ' web/gen' @@ -66,7 +66,7 @@ describe('User Agent Tests', () => { // @ts-ignore await executeQuery(queryRef(dc, '')).catch(() => {}); expect(fakeFetchImpl).to.be.calledWithMatch( - 'https://firebasedataconnect.googleapis.com/v1alpha/projects/p/locations/l/services/s/connectors/c:executeQuery', + 'https://firebasedataconnect.googleapis.com/v1beta/projects/p/locations/l/services/s/connectors/c:executeQuery', { headers: { ['X-Goog-Api-Client']: 'gl-js/ fire/' + SDK_VERSION diff --git a/scripts/emulator-testing/emulators/dataconnect-emulator.ts b/scripts/emulator-testing/emulators/dataconnect-emulator.ts index 012aca578ca..efe5bdbe52c 100644 --- a/scripts/emulator-testing/emulators/dataconnect-emulator.ts +++ b/scripts/emulator-testing/emulators/dataconnect-emulator.ts @@ -18,7 +18,7 @@ import { platform } from 'os'; import { Emulator } from './emulator'; -const DATABASE_EMULATOR_VERSION = '1.1.17'; +const DATABASE_EMULATOR_VERSION = '1.3.7'; export class DataConnectEmulator extends Emulator { // namespace: string; @@ -29,15 +29,15 @@ export class DataConnectEmulator extends Emulator { switch (os) { case 'darwin': urlString = - 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-macos-v1.3.5?alt=media&token=52c3db6e-2a2a-4094-a482-a8c85ae67a88'; + 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-macos-v1.3.7?alt=media&token=2cf32435-d479-4929-b963-a97ae1ac3f0b'; break; case 'linux': urlString = - 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-linux-v1.3.5?alt=media&token=bafb1f81-2a27-4851-b655-59934985b492'; + 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-linux-v1.3.7?alt=media&token=fd33b4fc-2e27-4874-893a-2d1f0ecbf116'; break; case 'win32': urlString = - 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-windows-v1.3.5?alt=media&token=d3d04c57-992f-4a4b-931d-5c90efd54c5a'; + 'https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-windows-v1.3.7?alt=media&token=bd6e60b0-50b4-46db-aa6c-5fcc6e991f39'; break; default: throw new Error( diff --git a/yarn.lock b/yarn.lock index 70858a5db9c..92372aa94a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1639,21 +1639,6 @@ resolved "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz#ef20350fec605a7f7035a01764731b2de0f3782b" integrity sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A== -"@firebase/component@0.6.8": - version "0.6.8" - resolved "https://registry.npmjs.org/@firebase/component/-/component-0.6.8.tgz#899b9318c0ce0586580e8cda7eaf61296f7fb43b" - integrity sha512-LcNvxGLLGjBwB0dJUsBGCej2fqAepWyBubs4jt1Tiuns7QLbXHuyObZ4aMeBjZjWx4m8g1LoVI9QFpSaq/k4/g== - dependencies: - "@firebase/util" "1.9.7" - tslib "^2.1.0" - -"@firebase/util@1.9.7": - version "1.9.7" - resolved "https://registry.npmjs.org/@firebase/util/-/util-1.9.7.tgz#c03b0ae065b3bba22800da0bd5314ef030848038" - integrity sha512-fBVNH/8bRbYjqlbIhZ+lBtdAAS4WqZumx03K06/u7fJSpz1TGjEMm1ImvKD47w+xaFKIP2ori6z8BrbakRfjJA== - dependencies: - tslib "^2.1.0" - "@gar/promisify@^1.0.1": version "1.1.2" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz"