From 2eeea30a1d44d9df33ecac46d2c41fd577fbda85 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Mon, 4 Aug 2025 14:18:21 +0100 Subject: [PATCH 1/2] feat: add firebase 12 support --- .../js/default-connector-v11/README.md | 922 ++++++++++++++++++ .../js/default-connector-v11/esm/index.esm.js | 96 ++ .../js/default-connector-v11/esm/package.json | 1 + .../js/default-connector-v11/index.cjs.js | 104 ++ .../js/default-connector-v11/index.d.ts | 191 ++++ .../js/default-connector-v11/package.json | 25 + .../js/default-connector-v12/README.md | 922 ++++++++++++++++++ .../js/default-connector-v12/esm/index.esm.js | 96 ++ .../js/default-connector-v12/esm/package.json | 1 + .../js/default-connector-v12/index.cjs.js | 104 ++ .../js/default-connector-v12/index.d.ts | 191 ++++ .../js/default-connector-v12/package.json | 25 + .../js/default-connector/esm/index.esm.js | 104 +- .../js/default-connector/esm/package.json | 4 +- .../js/default-connector/index.cjs.js | 103 +- .../js/default-connector/index.d.ts | 113 +-- .../js/default-connector/package.json | 2 +- dataconnect/connector-v11/connector.yaml | 5 + dataconnect/connector-v11/mutations.gql | 59 ++ dataconnect/connector-v11/queries.gql | 74 ++ dataconnect/connector-v12/connector.yaml | 5 + dataconnect/connector-v12/mutations.gql | 59 ++ dataconnect/connector-v12/queries.gql | 74 ++ dataconnect/dataconnect.yaml | 2 +- package.json | 3 +- packages/angular/package.json | 5 +- packages/angular/vitest.config.ts | 6 +- packages/react/package.json | 9 +- pnpm-lock.yaml | 33 +- pnpm-workspace.yaml | 8 +- scripts/generate-connectors.sh | 8 + 31 files changed, 3122 insertions(+), 232 deletions(-) create mode 100644 dataconnect-sdk/js/default-connector-v11/README.md create mode 100644 dataconnect-sdk/js/default-connector-v11/esm/index.esm.js create mode 100644 dataconnect-sdk/js/default-connector-v11/esm/package.json create mode 100644 dataconnect-sdk/js/default-connector-v11/index.cjs.js create mode 100644 dataconnect-sdk/js/default-connector-v11/index.d.ts create mode 100644 dataconnect-sdk/js/default-connector-v11/package.json create mode 100644 dataconnect-sdk/js/default-connector-v12/README.md create mode 100644 dataconnect-sdk/js/default-connector-v12/esm/index.esm.js create mode 100644 dataconnect-sdk/js/default-connector-v12/esm/package.json create mode 100644 dataconnect-sdk/js/default-connector-v12/index.cjs.js create mode 100644 dataconnect-sdk/js/default-connector-v12/index.d.ts create mode 100644 dataconnect-sdk/js/default-connector-v12/package.json create mode 100644 dataconnect/connector-v11/connector.yaml create mode 100644 dataconnect/connector-v11/mutations.gql create mode 100644 dataconnect/connector-v11/queries.gql create mode 100644 dataconnect/connector-v12/connector.yaml create mode 100644 dataconnect/connector-v12/mutations.gql create mode 100644 dataconnect/connector-v12/queries.gql create mode 100755 scripts/generate-connectors.sh diff --git a/dataconnect-sdk/js/default-connector-v11/README.md b/dataconnect-sdk/js/default-connector-v11/README.md new file mode 100644 index 00000000..fcfd0d7e --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v11/README.md @@ -0,0 +1,922 @@ +# Generated TypeScript README +This README will guide you through the process of using the generated JavaScript SDK package for the connector `default-connector-v11`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. + +***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.* + +# Table of Contents +- [**Overview**](#generated-javascript-readme) +- [**Accessing the connector**](#accessing-the-connector) + - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) +- [**Queries**](#queries) + - [*ListMovies*](#listmovies) + - [*GetMovieById*](#getmoviebyid) + - [*GetMeta*](#getmeta) +- [**Mutations**](#mutations) + - [*CreateMovie*](#createmovie) + - [*UpsertMovie*](#upsertmovie) + - [*DeleteMovie*](#deletemovie) + - [*AddMeta*](#addmeta) + - [*DeleteMeta*](#deletemeta) + +# Accessing the connector +A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default-connector-v11`. You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). + +You can use this generated SDK by importing from the package `@dataconnect/default-connector-v11` as shown below. Both CommonJS and ESM imports are supported. + +You can also follow the instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#set-client). + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig } from '@dataconnect/default-connector-v11'; + +const dataConnect = getDataConnect(connectorConfig); +``` + +## Connecting to the local Emulator +By default, the connector will connect to the production service. + +To connect to the emulator, you can use the following code. +You can also follow the emulator instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#instrument-clients). + +```typescript +import { connectDataConnectEmulator, getDataConnect } from 'firebase/data-connect'; +import { connectorConfig } from '@dataconnect/default-connector-v11'; + +const dataConnect = getDataConnect(connectorConfig); +connectDataConnectEmulator(dataConnect, 'localhost', 9399); +``` + +After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) from your generated SDK. + +# Queries + +There are two ways to execute a Data Connect Query using the generated Web SDK: +- Using a Query Reference function, which returns a `QueryRef` + - The `QueryRef` can be used as an argument to `executeQuery()`, which will execute the Query and return a `QueryPromise` +- Using an action shortcut function, which returns a `QueryPromise` + - Calling the action shortcut function will execute the Query and return a `QueryPromise` + +The following is true for both the action shortcut function and the `QueryRef` function: +- The `QueryPromise` returned will resolve to the result of the Query once it has finished executing +- If the Query accepts arguments, both the action shortcut function and the `QueryRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Query +- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. + +Below are examples of how to use the `default-connector-v11` connector's generated functions to execute each query. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-queries). + +## ListMovies +You can execute the `ListMovies` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +listMovies(): QueryPromise; + +interface ListMoviesRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; +} +export const listMoviesRef: ListMoviesRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```typescript +listMovies(dc: DataConnect): QueryPromise; + +interface ListMoviesRef { + ... + (dc: DataConnect): QueryRef; +} +export const listMoviesRef: ListMoviesRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the listMoviesRef: +```typescript +const name = listMoviesRef.operationName; +console.log(name); +``` + +### Variables +The `ListMovies` query has no variables. +### Return Type +Recall that executing the `ListMovies` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `ListMoviesData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface ListMoviesData { + movies: ({ + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key)[]; +} +``` +### Using `ListMovies`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, listMovies } from '@dataconnect/default-connector-v11'; + + +// Call the `listMovies()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await listMovies(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await listMovies(dataConnect); + +console.log(data.movies); + +// Or, you can use the `Promise` API. +listMovies().then((response) => { + const data = response.data; + console.log(data.movies); +}); +``` + +### Using `ListMovies`'s `QueryRef` function + +```typescript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, listMoviesRef } from '@dataconnect/default-connector-v11'; + + +// Call the `listMoviesRef()` function to get a reference to the query. +const ref = listMoviesRef(); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = listMoviesRef(dataConnect); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.movies); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.movies); +}); +``` + +## GetMovieById +You can execute the `GetMovieById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +getMovieById(vars: GetMovieByIdVariables): QueryPromise; + +interface GetMovieByIdRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: GetMovieByIdVariables): QueryRef; +} +export const getMovieByIdRef: GetMovieByIdRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```typescript +getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; + +interface GetMovieByIdRef { + ... + (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; +} +export const getMovieByIdRef: GetMovieByIdRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the getMovieByIdRef: +```typescript +const name = getMovieByIdRef.operationName; +console.log(name); +``` + +### Variables +The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface GetMovieByIdVariables { + id: UUIDString; +} +``` +### Return Type +Recall that executing the `GetMovieById` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `GetMovieByIdData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface GetMovieByIdData { + movie?: { + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key; +} +``` +### Using `GetMovieById`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, getMovieById, GetMovieByIdVariables } from '@dataconnect/default-connector-v11'; + +// The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`: +const getMovieByIdVars: GetMovieByIdVariables = { + id: ..., +}; + +// Call the `getMovieById()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await getMovieById(getMovieByIdVars); +// Variables can be defined inline as well. +const { data } = await getMovieById({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await getMovieById(dataConnect, getMovieByIdVars); + +console.log(data.movie); + +// Or, you can use the `Promise` API. +getMovieById(getMovieByIdVars).then((response) => { + const data = response.data; + console.log(data.movie); +}); +``` + +### Using `GetMovieById`'s `QueryRef` function + +```typescript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, getMovieByIdRef, GetMovieByIdVariables } from '@dataconnect/default-connector-v11'; + +// The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`: +const getMovieByIdVars: GetMovieByIdVariables = { + id: ..., +}; + +// Call the `getMovieByIdRef()` function to get a reference to the query. +const ref = getMovieByIdRef(getMovieByIdVars); +// Variables can be defined inline as well. +const ref = getMovieByIdRef({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = getMovieByIdRef(dataConnect, getMovieByIdVars); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.movie); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.movie); +}); +``` + +## GetMeta +You can execute the `GetMeta` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +getMeta(): QueryPromise; + +interface GetMetaRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; +} +export const getMetaRef: GetMetaRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```typescript +getMeta(dc: DataConnect): QueryPromise; + +interface GetMetaRef { + ... + (dc: DataConnect): QueryRef; +} +export const getMetaRef: GetMetaRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the getMetaRef: +```typescript +const name = getMetaRef.operationName; +console.log(name); +``` + +### Variables +The `GetMeta` query has no variables. +### Return Type +Recall that executing the `GetMeta` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `GetMetaData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface GetMetaData { + ref: ({ + id: UUIDString; + } & Meta_Key)[]; +} +``` +### Using `GetMeta`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, getMeta } from '@dataconnect/default-connector-v11'; + + +// Call the `getMeta()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await getMeta(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await getMeta(dataConnect); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +getMeta().then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +### Using `GetMeta`'s `QueryRef` function + +```typescript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, getMetaRef } from '@dataconnect/default-connector-v11'; + + +// Call the `getMetaRef()` function to get a reference to the query. +const ref = getMetaRef(); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = getMetaRef(dataConnect); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +# Mutations + +There are two ways to execute a Data Connect Mutation using the generated Web SDK: +- Using a Mutation Reference function, which returns a `MutationRef` + - The `MutationRef` can be used as an argument to `executeMutation()`, which will execute the Mutation and return a `MutationPromise` +- Using an action shortcut function, which returns a `MutationPromise` + - Calling the action shortcut function will execute the Mutation and return a `MutationPromise` + +The following is true for both the action shortcut function and the `MutationRef` function: +- The `MutationPromise` returned will resolve to the result of the Mutation once it has finished executing +- If the Mutation accepts arguments, both the action shortcut function and the `MutationRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Mutation +- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. + +Below are examples of how to use the `default-connector-v11` connector's generated functions to execute each mutation. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-mutations). + +## CreateMovie +You can execute the `CreateMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +createMovie(vars: CreateMovieVariables): MutationPromise; + +interface CreateMovieRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: CreateMovieVariables): MutationRef; +} +export const createMovieRef: CreateMovieRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; + +interface CreateMovieRef { + ... + (dc: DataConnect, vars: CreateMovieVariables): MutationRef; +} +export const createMovieRef: CreateMovieRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the createMovieRef: +```typescript +const name = createMovieRef.operationName; +console.log(name); +``` + +### Variables +The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface CreateMovieVariables { + title: string; + genre: string; + imageUrl: string; +} +``` +### Return Type +Recall that executing the `CreateMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `CreateMovieData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface CreateMovieData { + movie_insert: Movie_Key; +} +``` +### Using `CreateMovie`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, createMovie, CreateMovieVariables } from '@dataconnect/default-connector-v11'; + +// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: +const createMovieVars: CreateMovieVariables = { + title: ..., + genre: ..., + imageUrl: ..., +}; + +// Call the `createMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await createMovie(createMovieVars); +// Variables can be defined inline as well. +const { data } = await createMovie({ title: ..., genre: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await createMovie(dataConnect, createMovieVars); + +console.log(data.movie_insert); + +// Or, you can use the `Promise` API. +createMovie(createMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_insert); +}); +``` + +### Using `CreateMovie`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, createMovieRef, CreateMovieVariables } from '@dataconnect/default-connector-v11'; + +// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: +const createMovieVars: CreateMovieVariables = { + title: ..., + genre: ..., + imageUrl: ..., +}; + +// Call the `createMovieRef()` function to get a reference to the mutation. +const ref = createMovieRef(createMovieVars); +// Variables can be defined inline as well. +const ref = createMovieRef({ title: ..., genre: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = createMovieRef(dataConnect, createMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_insert); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_insert); +}); +``` + +## UpsertMovie +You can execute the `UpsertMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +upsertMovie(vars: UpsertMovieVariables): MutationPromise; + +interface UpsertMovieRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: UpsertMovieVariables): MutationRef; +} +export const upsertMovieRef: UpsertMovieRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; + +interface UpsertMovieRef { + ... + (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; +} +export const upsertMovieRef: UpsertMovieRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the upsertMovieRef: +```typescript +const name = upsertMovieRef.operationName; +console.log(name); +``` + +### Variables +The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface UpsertMovieVariables { + id: UUIDString; + title: string; + imageUrl: string; +} +``` +### Return Type +Recall that executing the `UpsertMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `UpsertMovieData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface UpsertMovieData { + movie_upsert: Movie_Key; +} +``` +### Using `UpsertMovie`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, upsertMovie, UpsertMovieVariables } from '@dataconnect/default-connector-v11'; + +// The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`: +const upsertMovieVars: UpsertMovieVariables = { + id: ..., + title: ..., + imageUrl: ..., +}; + +// Call the `upsertMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await upsertMovie(upsertMovieVars); +// Variables can be defined inline as well. +const { data } = await upsertMovie({ id: ..., title: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await upsertMovie(dataConnect, upsertMovieVars); + +console.log(data.movie_upsert); + +// Or, you can use the `Promise` API. +upsertMovie(upsertMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_upsert); +}); +``` + +### Using `UpsertMovie`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, upsertMovieRef, UpsertMovieVariables } from '@dataconnect/default-connector-v11'; + +// The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`: +const upsertMovieVars: UpsertMovieVariables = { + id: ..., + title: ..., + imageUrl: ..., +}; + +// Call the `upsertMovieRef()` function to get a reference to the mutation. +const ref = upsertMovieRef(upsertMovieVars); +// Variables can be defined inline as well. +const ref = upsertMovieRef({ id: ..., title: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = upsertMovieRef(dataConnect, upsertMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_upsert); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_upsert); +}); +``` + +## DeleteMovie +You can execute the `DeleteMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +deleteMovie(vars: DeleteMovieVariables): MutationPromise; + +interface DeleteMovieRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMovieVariables): MutationRef; +} +export const deleteMovieRef: DeleteMovieRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; + +interface DeleteMovieRef { + ... + (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; +} +export const deleteMovieRef: DeleteMovieRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the deleteMovieRef: +```typescript +const name = deleteMovieRef.operationName; +console.log(name); +``` + +### Variables +The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface DeleteMovieVariables { + id: UUIDString; +} +``` +### Return Type +Recall that executing the `DeleteMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `DeleteMovieData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface DeleteMovieData { + movie_delete?: Movie_Key | null; +} +``` +### Using `DeleteMovie`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, deleteMovie, DeleteMovieVariables } from '@dataconnect/default-connector-v11'; + +// The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`: +const deleteMovieVars: DeleteMovieVariables = { + id: ..., +}; + +// Call the `deleteMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await deleteMovie(deleteMovieVars); +// Variables can be defined inline as well. +const { data } = await deleteMovie({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await deleteMovie(dataConnect, deleteMovieVars); + +console.log(data.movie_delete); + +// Or, you can use the `Promise` API. +deleteMovie(deleteMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_delete); +}); +``` + +### Using `DeleteMovie`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, deleteMovieRef, DeleteMovieVariables } from '@dataconnect/default-connector-v11'; + +// The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`: +const deleteMovieVars: DeleteMovieVariables = { + id: ..., +}; + +// Call the `deleteMovieRef()` function to get a reference to the mutation. +const ref = deleteMovieRef(deleteMovieVars); +// Variables can be defined inline as well. +const ref = deleteMovieRef({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = deleteMovieRef(dataConnect, deleteMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_delete); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_delete); +}); +``` + +## AddMeta +You can execute the `AddMeta` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +addMeta(): MutationPromise; + +interface AddMetaRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (): MutationRef; +} +export const addMetaRef: AddMetaRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +addMeta(dc: DataConnect): MutationPromise; + +interface AddMetaRef { + ... + (dc: DataConnect): MutationRef; +} +export const addMetaRef: AddMetaRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the addMetaRef: +```typescript +const name = addMetaRef.operationName; +console.log(name); +``` + +### Variables +The `AddMeta` mutation has no variables. +### Return Type +Recall that executing the `AddMeta` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `AddMetaData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface AddMetaData { + ref: Meta_Key; +} +``` +### Using `AddMeta`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, addMeta } from '@dataconnect/default-connector-v11'; + + +// Call the `addMeta()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await addMeta(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await addMeta(dataConnect); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +addMeta().then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +### Using `AddMeta`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, addMetaRef } from '@dataconnect/default-connector-v11'; + + +// Call the `addMetaRef()` function to get a reference to the mutation. +const ref = addMetaRef(); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = addMetaRef(dataConnect); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +## DeleteMeta +You can execute the `DeleteMeta` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v11/index.d.ts](./index.d.ts): +```typescript +deleteMeta(vars: DeleteMetaVariables): MutationPromise; + +interface DeleteMetaRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMetaVariables): MutationRef; +} +export const deleteMetaRef: DeleteMetaRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; + +interface DeleteMetaRef { + ... + (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; +} +export const deleteMetaRef: DeleteMetaRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the deleteMetaRef: +```typescript +const name = deleteMetaRef.operationName; +console.log(name); +``` + +### Variables +The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface DeleteMetaVariables { + id: UUIDString; +} +``` +### Return Type +Recall that executing the `DeleteMeta` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `DeleteMetaData`, which is defined in [default-connector-v11/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface DeleteMetaData { + ref?: Meta_Key | null; +} +``` +### Using `DeleteMeta`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, deleteMeta, DeleteMetaVariables } from '@dataconnect/default-connector-v11'; + +// The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`: +const deleteMetaVars: DeleteMetaVariables = { + id: ..., +}; + +// Call the `deleteMeta()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await deleteMeta(deleteMetaVars); +// Variables can be defined inline as well. +const { data } = await deleteMeta({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await deleteMeta(dataConnect, deleteMetaVars); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +deleteMeta(deleteMetaVars).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +### Using `DeleteMeta`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, deleteMetaRef, DeleteMetaVariables } from '@dataconnect/default-connector-v11'; + +// The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`: +const deleteMetaVars: DeleteMetaVariables = { + id: ..., +}; + +// Call the `deleteMetaRef()` function to get a reference to the mutation. +const ref = deleteMetaRef(deleteMetaVars); +// Variables can be defined inline as well. +const ref = deleteMetaRef({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = deleteMetaRef(dataConnect, deleteMetaVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + diff --git a/dataconnect-sdk/js/default-connector-v11/esm/index.esm.js b/dataconnect-sdk/js/default-connector-v11/esm/index.esm.js new file mode 100644 index 00000000..d021f266 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v11/esm/index.esm.js @@ -0,0 +1,96 @@ +import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; + +export const connectorConfig = { + connector: 'default-connector-v11', + service: 'tanstack-query-firebase', + location: 'us-central1' +}; + +export const createMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} +createMovieRef.operationName = 'CreateMovie'; + +export function createMovie(dcOrVars, vars) { + return executeMutation(createMovieRef(dcOrVars, vars)); +} + +export const upsertMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'UpsertMovie', inputVars); +} +upsertMovieRef.operationName = 'UpsertMovie'; + +export function upsertMovie(dcOrVars, vars) { + return executeMutation(upsertMovieRef(dcOrVars, vars)); +} + +export const deleteMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMovie', inputVars); +} +deleteMovieRef.operationName = 'DeleteMovie'; + +export function deleteMovie(dcOrVars, vars) { + return executeMutation(deleteMovieRef(dcOrVars, vars)); +} + +export const addMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'AddMeta'); +} +addMetaRef.operationName = 'AddMeta'; + +export function addMeta(dc) { + return executeMutation(addMetaRef(dc)); +} + +export const deleteMetaRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMeta', inputVars); +} +deleteMetaRef.operationName = 'DeleteMeta'; + +export function deleteMeta(dcOrVars, vars) { + return executeMutation(deleteMetaRef(dcOrVars, vars)); +} + +export const listMoviesRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; + +export function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +} + +export const getMovieByIdRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; + +export function getMovieById(dcOrVars, vars) { + return executeQuery(getMovieByIdRef(dcOrVars, vars)); +} + +export const getMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; + +export function getMeta(dc) { + return executeQuery(getMetaRef(dc)); +} + diff --git a/dataconnect-sdk/js/default-connector-v11/esm/package.json b/dataconnect-sdk/js/default-connector-v11/esm/package.json new file mode 100644 index 00000000..7c34deb5 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v11/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/dataconnect-sdk/js/default-connector-v11/index.cjs.js b/dataconnect-sdk/js/default-connector-v11/index.cjs.js new file mode 100644 index 00000000..96436d68 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v11/index.cjs.js @@ -0,0 +1,104 @@ +const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); + +const connectorConfig = { + connector: 'default-connector-v11', + service: 'tanstack-query-firebase', + location: 'us-central1' +}; +exports.connectorConfig = connectorConfig; + +const createMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} +createMovieRef.operationName = 'CreateMovie'; +exports.createMovieRef = createMovieRef; + +exports.createMovie = function createMovie(dcOrVars, vars) { + return executeMutation(createMovieRef(dcOrVars, vars)); +}; + +const upsertMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'UpsertMovie', inputVars); +} +upsertMovieRef.operationName = 'UpsertMovie'; +exports.upsertMovieRef = upsertMovieRef; + +exports.upsertMovie = function upsertMovie(dcOrVars, vars) { + return executeMutation(upsertMovieRef(dcOrVars, vars)); +}; + +const deleteMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMovie', inputVars); +} +deleteMovieRef.operationName = 'DeleteMovie'; +exports.deleteMovieRef = deleteMovieRef; + +exports.deleteMovie = function deleteMovie(dcOrVars, vars) { + return executeMutation(deleteMovieRef(dcOrVars, vars)); +}; + +const addMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'AddMeta'); +} +addMetaRef.operationName = 'AddMeta'; +exports.addMetaRef = addMetaRef; + +exports.addMeta = function addMeta(dc) { + return executeMutation(addMetaRef(dc)); +}; + +const deleteMetaRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMeta', inputVars); +} +deleteMetaRef.operationName = 'DeleteMeta'; +exports.deleteMetaRef = deleteMetaRef; + +exports.deleteMeta = function deleteMeta(dcOrVars, vars) { + return executeMutation(deleteMetaRef(dcOrVars, vars)); +}; + +const listMoviesRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; +exports.listMoviesRef = listMoviesRef; + +exports.listMovies = function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +}; + +const getMovieByIdRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; +exports.getMovieByIdRef = getMovieByIdRef; + +exports.getMovieById = function getMovieById(dcOrVars, vars) { + return executeQuery(getMovieByIdRef(dcOrVars, vars)); +}; + +const getMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; +exports.getMetaRef = getMetaRef; + +exports.getMeta = function getMeta(dc) { + return executeQuery(getMetaRef(dc)); +}; diff --git a/dataconnect-sdk/js/default-connector-v11/index.d.ts b/dataconnect-sdk/js/default-connector-v11/index.d.ts new file mode 100644 index 00000000..be76eb72 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v11/index.d.ts @@ -0,0 +1,191 @@ +import { ConnectorConfig, DataConnect, QueryRef, QueryPromise, MutationRef, MutationPromise } from 'firebase/data-connect'; + +export const connectorConfig: ConnectorConfig; + +export type TimestampString = string; +export type UUIDString = string; +export type Int64String = string; +export type DateString = string; + + + + +export interface AddMetaData { + ref: Meta_Key; +} + +export interface CreateMovieData { + movie_insert: Movie_Key; +} + +export interface CreateMovieVariables { + title: string; + genre: string; + imageUrl: string; +} + +export interface DeleteMetaData { + ref?: Meta_Key | null; +} + +export interface DeleteMetaVariables { + id: UUIDString; +} + +export interface DeleteMovieData { + movie_delete?: Movie_Key | null; +} + +export interface DeleteMovieVariables { + id: UUIDString; +} + +export interface GetMetaData { + ref: ({ + id: UUIDString; + } & Meta_Key)[]; +} + +export interface GetMovieByIdData { + movie?: { + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key; +} + +export interface GetMovieByIdVariables { + id: UUIDString; +} + +export interface ListMoviesData { + movies: ({ + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key)[]; +} + +export interface Meta_Key { + id: UUIDString; + __typename?: 'Meta_Key'; +} + +export interface MovieMetadata_Key { + id: UUIDString; + __typename?: 'MovieMetadata_Key'; +} + +export interface Movie_Key { + id: UUIDString; + __typename?: 'Movie_Key'; +} + +export interface UpsertMovieData { + movie_upsert: Movie_Key; +} + +export interface UpsertMovieVariables { + id: UUIDString; + title: string; + imageUrl: string; +} + +interface CreateMovieRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: CreateMovieVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: CreateMovieVariables): MutationRef; + operationName: string; +} +export const createMovieRef: CreateMovieRef; + +export function createMovie(vars: CreateMovieVariables): MutationPromise; +export function createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; + +interface UpsertMovieRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: UpsertMovieVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; + operationName: string; +} +export const upsertMovieRef: UpsertMovieRef; + +export function upsertMovie(vars: UpsertMovieVariables): MutationPromise; +export function upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; + +interface DeleteMovieRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMovieVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; + operationName: string; +} +export const deleteMovieRef: DeleteMovieRef; + +export function deleteMovie(vars: DeleteMovieVariables): MutationPromise; +export function deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; + +interface AddMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): MutationRef; + operationName: string; +} +export const addMetaRef: AddMetaRef; + +export function addMeta(): MutationPromise; +export function addMeta(dc: DataConnect): MutationPromise; + +interface DeleteMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMetaVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; + operationName: string; +} +export const deleteMetaRef: DeleteMetaRef; + +export function deleteMeta(vars: DeleteMetaVariables): MutationPromise; +export function deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; + +interface ListMoviesRef { + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): QueryRef; + operationName: string; +} +export const listMoviesRef: ListMoviesRef; + +export function listMovies(): QueryPromise; +export function listMovies(dc: DataConnect): QueryPromise; + +interface GetMovieByIdRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: GetMovieByIdVariables): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; + operationName: string; +} +export const getMovieByIdRef: GetMovieByIdRef; + +export function getMovieById(vars: GetMovieByIdVariables): QueryPromise; +export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; + +interface GetMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): QueryRef; + operationName: string; +} +export const getMetaRef: GetMetaRef; + +export function getMeta(): QueryPromise; +export function getMeta(dc: DataConnect): QueryPromise; + diff --git a/dataconnect-sdk/js/default-connector-v11/package.json b/dataconnect-sdk/js/default-connector-v11/package.json new file mode 100644 index 00000000..0985f928 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v11/package.json @@ -0,0 +1,25 @@ +{ + "name": "@dataconnect/default-connector-v11", + "version": "1.0.0", + "author": "Firebase (https://firebase.google.com/)", + "description": "Generated SDK For default-connector-v11", + "license": "Apache-2.0", + "engines": { + "node": " >=18.0" + }, + "typings": "index.d.ts", + "module": "esm/index.esm.js", + "main": "index.cjs.js", + "browser": "esm/index.esm.js", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs.js", + "default": "./esm/index.esm.js" + }, + "./package.json": "./package.json" + }, + "peerDependencies": { + "firebase": "^10.14.0 || ^11.3.0" + } +} \ No newline at end of file diff --git a/dataconnect-sdk/js/default-connector-v12/README.md b/dataconnect-sdk/js/default-connector-v12/README.md new file mode 100644 index 00000000..04379138 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v12/README.md @@ -0,0 +1,922 @@ +# Generated TypeScript README +This README will guide you through the process of using the generated JavaScript SDK package for the connector `default-connector-v12`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. + +***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.* + +# Table of Contents +- [**Overview**](#generated-javascript-readme) +- [**Accessing the connector**](#accessing-the-connector) + - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) +- [**Queries**](#queries) + - [*ListMovies*](#listmovies) + - [*GetMovieById*](#getmoviebyid) + - [*GetMeta*](#getmeta) +- [**Mutations**](#mutations) + - [*CreateMovie*](#createmovie) + - [*UpsertMovie*](#upsertmovie) + - [*DeleteMovie*](#deletemovie) + - [*AddMeta*](#addmeta) + - [*DeleteMeta*](#deletemeta) + +# Accessing the connector +A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default-connector-v12`. You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). + +You can use this generated SDK by importing from the package `@dataconnect/default-connector-v12` as shown below. Both CommonJS and ESM imports are supported. + +You can also follow the instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#set-client). + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig } from '@dataconnect/default-connector-v12'; + +const dataConnect = getDataConnect(connectorConfig); +``` + +## Connecting to the local Emulator +By default, the connector will connect to the production service. + +To connect to the emulator, you can use the following code. +You can also follow the emulator instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#instrument-clients). + +```typescript +import { connectDataConnectEmulator, getDataConnect } from 'firebase/data-connect'; +import { connectorConfig } from '@dataconnect/default-connector-v12'; + +const dataConnect = getDataConnect(connectorConfig); +connectDataConnectEmulator(dataConnect, 'localhost', 9399); +``` + +After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) from your generated SDK. + +# Queries + +There are two ways to execute a Data Connect Query using the generated Web SDK: +- Using a Query Reference function, which returns a `QueryRef` + - The `QueryRef` can be used as an argument to `executeQuery()`, which will execute the Query and return a `QueryPromise` +- Using an action shortcut function, which returns a `QueryPromise` + - Calling the action shortcut function will execute the Query and return a `QueryPromise` + +The following is true for both the action shortcut function and the `QueryRef` function: +- The `QueryPromise` returned will resolve to the result of the Query once it has finished executing +- If the Query accepts arguments, both the action shortcut function and the `QueryRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Query +- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. + +Below are examples of how to use the `default-connector-v12` connector's generated functions to execute each query. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-queries). + +## ListMovies +You can execute the `ListMovies` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +listMovies(): QueryPromise; + +interface ListMoviesRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; +} +export const listMoviesRef: ListMoviesRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```typescript +listMovies(dc: DataConnect): QueryPromise; + +interface ListMoviesRef { + ... + (dc: DataConnect): QueryRef; +} +export const listMoviesRef: ListMoviesRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the listMoviesRef: +```typescript +const name = listMoviesRef.operationName; +console.log(name); +``` + +### Variables +The `ListMovies` query has no variables. +### Return Type +Recall that executing the `ListMovies` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `ListMoviesData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface ListMoviesData { + movies: ({ + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key)[]; +} +``` +### Using `ListMovies`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, listMovies } from '@dataconnect/default-connector-v12'; + + +// Call the `listMovies()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await listMovies(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await listMovies(dataConnect); + +console.log(data.movies); + +// Or, you can use the `Promise` API. +listMovies().then((response) => { + const data = response.data; + console.log(data.movies); +}); +``` + +### Using `ListMovies`'s `QueryRef` function + +```typescript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, listMoviesRef } from '@dataconnect/default-connector-v12'; + + +// Call the `listMoviesRef()` function to get a reference to the query. +const ref = listMoviesRef(); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = listMoviesRef(dataConnect); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.movies); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.movies); +}); +``` + +## GetMovieById +You can execute the `GetMovieById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +getMovieById(vars: GetMovieByIdVariables): QueryPromise; + +interface GetMovieByIdRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: GetMovieByIdVariables): QueryRef; +} +export const getMovieByIdRef: GetMovieByIdRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```typescript +getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; + +interface GetMovieByIdRef { + ... + (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; +} +export const getMovieByIdRef: GetMovieByIdRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the getMovieByIdRef: +```typescript +const name = getMovieByIdRef.operationName; +console.log(name); +``` + +### Variables +The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface GetMovieByIdVariables { + id: UUIDString; +} +``` +### Return Type +Recall that executing the `GetMovieById` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `GetMovieByIdData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface GetMovieByIdData { + movie?: { + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key; +} +``` +### Using `GetMovieById`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, getMovieById, GetMovieByIdVariables } from '@dataconnect/default-connector-v12'; + +// The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`: +const getMovieByIdVars: GetMovieByIdVariables = { + id: ..., +}; + +// Call the `getMovieById()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await getMovieById(getMovieByIdVars); +// Variables can be defined inline as well. +const { data } = await getMovieById({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await getMovieById(dataConnect, getMovieByIdVars); + +console.log(data.movie); + +// Or, you can use the `Promise` API. +getMovieById(getMovieByIdVars).then((response) => { + const data = response.data; + console.log(data.movie); +}); +``` + +### Using `GetMovieById`'s `QueryRef` function + +```typescript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, getMovieByIdRef, GetMovieByIdVariables } from '@dataconnect/default-connector-v12'; + +// The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`: +const getMovieByIdVars: GetMovieByIdVariables = { + id: ..., +}; + +// Call the `getMovieByIdRef()` function to get a reference to the query. +const ref = getMovieByIdRef(getMovieByIdVars); +// Variables can be defined inline as well. +const ref = getMovieByIdRef({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = getMovieByIdRef(dataConnect, getMovieByIdVars); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.movie); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.movie); +}); +``` + +## GetMeta +You can execute the `GetMeta` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +getMeta(): QueryPromise; + +interface GetMetaRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; +} +export const getMetaRef: GetMetaRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. +```typescript +getMeta(dc: DataConnect): QueryPromise; + +interface GetMetaRef { + ... + (dc: DataConnect): QueryRef; +} +export const getMetaRef: GetMetaRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the getMetaRef: +```typescript +const name = getMetaRef.operationName; +console.log(name); +``` + +### Variables +The `GetMeta` query has no variables. +### Return Type +Recall that executing the `GetMeta` query returns a `QueryPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `GetMetaData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface GetMetaData { + ref: ({ + id: UUIDString; + } & Meta_Key)[]; +} +``` +### Using `GetMeta`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, getMeta } from '@dataconnect/default-connector-v12'; + + +// Call the `getMeta()` function to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await getMeta(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await getMeta(dataConnect); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +getMeta().then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +### Using `GetMeta`'s `QueryRef` function + +```typescript +import { getDataConnect, executeQuery } from 'firebase/data-connect'; +import { connectorConfig, getMetaRef } from '@dataconnect/default-connector-v12'; + + +// Call the `getMetaRef()` function to get a reference to the query. +const ref = getMetaRef(); + +// You can also pass in a `DataConnect` instance to the `QueryRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = getMetaRef(dataConnect); + +// Call `executeQuery()` on the reference to execute the query. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeQuery(ref); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +executeQuery(ref).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +# Mutations + +There are two ways to execute a Data Connect Mutation using the generated Web SDK: +- Using a Mutation Reference function, which returns a `MutationRef` + - The `MutationRef` can be used as an argument to `executeMutation()`, which will execute the Mutation and return a `MutationPromise` +- Using an action shortcut function, which returns a `MutationPromise` + - Calling the action shortcut function will execute the Mutation and return a `MutationPromise` + +The following is true for both the action shortcut function and the `MutationRef` function: +- The `MutationPromise` returned will resolve to the result of the Mutation once it has finished executing +- If the Mutation accepts arguments, both the action shortcut function and the `MutationRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Mutation +- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. + +Below are examples of how to use the `default-connector-v12` connector's generated functions to execute each mutation. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-mutations). + +## CreateMovie +You can execute the `CreateMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +createMovie(vars: CreateMovieVariables): MutationPromise; + +interface CreateMovieRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: CreateMovieVariables): MutationRef; +} +export const createMovieRef: CreateMovieRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; + +interface CreateMovieRef { + ... + (dc: DataConnect, vars: CreateMovieVariables): MutationRef; +} +export const createMovieRef: CreateMovieRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the createMovieRef: +```typescript +const name = createMovieRef.operationName; +console.log(name); +``` + +### Variables +The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface CreateMovieVariables { + title: string; + genre: string; + imageUrl: string; +} +``` +### Return Type +Recall that executing the `CreateMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `CreateMovieData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface CreateMovieData { + movie_insert: Movie_Key; +} +``` +### Using `CreateMovie`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, createMovie, CreateMovieVariables } from '@dataconnect/default-connector-v12'; + +// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: +const createMovieVars: CreateMovieVariables = { + title: ..., + genre: ..., + imageUrl: ..., +}; + +// Call the `createMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await createMovie(createMovieVars); +// Variables can be defined inline as well. +const { data } = await createMovie({ title: ..., genre: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await createMovie(dataConnect, createMovieVars); + +console.log(data.movie_insert); + +// Or, you can use the `Promise` API. +createMovie(createMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_insert); +}); +``` + +### Using `CreateMovie`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, createMovieRef, CreateMovieVariables } from '@dataconnect/default-connector-v12'; + +// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: +const createMovieVars: CreateMovieVariables = { + title: ..., + genre: ..., + imageUrl: ..., +}; + +// Call the `createMovieRef()` function to get a reference to the mutation. +const ref = createMovieRef(createMovieVars); +// Variables can be defined inline as well. +const ref = createMovieRef({ title: ..., genre: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = createMovieRef(dataConnect, createMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_insert); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_insert); +}); +``` + +## UpsertMovie +You can execute the `UpsertMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +upsertMovie(vars: UpsertMovieVariables): MutationPromise; + +interface UpsertMovieRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: UpsertMovieVariables): MutationRef; +} +export const upsertMovieRef: UpsertMovieRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; + +interface UpsertMovieRef { + ... + (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; +} +export const upsertMovieRef: UpsertMovieRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the upsertMovieRef: +```typescript +const name = upsertMovieRef.operationName; +console.log(name); +``` + +### Variables +The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface UpsertMovieVariables { + id: UUIDString; + title: string; + imageUrl: string; +} +``` +### Return Type +Recall that executing the `UpsertMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `UpsertMovieData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface UpsertMovieData { + movie_upsert: Movie_Key; +} +``` +### Using `UpsertMovie`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, upsertMovie, UpsertMovieVariables } from '@dataconnect/default-connector-v12'; + +// The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`: +const upsertMovieVars: UpsertMovieVariables = { + id: ..., + title: ..., + imageUrl: ..., +}; + +// Call the `upsertMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await upsertMovie(upsertMovieVars); +// Variables can be defined inline as well. +const { data } = await upsertMovie({ id: ..., title: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await upsertMovie(dataConnect, upsertMovieVars); + +console.log(data.movie_upsert); + +// Or, you can use the `Promise` API. +upsertMovie(upsertMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_upsert); +}); +``` + +### Using `UpsertMovie`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, upsertMovieRef, UpsertMovieVariables } from '@dataconnect/default-connector-v12'; + +// The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`: +const upsertMovieVars: UpsertMovieVariables = { + id: ..., + title: ..., + imageUrl: ..., +}; + +// Call the `upsertMovieRef()` function to get a reference to the mutation. +const ref = upsertMovieRef(upsertMovieVars); +// Variables can be defined inline as well. +const ref = upsertMovieRef({ id: ..., title: ..., imageUrl: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = upsertMovieRef(dataConnect, upsertMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_upsert); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_upsert); +}); +``` + +## DeleteMovie +You can execute the `DeleteMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +deleteMovie(vars: DeleteMovieVariables): MutationPromise; + +interface DeleteMovieRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMovieVariables): MutationRef; +} +export const deleteMovieRef: DeleteMovieRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; + +interface DeleteMovieRef { + ... + (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; +} +export const deleteMovieRef: DeleteMovieRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the deleteMovieRef: +```typescript +const name = deleteMovieRef.operationName; +console.log(name); +``` + +### Variables +The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface DeleteMovieVariables { + id: UUIDString; +} +``` +### Return Type +Recall that executing the `DeleteMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `DeleteMovieData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface DeleteMovieData { + movie_delete?: Movie_Key | null; +} +``` +### Using `DeleteMovie`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, deleteMovie, DeleteMovieVariables } from '@dataconnect/default-connector-v12'; + +// The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`: +const deleteMovieVars: DeleteMovieVariables = { + id: ..., +}; + +// Call the `deleteMovie()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await deleteMovie(deleteMovieVars); +// Variables can be defined inline as well. +const { data } = await deleteMovie({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await deleteMovie(dataConnect, deleteMovieVars); + +console.log(data.movie_delete); + +// Or, you can use the `Promise` API. +deleteMovie(deleteMovieVars).then((response) => { + const data = response.data; + console.log(data.movie_delete); +}); +``` + +### Using `DeleteMovie`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, deleteMovieRef, DeleteMovieVariables } from '@dataconnect/default-connector-v12'; + +// The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`: +const deleteMovieVars: DeleteMovieVariables = { + id: ..., +}; + +// Call the `deleteMovieRef()` function to get a reference to the mutation. +const ref = deleteMovieRef(deleteMovieVars); +// Variables can be defined inline as well. +const ref = deleteMovieRef({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = deleteMovieRef(dataConnect, deleteMovieVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.movie_delete); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.movie_delete); +}); +``` + +## AddMeta +You can execute the `AddMeta` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +addMeta(): MutationPromise; + +interface AddMetaRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (): MutationRef; +} +export const addMetaRef: AddMetaRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +addMeta(dc: DataConnect): MutationPromise; + +interface AddMetaRef { + ... + (dc: DataConnect): MutationRef; +} +export const addMetaRef: AddMetaRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the addMetaRef: +```typescript +const name = addMetaRef.operationName; +console.log(name); +``` + +### Variables +The `AddMeta` mutation has no variables. +### Return Type +Recall that executing the `AddMeta` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `AddMetaData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface AddMetaData { + ref: Meta_Key; +} +``` +### Using `AddMeta`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, addMeta } from '@dataconnect/default-connector-v12'; + + +// Call the `addMeta()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await addMeta(); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await addMeta(dataConnect); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +addMeta().then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +### Using `AddMeta`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, addMetaRef } from '@dataconnect/default-connector-v12'; + + +// Call the `addMetaRef()` function to get a reference to the mutation. +const ref = addMetaRef(); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = addMetaRef(dataConnect); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +## DeleteMeta +You can execute the `DeleteMeta` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector-v12/index.d.ts](./index.d.ts): +```typescript +deleteMeta(vars: DeleteMetaVariables): MutationPromise; + +interface DeleteMetaRef { + ... + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMetaVariables): MutationRef; +} +export const deleteMetaRef: DeleteMetaRef; +``` +You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. +```typescript +deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; + +interface DeleteMetaRef { + ... + (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; +} +export const deleteMetaRef: DeleteMetaRef; +``` + +If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the deleteMetaRef: +```typescript +const name = deleteMetaRef.operationName; +console.log(name); +``` + +### Variables +The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: + +```typescript +export interface DeleteMetaVariables { + id: UUIDString; +} +``` +### Return Type +Recall that executing the `DeleteMeta` mutation returns a `MutationPromise` that resolves to an object with a `data` property. + +The `data` property is an object of type `DeleteMetaData`, which is defined in [default-connector-v12/index.d.ts](./index.d.ts). It has the following fields: +```typescript +export interface DeleteMetaData { + ref?: Meta_Key | null; +} +``` +### Using `DeleteMeta`'s action shortcut function + +```typescript +import { getDataConnect } from 'firebase/data-connect'; +import { connectorConfig, deleteMeta, DeleteMetaVariables } from '@dataconnect/default-connector-v12'; + +// The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`: +const deleteMetaVars: DeleteMetaVariables = { + id: ..., +}; + +// Call the `deleteMeta()` function to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await deleteMeta(deleteMetaVars); +// Variables can be defined inline as well. +const { data } = await deleteMeta({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the action shortcut function. +const dataConnect = getDataConnect(connectorConfig); +const { data } = await deleteMeta(dataConnect, deleteMetaVars); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +deleteMeta(deleteMetaVars).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + +### Using `DeleteMeta`'s `MutationRef` function + +```typescript +import { getDataConnect, executeMutation } from 'firebase/data-connect'; +import { connectorConfig, deleteMetaRef, DeleteMetaVariables } from '@dataconnect/default-connector-v12'; + +// The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`: +const deleteMetaVars: DeleteMetaVariables = { + id: ..., +}; + +// Call the `deleteMetaRef()` function to get a reference to the mutation. +const ref = deleteMetaRef(deleteMetaVars); +// Variables can be defined inline as well. +const ref = deleteMetaRef({ id: ..., }); + +// You can also pass in a `DataConnect` instance to the `MutationRef` function. +const dataConnect = getDataConnect(connectorConfig); +const ref = deleteMetaRef(dataConnect, deleteMetaVars); + +// Call `executeMutation()` on the reference to execute the mutation. +// You can use the `await` keyword to wait for the promise to resolve. +const { data } = await executeMutation(ref); + +console.log(data.ref); + +// Or, you can use the `Promise` API. +executeMutation(ref).then((response) => { + const data = response.data; + console.log(data.ref); +}); +``` + diff --git a/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js b/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js new file mode 100644 index 00000000..01718907 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js @@ -0,0 +1,96 @@ +import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; + +export const connectorConfig = { + connector: 'default-connector-v12', + service: 'tanstack-query-firebase', + location: 'us-central1' +}; + +export const listMoviesRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; + +export function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +} + +export const getMovieByIdRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; + +export function getMovieById(dcOrVars, vars) { + return executeQuery(getMovieByIdRef(dcOrVars, vars)); +} + +export const getMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; + +export function getMeta(dc) { + return executeQuery(getMetaRef(dc)); +} + +export const createMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} +createMovieRef.operationName = 'CreateMovie'; + +export function createMovie(dcOrVars, vars) { + return executeMutation(createMovieRef(dcOrVars, vars)); +} + +export const upsertMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'UpsertMovie', inputVars); +} +upsertMovieRef.operationName = 'UpsertMovie'; + +export function upsertMovie(dcOrVars, vars) { + return executeMutation(upsertMovieRef(dcOrVars, vars)); +} + +export const deleteMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMovie', inputVars); +} +deleteMovieRef.operationName = 'DeleteMovie'; + +export function deleteMovie(dcOrVars, vars) { + return executeMutation(deleteMovieRef(dcOrVars, vars)); +} + +export const addMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'AddMeta'); +} +addMetaRef.operationName = 'AddMeta'; + +export function addMeta(dc) { + return executeMutation(addMetaRef(dc)); +} + +export const deleteMetaRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMeta', inputVars); +} +deleteMetaRef.operationName = 'DeleteMeta'; + +export function deleteMeta(dcOrVars, vars) { + return executeMutation(deleteMetaRef(dcOrVars, vars)); +} + diff --git a/dataconnect-sdk/js/default-connector-v12/esm/package.json b/dataconnect-sdk/js/default-connector-v12/esm/package.json new file mode 100644 index 00000000..7c34deb5 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v12/esm/package.json @@ -0,0 +1 @@ +{"type":"module"} \ No newline at end of file diff --git a/dataconnect-sdk/js/default-connector-v12/index.cjs.js b/dataconnect-sdk/js/default-connector-v12/index.cjs.js new file mode 100644 index 00000000..9e03ebf6 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v12/index.cjs.js @@ -0,0 +1,104 @@ +const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); + +const connectorConfig = { + connector: 'default-connector-v12', + service: 'tanstack-query-firebase', + location: 'us-central1' +}; +exports.connectorConfig = connectorConfig; + +const listMoviesRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; +exports.listMoviesRef = listMoviesRef; + +exports.listMovies = function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +}; + +const getMovieByIdRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; +exports.getMovieByIdRef = getMovieByIdRef; + +exports.getMovieById = function getMovieById(dcOrVars, vars) { + return executeQuery(getMovieByIdRef(dcOrVars, vars)); +}; + +const getMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; +exports.getMetaRef = getMetaRef; + +exports.getMeta = function getMeta(dc) { + return executeQuery(getMetaRef(dc)); +}; + +const createMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} +createMovieRef.operationName = 'CreateMovie'; +exports.createMovieRef = createMovieRef; + +exports.createMovie = function createMovie(dcOrVars, vars) { + return executeMutation(createMovieRef(dcOrVars, vars)); +}; + +const upsertMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'UpsertMovie', inputVars); +} +upsertMovieRef.operationName = 'UpsertMovie'; +exports.upsertMovieRef = upsertMovieRef; + +exports.upsertMovie = function upsertMovie(dcOrVars, vars) { + return executeMutation(upsertMovieRef(dcOrVars, vars)); +}; + +const deleteMovieRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMovie', inputVars); +} +deleteMovieRef.operationName = 'DeleteMovie'; +exports.deleteMovieRef = deleteMovieRef; + +exports.deleteMovie = function deleteMovie(dcOrVars, vars) { + return executeMutation(deleteMovieRef(dcOrVars, vars)); +}; + +const addMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'AddMeta'); +} +addMetaRef.operationName = 'AddMeta'; +exports.addMetaRef = addMetaRef; + +exports.addMeta = function addMeta(dc) { + return executeMutation(addMetaRef(dc)); +}; + +const deleteMetaRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return mutationRef(dcInstance, 'DeleteMeta', inputVars); +} +deleteMetaRef.operationName = 'DeleteMeta'; +exports.deleteMetaRef = deleteMetaRef; + +exports.deleteMeta = function deleteMeta(dcOrVars, vars) { + return executeMutation(deleteMetaRef(dcOrVars, vars)); +}; diff --git a/dataconnect-sdk/js/default-connector-v12/index.d.ts b/dataconnect-sdk/js/default-connector-v12/index.d.ts new file mode 100644 index 00000000..2ea08ad7 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v12/index.d.ts @@ -0,0 +1,191 @@ +import { ConnectorConfig, DataConnect, QueryRef, QueryPromise, MutationRef, MutationPromise } from 'firebase/data-connect'; + +export const connectorConfig: ConnectorConfig; + +export type TimestampString = string; +export type UUIDString = string; +export type Int64String = string; +export type DateString = string; + + + + +export interface AddMetaData { + ref: Meta_Key; +} + +export interface CreateMovieData { + movie_insert: Movie_Key; +} + +export interface CreateMovieVariables { + title: string; + genre: string; + imageUrl: string; +} + +export interface DeleteMetaData { + ref?: Meta_Key | null; +} + +export interface DeleteMetaVariables { + id: UUIDString; +} + +export interface DeleteMovieData { + movie_delete?: Movie_Key | null; +} + +export interface DeleteMovieVariables { + id: UUIDString; +} + +export interface GetMetaData { + ref: ({ + id: UUIDString; + } & Meta_Key)[]; +} + +export interface GetMovieByIdData { + movie?: { + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key; +} + +export interface GetMovieByIdVariables { + id: UUIDString; +} + +export interface ListMoviesData { + movies: ({ + id: UUIDString; + title: string; + imageUrl: string; + genre?: string | null; + } & Movie_Key)[]; +} + +export interface Meta_Key { + id: UUIDString; + __typename?: 'Meta_Key'; +} + +export interface MovieMetadata_Key { + id: UUIDString; + __typename?: 'MovieMetadata_Key'; +} + +export interface Movie_Key { + id: UUIDString; + __typename?: 'Movie_Key'; +} + +export interface UpsertMovieData { + movie_upsert: Movie_Key; +} + +export interface UpsertMovieVariables { + id: UUIDString; + title: string; + imageUrl: string; +} + +interface ListMoviesRef { + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): QueryRef; + operationName: string; +} +export const listMoviesRef: ListMoviesRef; + +export function listMovies(): QueryPromise; +export function listMovies(dc: DataConnect): QueryPromise; + +interface GetMovieByIdRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: GetMovieByIdVariables): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; + operationName: string; +} +export const getMovieByIdRef: GetMovieByIdRef; + +export function getMovieById(vars: GetMovieByIdVariables): QueryPromise; +export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; + +interface GetMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): QueryRef; + operationName: string; +} +export const getMetaRef: GetMetaRef; + +export function getMeta(): QueryPromise; +export function getMeta(dc: DataConnect): QueryPromise; + +interface CreateMovieRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: CreateMovieVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: CreateMovieVariables): MutationRef; + operationName: string; +} +export const createMovieRef: CreateMovieRef; + +export function createMovie(vars: CreateMovieVariables): MutationPromise; +export function createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; + +interface UpsertMovieRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: UpsertMovieVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; + operationName: string; +} +export const upsertMovieRef: UpsertMovieRef; + +export function upsertMovie(vars: UpsertMovieVariables): MutationPromise; +export function upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; + +interface DeleteMovieRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMovieVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; + operationName: string; +} +export const deleteMovieRef: DeleteMovieRef; + +export function deleteMovie(vars: DeleteMovieVariables): MutationPromise; +export function deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; + +interface AddMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): MutationRef; + operationName: string; +} +export const addMetaRef: AddMetaRef; + +export function addMeta(): MutationPromise; +export function addMeta(dc: DataConnect): MutationPromise; + +interface DeleteMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: DeleteMetaVariables): MutationRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; + operationName: string; +} +export const deleteMetaRef: DeleteMetaRef; + +export function deleteMeta(vars: DeleteMetaVariables): MutationPromise; +export function deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; + diff --git a/dataconnect-sdk/js/default-connector-v12/package.json b/dataconnect-sdk/js/default-connector-v12/package.json new file mode 100644 index 00000000..c0585771 --- /dev/null +++ b/dataconnect-sdk/js/default-connector-v12/package.json @@ -0,0 +1,25 @@ +{ + "name": "@dataconnect/default-connector-v12", + "version": "1.0.0", + "author": "Firebase (https://firebase.google.com/)", + "description": "Generated SDK For default-connector-v12", + "license": "Apache-2.0", + "engines": { + "node": " >=18.0" + }, + "typings": "index.d.ts", + "module": "esm/index.esm.js", + "main": "index.cjs.js", + "browser": "esm/index.esm.js", + "exports": { + ".": { + "types": "./index.d.ts", + "require": "./index.cjs.js", + "default": "./esm/index.esm.js" + }, + "./package.json": "./package.json" + }, + "peerDependencies": { + "firebase": "^10.14.0 || ^11.3.0" + } +} \ No newline at end of file diff --git a/dataconnect-sdk/js/default-connector/esm/index.esm.js b/dataconnect-sdk/js/default-connector/esm/index.esm.js index d4e0cce2..2ff02515 100644 --- a/dataconnect-sdk/js/default-connector/esm/index.esm.js +++ b/dataconnect-sdk/js/default-connector/esm/index.esm.js @@ -1,126 +1,96 @@ -import { - executeMutation, - executeQuery, - mutationRef, - queryRef, - validateArgs, -} from "firebase/data-connect"; +import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; export const connectorConfig = { - connector: "default", - service: "tanstack-query-firebase", - location: "us-central1", + connector: 'default', + service: 'tanstack-query-firebase', + location: 'us-central1' }; export const createMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "CreateMovie", inputVars); -}; -createMovieRef.operationName = "CreateMovie"; + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} +createMovieRef.operationName = 'CreateMovie'; export function createMovie(dcOrVars, vars) { return executeMutation(createMovieRef(dcOrVars, vars)); } export const upsertMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "UpsertMovie", inputVars); -}; -upsertMovieRef.operationName = "UpsertMovie"; + return mutationRef(dcInstance, 'UpsertMovie', inputVars); +} +upsertMovieRef.operationName = 'UpsertMovie'; export function upsertMovie(dcOrVars, vars) { return executeMutation(upsertMovieRef(dcOrVars, vars)); } export const deleteMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "DeleteMovie", inputVars); -}; -deleteMovieRef.operationName = "DeleteMovie"; + return mutationRef(dcInstance, 'DeleteMovie', inputVars); +} +deleteMovieRef.operationName = 'DeleteMovie'; export function deleteMovie(dcOrVars, vars) { return executeMutation(deleteMovieRef(dcOrVars, vars)); } export const addMetaRef = (dc) => { - const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "AddMeta"); -}; -addMetaRef.operationName = "AddMeta"; + return mutationRef(dcInstance, 'AddMeta'); +} +addMetaRef.operationName = 'AddMeta'; export function addMeta(dc) { return executeMutation(addMetaRef(dc)); } export const deleteMetaRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "DeleteMeta", inputVars); -}; -deleteMetaRef.operationName = "DeleteMeta"; + return mutationRef(dcInstance, 'DeleteMeta', inputVars); +} +deleteMetaRef.operationName = 'DeleteMeta'; export function deleteMeta(dcOrVars, vars) { return executeMutation(deleteMetaRef(dcOrVars, vars)); } export const listMoviesRef = (dc) => { - const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, "ListMovies"); -}; -listMoviesRef.operationName = "ListMovies"; + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; export function listMovies(dc) { return executeQuery(listMoviesRef(dc)); } export const getMovieByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, "GetMovieById", inputVars); -}; -getMovieByIdRef.operationName = "GetMovieById"; + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; export function getMovieById(dcOrVars, vars) { return executeQuery(getMovieByIdRef(dcOrVars, vars)); } export const getMetaRef = (dc) => { - const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, "GetMeta"); -}; -getMetaRef.operationName = "GetMeta"; + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; export function getMeta(dc) { return executeQuery(getMetaRef(dc)); } + diff --git a/dataconnect-sdk/js/default-connector/esm/package.json b/dataconnect-sdk/js/default-connector/esm/package.json index 3dbc1ca5..7c34deb5 100644 --- a/dataconnect-sdk/js/default-connector/esm/package.json +++ b/dataconnect-sdk/js/default-connector/esm/package.json @@ -1,3 +1 @@ -{ - "type": "module" -} +{"type":"module"} \ No newline at end of file diff --git a/dataconnect-sdk/js/default-connector/index.cjs.js b/dataconnect-sdk/js/default-connector/index.cjs.js index 70c75d49..1de60aa6 100644 --- a/dataconnect-sdk/js/default-connector/index.cjs.js +++ b/dataconnect-sdk/js/default-connector/index.cjs.js @@ -1,29 +1,18 @@ -const { - queryRef, - executeQuery, - mutationRef, - executeMutation, - validateArgs, -} = require("firebase/data-connect"); +const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); const connectorConfig = { - connector: "default", - service: "tanstack-query-firebase", - location: "us-central1", + connector: 'default', + service: 'tanstack-query-firebase', + location: 'us-central1' }; exports.connectorConfig = connectorConfig; const createMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "CreateMovie", inputVars); -}; -createMovieRef.operationName = "CreateMovie"; + return mutationRef(dcInstance, 'CreateMovie', inputVars); +} +createMovieRef.operationName = 'CreateMovie'; exports.createMovieRef = createMovieRef; exports.createMovie = function createMovie(dcOrVars, vars) { @@ -31,16 +20,11 @@ exports.createMovie = function createMovie(dcOrVars, vars) { }; const upsertMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "UpsertMovie", inputVars); -}; -upsertMovieRef.operationName = "UpsertMovie"; + return mutationRef(dcInstance, 'UpsertMovie', inputVars); +} +upsertMovieRef.operationName = 'UpsertMovie'; exports.upsertMovieRef = upsertMovieRef; exports.upsertMovie = function upsertMovie(dcOrVars, vars) { @@ -48,16 +32,11 @@ exports.upsertMovie = function upsertMovie(dcOrVars, vars) { }; const deleteMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "DeleteMovie", inputVars); -}; -deleteMovieRef.operationName = "DeleteMovie"; + return mutationRef(dcInstance, 'DeleteMovie', inputVars); +} +deleteMovieRef.operationName = 'DeleteMovie'; exports.deleteMovieRef = deleteMovieRef; exports.deleteMovie = function deleteMovie(dcOrVars, vars) { @@ -65,11 +44,11 @@ exports.deleteMovie = function deleteMovie(dcOrVars, vars) { }; const addMetaRef = (dc) => { - const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "AddMeta"); -}; -addMetaRef.operationName = "AddMeta"; + return mutationRef(dcInstance, 'AddMeta'); +} +addMetaRef.operationName = 'AddMeta'; exports.addMetaRef = addMetaRef; exports.addMeta = function addMeta(dc) { @@ -77,16 +56,11 @@ exports.addMeta = function addMeta(dc) { }; const deleteMetaRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, "DeleteMeta", inputVars); -}; -deleteMetaRef.operationName = "DeleteMeta"; + return mutationRef(dcInstance, 'DeleteMeta', inputVars); +} +deleteMetaRef.operationName = 'DeleteMeta'; exports.deleteMetaRef = deleteMetaRef; exports.deleteMeta = function deleteMeta(dcOrVars, vars) { @@ -94,11 +68,11 @@ exports.deleteMeta = function deleteMeta(dcOrVars, vars) { }; const listMoviesRef = (dc) => { - const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, "ListMovies"); -}; -listMoviesRef.operationName = "ListMovies"; + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; exports.listMoviesRef = listMoviesRef; exports.listMovies = function listMovies(dc) { @@ -106,16 +80,11 @@ exports.listMovies = function listMovies(dc) { }; const getMovieByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars } = validateArgs( - connectorConfig, - dcOrVars, - vars, - true, - ); + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, "GetMovieById", inputVars); -}; -getMovieByIdRef.operationName = "GetMovieById"; + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; exports.getMovieByIdRef = getMovieByIdRef; exports.getMovieById = function getMovieById(dcOrVars, vars) { @@ -123,11 +92,11 @@ exports.getMovieById = function getMovieById(dcOrVars, vars) { }; const getMetaRef = (dc) => { - const { dc: dcInstance } = validateArgs(connectorConfig, dc, undefined); + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, "GetMeta"); -}; -getMetaRef.operationName = "GetMeta"; + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; exports.getMetaRef = getMetaRef; exports.getMeta = function getMeta(dc) { diff --git a/dataconnect-sdk/js/default-connector/index.d.ts b/dataconnect-sdk/js/default-connector/index.d.ts index e6b78a4a..be76eb72 100644 --- a/dataconnect-sdk/js/default-connector/index.d.ts +++ b/dataconnect-sdk/js/default-connector/index.d.ts @@ -1,11 +1,4 @@ -import { - ConnectorConfig, - DataConnect, - QueryRef, - QueryPromise, - MutationRef, - MutationPromise, -} from "firebase/data-connect"; +import { ConnectorConfig, DataConnect, QueryRef, QueryPromise, MutationRef, MutationPromise } from 'firebase/data-connect'; export const connectorConfig: ConnectorConfig; @@ -14,6 +7,9 @@ export type UUIDString = string; export type Int64String = string; export type DateString = string; + + + export interface AddMetaData { ref: Meta_Key; } @@ -74,17 +70,17 @@ export interface ListMoviesData { export interface Meta_Key { id: UUIDString; - __typename?: "Meta_Key"; + __typename?: 'Meta_Key'; } export interface MovieMetadata_Key { id: UUIDString; - __typename?: "MovieMetadata_Key"; + __typename?: 'MovieMetadata_Key'; } export interface Movie_Key { id: UUIDString; - __typename?: "Movie_Key"; + __typename?: 'Movie_Key'; } export interface UpsertMovieData { @@ -99,69 +95,39 @@ export interface UpsertMovieVariables { interface CreateMovieRef { /* Allow users to create refs without passing in DataConnect */ - ( - vars: CreateMovieVariables, - ): MutationRef; + (vars: CreateMovieVariables): MutationRef; /* Allow users to pass in custom DataConnect instances */ - ( - dc: DataConnect, - vars: CreateMovieVariables, - ): MutationRef; + (dc: DataConnect, vars: CreateMovieVariables): MutationRef; operationName: string; } export const createMovieRef: CreateMovieRef; -export function createMovie( - vars: CreateMovieVariables, -): MutationPromise; -export function createMovie( - dc: DataConnect, - vars: CreateMovieVariables, -): MutationPromise; +export function createMovie(vars: CreateMovieVariables): MutationPromise; +export function createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; interface UpsertMovieRef { /* Allow users to create refs without passing in DataConnect */ - ( - vars: UpsertMovieVariables, - ): MutationRef; + (vars: UpsertMovieVariables): MutationRef; /* Allow users to pass in custom DataConnect instances */ - ( - dc: DataConnect, - vars: UpsertMovieVariables, - ): MutationRef; + (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; operationName: string; } export const upsertMovieRef: UpsertMovieRef; -export function upsertMovie( - vars: UpsertMovieVariables, -): MutationPromise; -export function upsertMovie( - dc: DataConnect, - vars: UpsertMovieVariables, -): MutationPromise; +export function upsertMovie(vars: UpsertMovieVariables): MutationPromise; +export function upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; interface DeleteMovieRef { /* Allow users to create refs without passing in DataConnect */ - ( - vars: DeleteMovieVariables, - ): MutationRef; + (vars: DeleteMovieVariables): MutationRef; /* Allow users to pass in custom DataConnect instances */ - ( - dc: DataConnect, - vars: DeleteMovieVariables, - ): MutationRef; + (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; operationName: string; } export const deleteMovieRef: DeleteMovieRef; -export function deleteMovie( - vars: DeleteMovieVariables, -): MutationPromise; -export function deleteMovie( - dc: DataConnect, - vars: DeleteMovieVariables, -): MutationPromise; +export function deleteMovie(vars: DeleteMovieVariables): MutationPromise; +export function deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; interface AddMetaRef { /* Allow users to create refs without passing in DataConnect */ @@ -173,29 +139,19 @@ interface AddMetaRef { export const addMetaRef: AddMetaRef; export function addMeta(): MutationPromise; -export function addMeta( - dc: DataConnect, -): MutationPromise; +export function addMeta(dc: DataConnect): MutationPromise; interface DeleteMetaRef { /* Allow users to create refs without passing in DataConnect */ (vars: DeleteMetaVariables): MutationRef; /* Allow users to pass in custom DataConnect instances */ - ( - dc: DataConnect, - vars: DeleteMetaVariables, - ): MutationRef; + (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; operationName: string; } export const deleteMetaRef: DeleteMetaRef; -export function deleteMeta( - vars: DeleteMetaVariables, -): MutationPromise; -export function deleteMeta( - dc: DataConnect, - vars: DeleteMetaVariables, -): MutationPromise; +export function deleteMeta(vars: DeleteMetaVariables): MutationPromise; +export function deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; interface ListMoviesRef { /* Allow users to create refs without passing in DataConnect */ @@ -207,31 +163,19 @@ interface ListMoviesRef { export const listMoviesRef: ListMoviesRef; export function listMovies(): QueryPromise; -export function listMovies( - dc: DataConnect, -): QueryPromise; +export function listMovies(dc: DataConnect): QueryPromise; interface GetMovieByIdRef { /* Allow users to create refs without passing in DataConnect */ - ( - vars: GetMovieByIdVariables, - ): QueryRef; + (vars: GetMovieByIdVariables): QueryRef; /* Allow users to pass in custom DataConnect instances */ - ( - dc: DataConnect, - vars: GetMovieByIdVariables, - ): QueryRef; + (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; operationName: string; } export const getMovieByIdRef: GetMovieByIdRef; -export function getMovieById( - vars: GetMovieByIdVariables, -): QueryPromise; -export function getMovieById( - dc: DataConnect, - vars: GetMovieByIdVariables, -): QueryPromise; +export function getMovieById(vars: GetMovieByIdVariables): QueryPromise; +export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; interface GetMetaRef { /* Allow users to create refs without passing in DataConnect */ @@ -244,3 +188,4 @@ export const getMetaRef: GetMetaRef; export function getMeta(): QueryPromise; export function getMeta(dc: DataConnect): QueryPromise; + diff --git a/dataconnect-sdk/js/default-connector/package.json b/dataconnect-sdk/js/default-connector/package.json index 94658e12..faa3fdfb 100644 --- a/dataconnect-sdk/js/default-connector/package.json +++ b/dataconnect-sdk/js/default-connector/package.json @@ -22,4 +22,4 @@ "peerDependencies": { "firebase": "^10.14.0 || ^11.3.0" } -} +} \ No newline at end of file diff --git a/dataconnect/connector-v11/connector.yaml b/dataconnect/connector-v11/connector.yaml new file mode 100644 index 00000000..1fdfbcf9 --- /dev/null +++ b/dataconnect/connector-v11/connector.yaml @@ -0,0 +1,5 @@ +connectorId: default-connector-v11 +generate: + javascriptSdk: + outputDir: ../../dataconnect-sdk/js/default-connector-v11 + package: "@dataconnect/default-connector-v11" \ No newline at end of file diff --git a/dataconnect/connector-v11/mutations.gql b/dataconnect/connector-v11/mutations.gql new file mode 100644 index 00000000..e8ad7ca8 --- /dev/null +++ b/dataconnect/connector-v11/mutations.gql @@ -0,0 +1,59 @@ +# # Example mutations for a simple movie app + +# Create a movie based on user input +mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!) +@auth(level: PUBLIC) { + movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl }) +} + +# Upsert a movie +mutation UpsertMovie($id: UUID!, $title: String!, $imageUrl: String!) +@auth(level: PUBLIC) { + movie_upsert(data: { id: $id, title: $title, imageUrl: $imageUrl }) +} + +# Delete a movie +mutation DeleteMovie($id: UUID!) @auth(level: PUBLIC) { + movie_delete(id: $id) +} + +mutation AddMeta @auth(level: PUBLIC) { + ref: meta_insert(data: { ref: "" }) +} +mutation DeleteMeta($id: UUID!) @auth(level: PUBLIC) { + ref: meta_delete(id: $id) +} + +# # Upsert (update or insert) a user's username based on their auth.uid +# mutation UpsertUser($username: String!) @auth(level: USER) { +# user_upsert( +# data: { +# id_expr: "auth.uid" +# username: $username +# } +# ) +# } + +# # Add a review for a movie +# mutation AddReview( +# $movieId: UUID! +# $rating: Int! +# $reviewText: String! +# ) @auth(level: USER) { +# review_upsert( +# data: { +# userId_expr: "auth.uid" +# movieId: $movieId +# rating: $rating +# reviewText: $reviewText +# # reviewDate defaults to today in the schema. No need to set it manually. +# } +# ) +# } + +# # Logged in user can delete their review for a movie +# mutation DeleteReview( +# $movieId: UUID! +# ) @auth(level: USER) { +# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId }) +# } diff --git a/dataconnect/connector-v11/queries.gql b/dataconnect/connector-v11/queries.gql new file mode 100644 index 00000000..b542c030 --- /dev/null +++ b/dataconnect/connector-v11/queries.gql @@ -0,0 +1,74 @@ +# # Example queries for a simple movie app. + +# @auth() directives control who can call each operation. +# Anyone should be able to list all movies, so the auth level is set to PUBLIC +query ListMovies @auth(level: PUBLIC) { + movies { + id + title + imageUrl + genre + } +} + +# Get movie by id +query GetMovieById($id: UUID!) @auth(level: PUBLIC) { + movie(id: $id) { + id + title + imageUrl + genre + } +} + +query GetMeta @auth(level: PUBLIC) { + ref: metas { + id + } +} + +# # List all users, only admins should be able to list all users, so we use NO_ACCESS +# query ListUsers @auth(level: NO_ACCESS) { +# users { id, username } +# } + +# # Logged in user can list all their reviews and movie titles associated with the review +# # Since the query requires the uid of the current authenticated user, the auth level is set to USER +# query ListUserReviews @auth(level: USER) { +# user(key: {id_expr: "auth.uid"}) { +# id +# username +# # _on_ makes it easy to grab info from another table +# # Here, we use it to grab all the reviews written by the user. +# reviews: reviews_on_user { +# id +# rating +# reviewDate +# reviewText +# movie { +# id +# title +# } +# } +# } +# } + +# # Search for movies, actors, and reviews +# query SearchMovie( +# $titleInput: String +# $genre: String +# ) @auth(level: PUBLIC) { +# movies( +# where: { +# _and: [ +# { genre: { eq: $genre } } +# { title: { contains: $titleInput } } +# ] +# } +# ) { +# id +# title +# genre +# imageUrl +# } +# } diff --git a/dataconnect/connector-v12/connector.yaml b/dataconnect/connector-v12/connector.yaml new file mode 100644 index 00000000..d3b295a9 --- /dev/null +++ b/dataconnect/connector-v12/connector.yaml @@ -0,0 +1,5 @@ +connectorId: default-connector-v12 +generate: + javascriptSdk: + outputDir: ../../dataconnect-sdk/js/default-connector-v12 + package: "@dataconnect/default-connector-v12" \ No newline at end of file diff --git a/dataconnect/connector-v12/mutations.gql b/dataconnect/connector-v12/mutations.gql new file mode 100644 index 00000000..e8ad7ca8 --- /dev/null +++ b/dataconnect/connector-v12/mutations.gql @@ -0,0 +1,59 @@ +# # Example mutations for a simple movie app + +# Create a movie based on user input +mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!) +@auth(level: PUBLIC) { + movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl }) +} + +# Upsert a movie +mutation UpsertMovie($id: UUID!, $title: String!, $imageUrl: String!) +@auth(level: PUBLIC) { + movie_upsert(data: { id: $id, title: $title, imageUrl: $imageUrl }) +} + +# Delete a movie +mutation DeleteMovie($id: UUID!) @auth(level: PUBLIC) { + movie_delete(id: $id) +} + +mutation AddMeta @auth(level: PUBLIC) { + ref: meta_insert(data: { ref: "" }) +} +mutation DeleteMeta($id: UUID!) @auth(level: PUBLIC) { + ref: meta_delete(id: $id) +} + +# # Upsert (update or insert) a user's username based on their auth.uid +# mutation UpsertUser($username: String!) @auth(level: USER) { +# user_upsert( +# data: { +# id_expr: "auth.uid" +# username: $username +# } +# ) +# } + +# # Add a review for a movie +# mutation AddReview( +# $movieId: UUID! +# $rating: Int! +# $reviewText: String! +# ) @auth(level: USER) { +# review_upsert( +# data: { +# userId_expr: "auth.uid" +# movieId: $movieId +# rating: $rating +# reviewText: $reviewText +# # reviewDate defaults to today in the schema. No need to set it manually. +# } +# ) +# } + +# # Logged in user can delete their review for a movie +# mutation DeleteReview( +# $movieId: UUID! +# ) @auth(level: USER) { +# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId }) +# } diff --git a/dataconnect/connector-v12/queries.gql b/dataconnect/connector-v12/queries.gql new file mode 100644 index 00000000..b542c030 --- /dev/null +++ b/dataconnect/connector-v12/queries.gql @@ -0,0 +1,74 @@ +# # Example queries for a simple movie app. + +# @auth() directives control who can call each operation. +# Anyone should be able to list all movies, so the auth level is set to PUBLIC +query ListMovies @auth(level: PUBLIC) { + movies { + id + title + imageUrl + genre + } +} + +# Get movie by id +query GetMovieById($id: UUID!) @auth(level: PUBLIC) { + movie(id: $id) { + id + title + imageUrl + genre + } +} + +query GetMeta @auth(level: PUBLIC) { + ref: metas { + id + } +} + +# # List all users, only admins should be able to list all users, so we use NO_ACCESS +# query ListUsers @auth(level: NO_ACCESS) { +# users { id, username } +# } + +# # Logged in user can list all their reviews and movie titles associated with the review +# # Since the query requires the uid of the current authenticated user, the auth level is set to USER +# query ListUserReviews @auth(level: USER) { +# user(key: {id_expr: "auth.uid"}) { +# id +# username +# # _on_ makes it easy to grab info from another table +# # Here, we use it to grab all the reviews written by the user. +# reviews: reviews_on_user { +# id +# rating +# reviewDate +# reviewText +# movie { +# id +# title +# } +# } +# } +# } + +# # Search for movies, actors, and reviews +# query SearchMovie( +# $titleInput: String +# $genre: String +# ) @auth(level: PUBLIC) { +# movies( +# where: { +# _and: [ +# { genre: { eq: $genre } } +# { title: { contains: $titleInput } } +# ] +# } +# ) { +# id +# title +# genre +# imageUrl +# } +# } diff --git a/dataconnect/dataconnect.yaml b/dataconnect/dataconnect.yaml index 074f3f5d..c9cd4cab 100644 --- a/dataconnect/dataconnect.yaml +++ b/dataconnect/dataconnect.yaml @@ -9,4 +9,4 @@ schema: cloudSql: instanceId: "tanstack-query-firebase-fdc" # schemaValidation: "COMPATIBLE" -connectorDirs: ["./connector"] +connectorDirs: ["./connector", "./connector-v11", "./connector-v12"] diff --git a/package.json b/package.json index 22001fba..d13b76d3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "changeset": "changeset", "version": "changeset version", "release": "pnpm build && changeset publish", - "build": "turbo build" + "build": "turbo build", + "generate:connectors": "./scripts/generate-connectors.sh" }, "devDependencies": { "@angular/core": "^19.1.8", diff --git a/packages/angular/package.json b/packages/angular/package.json index 9b30188e..bd561c3a 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -27,12 +27,13 @@ "author": "", "license": "Apache-2.0", "devDependencies": { - "@dataconnect/default-connector": "workspace:*", + "@dataconnect/default-connector-v11": "workspace:*", "@analogjs/vite-plugin-angular": "^1.13.0", "@angular/animations": "^19.0.0", "@testing-library/angular": "^17.3.5", "@testing-library/dom": "^10.4.0", - "tsup": "^8.4.0" + "tsup": "^8.4.0", + "firebase": "catalog:firebase11" }, "peerDependencies": { "@tanstack/angular-query-experimental": "5.66.4", diff --git a/packages/angular/vitest.config.ts b/packages/angular/vitest.config.ts index a9631f72..dcec9cbe 100644 --- a/packages/angular/vitest.config.ts +++ b/packages/angular/vitest.config.ts @@ -9,7 +9,11 @@ export default defineConfig({ "~/testing-utils": path.resolve(__dirname, "../../vitest/utils"), "@/dataconnect/default-connector": path.resolve( __dirname, - "../../dataconnect-sdk/js/default-connector", + "../../dataconnect-sdk/js/default-connector-v11", + ), + "@dataconnect/default-connector-v11": path.resolve( + __dirname, + "../../dataconnect-sdk/js/default-connector-v11", ), }, }, diff --git a/packages/react/package.json b/packages/react/package.json index 8a838997..93a7c4c0 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -39,12 +39,19 @@ "license": "Apache-2.0", "devDependencies": { "@dataconnect/default-connector": "workspace:*", + "@dataconnect/default-connector-v11": "workspace:*", + "@dataconnect/default-connector-v12": "workspace:*", "@testing-library/react": "^16.0.1", "@types/react": "^19.0.1", "react": "^19.0.0" }, "peerDependencies": { "@tanstack/react-query": "^5", - "firebase": "^11.3.0" + "firebase": "^11.3.0 || ^12.0.0" + }, + "peerDependenciesMeta": { + "firebase": { + "optional": false + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 875b3520..b9f53909 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,12 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +catalogs: + firebase11: + firebase: + specifier: ^11.3.0 + version: 11.3.1 + importers: .: @@ -64,6 +70,18 @@ importers: specifier: ^10.14.0 || ^11.3.0 version: 11.3.1 + dataconnect-sdk/js/default-connector-v11: + dependencies: + firebase: + specifier: ^10.14.0 || ^11.3.0 + version: 11.3.1 + + dataconnect-sdk/js/default-connector-v12: + dependencies: + firebase: + specifier: ^10.14.0 || ^11.3.0 + version: 11.3.1 + examples/react-example: dependencies: '@dataconnect/default-connector': @@ -140,15 +158,18 @@ importers: '@angular/animations': specifier: ^19.0.0 version: 19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0)) - '@dataconnect/default-connector': + '@dataconnect/default-connector-v11': specifier: workspace:* - version: link:../../dataconnect-sdk/js/default-connector + version: link:../../dataconnect-sdk/js/default-connector-v11 '@testing-library/angular': specifier: ^17.3.5 version: 17.3.6(@angular/common@19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.1.8(@angular/animations@19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/router@19.1.8(@angular/common@19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.1.8(@angular/animations@19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.1.8(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.1.8(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1))(@testing-library/dom@10.4.0) '@testing-library/dom': specifier: ^10.4.0 version: 10.4.0 + firebase: + specifier: catalog:firebase11 + version: 11.3.1 tsup: specifier: ^8.4.0 version: 8.4.0(jiti@1.21.7)(postcss@8.5.3)(typescript@5.7.3)(yaml@2.7.0) @@ -159,12 +180,18 @@ importers: specifier: ^5 version: 5.66.9(react@19.0.0) firebase: - specifier: ^11.3.0 + specifier: ^11.3.0 || ^12.0.0 version: 11.3.1 devDependencies: '@dataconnect/default-connector': specifier: workspace:* version: link:../../dataconnect-sdk/js/default-connector + '@dataconnect/default-connector-v11': + specifier: workspace:* + version: link:../../dataconnect-sdk/js/default-connector-v11 + '@dataconnect/default-connector-v12': + specifier: workspace:* + version: link:../../dataconnect-sdk/js/default-connector-v12 '@testing-library/react': specifier: ^16.0.1 version: 16.2.0(@testing-library/dom@10.4.0)(@types/react-dom@19.0.4(@types/react@19.0.10))(@types/react@19.0.10)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a8ee674a..0c8bc176 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,10 @@ packages: - 'examples/*' - 'packages/*' - - 'dataconnect-sdk/js/*' \ No newline at end of file + - 'dataconnect-sdk/js/*' + +catalogs: + firebase11: + firebase: ^11.3.0 + firebase12: + firebase: ^12.0.0 \ No newline at end of file diff --git a/scripts/generate-connectors.sh b/scripts/generate-connectors.sh new file mode 100755 index 00000000..deea26fc --- /dev/null +++ b/scripts/generate-connectors.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Generate Data Connect SDKs for multiple Firebase versions + +echo "Generating Data Connect SDKs..." +firebase dataconnect:sdk:generate + +echo "Data Connect SDK generation complete!" \ No newline at end of file From 7549336bd74f9f8e95d1335b06b7942f8be7e5ff Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Mon, 4 Aug 2025 15:28:53 +0100 Subject: [PATCH 2/2] refactor: remove default connector --- CONTRIBUTING.md | 15 + .../js/default-connector-v12/esm/index.esm.js | 66 +- .../js/default-connector-v12/index.cjs.js | 72 +- .../js/default-connector-v12/index.d.ts | 72 +- .../js/default-connector/README.md | 922 ------------------ .../js/default-connector/esm/index.esm.js | 96 -- .../js/default-connector/esm/package.json | 1 - .../js/default-connector/index.cjs.js | 104 -- .../js/default-connector/index.d.ts | 191 ---- .../js/default-connector/package.json | 25 - dataconnect/connector/connector.yaml | 5 - dataconnect/connector/mutations.gql | 59 -- dataconnect/connector/queries.gql | 74 -- dataconnect/dataconnect.yaml | 2 +- docs/react/data-connect/mutations.mdx | 2 +- docs/react/data-connect/querying.mdx | 2 +- .../data-connect/server-side-rendering.mdx | 4 +- examples/react-example/package.json | 4 +- .../src/app/rsc/data-connect/page.tsx | 2 +- .../src/examples/data-connect.tsx | 5 +- examples/react-example/src/firebase.ts | 2 +- .../src/pages/ssr/data-connect.tsx | 2 +- packages/react/package.json | 1 - packages/react/vitest.config.ts | 2 +- pnpm-lock.yaml | 521 +++++++++- 25 files changed, 640 insertions(+), 1611 deletions(-) delete mode 100644 dataconnect-sdk/js/default-connector/README.md delete mode 100644 dataconnect-sdk/js/default-connector/esm/index.esm.js delete mode 100644 dataconnect-sdk/js/default-connector/esm/package.json delete mode 100644 dataconnect-sdk/js/default-connector/index.cjs.js delete mode 100644 dataconnect-sdk/js/default-connector/index.d.ts delete mode 100644 dataconnect-sdk/js/default-connector/package.json delete mode 100644 dataconnect/connector/connector.yaml delete mode 100644 dataconnect/connector/mutations.gql delete mode 100644 dataconnect/connector/queries.gql diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc49798f..3a3bd8ba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,6 +30,21 @@ pnpm emulator ## Development Tools +### Firebase Multi-Version Support + +This monorepo supports multiple Firebase versions simultaneously: +- The React package supports both Firebase 11 and 12 +- The Angular package is locked to Firebase 11 (due to @angular/fire compatibility) + +To handle type differences between Firebase versions, we use separate Data Connect connectors: +- `connector-v11`: Used for Firebase 11 compatibility +- `connector-v12`: Used for Firebase 12 compatibility + +The connectors generate identical functionality but with version-specific types. This approach ensures: +- Type safety at compile time +- No runtime version detection needed +- Clean separation of version-specific code + ### Turborepo This project uses Turborepo for managing the monorepo. Key commands: diff --git a/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js b/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js index 01718907..19dcda20 100644 --- a/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js +++ b/dataconnect-sdk/js/default-connector-v12/esm/index.esm.js @@ -6,39 +6,6 @@ export const connectorConfig = { location: 'us-central1' }; -export const listMoviesRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'ListMovies'); -} -listMoviesRef.operationName = 'ListMovies'; - -export function listMovies(dc) { - return executeQuery(listMoviesRef(dc)); -} - -export const getMovieByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMovieById', inputVars); -} -getMovieByIdRef.operationName = 'GetMovieById'; - -export function getMovieById(dcOrVars, vars) { - return executeQuery(getMovieByIdRef(dcOrVars, vars)); -} - -export const getMetaRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMeta'); -} -getMetaRef.operationName = 'GetMeta'; - -export function getMeta(dc) { - return executeQuery(getMetaRef(dc)); -} - export const createMovieRef = (dcOrVars, vars) => { const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); @@ -94,3 +61,36 @@ export function deleteMeta(dcOrVars, vars) { return executeMutation(deleteMetaRef(dcOrVars, vars)); } +export const listMoviesRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; + +export function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +} + +export const getMovieByIdRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; + +export function getMovieById(dcOrVars, vars) { + return executeQuery(getMovieByIdRef(dcOrVars, vars)); +} + +export const getMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; + +export function getMeta(dc) { + return executeQuery(getMetaRef(dc)); +} + diff --git a/dataconnect-sdk/js/default-connector-v12/index.cjs.js b/dataconnect-sdk/js/default-connector-v12/index.cjs.js index 9e03ebf6..1a00f40f 100644 --- a/dataconnect-sdk/js/default-connector-v12/index.cjs.js +++ b/dataconnect-sdk/js/default-connector-v12/index.cjs.js @@ -7,42 +7,6 @@ const connectorConfig = { }; exports.connectorConfig = connectorConfig; -const listMoviesRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'ListMovies'); -} -listMoviesRef.operationName = 'ListMovies'; -exports.listMoviesRef = listMoviesRef; - -exports.listMovies = function listMovies(dc) { - return executeQuery(listMoviesRef(dc)); -}; - -const getMovieByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMovieById', inputVars); -} -getMovieByIdRef.operationName = 'GetMovieById'; -exports.getMovieByIdRef = getMovieByIdRef; - -exports.getMovieById = function getMovieById(dcOrVars, vars) { - return executeQuery(getMovieByIdRef(dcOrVars, vars)); -}; - -const getMetaRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMeta'); -} -getMetaRef.operationName = 'GetMeta'; -exports.getMetaRef = getMetaRef; - -exports.getMeta = function getMeta(dc) { - return executeQuery(getMetaRef(dc)); -}; - const createMovieRef = (dcOrVars, vars) => { const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); dcInstance._useGeneratedSdk(); @@ -102,3 +66,39 @@ exports.deleteMetaRef = deleteMetaRef; exports.deleteMeta = function deleteMeta(dcOrVars, vars) { return executeMutation(deleteMetaRef(dcOrVars, vars)); }; + +const listMoviesRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'ListMovies'); +} +listMoviesRef.operationName = 'ListMovies'; +exports.listMoviesRef = listMoviesRef; + +exports.listMovies = function listMovies(dc) { + return executeQuery(listMoviesRef(dc)); +}; + +const getMovieByIdRef = (dcOrVars, vars) => { + const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMovieById', inputVars); +} +getMovieByIdRef.operationName = 'GetMovieById'; +exports.getMovieByIdRef = getMovieByIdRef; + +exports.getMovieById = function getMovieById(dcOrVars, vars) { + return executeQuery(getMovieByIdRef(dcOrVars, vars)); +}; + +const getMetaRef = (dc) => { + const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); + dcInstance._useGeneratedSdk(); + return queryRef(dcInstance, 'GetMeta'); +} +getMetaRef.operationName = 'GetMeta'; +exports.getMetaRef = getMetaRef; + +exports.getMeta = function getMeta(dc) { + return executeQuery(getMetaRef(dc)); +}; diff --git a/dataconnect-sdk/js/default-connector-v12/index.d.ts b/dataconnect-sdk/js/default-connector-v12/index.d.ts index 2ea08ad7..be76eb72 100644 --- a/dataconnect-sdk/js/default-connector-v12/index.d.ts +++ b/dataconnect-sdk/js/default-connector-v12/index.d.ts @@ -93,42 +93,6 @@ export interface UpsertMovieVariables { imageUrl: string; } -interface ListMoviesRef { - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect): QueryRef; - operationName: string; -} -export const listMoviesRef: ListMoviesRef; - -export function listMovies(): QueryPromise; -export function listMovies(dc: DataConnect): QueryPromise; - -interface GetMovieByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetMovieByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; - operationName: string; -} -export const getMovieByIdRef: GetMovieByIdRef; - -export function getMovieById(vars: GetMovieByIdVariables): QueryPromise; -export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; - -interface GetMetaRef { - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect): QueryRef; - operationName: string; -} -export const getMetaRef: GetMetaRef; - -export function getMeta(): QueryPromise; -export function getMeta(dc: DataConnect): QueryPromise; - interface CreateMovieRef { /* Allow users to create refs without passing in DataConnect */ (vars: CreateMovieVariables): MutationRef; @@ -189,3 +153,39 @@ export const deleteMetaRef: DeleteMetaRef; export function deleteMeta(vars: DeleteMetaVariables): MutationPromise; export function deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; +interface ListMoviesRef { + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): QueryRef; + operationName: string; +} +export const listMoviesRef: ListMoviesRef; + +export function listMovies(): QueryPromise; +export function listMovies(dc: DataConnect): QueryPromise; + +interface GetMovieByIdRef { + /* Allow users to create refs without passing in DataConnect */ + (vars: GetMovieByIdVariables): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; + operationName: string; +} +export const getMovieByIdRef: GetMovieByIdRef; + +export function getMovieById(vars: GetMovieByIdVariables): QueryPromise; +export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; + +interface GetMetaRef { + /* Allow users to create refs without passing in DataConnect */ + (): QueryRef; + /* Allow users to pass in custom DataConnect instances */ + (dc: DataConnect): QueryRef; + operationName: string; +} +export const getMetaRef: GetMetaRef; + +export function getMeta(): QueryPromise; +export function getMeta(dc: DataConnect): QueryPromise; + diff --git a/dataconnect-sdk/js/default-connector/README.md b/dataconnect-sdk/js/default-connector/README.md deleted file mode 100644 index 171d7f6a..00000000 --- a/dataconnect-sdk/js/default-connector/README.md +++ /dev/null @@ -1,922 +0,0 @@ -# Generated TypeScript README -This README will guide you through the process of using the generated JavaScript SDK package for the connector `default`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. - -***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.* - -# Table of Contents -- [**Overview**](#generated-javascript-readme) -- [**Accessing the connector**](#accessing-the-connector) - - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) -- [**Queries**](#queries) - - [*ListMovies*](#listmovies) - - [*GetMovieById*](#getmoviebyid) - - [*GetMeta*](#getmeta) -- [**Mutations**](#mutations) - - [*CreateMovie*](#createmovie) - - [*UpsertMovie*](#upsertmovie) - - [*DeleteMovie*](#deletemovie) - - [*AddMeta*](#addmeta) - - [*DeleteMeta*](#deletemeta) - -# Accessing the connector -A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default`. You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). - -You can use this generated SDK by importing from the package `@dataconnect/default-connector` as shown below. Both CommonJS and ESM imports are supported. - -You can also follow the instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#set-client). - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/default-connector'; - -const dataConnect = getDataConnect(connectorConfig); -``` - -## Connecting to the local Emulator -By default, the connector will connect to the production service. - -To connect to the emulator, you can use the following code. -You can also follow the emulator instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#instrument-clients). - -```typescript -import { connectDataConnectEmulator, getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/default-connector'; - -const dataConnect = getDataConnect(connectorConfig); -connectDataConnectEmulator(dataConnect, 'localhost', 9399); -``` - -After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) from your generated SDK. - -# Queries - -There are two ways to execute a Data Connect Query using the generated Web SDK: -- Using a Query Reference function, which returns a `QueryRef` - - The `QueryRef` can be used as an argument to `executeQuery()`, which will execute the Query and return a `QueryPromise` -- Using an action shortcut function, which returns a `QueryPromise` - - Calling the action shortcut function will execute the Query and return a `QueryPromise` - -The following is true for both the action shortcut function and the `QueryRef` function: -- The `QueryPromise` returned will resolve to the result of the Query once it has finished executing -- If the Query accepts arguments, both the action shortcut function and the `QueryRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Query -- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. - -Below are examples of how to use the `default` connector's generated functions to execute each query. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-queries). - -## ListMovies -You can execute the `ListMovies` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -listMovies(): QueryPromise; - -interface ListMoviesRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listMoviesRef: ListMoviesRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listMovies(dc: DataConnect): QueryPromise; - -interface ListMoviesRef { - ... - (dc: DataConnect): QueryRef; -} -export const listMoviesRef: ListMoviesRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the listMoviesRef: -```typescript -const name = listMoviesRef.operationName; -console.log(name); -``` - -### Variables -The `ListMovies` query has no variables. -### Return Type -Recall that executing the `ListMovies` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListMoviesData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListMoviesData { - movies: ({ - id: UUIDString; - title: string; - imageUrl: string; - genre?: string | null; - } & Movie_Key)[]; -} -``` -### Using `ListMovies`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listMovies } from '@dataconnect/default-connector'; - - -// Call the `listMovies()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listMovies(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listMovies(dataConnect); - -console.log(data.movies); - -// Or, you can use the `Promise` API. -listMovies().then((response) => { - const data = response.data; - console.log(data.movies); -}); -``` - -### Using `ListMovies`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listMoviesRef } from '@dataconnect/default-connector'; - - -// Call the `listMoviesRef()` function to get a reference to the query. -const ref = listMoviesRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listMoviesRef(dataConnect); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.movies); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.movies); -}); -``` - -## GetMovieById -You can execute the `GetMovieById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -getMovieById(vars: GetMovieByIdVariables): QueryPromise; - -interface GetMovieByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetMovieByIdVariables): QueryRef; -} -export const getMovieByIdRef: GetMovieByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; - -interface GetMovieByIdRef { - ... - (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; -} -export const getMovieByIdRef: GetMovieByIdRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the getMovieByIdRef: -```typescript -const name = getMovieByIdRef.operationName; -console.log(name); -``` - -### Variables -The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetMovieByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `GetMovieById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetMovieByIdData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetMovieByIdData { - movie?: { - id: UUIDString; - title: string; - imageUrl: string; - genre?: string | null; - } & Movie_Key; -} -``` -### Using `GetMovieById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getMovieById, GetMovieByIdVariables } from '@dataconnect/default-connector'; - -// The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`: -const getMovieByIdVars: GetMovieByIdVariables = { - id: ..., -}; - -// Call the `getMovieById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getMovieById(getMovieByIdVars); -// Variables can be defined inline as well. -const { data } = await getMovieById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getMovieById(dataConnect, getMovieByIdVars); - -console.log(data.movie); - -// Or, you can use the `Promise` API. -getMovieById(getMovieByIdVars).then((response) => { - const data = response.data; - console.log(data.movie); -}); -``` - -### Using `GetMovieById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getMovieByIdRef, GetMovieByIdVariables } from '@dataconnect/default-connector'; - -// The `GetMovieById` query requires an argument of type `GetMovieByIdVariables`: -const getMovieByIdVars: GetMovieByIdVariables = { - id: ..., -}; - -// Call the `getMovieByIdRef()` function to get a reference to the query. -const ref = getMovieByIdRef(getMovieByIdVars); -// Variables can be defined inline as well. -const ref = getMovieByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getMovieByIdRef(dataConnect, getMovieByIdVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.movie); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.movie); -}); -``` - -## GetMeta -You can execute the `GetMeta` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -getMeta(): QueryPromise; - -interface GetMetaRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const getMetaRef: GetMetaRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getMeta(dc: DataConnect): QueryPromise; - -interface GetMetaRef { - ... - (dc: DataConnect): QueryRef; -} -export const getMetaRef: GetMetaRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the getMetaRef: -```typescript -const name = getMetaRef.operationName; -console.log(name); -``` - -### Variables -The `GetMeta` query has no variables. -### Return Type -Recall that executing the `GetMeta` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetMetaData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetMetaData { - ref: ({ - id: UUIDString; - } & Meta_Key)[]; -} -``` -### Using `GetMeta`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getMeta } from '@dataconnect/default-connector'; - - -// Call the `getMeta()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getMeta(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getMeta(dataConnect); - -console.log(data.ref); - -// Or, you can use the `Promise` API. -getMeta().then((response) => { - const data = response.data; - console.log(data.ref); -}); -``` - -### Using `GetMeta`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getMetaRef } from '@dataconnect/default-connector'; - - -// Call the `getMetaRef()` function to get a reference to the query. -const ref = getMetaRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getMetaRef(dataConnect); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.ref); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.ref); -}); -``` - -# Mutations - -There are two ways to execute a Data Connect Mutation using the generated Web SDK: -- Using a Mutation Reference function, which returns a `MutationRef` - - The `MutationRef` can be used as an argument to `executeMutation()`, which will execute the Mutation and return a `MutationPromise` -- Using an action shortcut function, which returns a `MutationPromise` - - Calling the action shortcut function will execute the Mutation and return a `MutationPromise` - -The following is true for both the action shortcut function and the `MutationRef` function: -- The `MutationPromise` returned will resolve to the result of the Mutation once it has finished executing -- If the Mutation accepts arguments, both the action shortcut function and the `MutationRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Mutation -- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. - -Below are examples of how to use the `default` connector's generated functions to execute each mutation. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-mutations). - -## CreateMovie -You can execute the `CreateMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -createMovie(vars: CreateMovieVariables): MutationPromise; - -interface CreateMovieRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateMovieVariables): MutationRef; -} -export const createMovieRef: CreateMovieRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; - -interface CreateMovieRef { - ... - (dc: DataConnect, vars: CreateMovieVariables): MutationRef; -} -export const createMovieRef: CreateMovieRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the createMovieRef: -```typescript -const name = createMovieRef.operationName; -console.log(name); -``` - -### Variables -The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateMovieVariables { - title: string; - genre: string; - imageUrl: string; -} -``` -### Return Type -Recall that executing the `CreateMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateMovieData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateMovieData { - movie_insert: Movie_Key; -} -``` -### Using `CreateMovie`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createMovie, CreateMovieVariables } from '@dataconnect/default-connector'; - -// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: -const createMovieVars: CreateMovieVariables = { - title: ..., - genre: ..., - imageUrl: ..., -}; - -// Call the `createMovie()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createMovie(createMovieVars); -// Variables can be defined inline as well. -const { data } = await createMovie({ title: ..., genre: ..., imageUrl: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createMovie(dataConnect, createMovieVars); - -console.log(data.movie_insert); - -// Or, you can use the `Promise` API. -createMovie(createMovieVars).then((response) => { - const data = response.data; - console.log(data.movie_insert); -}); -``` - -### Using `CreateMovie`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createMovieRef, CreateMovieVariables } from '@dataconnect/default-connector'; - -// The `CreateMovie` mutation requires an argument of type `CreateMovieVariables`: -const createMovieVars: CreateMovieVariables = { - title: ..., - genre: ..., - imageUrl: ..., -}; - -// Call the `createMovieRef()` function to get a reference to the mutation. -const ref = createMovieRef(createMovieVars); -// Variables can be defined inline as well. -const ref = createMovieRef({ title: ..., genre: ..., imageUrl: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createMovieRef(dataConnect, createMovieVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.movie_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.movie_insert); -}); -``` - -## UpsertMovie -You can execute the `UpsertMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -upsertMovie(vars: UpsertMovieVariables): MutationPromise; - -interface UpsertMovieRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpsertMovieVariables): MutationRef; -} -export const upsertMovieRef: UpsertMovieRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; - -interface UpsertMovieRef { - ... - (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; -} -export const upsertMovieRef: UpsertMovieRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the upsertMovieRef: -```typescript -const name = upsertMovieRef.operationName; -console.log(name); -``` - -### Variables -The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpsertMovieVariables { - id: UUIDString; - title: string; - imageUrl: string; -} -``` -### Return Type -Recall that executing the `UpsertMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpsertMovieData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpsertMovieData { - movie_upsert: Movie_Key; -} -``` -### Using `UpsertMovie`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, upsertMovie, UpsertMovieVariables } from '@dataconnect/default-connector'; - -// The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`: -const upsertMovieVars: UpsertMovieVariables = { - id: ..., - title: ..., - imageUrl: ..., -}; - -// Call the `upsertMovie()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await upsertMovie(upsertMovieVars); -// Variables can be defined inline as well. -const { data } = await upsertMovie({ id: ..., title: ..., imageUrl: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await upsertMovie(dataConnect, upsertMovieVars); - -console.log(data.movie_upsert); - -// Or, you can use the `Promise` API. -upsertMovie(upsertMovieVars).then((response) => { - const data = response.data; - console.log(data.movie_upsert); -}); -``` - -### Using `UpsertMovie`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, upsertMovieRef, UpsertMovieVariables } from '@dataconnect/default-connector'; - -// The `UpsertMovie` mutation requires an argument of type `UpsertMovieVariables`: -const upsertMovieVars: UpsertMovieVariables = { - id: ..., - title: ..., - imageUrl: ..., -}; - -// Call the `upsertMovieRef()` function to get a reference to the mutation. -const ref = upsertMovieRef(upsertMovieVars); -// Variables can be defined inline as well. -const ref = upsertMovieRef({ id: ..., title: ..., imageUrl: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = upsertMovieRef(dataConnect, upsertMovieVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.movie_upsert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.movie_upsert); -}); -``` - -## DeleteMovie -You can execute the `DeleteMovie` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -deleteMovie(vars: DeleteMovieVariables): MutationPromise; - -interface DeleteMovieRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteMovieVariables): MutationRef; -} -export const deleteMovieRef: DeleteMovieRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; - -interface DeleteMovieRef { - ... - (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; -} -export const deleteMovieRef: DeleteMovieRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the deleteMovieRef: -```typescript -const name = deleteMovieRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteMovieVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteMovie` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteMovieData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteMovieData { - movie_delete?: Movie_Key | null; -} -``` -### Using `DeleteMovie`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteMovie, DeleteMovieVariables } from '@dataconnect/default-connector'; - -// The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`: -const deleteMovieVars: DeleteMovieVariables = { - id: ..., -}; - -// Call the `deleteMovie()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteMovie(deleteMovieVars); -// Variables can be defined inline as well. -const { data } = await deleteMovie({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteMovie(dataConnect, deleteMovieVars); - -console.log(data.movie_delete); - -// Or, you can use the `Promise` API. -deleteMovie(deleteMovieVars).then((response) => { - const data = response.data; - console.log(data.movie_delete); -}); -``` - -### Using `DeleteMovie`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteMovieRef, DeleteMovieVariables } from '@dataconnect/default-connector'; - -// The `DeleteMovie` mutation requires an argument of type `DeleteMovieVariables`: -const deleteMovieVars: DeleteMovieVariables = { - id: ..., -}; - -// Call the `deleteMovieRef()` function to get a reference to the mutation. -const ref = deleteMovieRef(deleteMovieVars); -// Variables can be defined inline as well. -const ref = deleteMovieRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteMovieRef(dataConnect, deleteMovieVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.movie_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.movie_delete); -}); -``` - -## AddMeta -You can execute the `AddMeta` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -addMeta(): MutationPromise; - -interface AddMetaRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): MutationRef; -} -export const addMetaRef: AddMetaRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -addMeta(dc: DataConnect): MutationPromise; - -interface AddMetaRef { - ... - (dc: DataConnect): MutationRef; -} -export const addMetaRef: AddMetaRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the addMetaRef: -```typescript -const name = addMetaRef.operationName; -console.log(name); -``` - -### Variables -The `AddMeta` mutation has no variables. -### Return Type -Recall that executing the `AddMeta` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `AddMetaData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface AddMetaData { - ref: Meta_Key; -} -``` -### Using `AddMeta`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, addMeta } from '@dataconnect/default-connector'; - - -// Call the `addMeta()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await addMeta(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await addMeta(dataConnect); - -console.log(data.ref); - -// Or, you can use the `Promise` API. -addMeta().then((response) => { - const data = response.data; - console.log(data.ref); -}); -``` - -### Using `AddMeta`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, addMetaRef } from '@dataconnect/default-connector'; - - -// Call the `addMetaRef()` function to get a reference to the mutation. -const ref = addMetaRef(); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = addMetaRef(dataConnect); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.ref); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.ref); -}); -``` - -## DeleteMeta -You can execute the `DeleteMeta` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```typescript -deleteMeta(vars: DeleteMetaVariables): MutationPromise; - -interface DeleteMetaRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteMetaVariables): MutationRef; -} -export const deleteMetaRef: DeleteMetaRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; - -interface DeleteMetaRef { - ... - (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; -} -export const deleteMetaRef: DeleteMetaRef; -``` - -If you need the name of the operation without creating a ref, you can retrieve the operation name by calling the `operationName` property on the deleteMetaRef: -```typescript -const name = deleteMetaRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteMetaVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteMeta` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteMetaData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteMetaData { - ref?: Meta_Key | null; -} -``` -### Using `DeleteMeta`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteMeta, DeleteMetaVariables } from '@dataconnect/default-connector'; - -// The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`: -const deleteMetaVars: DeleteMetaVariables = { - id: ..., -}; - -// Call the `deleteMeta()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteMeta(deleteMetaVars); -// Variables can be defined inline as well. -const { data } = await deleteMeta({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteMeta(dataConnect, deleteMetaVars); - -console.log(data.ref); - -// Or, you can use the `Promise` API. -deleteMeta(deleteMetaVars).then((response) => { - const data = response.data; - console.log(data.ref); -}); -``` - -### Using `DeleteMeta`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteMetaRef, DeleteMetaVariables } from '@dataconnect/default-connector'; - -// The `DeleteMeta` mutation requires an argument of type `DeleteMetaVariables`: -const deleteMetaVars: DeleteMetaVariables = { - id: ..., -}; - -// Call the `deleteMetaRef()` function to get a reference to the mutation. -const ref = deleteMetaRef(deleteMetaVars); -// Variables can be defined inline as well. -const ref = deleteMetaRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteMetaRef(dataConnect, deleteMetaVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.ref); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.ref); -}); -``` - diff --git a/dataconnect-sdk/js/default-connector/esm/index.esm.js b/dataconnect-sdk/js/default-connector/esm/index.esm.js deleted file mode 100644 index 2ff02515..00000000 --- a/dataconnect-sdk/js/default-connector/esm/index.esm.js +++ /dev/null @@ -1,96 +0,0 @@ -import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; - -export const connectorConfig = { - connector: 'default', - service: 'tanstack-query-firebase', - location: 'us-central1' -}; - -export const createMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateMovie', inputVars); -} -createMovieRef.operationName = 'CreateMovie'; - -export function createMovie(dcOrVars, vars) { - return executeMutation(createMovieRef(dcOrVars, vars)); -} - -export const upsertMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpsertMovie', inputVars); -} -upsertMovieRef.operationName = 'UpsertMovie'; - -export function upsertMovie(dcOrVars, vars) { - return executeMutation(upsertMovieRef(dcOrVars, vars)); -} - -export const deleteMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteMovie', inputVars); -} -deleteMovieRef.operationName = 'DeleteMovie'; - -export function deleteMovie(dcOrVars, vars) { - return executeMutation(deleteMovieRef(dcOrVars, vars)); -} - -export const addMetaRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'AddMeta'); -} -addMetaRef.operationName = 'AddMeta'; - -export function addMeta(dc) { - return executeMutation(addMetaRef(dc)); -} - -export const deleteMetaRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteMeta', inputVars); -} -deleteMetaRef.operationName = 'DeleteMeta'; - -export function deleteMeta(dcOrVars, vars) { - return executeMutation(deleteMetaRef(dcOrVars, vars)); -} - -export const listMoviesRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'ListMovies'); -} -listMoviesRef.operationName = 'ListMovies'; - -export function listMovies(dc) { - return executeQuery(listMoviesRef(dc)); -} - -export const getMovieByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMovieById', inputVars); -} -getMovieByIdRef.operationName = 'GetMovieById'; - -export function getMovieById(dcOrVars, vars) { - return executeQuery(getMovieByIdRef(dcOrVars, vars)); -} - -export const getMetaRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMeta'); -} -getMetaRef.operationName = 'GetMeta'; - -export function getMeta(dc) { - return executeQuery(getMetaRef(dc)); -} - diff --git a/dataconnect-sdk/js/default-connector/esm/package.json b/dataconnect-sdk/js/default-connector/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/dataconnect-sdk/js/default-connector/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/dataconnect-sdk/js/default-connector/index.cjs.js b/dataconnect-sdk/js/default-connector/index.cjs.js deleted file mode 100644 index 1de60aa6..00000000 --- a/dataconnect-sdk/js/default-connector/index.cjs.js +++ /dev/null @@ -1,104 +0,0 @@ -const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); - -const connectorConfig = { - connector: 'default', - service: 'tanstack-query-firebase', - location: 'us-central1' -}; -exports.connectorConfig = connectorConfig; - -const createMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateMovie', inputVars); -} -createMovieRef.operationName = 'CreateMovie'; -exports.createMovieRef = createMovieRef; - -exports.createMovie = function createMovie(dcOrVars, vars) { - return executeMutation(createMovieRef(dcOrVars, vars)); -}; - -const upsertMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpsertMovie', inputVars); -} -upsertMovieRef.operationName = 'UpsertMovie'; -exports.upsertMovieRef = upsertMovieRef; - -exports.upsertMovie = function upsertMovie(dcOrVars, vars) { - return executeMutation(upsertMovieRef(dcOrVars, vars)); -}; - -const deleteMovieRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteMovie', inputVars); -} -deleteMovieRef.operationName = 'DeleteMovie'; -exports.deleteMovieRef = deleteMovieRef; - -exports.deleteMovie = function deleteMovie(dcOrVars, vars) { - return executeMutation(deleteMovieRef(dcOrVars, vars)); -}; - -const addMetaRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'AddMeta'); -} -addMetaRef.operationName = 'AddMeta'; -exports.addMetaRef = addMetaRef; - -exports.addMeta = function addMeta(dc) { - return executeMutation(addMetaRef(dc)); -}; - -const deleteMetaRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteMeta', inputVars); -} -deleteMetaRef.operationName = 'DeleteMeta'; -exports.deleteMetaRef = deleteMetaRef; - -exports.deleteMeta = function deleteMeta(dcOrVars, vars) { - return executeMutation(deleteMetaRef(dcOrVars, vars)); -}; - -const listMoviesRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'ListMovies'); -} -listMoviesRef.operationName = 'ListMovies'; -exports.listMoviesRef = listMoviesRef; - -exports.listMovies = function listMovies(dc) { - return executeQuery(listMoviesRef(dc)); -}; - -const getMovieByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMovieById', inputVars); -} -getMovieByIdRef.operationName = 'GetMovieById'; -exports.getMovieByIdRef = getMovieByIdRef; - -exports.getMovieById = function getMovieById(dcOrVars, vars) { - return executeQuery(getMovieByIdRef(dcOrVars, vars)); -}; - -const getMetaRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetMeta'); -} -getMetaRef.operationName = 'GetMeta'; -exports.getMetaRef = getMetaRef; - -exports.getMeta = function getMeta(dc) { - return executeQuery(getMetaRef(dc)); -}; diff --git a/dataconnect-sdk/js/default-connector/index.d.ts b/dataconnect-sdk/js/default-connector/index.d.ts deleted file mode 100644 index be76eb72..00000000 --- a/dataconnect-sdk/js/default-connector/index.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -import { ConnectorConfig, DataConnect, QueryRef, QueryPromise, MutationRef, MutationPromise } from 'firebase/data-connect'; - -export const connectorConfig: ConnectorConfig; - -export type TimestampString = string; -export type UUIDString = string; -export type Int64String = string; -export type DateString = string; - - - - -export interface AddMetaData { - ref: Meta_Key; -} - -export interface CreateMovieData { - movie_insert: Movie_Key; -} - -export interface CreateMovieVariables { - title: string; - genre: string; - imageUrl: string; -} - -export interface DeleteMetaData { - ref?: Meta_Key | null; -} - -export interface DeleteMetaVariables { - id: UUIDString; -} - -export interface DeleteMovieData { - movie_delete?: Movie_Key | null; -} - -export interface DeleteMovieVariables { - id: UUIDString; -} - -export interface GetMetaData { - ref: ({ - id: UUIDString; - } & Meta_Key)[]; -} - -export interface GetMovieByIdData { - movie?: { - id: UUIDString; - title: string; - imageUrl: string; - genre?: string | null; - } & Movie_Key; -} - -export interface GetMovieByIdVariables { - id: UUIDString; -} - -export interface ListMoviesData { - movies: ({ - id: UUIDString; - title: string; - imageUrl: string; - genre?: string | null; - } & Movie_Key)[]; -} - -export interface Meta_Key { - id: UUIDString; - __typename?: 'Meta_Key'; -} - -export interface MovieMetadata_Key { - id: UUIDString; - __typename?: 'MovieMetadata_Key'; -} - -export interface Movie_Key { - id: UUIDString; - __typename?: 'Movie_Key'; -} - -export interface UpsertMovieData { - movie_upsert: Movie_Key; -} - -export interface UpsertMovieVariables { - id: UUIDString; - title: string; - imageUrl: string; -} - -interface CreateMovieRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateMovieVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateMovieVariables): MutationRef; - operationName: string; -} -export const createMovieRef: CreateMovieRef; - -export function createMovie(vars: CreateMovieVariables): MutationPromise; -export function createMovie(dc: DataConnect, vars: CreateMovieVariables): MutationPromise; - -interface UpsertMovieRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpsertMovieVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpsertMovieVariables): MutationRef; - operationName: string; -} -export const upsertMovieRef: UpsertMovieRef; - -export function upsertMovie(vars: UpsertMovieVariables): MutationPromise; -export function upsertMovie(dc: DataConnect, vars: UpsertMovieVariables): MutationPromise; - -interface DeleteMovieRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteMovieVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteMovieVariables): MutationRef; - operationName: string; -} -export const deleteMovieRef: DeleteMovieRef; - -export function deleteMovie(vars: DeleteMovieVariables): MutationPromise; -export function deleteMovie(dc: DataConnect, vars: DeleteMovieVariables): MutationPromise; - -interface AddMetaRef { - /* Allow users to create refs without passing in DataConnect */ - (): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect): MutationRef; - operationName: string; -} -export const addMetaRef: AddMetaRef; - -export function addMeta(): MutationPromise; -export function addMeta(dc: DataConnect): MutationPromise; - -interface DeleteMetaRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteMetaVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteMetaVariables): MutationRef; - operationName: string; -} -export const deleteMetaRef: DeleteMetaRef; - -export function deleteMeta(vars: DeleteMetaVariables): MutationPromise; -export function deleteMeta(dc: DataConnect, vars: DeleteMetaVariables): MutationPromise; - -interface ListMoviesRef { - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect): QueryRef; - operationName: string; -} -export const listMoviesRef: ListMoviesRef; - -export function listMovies(): QueryPromise; -export function listMovies(dc: DataConnect): QueryPromise; - -interface GetMovieByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetMovieByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetMovieByIdVariables): QueryRef; - operationName: string; -} -export const getMovieByIdRef: GetMovieByIdRef; - -export function getMovieById(vars: GetMovieByIdVariables): QueryPromise; -export function getMovieById(dc: DataConnect, vars: GetMovieByIdVariables): QueryPromise; - -interface GetMetaRef { - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect): QueryRef; - operationName: string; -} -export const getMetaRef: GetMetaRef; - -export function getMeta(): QueryPromise; -export function getMeta(dc: DataConnect): QueryPromise; - diff --git a/dataconnect-sdk/js/default-connector/package.json b/dataconnect-sdk/js/default-connector/package.json deleted file mode 100644 index faa3fdfb..00000000 --- a/dataconnect-sdk/js/default-connector/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@dataconnect/default-connector", - "version": "1.0.0", - "author": "Firebase (https://firebase.google.com/)", - "description": "Generated SDK For default", - "license": "Apache-2.0", - "engines": { - "node": " >=18.0" - }, - "typings": "index.d.ts", - "module": "esm/index.esm.js", - "main": "index.cjs.js", - "browser": "esm/index.esm.js", - "exports": { - ".": { - "types": "./index.d.ts", - "require": "./index.cjs.js", - "default": "./esm/index.esm.js" - }, - "./package.json": "./package.json" - }, - "peerDependencies": { - "firebase": "^10.14.0 || ^11.3.0" - } -} \ No newline at end of file diff --git a/dataconnect/connector/connector.yaml b/dataconnect/connector/connector.yaml deleted file mode 100644 index 425cadd9..00000000 --- a/dataconnect/connector/connector.yaml +++ /dev/null @@ -1,5 +0,0 @@ -connectorId: default -generate: - javascriptSdk: - outputDir: ../../dataconnect-sdk/js/default-connector - package: "@dataconnect/default-connector" diff --git a/dataconnect/connector/mutations.gql b/dataconnect/connector/mutations.gql deleted file mode 100644 index e8ad7ca8..00000000 --- a/dataconnect/connector/mutations.gql +++ /dev/null @@ -1,59 +0,0 @@ -# # Example mutations for a simple movie app - -# Create a movie based on user input -mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!) -@auth(level: PUBLIC) { - movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl }) -} - -# Upsert a movie -mutation UpsertMovie($id: UUID!, $title: String!, $imageUrl: String!) -@auth(level: PUBLIC) { - movie_upsert(data: { id: $id, title: $title, imageUrl: $imageUrl }) -} - -# Delete a movie -mutation DeleteMovie($id: UUID!) @auth(level: PUBLIC) { - movie_delete(id: $id) -} - -mutation AddMeta @auth(level: PUBLIC) { - ref: meta_insert(data: { ref: "" }) -} -mutation DeleteMeta($id: UUID!) @auth(level: PUBLIC) { - ref: meta_delete(id: $id) -} - -# # Upsert (update or insert) a user's username based on their auth.uid -# mutation UpsertUser($username: String!) @auth(level: USER) { -# user_upsert( -# data: { -# id_expr: "auth.uid" -# username: $username -# } -# ) -# } - -# # Add a review for a movie -# mutation AddReview( -# $movieId: UUID! -# $rating: Int! -# $reviewText: String! -# ) @auth(level: USER) { -# review_upsert( -# data: { -# userId_expr: "auth.uid" -# movieId: $movieId -# rating: $rating -# reviewText: $reviewText -# # reviewDate defaults to today in the schema. No need to set it manually. -# } -# ) -# } - -# # Logged in user can delete their review for a movie -# mutation DeleteReview( -# $movieId: UUID! -# ) @auth(level: USER) { -# review_delete(key: { userId_expr: "auth.uid", movieId: $movieId }) -# } diff --git a/dataconnect/connector/queries.gql b/dataconnect/connector/queries.gql deleted file mode 100644 index b542c030..00000000 --- a/dataconnect/connector/queries.gql +++ /dev/null @@ -1,74 +0,0 @@ -# # Example queries for a simple movie app. - -# @auth() directives control who can call each operation. -# Anyone should be able to list all movies, so the auth level is set to PUBLIC -query ListMovies @auth(level: PUBLIC) { - movies { - id - title - imageUrl - genre - } -} - -# Get movie by id -query GetMovieById($id: UUID!) @auth(level: PUBLIC) { - movie(id: $id) { - id - title - imageUrl - genre - } -} - -query GetMeta @auth(level: PUBLIC) { - ref: metas { - id - } -} - -# # List all users, only admins should be able to list all users, so we use NO_ACCESS -# query ListUsers @auth(level: NO_ACCESS) { -# users { id, username } -# } - -# # Logged in user can list all their reviews and movie titles associated with the review -# # Since the query requires the uid of the current authenticated user, the auth level is set to USER -# query ListUserReviews @auth(level: USER) { -# user(key: {id_expr: "auth.uid"}) { -# id -# username -# # _on_ makes it easy to grab info from another table -# # Here, we use it to grab all the reviews written by the user. -# reviews: reviews_on_user { -# id -# rating -# reviewDate -# reviewText -# movie { -# id -# title -# } -# } -# } -# } - -# # Search for movies, actors, and reviews -# query SearchMovie( -# $titleInput: String -# $genre: String -# ) @auth(level: PUBLIC) { -# movies( -# where: { -# _and: [ -# { genre: { eq: $genre } } -# { title: { contains: $titleInput } } -# ] -# } -# ) { -# id -# title -# genre -# imageUrl -# } -# } diff --git a/dataconnect/dataconnect.yaml b/dataconnect/dataconnect.yaml index c9cd4cab..ba3e9f6e 100644 --- a/dataconnect/dataconnect.yaml +++ b/dataconnect/dataconnect.yaml @@ -9,4 +9,4 @@ schema: cloudSql: instanceId: "tanstack-query-firebase-fdc" # schemaValidation: "COMPATIBLE" -connectorDirs: ["./connector", "./connector-v11", "./connector-v12"] +connectorDirs: ["./connector-v11", "./connector-v12"] diff --git a/docs/react/data-connect/mutations.mdx b/docs/react/data-connect/mutations.mdx index 894eadeb..cafa2557 100644 --- a/docs/react/data-connect/mutations.mdx +++ b/docs/react/data-connect/mutations.mdx @@ -9,7 +9,7 @@ To mutate data in Firebase Data Connect, you can use the `useDataConnectMutation ```tsx import { useDataConnectMutation } from "@tanstack-query-firebase/react/data-connect"; -import { createMovieRef } from "@dataconnect/default-connector"; +import { createMovieRef } from "@dataconnect/your-connector"; function Component() { const createMovie = useDataConnectMutation( diff --git a/docs/react/data-connect/querying.mdx b/docs/react/data-connect/querying.mdx index 6f9faa55..cbfcee5a 100644 --- a/docs/react/data-connect/querying.mdx +++ b/docs/react/data-connect/querying.mdx @@ -9,7 +9,7 @@ To query data from Firebase Data Connect, you can use the `useDataConnectQuery` ```tsx import { useDataConnectQuery } from "@tanstack-query-firebase/react/data-connect"; -import { listMoviesRef } from "@dataconnect/default-connector"; +import { listMoviesRef } from "@dataconnect/your-connector"; function Component() { const { data, isPending, isSuccess, isError, error } = useDataConnectQuery( diff --git a/docs/react/data-connect/server-side-rendering.mdx b/docs/react/data-connect/server-side-rendering.mdx index 56fb24cf..340b31c2 100644 --- a/docs/react/data-connect/server-side-rendering.mdx +++ b/docs/react/data-connect/server-side-rendering.mdx @@ -18,7 +18,7 @@ The following example demonstrates how to do this with the `DataConnectQueryClie ```tsx import type { InferGetStaticPropsType } from "next"; import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; -import { listMoviesRef } from "@dataconnect/default-connector"; +import { listMoviesRef } from "@dataconnect/your-connector"; import { DataConnectQueryClient } from "@tanstack-query-firebase/react/data-connect"; export async function getStaticProps() { @@ -74,7 +74,7 @@ If you are oping into using React Server Components, you can similarly use the ` ```tsx import { Movies } from "@/examples/data-connect"; -import { listMoviesRef } from "@dataconnect/default-connector"; +import { listMoviesRef } from "@dataconnect/your-connector"; import { DataConnectQueryClient } from "@tanstack-query-firebase/react/data-connect"; import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; diff --git a/examples/react-example/package.json b/examples/react-example/package.json index 15d3b128..936b727b 100644 --- a/examples/react-example/package.json +++ b/examples/react-example/package.json @@ -11,8 +11,8 @@ "dependencies": { "@tanstack/react-query": "^5.55.4", "@tanstack-query-firebase/react": "link:../../packages/react/dist", - "@dataconnect/default-connector": "link:../../dataconnect-sdk/js/default-connector", - "firebase": "^11.3.0", + "@dataconnect/default-connector-v12": "link:../../dataconnect-sdk/js/default-connector-v12", + "firebase": "^12.0.0", "next": "15.1.0", "react": "^19.0.0", "react-dom": "^19.0.0" diff --git a/examples/react-example/src/app/rsc/data-connect/page.tsx b/examples/react-example/src/app/rsc/data-connect/page.tsx index 7deff6cc..ad502a75 100644 --- a/examples/react-example/src/app/rsc/data-connect/page.tsx +++ b/examples/react-example/src/app/rsc/data-connect/page.tsx @@ -1,4 +1,4 @@ -import { listMoviesRef } from "@dataconnect/default-connector"; +import { listMoviesRef } from "@dataconnect/default-connector-v12"; import { dehydrate, HydrationBoundary, diff --git a/examples/react-example/src/examples/data-connect.tsx b/examples/react-example/src/examples/data-connect.tsx index 3fd0cb9c..42b2a903 100644 --- a/examples/react-example/src/examples/data-connect.tsx +++ b/examples/react-example/src/examples/data-connect.tsx @@ -1,6 +1,9 @@ "use client"; -import { createMovieRef, listMoviesRef } from "@dataconnect/default-connector"; +import { + createMovieRef, + listMoviesRef, +} from "@dataconnect/default-connector-v12"; import { useDataConnectMutation, useDataConnectQuery, diff --git a/examples/react-example/src/firebase.ts b/examples/react-example/src/firebase.ts index bb37a844..9df7be85 100644 --- a/examples/react-example/src/firebase.ts +++ b/examples/react-example/src/firebase.ts @@ -1,4 +1,4 @@ -import { connectorConfig } from "@dataconnect/default-connector"; +import { connectorConfig } from "@dataconnect/default-connector-v12"; import { getApps, initializeApp } from "firebase/app"; import { connectDataConnectEmulator, diff --git a/examples/react-example/src/pages/ssr/data-connect.tsx b/examples/react-example/src/pages/ssr/data-connect.tsx index bd656eb0..21587aa1 100644 --- a/examples/react-example/src/pages/ssr/data-connect.tsx +++ b/examples/react-example/src/pages/ssr/data-connect.tsx @@ -1,4 +1,4 @@ -import { listMoviesRef } from "@dataconnect/default-connector"; +import { listMoviesRef } from "@dataconnect/default-connector-v12"; import { dehydrate, HydrationBoundary } from "@tanstack/react-query"; import { DataConnectQueryClient } from "@tanstack-query-firebase/react/data-connect"; import type { InferGetStaticPropsType } from "next"; diff --git a/packages/react/package.json b/packages/react/package.json index 93a7c4c0..1f6f1947 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -38,7 +38,6 @@ }, "license": "Apache-2.0", "devDependencies": { - "@dataconnect/default-connector": "workspace:*", "@dataconnect/default-connector-v11": "workspace:*", "@dataconnect/default-connector-v12": "workspace:*", "@testing-library/react": "^16.0.1", diff --git a/packages/react/vitest.config.ts b/packages/react/vitest.config.ts index b73b049c..4b107ba1 100644 --- a/packages/react/vitest.config.ts +++ b/packages/react/vitest.config.ts @@ -11,7 +11,7 @@ export default defineConfig({ "~/testing-utils": path.resolve(__dirname, "./vitest/utils"), "@/dataconnect/default-connector": path.resolve( __dirname, - "../../dataconnect-sdk/js/default-connector", + "../../dataconnect-sdk/js/default-connector-v11", ), }, }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b9f53909..64f37cfb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,9 +84,9 @@ importers: examples/react-example: dependencies: - '@dataconnect/default-connector': - specifier: link:../../dataconnect-sdk/js/default-connector - version: link:../../dataconnect-sdk/js/default-connector + '@dataconnect/default-connector-v12': + specifier: link:../../dataconnect-sdk/js/default-connector-v12 + version: link:../../dataconnect-sdk/js/default-connector-v12 '@tanstack-query-firebase/react': specifier: link:../../packages/react/dist version: link:../../packages/react/dist @@ -94,8 +94,8 @@ importers: specifier: ^5.55.4 version: 5.66.9(react@19.0.0) firebase: - specifier: ^11.3.0 - version: 11.3.1 + specifier: ^12.0.0 + version: 12.0.0 next: specifier: 15.1.0 version: 15.1.0(@babel/core@7.26.9)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -183,9 +183,6 @@ importers: specifier: ^11.3.0 || ^12.0.0 version: 11.3.1 devDependencies: - '@dataconnect/default-connector': - specifier: workspace:* - version: link:../../dataconnect-sdk/js/default-connector '@dataconnect/default-connector-v11': specifier: workspace:* version: link:../../dataconnect-sdk/js/default-connector-v11 @@ -810,11 +807,23 @@ packages: resolution: {integrity: sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@firebase/ai@2.0.0': + resolution: {integrity: sha512-N/aSHjqOpU+KkYU3piMkbcuxzvqsOvxflLUXBAkYAPAz8wjE2Ye3BQDgKHEYuhMmEWqj6LFgEBUN8wwc6dfMTw==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@firebase/app-types': 0.x + '@firebase/analytics-compat@0.2.17': resolution: {integrity: sha512-SJNVOeTvzdqZQvXFzj7yAirXnYcLDxh57wBFROfeowq/kRN1AqOw1tG6U4OiFOEhqi7s3xLze/LMkZatk2IEww==} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/analytics-compat@0.2.24': + resolution: {integrity: sha512-jE+kJnPG86XSqGQGhXXYt1tpTbCTED8OQJ/PQ90SEw14CuxRxx/H+lFbWA1rlFtFSsTCptAJtgyRBwr/f00vsw==} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/analytics-types@0.8.3': resolution: {integrity: sha512-VrIp/d8iq2g501qO46uGz3hjbDb8xzYMrbu8Tp0ovzIzrvJZ2fvmj649gTjge/b7cCCcjT0H37g1gVtlNhnkbg==} @@ -823,18 +832,35 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/analytics@0.10.18': + resolution: {integrity: sha512-iN7IgLvM06iFk8BeFoWqvVpRFW3Z70f+Qe2PfCJ7vPIgLPjHXDE774DhCT5Y2/ZU/ZbXPDPD60x/XPWEoZLNdg==} + peerDependencies: + '@firebase/app': 0.x + '@firebase/app-check-compat@0.3.18': resolution: {integrity: sha512-qjozwnwYmAIdrsVGrJk+hnF1WBois54IhZR6gO0wtZQoTvWL/GtiA2F31TIgAhF0ayUiZhztOv1RfC7YyrZGDQ==} engines: {node: '>=18.0.0'} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/app-check-compat@0.4.0': + resolution: {integrity: sha512-UfK2Q8RJNjYM/8MFORltZRG9lJj11k0nW84rrffiKvcJxLf1jf6IEjCIkCamykHE73C6BwqhVfhIBs69GXQV0g==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/app-check-interop-types@0.3.3': resolution: {integrity: sha512-gAlxfPLT2j8bTI/qfe3ahl2I2YcBQ8cFIBdhAQA4I2f3TndcO+22YizyGYuttLHPQEpWkhmpFW60VCFEPg4g5A==} '@firebase/app-check-types@0.5.3': resolution: {integrity: sha512-hyl5rKSj0QmwPdsAxrI5x1otDlByQ7bvNvVt8G/XPO2CSwE++rmSVf3VEhaeOR4J8ZFaF0Z0NDSmLejPweZ3ng==} + '@firebase/app-check@0.11.0': + resolution: {integrity: sha512-XAvALQayUMBJo58U/rxW02IhsesaxxfWVmVkauZvGEz3vOAjMEQnzFlyblqkc2iAaO82uJ2ZVyZv9XzPfxjJ6w==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@firebase/app-check@0.8.11': resolution: {integrity: sha512-42zIfRI08/7bQqczAy7sY2JqZYEv3a1eNa4fLFdtJ54vNevbBIRSEA3fZgRqWFNHalh5ohsBXdrYgFqaRIuCcQ==} engines: {node: '>=18.0.0'} @@ -845,6 +871,10 @@ packages: resolution: {integrity: sha512-7yD362icKgjoNvFxwth420TNZgqCfuTJ28yQCdpyjC2fXyaZHhAbxVKnHEXGTAaUKSHWxsIy46lBKGi/x/Mflw==} engines: {node: '>=18.0.0'} + '@firebase/app-compat@0.5.0': + resolution: {integrity: sha512-nUnNpOeRj0KZzVzHsyuyrmZKKHfykZ8mn40FtG28DeSTWeM5b/2P242Va4bmQpJsy5y32vfv50+jvdckrpzy7Q==} + engines: {node: '>=20.0.0'} + '@firebase/app-types@0.9.3': resolution: {integrity: sha512-kRVpIl4vVGJ4baogMDINbyrIOtOxqhkZQg4jTq3l8Lw6WSk0xfpEYzezFu+Kl4ve4fbPl79dvwRtaFqAC/ucCw==} @@ -852,12 +882,22 @@ packages: resolution: {integrity: sha512-Vz4DrNLPfDx3RwQf+4klXtu7OUYDO6xz2hlRyFawWskS7YqdtNzkDDxrqH20KDfjCF1lib46/NgchIj1+8h4wQ==} engines: {node: '>=18.0.0'} + '@firebase/app@0.14.0': + resolution: {integrity: sha512-APIAeKvRNFWKJLjIL8wLDjh7u8g6ZjaeVmItyqSjCdEkJj14UuVlus74D8ofsOMWh45HEwxwkd96GYbi+CImEg==} + engines: {node: '>=20.0.0'} + '@firebase/auth-compat@0.5.18': resolution: {integrity: sha512-dFBev8AMNb2AgIt9afwf/Ku4/0Wq9R9OFSeBB/xjyJt+RfQ9PnNWqU2oFphews23byLg6jle8twRA7iOYfRGRw==} engines: {node: '>=18.0.0'} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/auth-compat@0.6.0': + resolution: {integrity: sha512-J0lGSxXlG/lYVi45wbpPhcWiWUMXevY4fvLZsN1GHh+po7TZVng+figdHBVhFheaiipU8HZyc7ljw1jNojM2nw==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/auth-interop-types@0.2.4': resolution: {integrity: sha512-JPgcXKCuO+CWqGDnigBtvo09HeBs5u/Ktc2GaFj2m01hLarbxthLNm7Fk8iOP1aqAtXV+fnnGj7U28xmk7IwVA==} @@ -867,6 +907,16 @@ packages: '@firebase/app-types': 0.x '@firebase/util': 1.x + '@firebase/auth@1.11.0': + resolution: {integrity: sha512-5j7+ua93X+IRcJ1oMDTClTo85l7Xe40WSkoJ+shzPrX7OISlVWLdE1mKC57PSD+/LfAbdhJmvKixINBw2ESK6w==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@react-native-async-storage/async-storage': ^1.18.1 + peerDependenciesMeta: + '@react-native-async-storage/async-storage': + optional: true + '@firebase/auth@1.9.0': resolution: {integrity: sha512-Xz2mbEYauF689qXG/4HppS2+/yGo9R7B6eNUBh3H2+XpAZTGdx8d8TFsW/BMTAK9Q95NB0pb1Bbvfx0lwofq8Q==} engines: {node: '>=18.0.0'} @@ -881,15 +931,31 @@ packages: resolution: {integrity: sha512-YnxqjtohLbnb7raXt2YuA44cC1wA9GiehM/cmxrsoxKlFxBLy2V0OkRSj9gpngAE0UoJ421Wlav9ycO7lTPAUw==} engines: {node: '>=18.0.0'} + '@firebase/component@0.7.0': + resolution: {integrity: sha512-wR9En2A+WESUHexjmRHkqtaVH94WLNKt6rmeqZhSLBybg4Wyf0Umk04SZsS6sBq4102ZsDBFwoqMqJYj2IoDSg==} + engines: {node: '>=20.0.0'} + '@firebase/data-connect@0.3.0': resolution: {integrity: sha512-inbLq0JyQD/d02Al3Lso0Hc8z1BVpB3dYSMFcQkeKhYyjn5bspLczLdasPbCOEUp8MOkLblLZhJuRs7Q/spFnw==} peerDependencies: '@firebase/app': 0.x + '@firebase/data-connect@0.3.11': + resolution: {integrity: sha512-G258eLzAD6im9Bsw+Qm1Z+P4x0PGNQ45yeUuuqe5M9B1rn0RJvvsQCRHXgE52Z+n9+WX1OJd/crcuunvOGc7Vw==} + peerDependencies: + '@firebase/app': 0.x + '@firebase/database-compat@2.0.3': resolution: {integrity: sha512-uHGQrSUeJvsDfA+IyHW5O4vdRPsCksEzv4T4Jins+bmQgYy20ZESU4x01xrQCn/nzqKHuQMEW99CoCO7D+5NiQ==} engines: {node: '>=18.0.0'} + '@firebase/database-compat@2.1.0': + resolution: {integrity: sha512-8nYc43RqxScsePVd1qe1xxvWNf0OBnbwHxmXJ7MHSuuTVYFO3eLyLW3PiCKJ9fHnmIz4p4LbieXwz+qtr9PZDg==} + engines: {node: '>=20.0.0'} + + '@firebase/database-types@1.0.16': + resolution: {integrity: sha512-xkQLQfU5De7+SPhEGAXFBnDryUWhhlFXelEg2YeZOQMCdoe7dL64DDAd77SQsR+6uoXIZY5MB4y/inCs4GTfcw==} + '@firebase/database-types@1.0.8': resolution: {integrity: sha512-6lPWIGeufhUq1heofZULyVvWFhD01TUrkkB9vyhmksjZ4XF7NaivQp9rICMk7QNhqwa+uDCaj4j+Q8qqcSVZ9g==} @@ -897,12 +963,22 @@ packages: resolution: {integrity: sha512-psFl5t6rSFHq3i3fnU1QQlc4BB9Hnhh8TgEqvQlPPm8kDLw8gYxvjqYw3c5CZW0+zKR837nwT6im/wtJUivMKw==} engines: {node: '>=18.0.0'} + '@firebase/database@1.1.0': + resolution: {integrity: sha512-gM6MJFae3pTyNLoc9VcJNuaUDej0ctdjn3cVtILo3D5lpp0dmUHHLFN/pUKe7ImyeB1KAvRlEYxvIHNF04Filg==} + engines: {node: '>=20.0.0'} + '@firebase/firestore-compat@0.3.43': resolution: {integrity: sha512-zxg7YS07XQnTetGs3GADM/eA6HB4vWUp+Av4iugmTbft0fQxuTSnGm7ifctaYuR7VMTPckU9CW+oFC9QUNSYvg==} engines: {node: '>=18.0.0'} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/firestore-compat@0.4.0': + resolution: {integrity: sha512-4O7v4VFeSEwAZtLjsaj33YrMHMRjplOIYC2CiYsF6o/MboOhrhe01VrTt8iY9Y5EwjRHuRz4pS6jMBT8LfQYJA==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/firestore-types@3.0.3': resolution: {integrity: sha512-hD2jGdiWRxB/eZWF89xcK9gF8wvENDJkzpVFb4aGkzfEaKxVRD1kjz1t1Wj8VZEp2LCB53Yx1zD8mrhQu87R6Q==} peerDependencies: @@ -915,12 +991,24 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/firestore@4.9.0': + resolution: {integrity: sha512-5zl0+/h1GvlCSLt06RMwqFsd7uqRtnNZt4sW99k2rKRd6k/ECObIWlEnvthm2cuOSnUmwZknFqtmd1qyYSLUuQ==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@firebase/functions-compat@0.3.19': resolution: {integrity: sha512-uw4tR8NcJCDu86UD63Za8A8SgFgmAVFb1XsGlkuBY7gpLyZWEFavWnwRkZ/8cUwpqUhp/SptXFZ1WFJSnOokLw==} engines: {node: '>=18.0.0'} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/functions-compat@0.4.0': + resolution: {integrity: sha512-VPgtvoGFywWbQqtvgJnVWIDFSHV1WE6Hmyi5EGI+P+56EskiGkmnw6lEqc/MEUfGpPGdvmc4I9XMU81uj766/g==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/functions-types@0.6.3': resolution: {integrity: sha512-EZoDKQLUHFKNx6VLipQwrSMh01A1SaL3Wg6Hpi//x6/fJ6Ee4hrAeswK99I5Ht8roiniKHw4iO0B1Oxj5I4plg==} @@ -930,11 +1018,22 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/functions@0.13.0': + resolution: {integrity: sha512-2/LH5xIbD8aaLOWSFHAwwAybgSzHIM0dB5oVOL0zZnxFG1LctX2bc1NIAaPk1T+Zo9aVkLKUlB5fTXTkVUQprQ==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@firebase/installations-compat@0.2.12': resolution: {integrity: sha512-RhcGknkxmFu92F6Jb3rXxv6a4sytPjJGifRZj8MSURPuv2Xu+/AispCXEfY1ZraobhEHTG5HLGsP6R4l9qB5aA==} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/installations-compat@0.2.19': + resolution: {integrity: sha512-khfzIY3EI5LePePo7vT19/VEIH1E3iYsHknI/6ek9T8QCozAZshWT9CjlwOzZrKvTHMeNcbpo/VSOSIWDSjWdQ==} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/installations-types@0.5.3': resolution: {integrity: sha512-2FJI7gkLqIE0iYsNQ1P751lO3hER+Umykel+TkLwHj6plzWVxqvfclPUZhcKFVQObqloEBTmpi2Ozn7EkCABAA==} peerDependencies: @@ -945,15 +1044,29 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/installations@0.6.19': + resolution: {integrity: sha512-nGDmiwKLI1lerhwfwSHvMR9RZuIH5/8E3kgUWnVRqqL7kGVSktjLTWEMva7oh5yxQ3zXfIlIwJwMcaM5bK5j8Q==} + peerDependencies: + '@firebase/app': 0.x + '@firebase/logger@0.4.4': resolution: {integrity: sha512-mH0PEh1zoXGnaR8gD1DeGeNZtWFKbnz9hDO91dIml3iou1gpOnLqXQ2dJfB71dj6dpmUjcQ6phY3ZZJbjErr9g==} engines: {node: '>=18.0.0'} + '@firebase/logger@0.5.0': + resolution: {integrity: sha512-cGskaAvkrnh42b3BA3doDWeBmuHFO/Mx5A83rbRDYakPjO9bJtRL3dX7javzc2Rr/JHZf4HlterTW2lUkfeN4g==} + engines: {node: '>=20.0.0'} + '@firebase/messaging-compat@0.2.16': resolution: {integrity: sha512-9HZZ88Ig3zQ0ok/Pwt4gQcNsOhoEy8hDHoGsV1am6ulgMuGuDVD2gl11Lere2ksL+msM12Lddi2x/7TCqmODZw==} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/messaging-compat@0.2.23': + resolution: {integrity: sha512-SN857v/kBUvlQ9X/UjAqBoQ2FEaL1ZozpnmL1ByTe57iXkmnVVFm9KqAsTfmf+OEwWI4kJJe9NObtN/w22lUgg==} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/messaging-interop-types@0.2.3': resolution: {integrity: sha512-xfzFaJpzcmtDjycpDeCUj0Ge10ATFi/VHVIvEEjDNc3hodVBQADZ7BWQU7CuFpjSHE+eLuBI13z5F/9xOoGX8Q==} @@ -962,11 +1075,21 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/messaging@0.12.23': + resolution: {integrity: sha512-cfuzv47XxqW4HH/OcR5rM+AlQd1xL/VhuaeW/wzMW1LFrsFcTn0GND/hak1vkQc2th8UisBcrkVcQAnOnKwYxg==} + peerDependencies: + '@firebase/app': 0.x + '@firebase/performance-compat@0.2.13': resolution: {integrity: sha512-pB0SMQj2TLQ6roDcX0YQDWvUnVgsVOl0VnUvyT/VBdCUuQYDHobZsPEuQsoEqmPA44KS/Gl0oyKqf+I8UPtRgw==} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/performance-compat@0.2.21': + resolution: {integrity: sha512-OQfYRsIQiEf9ez1SOMLb5TRevBHNIyA2x1GI1H10lZ432W96AK5r4LTM+SNApg84dxOuHt6RWSQWY7TPWffKXg==} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/performance-types@0.2.3': resolution: {integrity: sha512-IgkyTz6QZVPAq8GSkLYJvwSLr3LS9+V6vNPQr0x4YozZJiLF5jYixj0amDtATf1X0EtYHqoPO48a9ija8GocxQ==} @@ -975,11 +1098,21 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/performance@0.7.8': + resolution: {integrity: sha512-k6xfNM/CdTl4RaV4gT/lH53NU+wP33JiN0pUeNBzGVNvfXZ3HbCkoISE3M/XaiOwHgded1l6XfLHa4zHgm0Wyg==} + peerDependencies: + '@firebase/app': 0.x + '@firebase/remote-config-compat@0.2.12': resolution: {integrity: sha512-91jLWPtubIuPBngg9SzwvNCWzhMLcyBccmt7TNZP+y1cuYFNOWWHKUXQ3IrxCLB7WwLqQaEu7fTDAjHsTyBsSw==} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/remote-config-compat@0.2.19': + resolution: {integrity: sha512-y7PZAb0l5+5oIgLJr88TNSelxuASGlXyAKj+3pUc4fDuRIdPNBoONMHaIUa9rlffBR5dErmaD2wUBJ7Z1a513Q==} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/remote-config-types@0.4.0': resolution: {integrity: sha512-7p3mRE/ldCNYt8fmWMQ/MSGRmXYlJ15Rvs9Rk17t8p0WwZDbeK7eRmoI1tvCPaDzn9Oqh+yD6Lw+sGLsLg4kKg==} @@ -988,12 +1121,23 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/remote-config@0.6.6': + resolution: {integrity: sha512-Yelp5xd8hM4NO1G1SuWrIk4h5K42mNwC98eWZ9YLVu6Z0S6hFk1mxotAdCRmH2luH8FASlYgLLq6OQLZ4nbnCA==} + peerDependencies: + '@firebase/app': 0.x + '@firebase/storage-compat@0.3.16': resolution: {integrity: sha512-EeMuok/s0r938lEomia8XILEqSYULm7HcYZ/GTZLDWur0kMf2ktuPVZiTdRiwEV3Iki7FtQO5txrQ/0pLRVLAw==} engines: {node: '>=18.0.0'} peerDependencies: '@firebase/app-compat': 0.x + '@firebase/storage-compat@0.4.0': + resolution: {integrity: sha512-vDzhgGczr1OfcOy285YAPur5pWDEvD67w4thyeCUh6Ys0izN9fNYtA1MJERmNBfqjqu0lg0FM5GLbw0Il21M+g==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app-compat': 0.x + '@firebase/storage-types@0.8.3': resolution: {integrity: sha512-+Muk7g9uwngTpd8xn9OdF/D48uiQ7I1Fae7ULsWPuKoCH3HU7bfFPhxtJYzyhjdniowhuDpQcfPmuNRAqZEfvg==} peerDependencies: @@ -1006,10 +1150,20 @@ packages: peerDependencies: '@firebase/app': 0.x + '@firebase/storage@0.14.0': + resolution: {integrity: sha512-xWWbb15o6/pWEw8H01UQ1dC5U3rf8QTAzOChYyCpafV6Xki7KVp3Yaw2nSklUwHEziSWE9KoZJS7iYeyqWnYFA==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@firebase/app': 0.x + '@firebase/util@1.10.3': resolution: {integrity: sha512-wfoF5LTy0m2ufUapV0ZnpcGQvuavTbJ5Qr1Ze9OJGL70cSMvhDyjS4w2121XdA3lGZSTOsDOyGhpoDtYwck85A==} engines: {node: '>=18.0.0'} + '@firebase/util@1.13.0': + resolution: {integrity: sha512-0AZUyYUfpMNcztR5l09izHwXkZpghLgCUaAGjtMwXnCg3bj4ml5VgiwqOMOxJ+Nw4qN/zJAaOQBcJ7KGkWStqQ==} + engines: {node: '>=20.0.0'} + '@firebase/vertexai@1.0.4': resolution: {integrity: sha512-Nkf/r4u166b4Id6zrrW0Qtg1KyZpQvvYchtkebamnHtIfY+Qnt51I/sx4Saos/WrmO8SnrSU850LfmJ7pehYXg==} engines: {node: '>=18.0.0'} @@ -1020,6 +1174,9 @@ packages: '@firebase/webchannel-wrapper@1.0.3': resolution: {integrity: sha512-2xCRM9q9FlzGZCdgDMJwc0gyUkWFtkosy7Xxr6sFgQwn+wMNIWd7xIvYNauU1r64B5L5rsGKy/n9TKJ0aAFeqQ==} + '@firebase/webchannel-wrapper@1.0.4': + resolution: {integrity: sha512-6m8+P+dE/RPl4OPzjTxcTbQ0rGeRyeTvAi9KwIffBVCiAMKrfXfLZaqD1F+m8t4B5/Q5aHsMozOgirkH1F5oMQ==} + '@grpc/grpc-js@1.9.15': resolution: {integrity: sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==} engines: {node: ^8.13.0 || >=10.10.0} @@ -2211,6 +2368,9 @@ packages: firebase@11.3.1: resolution: {integrity: sha512-P4YVFM0Bm2d8aO61SCEMF8E1pYgieGLrmr/LFw7vs6sAMebwuwHt+Wug+1qL2fhAHWPwpWbCLsdJH8NQ+4Sw8Q==} + firebase@12.0.0: + resolution: {integrity: sha512-KV+OrMJpi2uXlqL2zaCcXb7YuQbY/gMIWT1hf8hKeTW1bSumWaHT5qfmn0WTpHwKQa3QEVOtZR2ta9EchcmYuw==} + flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -4234,6 +4394,16 @@ snapshots: '@eslint/core': 0.12.0 levn: 0.4.1 + '@firebase/ai@2.0.0(@firebase/app-types@0.9.3)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/app-check-interop-types': 0.3.3 + '@firebase/app-types': 0.9.3 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/analytics-compat@0.2.17(@firebase/app-compat@0.2.50)(@firebase/app@0.11.1)': dependencies: '@firebase/analytics': 0.10.11(@firebase/app@0.11.1) @@ -4245,6 +4415,17 @@ snapshots: transitivePeerDependencies: - '@firebase/app' + '@firebase/analytics-compat@0.2.24(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0)': + dependencies: + '@firebase/analytics': 0.10.18(@firebase/app@0.14.0) + '@firebase/analytics-types': 0.8.3 + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + '@firebase/analytics-types@0.8.3': {} '@firebase/analytics@0.10.11(@firebase/app@0.11.1)': @@ -4256,6 +4437,15 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/analytics@0.10.18(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.0) + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/app-check-compat@0.3.18(@firebase/app-compat@0.2.50)(@firebase/app@0.11.1)': dependencies: '@firebase/app-check': 0.8.11(@firebase/app@0.11.1) @@ -4268,10 +4458,30 @@ snapshots: transitivePeerDependencies: - '@firebase/app' + '@firebase/app-check-compat@0.4.0(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-check': 0.11.0(@firebase/app@0.14.0) + '@firebase/app-check-types': 0.5.3 + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + '@firebase/app-check-interop-types@0.3.3': {} '@firebase/app-check-types@0.5.3': {} + '@firebase/app-check@0.11.0(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/app-check@0.8.11(@firebase/app@0.11.1)': dependencies: '@firebase/app': 0.11.1 @@ -4288,6 +4498,14 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/app-compat@0.5.0': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/app-types@0.9.3': {} '@firebase/app@0.11.1': @@ -4298,6 +4516,14 @@ snapshots: idb: 7.1.1 tslib: 2.8.1 + '@firebase/app@0.14.0': + dependencies: + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + idb: 7.1.1 + tslib: 2.8.1 + '@firebase/auth-compat@0.5.18(@firebase/app-compat@0.2.50)(@firebase/app-types@0.9.3)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4311,6 +4537,19 @@ snapshots: - '@firebase/app-types' - '@react-native-async-storage/async-storage' + '@firebase/auth-compat@0.6.0(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/auth': 1.11.0(@firebase/app@0.14.0) + '@firebase/auth-types': 0.13.0(@firebase/app-types@0.9.3)(@firebase/util@1.13.0) + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' + - '@react-native-async-storage/async-storage' + '@firebase/auth-interop-types@0.2.4': {} '@firebase/auth-types@0.13.0(@firebase/app-types@0.9.3)(@firebase/util@1.10.3)': @@ -4318,6 +4557,19 @@ snapshots: '@firebase/app-types': 0.9.3 '@firebase/util': 1.10.3 + '@firebase/auth-types@0.13.0(@firebase/app-types@0.9.3)(@firebase/util@1.13.0)': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + + '@firebase/auth@1.11.0(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/auth@1.9.0(@firebase/app@0.11.1)': dependencies: '@firebase/app': 0.11.1 @@ -4331,6 +4583,11 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/component@0.7.0': + dependencies: + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/data-connect@0.3.0(@firebase/app@0.11.1)': dependencies: '@firebase/app': 0.11.1 @@ -4340,6 +4597,15 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/data-connect@0.3.11(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/auth-interop-types': 0.2.4 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/database-compat@2.0.3': dependencies: '@firebase/component': 0.6.12 @@ -4349,6 +4615,20 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/database-compat@2.1.0': + dependencies: + '@firebase/component': 0.7.0 + '@firebase/database': 1.1.0 + '@firebase/database-types': 1.0.16 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + + '@firebase/database-types@1.0.16': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + '@firebase/database-types@1.0.8': dependencies: '@firebase/app-types': 0.9.3 @@ -4364,6 +4644,16 @@ snapshots: faye-websocket: 0.11.4 tslib: 2.8.1 + '@firebase/database@1.1.0': + dependencies: + '@firebase/app-check-interop-types': 0.3.3 + '@firebase/auth-interop-types': 0.2.4 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + faye-websocket: 0.11.4 + tslib: 2.8.1 + '@firebase/firestore-compat@0.3.43(@firebase/app-compat@0.2.50)(@firebase/app-types@0.9.3)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4376,11 +4666,28 @@ snapshots: - '@firebase/app' - '@firebase/app-types' + '@firebase/firestore-compat@0.4.0(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/firestore': 4.9.0(@firebase/app@0.14.0) + '@firebase/firestore-types': 3.0.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' + '@firebase/firestore-types@3.0.3(@firebase/app-types@0.9.3)(@firebase/util@1.10.3)': dependencies: '@firebase/app-types': 0.9.3 '@firebase/util': 1.10.3 + '@firebase/firestore-types@3.0.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0)': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + '@firebase/firestore@4.7.8(@firebase/app@0.11.1)': dependencies: '@firebase/app': 0.11.1 @@ -4392,6 +4699,17 @@ snapshots: '@grpc/proto-loader': 0.7.13 tslib: 2.8.1 + '@firebase/firestore@4.9.0(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + '@firebase/webchannel-wrapper': 1.0.4 + '@grpc/grpc-js': 1.9.15 + '@grpc/proto-loader': 0.7.13 + tslib: 2.8.1 + '@firebase/functions-compat@0.3.19(@firebase/app-compat@0.2.50)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4403,6 +4721,17 @@ snapshots: transitivePeerDependencies: - '@firebase/app' + '@firebase/functions-compat@0.4.0(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/functions': 0.13.0(@firebase/app@0.14.0) + '@firebase/functions-types': 0.6.3 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + '@firebase/functions-types@0.6.3': {} '@firebase/functions@0.12.2(@firebase/app@0.11.1)': @@ -4415,6 +4744,16 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/functions@0.13.0(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/app-check-interop-types': 0.3.3 + '@firebase/auth-interop-types': 0.2.4 + '@firebase/component': 0.7.0 + '@firebase/messaging-interop-types': 0.2.3 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/installations-compat@0.2.12(@firebase/app-compat@0.2.50)(@firebase/app-types@0.9.3)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4427,6 +4766,18 @@ snapshots: - '@firebase/app' - '@firebase/app-types' + '@firebase/installations-compat@0.2.19(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.0) + '@firebase/installations-types': 0.5.3(@firebase/app-types@0.9.3) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' + '@firebase/installations-types@0.5.3(@firebase/app-types@0.9.3)': dependencies: '@firebase/app-types': 0.9.3 @@ -4439,10 +4790,22 @@ snapshots: idb: 7.1.1 tslib: 2.8.1 + '@firebase/installations@0.6.19(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + idb: 7.1.1 + tslib: 2.8.1 + '@firebase/logger@0.4.4': dependencies: tslib: 2.8.1 + '@firebase/logger@0.5.0': + dependencies: + tslib: 2.8.1 + '@firebase/messaging-compat@0.2.16(@firebase/app-compat@0.2.50)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4453,6 +4816,16 @@ snapshots: transitivePeerDependencies: - '@firebase/app' + '@firebase/messaging-compat@0.2.23(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/messaging': 0.12.23(@firebase/app@0.14.0) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + '@firebase/messaging-interop-types@0.2.3': {} '@firebase/messaging@0.12.16(@firebase/app@0.11.1)': @@ -4465,6 +4838,16 @@ snapshots: idb: 7.1.1 tslib: 2.8.1 + '@firebase/messaging@0.12.23(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.0) + '@firebase/messaging-interop-types': 0.2.3 + '@firebase/util': 1.13.0 + idb: 7.1.1 + tslib: 2.8.1 + '@firebase/performance-compat@0.2.13(@firebase/app-compat@0.2.50)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4477,6 +4860,18 @@ snapshots: transitivePeerDependencies: - '@firebase/app' + '@firebase/performance-compat@0.2.21(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/performance': 0.7.8(@firebase/app@0.14.0) + '@firebase/performance-types': 0.2.3 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + '@firebase/performance-types@0.2.3': {} '@firebase/performance@0.7.0(@firebase/app@0.11.1)': @@ -4489,6 +4884,16 @@ snapshots: tslib: 2.8.1 web-vitals: 4.2.4 + '@firebase/performance@0.7.8(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.0) + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + web-vitals: 4.2.4 + '@firebase/remote-config-compat@0.2.12(@firebase/app-compat@0.2.50)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4501,6 +4906,18 @@ snapshots: transitivePeerDependencies: - '@firebase/app' + '@firebase/remote-config-compat@0.2.19(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/logger': 0.5.0 + '@firebase/remote-config': 0.6.6(@firebase/app@0.14.0) + '@firebase/remote-config-types': 0.4.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + '@firebase/remote-config-types@0.4.0': {} '@firebase/remote-config@0.5.0(@firebase/app@0.11.1)': @@ -4512,6 +4929,15 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/remote-config@0.6.6(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/installations': 0.6.19(@firebase/app@0.14.0) + '@firebase/logger': 0.5.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/storage-compat@0.3.16(@firebase/app-compat@0.2.50)(@firebase/app-types@0.9.3)(@firebase/app@0.11.1)': dependencies: '@firebase/app-compat': 0.2.50 @@ -4524,11 +4950,28 @@ snapshots: - '@firebase/app' - '@firebase/app-types' + '@firebase/storage-compat@0.4.0(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0)': + dependencies: + '@firebase/app-compat': 0.5.0 + '@firebase/component': 0.7.0 + '@firebase/storage': 0.14.0(@firebase/app@0.14.0) + '@firebase/storage-types': 0.8.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0) + '@firebase/util': 1.13.0 + tslib: 2.8.1 + transitivePeerDependencies: + - '@firebase/app' + - '@firebase/app-types' + '@firebase/storage-types@0.8.3(@firebase/app-types@0.9.3)(@firebase/util@1.10.3)': dependencies: '@firebase/app-types': 0.9.3 '@firebase/util': 1.10.3 + '@firebase/storage-types@0.8.3(@firebase/app-types@0.9.3)(@firebase/util@1.13.0)': + dependencies: + '@firebase/app-types': 0.9.3 + '@firebase/util': 1.13.0 + '@firebase/storage@0.13.6(@firebase/app@0.11.1)': dependencies: '@firebase/app': 0.11.1 @@ -4536,10 +4979,21 @@ snapshots: '@firebase/util': 1.10.3 tslib: 2.8.1 + '@firebase/storage@0.14.0(@firebase/app@0.14.0)': + dependencies: + '@firebase/app': 0.14.0 + '@firebase/component': 0.7.0 + '@firebase/util': 1.13.0 + tslib: 2.8.1 + '@firebase/util@1.10.3': dependencies: tslib: 2.8.1 + '@firebase/util@1.13.0': + dependencies: + tslib: 2.8.1 + '@firebase/vertexai@1.0.4(@firebase/app-types@0.9.3)(@firebase/app@0.11.1)': dependencies: '@firebase/app': 0.11.1 @@ -4552,6 +5006,8 @@ snapshots: '@firebase/webchannel-wrapper@1.0.3': {} + '@firebase/webchannel-wrapper@1.0.4': {} + '@grpc/grpc-js@1.9.15': dependencies: '@grpc/proto-loader': 0.7.13 @@ -5628,8 +6084,8 @@ snapshots: '@typescript-eslint/parser': 8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3) eslint: 9.21.0(jiti@1.21.7) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0)(eslint@9.21.0(jiti@1.21.7)) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.3)(eslint@9.21.0(jiti@1.21.7)) + eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.21.0(jiti@1.21.7)) eslint-plugin-react: 7.37.4(eslint@9.21.0(jiti@1.21.7)) eslint-plugin-react-hooks: 5.1.0(eslint@9.21.0(jiti@1.21.7)) @@ -5648,7 +6104,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0)(eslint@9.21.0(jiti@1.21.7)): + eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.0 @@ -5659,22 +6115,22 @@ snapshots: stable-hash: 0.0.4 tinyglobby: 0.2.12 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.3)(eslint@9.21.0(jiti@1.21.7)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)) transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3)(eslint@9.21.0(jiti@1.21.7)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3) eslint: 9.21.0(jiti@1.21.7) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0)(eslint@9.21.0(jiti@1.21.7)) + eslint-import-resolver-typescript: 3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.3)(eslint@9.21.0(jiti@1.21.7)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -5685,7 +6141,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.21.0(jiti@1.21.7) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3)(eslint@9.21.0(jiti@1.21.7)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.8.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.25.0(eslint@9.21.0(jiti@1.21.7))(typescript@5.7.3))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)))(eslint@9.21.0(jiti@1.21.7)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -5919,6 +6375,39 @@ snapshots: transitivePeerDependencies: - '@react-native-async-storage/async-storage' + firebase@12.0.0: + dependencies: + '@firebase/ai': 2.0.0(@firebase/app-types@0.9.3)(@firebase/app@0.14.0) + '@firebase/analytics': 0.10.18(@firebase/app@0.14.0) + '@firebase/analytics-compat': 0.2.24(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0) + '@firebase/app': 0.14.0 + '@firebase/app-check': 0.11.0(@firebase/app@0.14.0) + '@firebase/app-check-compat': 0.4.0(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0) + '@firebase/app-compat': 0.5.0 + '@firebase/app-types': 0.9.3 + '@firebase/auth': 1.11.0(@firebase/app@0.14.0) + '@firebase/auth-compat': 0.6.0(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0) + '@firebase/data-connect': 0.3.11(@firebase/app@0.14.0) + '@firebase/database': 1.1.0 + '@firebase/database-compat': 2.1.0 + '@firebase/firestore': 4.9.0(@firebase/app@0.14.0) + '@firebase/firestore-compat': 0.4.0(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0) + '@firebase/functions': 0.13.0(@firebase/app@0.14.0) + '@firebase/functions-compat': 0.4.0(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0) + '@firebase/installations': 0.6.19(@firebase/app@0.14.0) + '@firebase/installations-compat': 0.2.19(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0) + '@firebase/messaging': 0.12.23(@firebase/app@0.14.0) + '@firebase/messaging-compat': 0.2.23(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0) + '@firebase/performance': 0.7.8(@firebase/app@0.14.0) + '@firebase/performance-compat': 0.2.21(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0) + '@firebase/remote-config': 0.6.6(@firebase/app@0.14.0) + '@firebase/remote-config-compat': 0.2.19(@firebase/app-compat@0.5.0)(@firebase/app@0.14.0) + '@firebase/storage': 0.14.0(@firebase/app@0.14.0) + '@firebase/storage-compat': 0.4.0(@firebase/app-compat@0.5.0)(@firebase/app-types@0.9.3)(@firebase/app@0.14.0) + '@firebase/util': 1.13.0 + transitivePeerDependencies: + - '@react-native-async-storage/async-storage' + flat-cache@4.0.1: dependencies: flatted: 3.3.3