From 19ceece8f217f98965dfe3fff2d36b5a9ce48ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Salazar?= <73718835+joshrs23@users.noreply.github.com> Date: Tue, 25 Nov 2025 17:14:32 -0500 Subject: [PATCH] ignore dataconnect in front and harness-dev deploy schema --- Makefile | 2 +- .../dataconnect-generated/.guides/config.json | 9 - .../dataconnect-generated/.guides/setup.md | 62 - .../dataconnect-generated/.guides/usage.md | 109 - .../src/dataconnect-generated/README.md | 4872 ----------------- .../dataconnect-generated/esm/index.esm.js | 535 -- .../dataconnect-generated/esm/package.json | 1 - .../src/dataconnect-generated/index.cjs.js | 586 -- .../src/dataconnect-generated/index.d.ts | 1288 ----- .../src/dataconnect-generated/package.json | 32 - .../src/dataconnect-generated/react/README.md | 4023 -------------- .../react/esm/index.esm.js | 269 - .../react/esm/package.json | 1 - .../dataconnect-generated/react/index.cjs.js | 269 - .../dataconnect-generated/react/index.d.ts | 120 - .../dataconnect-generated/react/package.json | 17 - .../dataconnect-generated/.guides/config.json | 9 - .../dataconnect-generated/.guides/setup.md | 62 - .../dataconnect-generated/.guides/usage.md | 109 - .../src/dataconnect-generated/README.md | 4872 ----------------- .../dataconnect-generated/esm/index.esm.js | 535 -- .../dataconnect-generated/esm/package.json | 1 - .../src/dataconnect-generated/index.cjs.js | 586 -- .../src/dataconnect-generated/index.d.ts | 1288 ----- .../src/dataconnect-generated/package.json | 32 - .../src/dataconnect-generated/react/README.md | 4023 -------------- .../react/esm/index.esm.js | 269 - .../react/esm/package.json | 1 - .../dataconnect-generated/react/index.cjs.js | 269 - .../dataconnect-generated/react/index.d.ts | 120 - .../dataconnect-generated/react/package.json | 17 - 31 files changed, 1 insertion(+), 24387 deletions(-) delete mode 100644 frontend-web/src/dataconnect-generated/.guides/config.json delete mode 100644 frontend-web/src/dataconnect-generated/.guides/setup.md delete mode 100644 frontend-web/src/dataconnect-generated/.guides/usage.md delete mode 100644 frontend-web/src/dataconnect-generated/README.md delete mode 100644 frontend-web/src/dataconnect-generated/esm/index.esm.js delete mode 100644 frontend-web/src/dataconnect-generated/esm/package.json delete mode 100644 frontend-web/src/dataconnect-generated/index.cjs.js delete mode 100644 frontend-web/src/dataconnect-generated/index.d.ts delete mode 100644 frontend-web/src/dataconnect-generated/package.json delete mode 100644 frontend-web/src/dataconnect-generated/react/README.md delete mode 100644 frontend-web/src/dataconnect-generated/react/esm/index.esm.js delete mode 100644 frontend-web/src/dataconnect-generated/react/esm/package.json delete mode 100644 frontend-web/src/dataconnect-generated/react/index.cjs.js delete mode 100644 frontend-web/src/dataconnect-generated/react/index.d.ts delete mode 100644 frontend-web/src/dataconnect-generated/react/package.json delete mode 100644 internal-api-harness/src/dataconnect-generated/.guides/config.json delete mode 100644 internal-api-harness/src/dataconnect-generated/.guides/setup.md delete mode 100644 internal-api-harness/src/dataconnect-generated/.guides/usage.md delete mode 100644 internal-api-harness/src/dataconnect-generated/README.md delete mode 100644 internal-api-harness/src/dataconnect-generated/esm/index.esm.js delete mode 100644 internal-api-harness/src/dataconnect-generated/esm/package.json delete mode 100644 internal-api-harness/src/dataconnect-generated/index.cjs.js delete mode 100644 internal-api-harness/src/dataconnect-generated/index.d.ts delete mode 100644 internal-api-harness/src/dataconnect-generated/package.json delete mode 100644 internal-api-harness/src/dataconnect-generated/react/README.md delete mode 100644 internal-api-harness/src/dataconnect-generated/react/esm/index.esm.js delete mode 100644 internal-api-harness/src/dataconnect-generated/react/esm/package.json delete mode 100644 internal-api-harness/src/dataconnect-generated/react/index.cjs.js delete mode 100644 internal-api-harness/src/dataconnect-generated/react/index.d.ts delete mode 100644 internal-api-harness/src/dataconnect-generated/react/package.json diff --git a/Makefile b/Makefile index 340e00cf..8910eb11 100644 --- a/Makefile +++ b/Makefile @@ -172,7 +172,7 @@ harness-install: @echo "--> Installing API Test Harness dependencies..." @cd internal-api-harness && npm install -harness-dev: +harness-dev: dataconnect-sync @echo "--> Starting API Test Harness development server on http://localhost:5175 ..." @cd internal-api-harness && npm run dev -- --port 5175 diff --git a/frontend-web/src/dataconnect-generated/.guides/config.json b/frontend-web/src/dataconnect-generated/.guides/config.json deleted file mode 100644 index e37ed06f..00000000 --- a/frontend-web/src/dataconnect-generated/.guides/config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "description": "A set of guides for interacting with the generated firebase dataconnect sdk", - "mcpServers": { - "firebase": { - "command": "npx", - "args": ["-y", "firebase-tools@latest", "experimental:mcp"] - } - } -} diff --git a/frontend-web/src/dataconnect-generated/.guides/setup.md b/frontend-web/src/dataconnect-generated/.guides/setup.md deleted file mode 100644 index 64a49286..00000000 --- a/frontend-web/src/dataconnect-generated/.guides/setup.md +++ /dev/null @@ -1,62 +0,0 @@ -# Setup - -If the user hasn't already installed the SDK, always run the user's node package manager of choice, and install the package in the directory ../package.json. -For more information on where the library is located, look at the connector.yaml file. - -```ts -import { initializeApp } from 'firebase/app'; - -initializeApp({ - // fill in your project config here using the values from your Firebase project or from the `firebase_get_sdk_config` tool from the Firebase MCP server. -}); -``` - -Then, you can run the SDK as needed. -```ts -import { ... } from '@dataconnect/generated'; -``` - - - - -## React -### Setup - -The user should make sure to install the `@tanstack/react-query` package, along with `@tanstack-query-firebase/react` and `firebase`. - -Then, they should initialize Firebase: -```ts -import { initializeApp } from 'firebase/app'; -initializeApp(firebaseConfig); /* your config here. To generate this, you can use the `firebase_sdk_config` MCP tool */ -``` - -Then, they should add a `QueryClientProvider` to their root of their application. - -Here's an example: - -```ts -import { initializeApp } from 'firebase/app'; -import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; - -const firebaseConfig = { - /* your config here. To generate this, you can use the `firebase_sdk_config` MCP tool */ -}; - -// Initialize Firebase -const app = initializeApp(firebaseConfig); - -// Create a TanStack Query client instance -const queryClient = new QueryClient(); - -function App() { - return ( - // Provide the client to your App - - - - ) -} - -render(, document.getElementById('root')); -``` - diff --git a/frontend-web/src/dataconnect-generated/.guides/usage.md b/frontend-web/src/dataconnect-generated/.guides/usage.md deleted file mode 100644 index 76991bc0..00000000 --- a/frontend-web/src/dataconnect-generated/.guides/usage.md +++ /dev/null @@ -1,109 +0,0 @@ -# Basic Usage - -Always prioritize using a supported framework over using the generated SDK -directly. Supported frameworks simplify the developer experience and help ensure -best practices are followed. - - - - -### React -For each operation, there is a wrapper hook that can be used to call the operation. - -Here are all of the hooks that get generated: -```ts -import { useListBusiness, useGetBusinessById, useFilterBusiness, useCreateEvent, useUpdateEvent, useDeleteEvent, useListVendorDefaultSettings, useGetVendorDefaultSettingById, useFilterVendorDefaultSettings, useCreateVendorRate } from '@dataconnect/generated/react'; -// The types of these hooks are available in react/index.d.ts - -const { data, isPending, isSuccess, isError, error } = useListBusiness(); - -const { data, isPending, isSuccess, isError, error } = useGetBusinessById(getBusinessByIdVars); - -const { data, isPending, isSuccess, isError, error } = useFilterBusiness(filterBusinessVars); - -const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars); - -const { data, isPending, isSuccess, isError, error } = useUpdateEvent(updateEventVars); - -const { data, isPending, isSuccess, isError, error } = useDeleteEvent(deleteEventVars); - -const { data, isPending, isSuccess, isError, error } = useListVendorDefaultSettings(); - -const { data, isPending, isSuccess, isError, error } = useGetVendorDefaultSettingById(getVendorDefaultSettingByIdVars); - -const { data, isPending, isSuccess, isError, error } = useFilterVendorDefaultSettings(filterVendorDefaultSettingsVars); - -const { data, isPending, isSuccess, isError, error } = useCreateVendorRate(createVendorRateVars); - -``` - -Here's an example from a different generated SDK: - -```ts -import { useListAllMovies } from '@dataconnect/generated/react'; - -function MyComponent() { - const { isLoading, data, error } = useListAllMovies(); - if(isLoading) { - return
Loading...
- } - if(error) { - return
An Error Occurred: {error}
- } -} - -// App.tsx -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import MyComponent from './my-component'; - -function App() { - const queryClient = new QueryClient(); - return - - -} -``` - - - -## Advanced Usage -If a user is not using a supported framework, they can use the generated SDK directly. - -Here's an example of how to use it with the first 5 operations: - -```js -import { listBusiness, getBusinessById, filterBusiness, createEvent, updateEvent, deleteEvent, listVendorDefaultSettings, getVendorDefaultSettingById, filterVendorDefaultSettings, createVendorRate } from '@dataconnect/generated'; - - -// Operation listBusiness: -const { data } = await ListBusiness(dataConnect); - -// Operation getBusinessById: For variables, look at type GetBusinessByIdVars in ../index.d.ts -const { data } = await GetBusinessById(dataConnect, getBusinessByIdVars); - -// Operation filterBusiness: For variables, look at type FilterBusinessVars in ../index.d.ts -const { data } = await FilterBusiness(dataConnect, filterBusinessVars); - -// Operation CreateEvent: For variables, look at type CreateEventVars in ../index.d.ts -const { data } = await CreateEvent(dataConnect, createEventVars); - -// Operation UpdateEvent: For variables, look at type UpdateEventVars in ../index.d.ts -const { data } = await UpdateEvent(dataConnect, updateEventVars); - -// Operation DeleteEvent: For variables, look at type DeleteEventVars in ../index.d.ts -const { data } = await DeleteEvent(dataConnect, deleteEventVars); - -// Operation listVendorDefaultSettings: -const { data } = await ListVendorDefaultSettings(dataConnect); - -// Operation getVendorDefaultSettingById: For variables, look at type GetVendorDefaultSettingByIdVars in ../index.d.ts -const { data } = await GetVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars); - -// Operation filterVendorDefaultSettings: For variables, look at type FilterVendorDefaultSettingsVars in ../index.d.ts -const { data } = await FilterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars); - -// Operation CreateVendorRate: For variables, look at type CreateVendorRateVars in ../index.d.ts -const { data } = await CreateVendorRate(dataConnect, createVendorRateVars); - - -``` \ No newline at end of file diff --git a/frontend-web/src/dataconnect-generated/README.md b/frontend-web/src/dataconnect-generated/README.md deleted file mode 100644 index 165ef7f8..00000000 --- a/frontend-web/src/dataconnect-generated/README.md +++ /dev/null @@ -1,4872 +0,0 @@ -# Generated TypeScript README -This README will guide you through the process of using the generated JavaScript SDK package for the connector `krow-connector`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. - -**If you're looking for the `React README`, you can find it at [`dataconnect-generated/react/README.md`](./react/README.md)** - -***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) - - [*listBusiness*](#listbusiness) - - [*getBusinessById*](#getbusinessbyid) - - [*filterBusiness*](#filterbusiness) - - [*listVendorDefaultSettings*](#listvendordefaultsettings) - - [*getVendorDefaultSettingById*](#getvendordefaultsettingbyid) - - [*filterVendorDefaultSettings*](#filtervendordefaultsettings) - - [*listVendorRate*](#listvendorrate) - - [*getVendorRateById*](#getvendorratebyid) - - [*filterVendorRates*](#filtervendorrates) - - [*listEvents*](#listevents) - - [*getEventById*](#geteventbyid) - - [*filterEvents*](#filterevents) - - [*listInvoice*](#listinvoice) - - [*getInvoiceById*](#getinvoicebyid) - - [*filterInvoices*](#filterinvoices) - - [*listStaff*](#liststaff) - - [*listVendor*](#listvendor) - - [*getVendorById*](#getvendorbyid) - - [*filterVendors*](#filtervendors) -- [**Mutations**](#mutations) - - [*CreateEvent*](#createevent) - - [*UpdateEvent*](#updateevent) - - [*DeleteEvent*](#deleteevent) - - [*CreateVendorRate*](#createvendorrate) - - [*UpdateVendorRate*](#updatevendorrate) - - [*DeleteVendorRate*](#deletevendorrate) - - [*CreateInvoice*](#createinvoice) - - [*UpdateInvoice*](#updateinvoice) - - [*DeleteInvoice*](#deleteinvoice) - - [*CreateStaff*](#createstaff) - - [*CreateVendor*](#createvendor) - - [*UpdateVendor*](#updatevendor) - - [*DeleteVendor*](#deletevendor) - - [*CreateVendorDefaultSetting*](#createvendordefaultsetting) - - [*UpdateVendorDefaultSetting*](#updatevendordefaultsetting) - - [*DeleteVendorDefaultSetting*](#deletevendordefaultsetting) - - [*CreateBusiness*](#createbusiness) - - [*UpdateBusiness*](#updatebusiness) - - [*DeleteBusiness*](#deletebusiness) - -# 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 `krow-connector`. 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/generated` 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/generated'; - -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/generated'; - -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 `krow-connector` 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). - -## listBusiness -You can execute the `listBusiness` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listBusiness(): QueryPromise; - -interface ListBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listBusinessRef: ListBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listBusiness(dc: DataConnect): QueryPromise; - -interface ListBusinessRef { - ... - (dc: DataConnect): QueryRef; -} -export const listBusinessRef: ListBusinessRef; -``` - -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 listBusinessRef: -```typescript -const name = listBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `listBusiness` query has no variables. -### Return Type -Recall that executing the `listBusiness` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` -### Using `listBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listBusiness } from '@dataconnect/generated'; - - -// Call the `listBusiness()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listBusiness(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listBusiness(dataConnect); - -console.log(data.businesses); - -// Or, you can use the `Promise` API. -listBusiness().then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -### Using `listBusiness`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listBusinessRef } from '@dataconnect/generated'; - - -// Call the `listBusinessRef()` function to get a reference to the query. -const ref = listBusinessRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listBusinessRef(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.businesses); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -## getBusinessById -You can execute the `getBusinessById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getBusinessById(vars: GetBusinessByIdVariables): QueryPromise; - -interface GetBusinessByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetBusinessByIdVariables): QueryRef; -} -export const getBusinessByIdRef: GetBusinessByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables): QueryPromise; - -interface GetBusinessByIdRef { - ... - (dc: DataConnect, vars: GetBusinessByIdVariables): QueryRef; -} -export const getBusinessByIdRef: GetBusinessByIdRef; -``` - -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 getBusinessByIdRef: -```typescript -const name = getBusinessByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getBusinessById` query requires an argument of type `GetBusinessByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetBusinessByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getBusinessById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetBusinessByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetBusinessByIdData { - business?: { - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key; -} -``` -### Using `getBusinessById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getBusinessById, GetBusinessByIdVariables } from '@dataconnect/generated'; - -// The `getBusinessById` query requires an argument of type `GetBusinessByIdVariables`: -const getBusinessByIdVars: GetBusinessByIdVariables = { - id: ..., -}; - -// Call the `getBusinessById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getBusinessById(getBusinessByIdVars); -// Variables can be defined inline as well. -const { data } = await getBusinessById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getBusinessById(dataConnect, getBusinessByIdVars); - -console.log(data.business); - -// Or, you can use the `Promise` API. -getBusinessById(getBusinessByIdVars).then((response) => { - const data = response.data; - console.log(data.business); -}); -``` - -### Using `getBusinessById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getBusinessByIdRef, GetBusinessByIdVariables } from '@dataconnect/generated'; - -// The `getBusinessById` query requires an argument of type `GetBusinessByIdVariables`: -const getBusinessByIdVars: GetBusinessByIdVariables = { - id: ..., -}; - -// Call the `getBusinessByIdRef()` function to get a reference to the query. -const ref = getBusinessByIdRef(getBusinessByIdVars); -// Variables can be defined inline as well. -const ref = getBusinessByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getBusinessByIdRef(dataConnect, getBusinessByIdVars); - -// 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.business); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.business); -}); -``` - -## filterBusiness -You can execute the `filterBusiness` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterBusiness(vars?: FilterBusinessVariables): QueryPromise; - -interface FilterBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterBusinessVariables): QueryRef; -} -export const filterBusinessRef: FilterBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterBusiness(dc: DataConnect, vars?: FilterBusinessVariables): QueryPromise; - -interface FilterBusinessRef { - ... - (dc: DataConnect, vars?: FilterBusinessVariables): QueryRef; -} -export const filterBusinessRef: FilterBusinessRef; -``` - -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 filterBusinessRef: -```typescript -const name = filterBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `filterBusiness` query has an optional argument of type `FilterBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterBusinessVariables { - businessName?: string | null; - contactName?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that executing the `filterBusiness` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` -### Using `filterBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterBusiness, FilterBusinessVariables } from '@dataconnect/generated'; - -// The `filterBusiness` query has an optional argument of type `FilterBusinessVariables`: -const filterBusinessVars: FilterBusinessVariables = { - businessName: ..., // optional - contactName: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `filterBusiness()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterBusiness(filterBusinessVars); -// Variables can be defined inline as well. -const { data } = await filterBusiness({ businessName: ..., contactName: ..., sector: ..., rateGroup: ..., status: ..., }); -// Since all variables are optional for this query, you can omit the `FilterBusinessVariables` argument. -const { data } = await filterBusiness(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterBusiness(dataConnect, filterBusinessVars); - -console.log(data.businesses); - -// Or, you can use the `Promise` API. -filterBusiness(filterBusinessVars).then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -### Using `filterBusiness`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterBusinessRef, FilterBusinessVariables } from '@dataconnect/generated'; - -// The `filterBusiness` query has an optional argument of type `FilterBusinessVariables`: -const filterBusinessVars: FilterBusinessVariables = { - businessName: ..., // optional - contactName: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `filterBusinessRef()` function to get a reference to the query. -const ref = filterBusinessRef(filterBusinessVars); -// Variables can be defined inline as well. -const ref = filterBusinessRef({ businessName: ..., contactName: ..., sector: ..., rateGroup: ..., status: ..., }); -// Since all variables are optional for this query, you can omit the `FilterBusinessVariables` argument. -const ref = filterBusinessRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterBusinessRef(dataConnect, filterBusinessVars); - -// 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.businesses); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -## listVendorDefaultSettings -You can execute the `listVendorDefaultSettings` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listVendorDefaultSettings(): QueryPromise; - -interface ListVendorDefaultSettingsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listVendorDefaultSettingsRef: ListVendorDefaultSettingsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listVendorDefaultSettings(dc: DataConnect): QueryPromise; - -interface ListVendorDefaultSettingsRef { - ... - (dc: DataConnect): QueryRef; -} -export const listVendorDefaultSettingsRef: ListVendorDefaultSettingsRef; -``` - -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 listVendorDefaultSettingsRef: -```typescript -const name = listVendorDefaultSettingsRef.operationName; -console.log(name); -``` - -### Variables -The `listVendorDefaultSettings` query has no variables. -### Return Type -Recall that executing the `listVendorDefaultSettings` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` -### Using `listVendorDefaultSettings`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listVendorDefaultSettings } from '@dataconnect/generated'; - - -// Call the `listVendorDefaultSettings()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listVendorDefaultSettings(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listVendorDefaultSettings(dataConnect); - -console.log(data.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -listVendorDefaultSettings().then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -### Using `listVendorDefaultSettings`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listVendorDefaultSettingsRef } from '@dataconnect/generated'; - - -// Call the `listVendorDefaultSettingsRef()` function to get a reference to the query. -const ref = listVendorDefaultSettingsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listVendorDefaultSettingsRef(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.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -## getVendorDefaultSettingById -You can execute the `getVendorDefaultSettingById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables): QueryPromise; - -interface GetVendorDefaultSettingByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorDefaultSettingByIdVariables): QueryRef; -} -export const getVendorDefaultSettingByIdRef: GetVendorDefaultSettingByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryPromise; - -interface GetVendorDefaultSettingByIdRef { - ... - (dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryRef; -} -export const getVendorDefaultSettingByIdRef: GetVendorDefaultSettingByIdRef; -``` - -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 getVendorDefaultSettingByIdRef: -```typescript -const name = getVendorDefaultSettingByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getVendorDefaultSettingById` query requires an argument of type `GetVendorDefaultSettingByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetVendorDefaultSettingByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getVendorDefaultSettingById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetVendorDefaultSettingByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetVendorDefaultSettingByIdData { - vendorDefaultSetting?: { - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key; -} -``` -### Using `getVendorDefaultSettingById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getVendorDefaultSettingById, GetVendorDefaultSettingByIdVariables } from '@dataconnect/generated'; - -// The `getVendorDefaultSettingById` query requires an argument of type `GetVendorDefaultSettingByIdVariables`: -const getVendorDefaultSettingByIdVars: GetVendorDefaultSettingByIdVariables = { - id: ..., -}; - -// Call the `getVendorDefaultSettingById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getVendorDefaultSettingById(getVendorDefaultSettingByIdVars); -// Variables can be defined inline as well. -const { data } = await getVendorDefaultSettingById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars); - -console.log(data.vendorDefaultSetting); - -// Or, you can use the `Promise` API. -getVendorDefaultSettingById(getVendorDefaultSettingByIdVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting); -}); -``` - -### Using `getVendorDefaultSettingById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getVendorDefaultSettingByIdRef, GetVendorDefaultSettingByIdVariables } from '@dataconnect/generated'; - -// The `getVendorDefaultSettingById` query requires an argument of type `GetVendorDefaultSettingByIdVariables`: -const getVendorDefaultSettingByIdVars: GetVendorDefaultSettingByIdVariables = { - id: ..., -}; - -// Call the `getVendorDefaultSettingByIdRef()` function to get a reference to the query. -const ref = getVendorDefaultSettingByIdRef(getVendorDefaultSettingByIdVars); -// Variables can be defined inline as well. -const ref = getVendorDefaultSettingByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getVendorDefaultSettingByIdRef(dataConnect, getVendorDefaultSettingByIdVars); - -// 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.vendorDefaultSetting); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting); -}); -``` - -## filterVendorDefaultSettings -You can execute the `filterVendorDefaultSettings` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables): QueryPromise; - -interface FilterVendorDefaultSettingsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorDefaultSettingsVariables): QueryRef; -} -export const filterVendorDefaultSettingsRef: FilterVendorDefaultSettingsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryPromise; - -interface FilterVendorDefaultSettingsRef { - ... - (dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryRef; -} -export const filterVendorDefaultSettingsRef: FilterVendorDefaultSettingsRef; -``` - -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 filterVendorDefaultSettingsRef: -```typescript -const name = filterVendorDefaultSettingsRef.operationName; -console.log(name); -``` - -### Variables -The `filterVendorDefaultSettings` query has an optional argument of type `FilterVendorDefaultSettingsVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterVendorDefaultSettingsVariables { - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that executing the `filterVendorDefaultSettings` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` -### Using `filterVendorDefaultSettings`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterVendorDefaultSettings, FilterVendorDefaultSettingsVariables } from '@dataconnect/generated'; - -// The `filterVendorDefaultSettings` query has an optional argument of type `FilterVendorDefaultSettingsVariables`: -const filterVendorDefaultSettingsVars: FilterVendorDefaultSettingsVariables = { - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `filterVendorDefaultSettings()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterVendorDefaultSettings(filterVendorDefaultSettingsVars); -// Variables can be defined inline as well. -const { data } = await filterVendorDefaultSettings({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorDefaultSettingsVariables` argument. -const { data } = await filterVendorDefaultSettings(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars); - -console.log(data.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -filterVendorDefaultSettings(filterVendorDefaultSettingsVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -### Using `filterVendorDefaultSettings`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterVendorDefaultSettingsRef, FilterVendorDefaultSettingsVariables } from '@dataconnect/generated'; - -// The `filterVendorDefaultSettings` query has an optional argument of type `FilterVendorDefaultSettingsVariables`: -const filterVendorDefaultSettingsVars: FilterVendorDefaultSettingsVariables = { - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `filterVendorDefaultSettingsRef()` function to get a reference to the query. -const ref = filterVendorDefaultSettingsRef(filterVendorDefaultSettingsVars); -// Variables can be defined inline as well. -const ref = filterVendorDefaultSettingsRef({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorDefaultSettingsVariables` argument. -const ref = filterVendorDefaultSettingsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterVendorDefaultSettingsRef(dataConnect, filterVendorDefaultSettingsVars); - -// 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.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -## listVendorRate -You can execute the `listVendorRate` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listVendorRate(): QueryPromise; - -interface ListVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listVendorRateRef: ListVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listVendorRate(dc: DataConnect): QueryPromise; - -interface ListVendorRateRef { - ... - (dc: DataConnect): QueryRef; -} -export const listVendorRateRef: ListVendorRateRef; -``` - -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 listVendorRateRef: -```typescript -const name = listVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `listVendorRate` query has no variables. -### Return Type -Recall that executing the `listVendorRate` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListVendorRateData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` -### Using `listVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listVendorRate } from '@dataconnect/generated'; - - -// Call the `listVendorRate()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listVendorRate(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listVendorRate(dataConnect); - -console.log(data.vendorRates); - -// Or, you can use the `Promise` API. -listVendorRate().then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -### Using `listVendorRate`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listVendorRateRef } from '@dataconnect/generated'; - - -// Call the `listVendorRateRef()` function to get a reference to the query. -const ref = listVendorRateRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listVendorRateRef(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.vendorRates); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -## getVendorRateById -You can execute the `getVendorRateById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getVendorRateById(vars: GetVendorRateByIdVariables): QueryPromise; - -interface GetVendorRateByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorRateByIdVariables): QueryRef; -} -export const getVendorRateByIdRef: GetVendorRateByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables): QueryPromise; - -interface GetVendorRateByIdRef { - ... - (dc: DataConnect, vars: GetVendorRateByIdVariables): QueryRef; -} -export const getVendorRateByIdRef: GetVendorRateByIdRef; -``` - -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 getVendorRateByIdRef: -```typescript -const name = getVendorRateByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getVendorRateById` query requires an argument of type `GetVendorRateByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetVendorRateByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getVendorRateById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetVendorRateByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetVendorRateByIdData { - vendorRate?: { - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - createdDate?: TimestampString | null; - updatedDate?: TimestampString | null; - createdBy?: string | null; - } & VendorRate_Key; -} -``` -### Using `getVendorRateById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getVendorRateById, GetVendorRateByIdVariables } from '@dataconnect/generated'; - -// The `getVendorRateById` query requires an argument of type `GetVendorRateByIdVariables`: -const getVendorRateByIdVars: GetVendorRateByIdVariables = { - id: ..., -}; - -// Call the `getVendorRateById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getVendorRateById(getVendorRateByIdVars); -// Variables can be defined inline as well. -const { data } = await getVendorRateById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getVendorRateById(dataConnect, getVendorRateByIdVars); - -console.log(data.vendorRate); - -// Or, you can use the `Promise` API. -getVendorRateById(getVendorRateByIdVars).then((response) => { - const data = response.data; - console.log(data.vendorRate); -}); -``` - -### Using `getVendorRateById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getVendorRateByIdRef, GetVendorRateByIdVariables } from '@dataconnect/generated'; - -// The `getVendorRateById` query requires an argument of type `GetVendorRateByIdVariables`: -const getVendorRateByIdVars: GetVendorRateByIdVariables = { - id: ..., -}; - -// Call the `getVendorRateByIdRef()` function to get a reference to the query. -const ref = getVendorRateByIdRef(getVendorRateByIdVars); -// Variables can be defined inline as well. -const ref = getVendorRateByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getVendorRateByIdRef(dataConnect, getVendorRateByIdVars); - -// 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.vendorRate); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate); -}); -``` - -## filterVendorRates -You can execute the `filterVendorRates` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterVendorRates(vars?: FilterVendorRatesVariables): QueryPromise; - -interface FilterVendorRatesRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorRatesVariables): QueryRef; -} -export const filterVendorRatesRef: FilterVendorRatesRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables): QueryPromise; - -interface FilterVendorRatesRef { - ... - (dc: DataConnect, vars?: FilterVendorRatesVariables): QueryRef; -} -export const filterVendorRatesRef: FilterVendorRatesRef; -``` - -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 filterVendorRatesRef: -```typescript -const name = filterVendorRatesRef.operationName; -console.log(name); -``` - -### Variables -The `filterVendorRates` query has an optional argument of type `FilterVendorRatesVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterVendorRatesVariables { - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - minClientRate?: number | null; - maxClientRate?: number | null; -} -``` -### Return Type -Recall that executing the `filterVendorRates` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterVendorRatesData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterVendorRatesData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` -### Using `filterVendorRates`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterVendorRates, FilterVendorRatesVariables } from '@dataconnect/generated'; - -// The `filterVendorRates` query has an optional argument of type `FilterVendorRatesVariables`: -const filterVendorRatesVars: FilterVendorRatesVariables = { - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - minClientRate: ..., // optional - maxClientRate: ..., // optional -}; - -// Call the `filterVendorRates()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterVendorRates(filterVendorRatesVars); -// Variables can be defined inline as well. -const { data } = await filterVendorRates({ vendorName: ..., category: ..., roleName: ..., minClientRate: ..., maxClientRate: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorRatesVariables` argument. -const { data } = await filterVendorRates(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterVendorRates(dataConnect, filterVendorRatesVars); - -console.log(data.vendorRates); - -// Or, you can use the `Promise` API. -filterVendorRates(filterVendorRatesVars).then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -### Using `filterVendorRates`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterVendorRatesRef, FilterVendorRatesVariables } from '@dataconnect/generated'; - -// The `filterVendorRates` query has an optional argument of type `FilterVendorRatesVariables`: -const filterVendorRatesVars: FilterVendorRatesVariables = { - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - minClientRate: ..., // optional - maxClientRate: ..., // optional -}; - -// Call the `filterVendorRatesRef()` function to get a reference to the query. -const ref = filterVendorRatesRef(filterVendorRatesVars); -// Variables can be defined inline as well. -const ref = filterVendorRatesRef({ vendorName: ..., category: ..., roleName: ..., minClientRate: ..., maxClientRate: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorRatesVariables` argument. -const ref = filterVendorRatesRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterVendorRatesRef(dataConnect, filterVendorRatesVars); - -// 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.vendorRates); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -## listEvents -You can execute the `listEvents` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listEvents(): QueryPromise; - -interface ListEventsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listEventsRef: ListEventsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listEvents(dc: DataConnect): QueryPromise; - -interface ListEventsRef { - ... - (dc: DataConnect): QueryRef; -} -export const listEventsRef: ListEventsRef; -``` - -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 listEventsRef: -```typescript -const name = listEventsRef.operationName; -console.log(name); -``` - -### Variables -The `listEvents` query has no variables. -### Return Type -Recall that executing the `listEvents` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListEventsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` -### Using `listEvents`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listEvents } from '@dataconnect/generated'; - - -// Call the `listEvents()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listEvents(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listEvents(dataConnect); - -console.log(data.events); - -// Or, you can use the `Promise` API. -listEvents().then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -### Using `listEvents`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listEventsRef } from '@dataconnect/generated'; - - -// Call the `listEventsRef()` function to get a reference to the query. -const ref = listEventsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listEventsRef(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.events); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -## getEventById -You can execute the `getEventById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getEventById(vars: GetEventByIdVariables): QueryPromise; - -interface GetEventByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetEventByIdVariables): QueryRef; -} -export const getEventByIdRef: GetEventByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getEventById(dc: DataConnect, vars: GetEventByIdVariables): QueryPromise; - -interface GetEventByIdRef { - ... - (dc: DataConnect, vars: GetEventByIdVariables): QueryRef; -} -export const getEventByIdRef: GetEventByIdRef; -``` - -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 getEventByIdRef: -```typescript -const name = getEventByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getEventById` query requires an argument of type `GetEventByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetEventByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getEventById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetEventByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetEventByIdData { - event?: { - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key; -} -``` -### Using `getEventById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getEventById, GetEventByIdVariables } from '@dataconnect/generated'; - -// The `getEventById` query requires an argument of type `GetEventByIdVariables`: -const getEventByIdVars: GetEventByIdVariables = { - id: ..., -}; - -// Call the `getEventById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getEventById(getEventByIdVars); -// Variables can be defined inline as well. -const { data } = await getEventById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getEventById(dataConnect, getEventByIdVars); - -console.log(data.event); - -// Or, you can use the `Promise` API. -getEventById(getEventByIdVars).then((response) => { - const data = response.data; - console.log(data.event); -}); -``` - -### Using `getEventById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getEventByIdRef, GetEventByIdVariables } from '@dataconnect/generated'; - -// The `getEventById` query requires an argument of type `GetEventByIdVariables`: -const getEventByIdVars: GetEventByIdVariables = { - id: ..., -}; - -// Call the `getEventByIdRef()` function to get a reference to the query. -const ref = getEventByIdRef(getEventByIdVars); -// Variables can be defined inline as well. -const ref = getEventByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getEventByIdRef(dataConnect, getEventByIdVars); - -// 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.event); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.event); -}); -``` - -## filterEvents -You can execute the `filterEvents` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterEvents(vars?: FilterEventsVariables): QueryPromise; - -interface FilterEventsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterEventsVariables): QueryRef; -} -export const filterEventsRef: FilterEventsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterEvents(dc: DataConnect, vars?: FilterEventsVariables): QueryPromise; - -interface FilterEventsRef { - ... - (dc: DataConnect, vars?: FilterEventsVariables): QueryRef; -} -export const filterEventsRef: FilterEventsRef; -``` - -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 filterEventsRef: -```typescript -const name = filterEventsRef.operationName; -console.log(name); -``` - -### Variables -The `filterEvents` query has an optional argument of type `FilterEventsVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterEventsVariables { - status?: EventStatus | null; - businessId?: UUIDString | null; - vendorId?: UUIDString | null; - isRecurring?: boolean | null; - isRapid?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - date?: TimestampString | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - clientEmail?: string | null; -} -``` -### Return Type -Recall that executing the `filterEvents` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterEventsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` -### Using `filterEvents`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterEvents, FilterEventsVariables } from '@dataconnect/generated'; - -// The `filterEvents` query has an optional argument of type `FilterEventsVariables`: -const filterEventsVars: FilterEventsVariables = { - status: ..., // optional - businessId: ..., // optional - vendorId: ..., // optional - isRecurring: ..., // optional - isRapid: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - date: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - clientEmail: ..., // optional -}; - -// Call the `filterEvents()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterEvents(filterEventsVars); -// Variables can be defined inline as well. -const { data } = await filterEvents({ status: ..., businessId: ..., vendorId: ..., isRecurring: ..., isRapid: ..., isMultiDay: ..., recurrenceType: ..., date: ..., hub: ..., eventLocation: ..., contractType: ..., clientEmail: ..., }); -// Since all variables are optional for this query, you can omit the `FilterEventsVariables` argument. -const { data } = await filterEvents(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterEvents(dataConnect, filterEventsVars); - -console.log(data.events); - -// Or, you can use the `Promise` API. -filterEvents(filterEventsVars).then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -### Using `filterEvents`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterEventsRef, FilterEventsVariables } from '@dataconnect/generated'; - -// The `filterEvents` query has an optional argument of type `FilterEventsVariables`: -const filterEventsVars: FilterEventsVariables = { - status: ..., // optional - businessId: ..., // optional - vendorId: ..., // optional - isRecurring: ..., // optional - isRapid: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - date: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - clientEmail: ..., // optional -}; - -// Call the `filterEventsRef()` function to get a reference to the query. -const ref = filterEventsRef(filterEventsVars); -// Variables can be defined inline as well. -const ref = filterEventsRef({ status: ..., businessId: ..., vendorId: ..., isRecurring: ..., isRapid: ..., isMultiDay: ..., recurrenceType: ..., date: ..., hub: ..., eventLocation: ..., contractType: ..., clientEmail: ..., }); -// Since all variables are optional for this query, you can omit the `FilterEventsVariables` argument. -const ref = filterEventsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterEventsRef(dataConnect, filterEventsVars); - -// 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.events); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -## listInvoice -You can execute the `listInvoice` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listInvoice(): QueryPromise; - -interface ListInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listInvoiceRef: ListInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listInvoice(dc: DataConnect): QueryPromise; - -interface ListInvoiceRef { - ... - (dc: DataConnect): QueryRef; -} -export const listInvoiceRef: ListInvoiceRef; -``` - -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 listInvoiceRef: -```typescript -const name = listInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `listInvoice` query has no variables. -### Return Type -Recall that executing the `listInvoice` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListInvoiceData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` -### Using `listInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listInvoice } from '@dataconnect/generated'; - - -// Call the `listInvoice()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listInvoice(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listInvoice(dataConnect); - -console.log(data.invoices); - -// Or, you can use the `Promise` API. -listInvoice().then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -### Using `listInvoice`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listInvoiceRef } from '@dataconnect/generated'; - - -// Call the `listInvoiceRef()` function to get a reference to the query. -const ref = listInvoiceRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listInvoiceRef(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.invoices); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -## getInvoiceById -You can execute the `getInvoiceById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getInvoiceById(vars: GetInvoiceByIdVariables): QueryPromise; - -interface GetInvoiceByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetInvoiceByIdVariables): QueryRef; -} -export const getInvoiceByIdRef: GetInvoiceByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables): QueryPromise; - -interface GetInvoiceByIdRef { - ... - (dc: DataConnect, vars: GetInvoiceByIdVariables): QueryRef; -} -export const getInvoiceByIdRef: GetInvoiceByIdRef; -``` - -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 getInvoiceByIdRef: -```typescript -const name = getInvoiceByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getInvoiceById` query requires an argument of type `GetInvoiceByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetInvoiceByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getInvoiceById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetInvoiceByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetInvoiceByIdData { - invoice?: { - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; - } & Invoice_Key; -} -``` -### Using `getInvoiceById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getInvoiceById, GetInvoiceByIdVariables } from '@dataconnect/generated'; - -// The `getInvoiceById` query requires an argument of type `GetInvoiceByIdVariables`: -const getInvoiceByIdVars: GetInvoiceByIdVariables = { - id: ..., -}; - -// Call the `getInvoiceById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getInvoiceById(getInvoiceByIdVars); -// Variables can be defined inline as well. -const { data } = await getInvoiceById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getInvoiceById(dataConnect, getInvoiceByIdVars); - -console.log(data.invoice); - -// Or, you can use the `Promise` API. -getInvoiceById(getInvoiceByIdVars).then((response) => { - const data = response.data; - console.log(data.invoice); -}); -``` - -### Using `getInvoiceById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getInvoiceByIdRef, GetInvoiceByIdVariables } from '@dataconnect/generated'; - -// The `getInvoiceById` query requires an argument of type `GetInvoiceByIdVariables`: -const getInvoiceByIdVars: GetInvoiceByIdVariables = { - id: ..., -}; - -// Call the `getInvoiceByIdRef()` function to get a reference to the query. -const ref = getInvoiceByIdRef(getInvoiceByIdVars); -// Variables can be defined inline as well. -const ref = getInvoiceByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getInvoiceByIdRef(dataConnect, getInvoiceByIdVars); - -// 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.invoice); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.invoice); -}); -``` - -## filterInvoices -You can execute the `filterInvoices` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterInvoices(vars?: FilterInvoicesVariables): QueryPromise; - -interface FilterInvoicesRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterInvoicesVariables): QueryRef; -} -export const filterInvoicesRef: FilterInvoicesRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables): QueryPromise; - -interface FilterInvoicesRef { - ... - (dc: DataConnect, vars?: FilterInvoicesVariables): QueryRef; -} -export const filterInvoicesRef: FilterInvoicesRef; -``` - -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 filterInvoicesRef: -```typescript -const name = filterInvoicesRef.operationName; -console.log(name); -``` - -### Variables -The `filterInvoices` query has an optional argument of type `FilterInvoicesVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterInvoicesVariables { - invoiceNumber?: string | null; - status?: InvoiceStatus | null; - isAutoGenerated?: boolean | null; - amount?: number | null; -} -``` -### Return Type -Recall that executing the `filterInvoices` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterInvoicesData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterInvoicesData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` -### Using `filterInvoices`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterInvoices, FilterInvoicesVariables } from '@dataconnect/generated'; - -// The `filterInvoices` query has an optional argument of type `FilterInvoicesVariables`: -const filterInvoicesVars: FilterInvoicesVariables = { - invoiceNumber: ..., // optional - status: ..., // optional - isAutoGenerated: ..., // optional - amount: ..., // optional -}; - -// Call the `filterInvoices()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterInvoices(filterInvoicesVars); -// Variables can be defined inline as well. -const { data } = await filterInvoices({ invoiceNumber: ..., status: ..., isAutoGenerated: ..., amount: ..., }); -// Since all variables are optional for this query, you can omit the `FilterInvoicesVariables` argument. -const { data } = await filterInvoices(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterInvoices(dataConnect, filterInvoicesVars); - -console.log(data.invoices); - -// Or, you can use the `Promise` API. -filterInvoices(filterInvoicesVars).then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -### Using `filterInvoices`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterInvoicesRef, FilterInvoicesVariables } from '@dataconnect/generated'; - -// The `filterInvoices` query has an optional argument of type `FilterInvoicesVariables`: -const filterInvoicesVars: FilterInvoicesVariables = { - invoiceNumber: ..., // optional - status: ..., // optional - isAutoGenerated: ..., // optional - amount: ..., // optional -}; - -// Call the `filterInvoicesRef()` function to get a reference to the query. -const ref = filterInvoicesRef(filterInvoicesVars); -// Variables can be defined inline as well. -const ref = filterInvoicesRef({ invoiceNumber: ..., status: ..., isAutoGenerated: ..., amount: ..., }); -// Since all variables are optional for this query, you can omit the `FilterInvoicesVariables` argument. -const ref = filterInvoicesRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterInvoicesRef(dataConnect, filterInvoicesVars); - -// 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.invoices); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -## listStaff -You can execute the `listStaff` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listStaff(): QueryPromise; - -interface ListStaffRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listStaffRef: ListStaffRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listStaff(dc: DataConnect): QueryPromise; - -interface ListStaffRef { - ... - (dc: DataConnect): QueryRef; -} -export const listStaffRef: ListStaffRef; -``` - -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 listStaffRef: -```typescript -const name = listStaffRef.operationName; -console.log(name); -``` - -### Variables -The `listStaff` query has no variables. -### Return Type -Recall that executing the `listStaff` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListStaffData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListStaffData { - staffs: ({ - id: UUIDString; - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; - } & Staff_Key)[]; -} -``` -### Using `listStaff`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listStaff } from '@dataconnect/generated'; - - -// Call the `listStaff()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listStaff(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listStaff(dataConnect); - -console.log(data.staffs); - -// Or, you can use the `Promise` API. -listStaff().then((response) => { - const data = response.data; - console.log(data.staffs); -}); -``` - -### Using `listStaff`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listStaffRef } from '@dataconnect/generated'; - - -// Call the `listStaffRef()` function to get a reference to the query. -const ref = listStaffRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listStaffRef(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.staffs); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.staffs); -}); -``` - -## listVendor -You can execute the `listVendor` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listVendor(): QueryPromise; - -interface ListVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listVendorRef: ListVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listVendor(dc: DataConnect): QueryPromise; - -interface ListVendorRef { - ... - (dc: DataConnect): QueryRef; -} -export const listVendorRef: ListVendorRef; -``` - -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 listVendorRef: -```typescript -const name = listVendorRef.operationName; -console.log(name); -``` - -### Variables -The `listVendor` query has no variables. -### Return Type -Recall that executing the `listVendor` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListVendorData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` -### Using `listVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listVendor } from '@dataconnect/generated'; - - -// Call the `listVendor()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listVendor(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listVendor(dataConnect); - -console.log(data.vendors); - -// Or, you can use the `Promise` API. -listVendor().then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -### Using `listVendor`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listVendorRef } from '@dataconnect/generated'; - - -// Call the `listVendorRef()` function to get a reference to the query. -const ref = listVendorRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listVendorRef(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.vendors); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -## getVendorById -You can execute the `getVendorById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getVendorById(vars: GetVendorByIdVariables): QueryPromise; - -interface GetVendorByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorByIdVariables): QueryRef; -} -export const getVendorByIdRef: GetVendorByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getVendorById(dc: DataConnect, vars: GetVendorByIdVariables): QueryPromise; - -interface GetVendorByIdRef { - ... - (dc: DataConnect, vars: GetVendorByIdVariables): QueryRef; -} -export const getVendorByIdRef: GetVendorByIdRef; -``` - -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 getVendorByIdRef: -```typescript -const name = getVendorByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getVendorById` query requires an argument of type `GetVendorByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetVendorByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getVendorById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetVendorByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetVendorByIdData { - vendor?: { - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key; -} -``` -### Using `getVendorById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getVendorById, GetVendorByIdVariables } from '@dataconnect/generated'; - -// The `getVendorById` query requires an argument of type `GetVendorByIdVariables`: -const getVendorByIdVars: GetVendorByIdVariables = { - id: ..., -}; - -// Call the `getVendorById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getVendorById(getVendorByIdVars); -// Variables can be defined inline as well. -const { data } = await getVendorById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getVendorById(dataConnect, getVendorByIdVars); - -console.log(data.vendor); - -// Or, you can use the `Promise` API. -getVendorById(getVendorByIdVars).then((response) => { - const data = response.data; - console.log(data.vendor); -}); -``` - -### Using `getVendorById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getVendorByIdRef, GetVendorByIdVariables } from '@dataconnect/generated'; - -// The `getVendorById` query requires an argument of type `GetVendorByIdVariables`: -const getVendorByIdVars: GetVendorByIdVariables = { - id: ..., -}; - -// Call the `getVendorByIdRef()` function to get a reference to the query. -const ref = getVendorByIdRef(getVendorByIdVars); -// Variables can be defined inline as well. -const ref = getVendorByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getVendorByIdRef(dataConnect, getVendorByIdVars); - -// 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.vendor); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendor); -}); -``` - -## filterVendors -You can execute the `filterVendors` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterVendors(vars?: FilterVendorsVariables): QueryPromise; - -interface FilterVendorsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorsVariables): QueryRef; -} -export const filterVendorsRef: FilterVendorsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterVendors(dc: DataConnect, vars?: FilterVendorsVariables): QueryPromise; - -interface FilterVendorsRef { - ... - (dc: DataConnect, vars?: FilterVendorsVariables): QueryRef; -} -export const filterVendorsRef: FilterVendorsRef; -``` - -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 filterVendorsRef: -```typescript -const name = filterVendorsRef.operationName; -console.log(name); -``` - -### Variables -The `filterVendors` query has an optional argument of type `FilterVendorsVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterVendorsVariables { - region?: VendorRegion | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; - vendorNumber?: string | null; - primaryContactEmail?: string | null; - legalName?: string | null; - platformType?: VendorPlatformType | null; -} -``` -### Return Type -Recall that executing the `filterVendors` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterVendorsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterVendorsData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` -### Using `filterVendors`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterVendors, FilterVendorsVariables } from '@dataconnect/generated'; - -// The `filterVendors` query has an optional argument of type `FilterVendorsVariables`: -const filterVendorsVars: FilterVendorsVariables = { - region: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - vendorNumber: ..., // optional - primaryContactEmail: ..., // optional - legalName: ..., // optional - platformType: ..., // optional -}; - -// Call the `filterVendors()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterVendors(filterVendorsVars); -// Variables can be defined inline as well. -const { data } = await filterVendors({ region: ..., approvalStatus: ..., isActive: ..., vendorNumber: ..., primaryContactEmail: ..., legalName: ..., platformType: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorsVariables` argument. -const { data } = await filterVendors(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterVendors(dataConnect, filterVendorsVars); - -console.log(data.vendors); - -// Or, you can use the `Promise` API. -filterVendors(filterVendorsVars).then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -### Using `filterVendors`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterVendorsRef, FilterVendorsVariables } from '@dataconnect/generated'; - -// The `filterVendors` query has an optional argument of type `FilterVendorsVariables`: -const filterVendorsVars: FilterVendorsVariables = { - region: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - vendorNumber: ..., // optional - primaryContactEmail: ..., // optional - legalName: ..., // optional - platformType: ..., // optional -}; - -// Call the `filterVendorsRef()` function to get a reference to the query. -const ref = filterVendorsRef(filterVendorsVars); -// Variables can be defined inline as well. -const ref = filterVendorsRef({ region: ..., approvalStatus: ..., isActive: ..., vendorNumber: ..., primaryContactEmail: ..., legalName: ..., platformType: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorsVariables` argument. -const ref = filterVendorsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterVendorsRef(dataConnect, filterVendorsVars); - -// 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.vendors); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -# 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 `krow-connector` 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). - -## CreateEvent -You can execute the `CreateEvent` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createEvent(vars: CreateEventVariables): MutationPromise; - -interface CreateEventRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateEventVariables): MutationRef; -} -export const createEventRef: CreateEventRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createEvent(dc: DataConnect, vars: CreateEventVariables): MutationPromise; - -interface CreateEventRef { - ... - (dc: DataConnect, vars: CreateEventVariables): MutationRef; -} -export const createEventRef: CreateEventRef; -``` - -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 createEventRef: -```typescript -const name = createEventRef.operationName; -console.log(name); -``` - -### Variables -The `CreateEvent` mutation requires an argument of type `CreateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateEventVariables { - eventName: string; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status: EventStatus; - date: TimestampString; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that executing the `CreateEvent` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateEventData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateEventData { - event_insert: Event_Key; -} -``` -### Using `CreateEvent`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createEvent, CreateEventVariables } from '@dataconnect/generated'; - -// The `CreateEvent` mutation requires an argument of type `CreateEventVariables`: -const createEventVars: CreateEventVariables = { - eventName: ..., - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., - date: ..., - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `createEvent()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createEvent(createEventVars); -// Variables can be defined inline as well. -const { data } = await createEvent({ eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createEvent(dataConnect, createEventVars); - -console.log(data.event_insert); - -// Or, you can use the `Promise` API. -createEvent(createEventVars).then((response) => { - const data = response.data; - console.log(data.event_insert); -}); -``` - -### Using `CreateEvent`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createEventRef, CreateEventVariables } from '@dataconnect/generated'; - -// The `CreateEvent` mutation requires an argument of type `CreateEventVariables`: -const createEventVars: CreateEventVariables = { - eventName: ..., - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., - date: ..., - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `createEventRef()` function to get a reference to the mutation. -const ref = createEventRef(createEventVars); -// Variables can be defined inline as well. -const ref = createEventRef({ eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createEventRef(dataConnect, createEventVars); - -// 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.event_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.event_insert); -}); -``` - -## UpdateEvent -You can execute the `UpdateEvent` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateEvent(vars: UpdateEventVariables): MutationPromise; - -interface UpdateEventRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateEventVariables): MutationRef; -} -export const updateEventRef: UpdateEventRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateEvent(dc: DataConnect, vars: UpdateEventVariables): MutationPromise; - -interface UpdateEventRef { - ... - (dc: DataConnect, vars: UpdateEventVariables): MutationRef; -} -export const updateEventRef: UpdateEventRef; -``` - -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 updateEventRef: -```typescript -const name = updateEventRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateEvent` mutation requires an argument of type `UpdateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateEventVariables { - id: UUIDString; - eventName?: string | null; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId?: UUIDString | null; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status?: EventStatus | null; - date?: TimestampString | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that executing the `UpdateEvent` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateEventData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateEventData { - event_update?: Event_Key | null; -} -``` -### Using `UpdateEvent`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateEvent, UpdateEventVariables } from '@dataconnect/generated'; - -// The `UpdateEvent` mutation requires an argument of type `UpdateEventVariables`: -const updateEventVars: UpdateEventVariables = { - id: ..., - eventName: ..., // optional - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., // optional - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., // optional - date: ..., // optional - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `updateEvent()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateEvent(updateEventVars); -// Variables can be defined inline as well. -const { data } = await updateEvent({ id: ..., eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateEvent(dataConnect, updateEventVars); - -console.log(data.event_update); - -// Or, you can use the `Promise` API. -updateEvent(updateEventVars).then((response) => { - const data = response.data; - console.log(data.event_update); -}); -``` - -### Using `UpdateEvent`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateEventRef, UpdateEventVariables } from '@dataconnect/generated'; - -// The `UpdateEvent` mutation requires an argument of type `UpdateEventVariables`: -const updateEventVars: UpdateEventVariables = { - id: ..., - eventName: ..., // optional - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., // optional - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., // optional - date: ..., // optional - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `updateEventRef()` function to get a reference to the mutation. -const ref = updateEventRef(updateEventVars); -// Variables can be defined inline as well. -const ref = updateEventRef({ id: ..., eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateEventRef(dataConnect, updateEventVars); - -// 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.event_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.event_update); -}); -``` - -## DeleteEvent -You can execute the `DeleteEvent` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteEvent(vars: DeleteEventVariables): MutationPromise; - -interface DeleteEventRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteEventVariables): MutationRef; -} -export const deleteEventRef: DeleteEventRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteEvent(dc: DataConnect, vars: DeleteEventVariables): MutationPromise; - -interface DeleteEventRef { - ... - (dc: DataConnect, vars: DeleteEventVariables): MutationRef; -} -export const deleteEventRef: DeleteEventRef; -``` - -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 deleteEventRef: -```typescript -const name = deleteEventRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteEvent` mutation requires an argument of type `DeleteEventVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteEventVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteEvent` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteEventData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteEventData { - event_delete?: Event_Key | null; -} -``` -### Using `DeleteEvent`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteEvent, DeleteEventVariables } from '@dataconnect/generated'; - -// The `DeleteEvent` mutation requires an argument of type `DeleteEventVariables`: -const deleteEventVars: DeleteEventVariables = { - id: ..., -}; - -// Call the `deleteEvent()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteEvent(deleteEventVars); -// Variables can be defined inline as well. -const { data } = await deleteEvent({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteEvent(dataConnect, deleteEventVars); - -console.log(data.event_delete); - -// Or, you can use the `Promise` API. -deleteEvent(deleteEventVars).then((response) => { - const data = response.data; - console.log(data.event_delete); -}); -``` - -### Using `DeleteEvent`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteEventRef, DeleteEventVariables } from '@dataconnect/generated'; - -// The `DeleteEvent` mutation requires an argument of type `DeleteEventVariables`: -const deleteEventVars: DeleteEventVariables = { - id: ..., -}; - -// Call the `deleteEventRef()` function to get a reference to the mutation. -const ref = deleteEventRef(deleteEventVars); -// Variables can be defined inline as well. -const ref = deleteEventRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteEventRef(dataConnect, deleteEventVars); - -// 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.event_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.event_delete); -}); -``` - -## CreateVendorRate -You can execute the `CreateVendorRate` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createVendorRate(vars: CreateVendorRateVariables): MutationPromise; - -interface CreateVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorRateVariables): MutationRef; -} -export const createVendorRateRef: CreateVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createVendorRate(dc: DataConnect, vars: CreateVendorRateVariables): MutationPromise; - -interface CreateVendorRateRef { - ... - (dc: DataConnect, vars: CreateVendorRateVariables): MutationRef; -} -export const createVendorRateRef: CreateVendorRateRef; -``` - -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 createVendorRateRef: -```typescript -const name = createVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `CreateVendorRate` mutation requires an argument of type `CreateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateVendorRateVariables { - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; -} -``` -### Return Type -Recall that executing the `CreateVendorRate` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateVendorRateData { - vendorRate_insert: VendorRate_Key; -} -``` -### Using `CreateVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createVendorRate, CreateVendorRateVariables } from '@dataconnect/generated'; - -// The `CreateVendorRate` mutation requires an argument of type `CreateVendorRateVariables`: -const createVendorRateVars: CreateVendorRateVariables = { - vendorName: ..., - category: ..., - roleName: ..., - employeeWage: ..., - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., -}; - -// Call the `createVendorRate()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createVendorRate(createVendorRateVars); -// Variables can be defined inline as well. -const { data } = await createVendorRate({ vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createVendorRate(dataConnect, createVendorRateVars); - -console.log(data.vendorRate_insert); - -// Or, you can use the `Promise` API. -createVendorRate(createVendorRateVars).then((response) => { - const data = response.data; - console.log(data.vendorRate_insert); -}); -``` - -### Using `CreateVendorRate`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createVendorRateRef, CreateVendorRateVariables } from '@dataconnect/generated'; - -// The `CreateVendorRate` mutation requires an argument of type `CreateVendorRateVariables`: -const createVendorRateVars: CreateVendorRateVariables = { - vendorName: ..., - category: ..., - roleName: ..., - employeeWage: ..., - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., -}; - -// Call the `createVendorRateRef()` function to get a reference to the mutation. -const ref = createVendorRateRef(createVendorRateVars); -// Variables can be defined inline as well. -const ref = createVendorRateRef({ vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createVendorRateRef(dataConnect, createVendorRateVars); - -// 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.vendorRate_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate_insert); -}); -``` - -## UpdateVendorRate -You can execute the `UpdateVendorRate` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateVendorRate(vars: UpdateVendorRateVariables): MutationPromise; - -interface UpdateVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorRateVariables): MutationRef; -} -export const updateVendorRateRef: UpdateVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateVendorRate(dc: DataConnect, vars: UpdateVendorRateVariables): MutationPromise; - -interface UpdateVendorRateRef { - ... - (dc: DataConnect, vars: UpdateVendorRateVariables): MutationRef; -} -export const updateVendorRateRef: UpdateVendorRateRef; -``` - -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 updateVendorRateRef: -```typescript -const name = updateVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateVendorRate` mutation requires an argument of type `UpdateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateVendorRateVariables { - id: UUIDString; - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - employeeWage?: number | null; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate?: number | null; -} -``` -### Return Type -Recall that executing the `UpdateVendorRate` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateVendorRateData { - vendorRate_update?: VendorRate_Key | null; -} -``` -### Using `UpdateVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateVendorRate, UpdateVendorRateVariables } from '@dataconnect/generated'; - -// The `UpdateVendorRate` mutation requires an argument of type `UpdateVendorRateVariables`: -const updateVendorRateVars: UpdateVendorRateVariables = { - id: ..., - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - employeeWage: ..., // optional - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., // optional -}; - -// Call the `updateVendorRate()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateVendorRate(updateVendorRateVars); -// Variables can be defined inline as well. -const { data } = await updateVendorRate({ id: ..., vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateVendorRate(dataConnect, updateVendorRateVars); - -console.log(data.vendorRate_update); - -// Or, you can use the `Promise` API. -updateVendorRate(updateVendorRateVars).then((response) => { - const data = response.data; - console.log(data.vendorRate_update); -}); -``` - -### Using `UpdateVendorRate`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateVendorRateRef, UpdateVendorRateVariables } from '@dataconnect/generated'; - -// The `UpdateVendorRate` mutation requires an argument of type `UpdateVendorRateVariables`: -const updateVendorRateVars: UpdateVendorRateVariables = { - id: ..., - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - employeeWage: ..., // optional - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., // optional -}; - -// Call the `updateVendorRateRef()` function to get a reference to the mutation. -const ref = updateVendorRateRef(updateVendorRateVars); -// Variables can be defined inline as well. -const ref = updateVendorRateRef({ id: ..., vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateVendorRateRef(dataConnect, updateVendorRateVars); - -// 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.vendorRate_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate_update); -}); -``` - -## DeleteVendorRate -You can execute the `DeleteVendorRate` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteVendorRate(vars: DeleteVendorRateVariables): MutationPromise; - -interface DeleteVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorRateVariables): MutationRef; -} -export const deleteVendorRateRef: DeleteVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteVendorRate(dc: DataConnect, vars: DeleteVendorRateVariables): MutationPromise; - -interface DeleteVendorRateRef { - ... - (dc: DataConnect, vars: DeleteVendorRateVariables): MutationRef; -} -export const deleteVendorRateRef: DeleteVendorRateRef; -``` - -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 deleteVendorRateRef: -```typescript -const name = deleteVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteVendorRate` mutation requires an argument of type `DeleteVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteVendorRateVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteVendorRate` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteVendorRateData { - vendorRate_delete?: VendorRate_Key | null; -} -``` -### Using `DeleteVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorRate, DeleteVendorRateVariables } from '@dataconnect/generated'; - -// The `DeleteVendorRate` mutation requires an argument of type `DeleteVendorRateVariables`: -const deleteVendorRateVars: DeleteVendorRateVariables = { - id: ..., -}; - -// Call the `deleteVendorRate()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteVendorRate(deleteVendorRateVars); -// Variables can be defined inline as well. -const { data } = await deleteVendorRate({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteVendorRate(dataConnect, deleteVendorRateVars); - -console.log(data.vendorRate_delete); - -// Or, you can use the `Promise` API. -deleteVendorRate(deleteVendorRateVars).then((response) => { - const data = response.data; - console.log(data.vendorRate_delete); -}); -``` - -### Using `DeleteVendorRate`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorRateRef, DeleteVendorRateVariables } from '@dataconnect/generated'; - -// The `DeleteVendorRate` mutation requires an argument of type `DeleteVendorRateVariables`: -const deleteVendorRateVars: DeleteVendorRateVariables = { - id: ..., -}; - -// Call the `deleteVendorRateRef()` function to get a reference to the mutation. -const ref = deleteVendorRateRef(deleteVendorRateVars); -// Variables can be defined inline as well. -const ref = deleteVendorRateRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteVendorRateRef(dataConnect, deleteVendorRateVars); - -// 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.vendorRate_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate_delete); -}); -``` - -## CreateInvoice -You can execute the `CreateInvoice` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createInvoice(vars: CreateInvoiceVariables): MutationPromise; - -interface CreateInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateInvoiceVariables): MutationRef; -} -export const createInvoiceRef: CreateInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createInvoice(dc: DataConnect, vars: CreateInvoiceVariables): MutationPromise; - -interface CreateInvoiceRef { - ... - (dc: DataConnect, vars: CreateInvoiceVariables): MutationRef; -} -export const createInvoiceRef: CreateInvoiceRef; -``` - -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 createInvoiceRef: -```typescript -const name = createInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `CreateInvoice` mutation requires an argument of type `CreateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateInvoiceVariables { - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that executing the `CreateInvoice` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateInvoiceData { - invoice_insert: Invoice_Key; -} -``` -### Using `CreateInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createInvoice, CreateInvoiceVariables } from '@dataconnect/generated'; - -// The `CreateInvoice` mutation requires an argument of type `CreateInvoiceVariables`: -const createInvoiceVars: CreateInvoiceVariables = { - invoiceNumber: ..., - amount: ..., - status: ..., - issueDate: ..., - dueDate: ..., - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `createInvoice()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createInvoice(createInvoiceVars); -// Variables can be defined inline as well. -const { data } = await createInvoice({ invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createInvoice(dataConnect, createInvoiceVars); - -console.log(data.invoice_insert); - -// Or, you can use the `Promise` API. -createInvoice(createInvoiceVars).then((response) => { - const data = response.data; - console.log(data.invoice_insert); -}); -``` - -### Using `CreateInvoice`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createInvoiceRef, CreateInvoiceVariables } from '@dataconnect/generated'; - -// The `CreateInvoice` mutation requires an argument of type `CreateInvoiceVariables`: -const createInvoiceVars: CreateInvoiceVariables = { - invoiceNumber: ..., - amount: ..., - status: ..., - issueDate: ..., - dueDate: ..., - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `createInvoiceRef()` function to get a reference to the mutation. -const ref = createInvoiceRef(createInvoiceVars); -// Variables can be defined inline as well. -const ref = createInvoiceRef({ invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createInvoiceRef(dataConnect, createInvoiceVars); - -// 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.invoice_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.invoice_insert); -}); -``` - -## UpdateInvoice -You can execute the `UpdateInvoice` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateInvoice(vars: UpdateInvoiceVariables): MutationPromise; - -interface UpdateInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateInvoiceVariables): MutationRef; -} -export const updateInvoiceRef: UpdateInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateInvoice(dc: DataConnect, vars: UpdateInvoiceVariables): MutationPromise; - -interface UpdateInvoiceRef { - ... - (dc: DataConnect, vars: UpdateInvoiceVariables): MutationRef; -} -export const updateInvoiceRef: UpdateInvoiceRef; -``` - -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 updateInvoiceRef: -```typescript -const name = updateInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateInvoice` mutation requires an argument of type `UpdateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateInvoiceVariables { - id: UUIDString; - invoiceNumber?: string | null; - amount?: number | null; - status?: InvoiceStatus | null; - issueDate?: TimestampString | null; - dueDate?: TimestampString | null; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that executing the `UpdateInvoice` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateInvoiceData { - invoice_update?: Invoice_Key | null; -} -``` -### Using `UpdateInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateInvoice, UpdateInvoiceVariables } from '@dataconnect/generated'; - -// The `UpdateInvoice` mutation requires an argument of type `UpdateInvoiceVariables`: -const updateInvoiceVars: UpdateInvoiceVariables = { - id: ..., - invoiceNumber: ..., // optional - amount: ..., // optional - status: ..., // optional - issueDate: ..., // optional - dueDate: ..., // optional - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `updateInvoice()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateInvoice(updateInvoiceVars); -// Variables can be defined inline as well. -const { data } = await updateInvoice({ id: ..., invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateInvoice(dataConnect, updateInvoiceVars); - -console.log(data.invoice_update); - -// Or, you can use the `Promise` API. -updateInvoice(updateInvoiceVars).then((response) => { - const data = response.data; - console.log(data.invoice_update); -}); -``` - -### Using `UpdateInvoice`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateInvoiceRef, UpdateInvoiceVariables } from '@dataconnect/generated'; - -// The `UpdateInvoice` mutation requires an argument of type `UpdateInvoiceVariables`: -const updateInvoiceVars: UpdateInvoiceVariables = { - id: ..., - invoiceNumber: ..., // optional - amount: ..., // optional - status: ..., // optional - issueDate: ..., // optional - dueDate: ..., // optional - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `updateInvoiceRef()` function to get a reference to the mutation. -const ref = updateInvoiceRef(updateInvoiceVars); -// Variables can be defined inline as well. -const ref = updateInvoiceRef({ id: ..., invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateInvoiceRef(dataConnect, updateInvoiceVars); - -// 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.invoice_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.invoice_update); -}); -``` - -## DeleteInvoice -You can execute the `DeleteInvoice` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteInvoice(vars: DeleteInvoiceVariables): MutationPromise; - -interface DeleteInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteInvoiceVariables): MutationRef; -} -export const deleteInvoiceRef: DeleteInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteInvoice(dc: DataConnect, vars: DeleteInvoiceVariables): MutationPromise; - -interface DeleteInvoiceRef { - ... - (dc: DataConnect, vars: DeleteInvoiceVariables): MutationRef; -} -export const deleteInvoiceRef: DeleteInvoiceRef; -``` - -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 deleteInvoiceRef: -```typescript -const name = deleteInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteInvoice` mutation requires an argument of type `DeleteInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteInvoiceVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteInvoice` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteInvoiceData { - invoice_delete?: Invoice_Key | null; -} -``` -### Using `DeleteInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteInvoice, DeleteInvoiceVariables } from '@dataconnect/generated'; - -// The `DeleteInvoice` mutation requires an argument of type `DeleteInvoiceVariables`: -const deleteInvoiceVars: DeleteInvoiceVariables = { - id: ..., -}; - -// Call the `deleteInvoice()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteInvoice(deleteInvoiceVars); -// Variables can be defined inline as well. -const { data } = await deleteInvoice({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteInvoice(dataConnect, deleteInvoiceVars); - -console.log(data.invoice_delete); - -// Or, you can use the `Promise` API. -deleteInvoice(deleteInvoiceVars).then((response) => { - const data = response.data; - console.log(data.invoice_delete); -}); -``` - -### Using `DeleteInvoice`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteInvoiceRef, DeleteInvoiceVariables } from '@dataconnect/generated'; - -// The `DeleteInvoice` mutation requires an argument of type `DeleteInvoiceVariables`: -const deleteInvoiceVars: DeleteInvoiceVariables = { - id: ..., -}; - -// Call the `deleteInvoiceRef()` function to get a reference to the mutation. -const ref = deleteInvoiceRef(deleteInvoiceVars); -// Variables can be defined inline as well. -const ref = deleteInvoiceRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteInvoiceRef(dataConnect, deleteInvoiceVars); - -// 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.invoice_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.invoice_delete); -}); -``` - -## CreateStaff -You can execute the `CreateStaff` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createStaff(vars: CreateStaffVariables): MutationPromise; - -interface CreateStaffRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateStaffVariables): MutationRef; -} -export const createStaffRef: CreateStaffRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createStaff(dc: DataConnect, vars: CreateStaffVariables): MutationPromise; - -interface CreateStaffRef { - ... - (dc: DataConnect, vars: CreateStaffVariables): MutationRef; -} -export const createStaffRef: CreateStaffRef; -``` - -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 createStaffRef: -```typescript -const name = createStaffRef.operationName; -console.log(name); -``` - -### Variables -The `CreateStaff` mutation requires an argument of type `CreateStaffVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateStaffVariables { - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; -} -``` -### Return Type -Recall that executing the `CreateStaff` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateStaffData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateStaffData { - staff_insert: Staff_Key; -} -``` -### Using `CreateStaff`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createStaff, CreateStaffVariables } from '@dataconnect/generated'; - -// The `CreateStaff` mutation requires an argument of type `CreateStaffVariables`: -const createStaffVars: CreateStaffVariables = { - employeeName: ..., - vendorId: ..., // optional - email: ..., // optional - position: ..., // optional - employmentType: ..., - rating: ..., // optional - reliabilityScore: ..., // optional - backgroundCheckStatus: ..., - certifications: ..., // optional -}; - -// Call the `createStaff()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createStaff(createStaffVars); -// Variables can be defined inline as well. -const { data } = await createStaff({ employeeName: ..., vendorId: ..., email: ..., position: ..., employmentType: ..., rating: ..., reliabilityScore: ..., backgroundCheckStatus: ..., certifications: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createStaff(dataConnect, createStaffVars); - -console.log(data.staff_insert); - -// Or, you can use the `Promise` API. -createStaff(createStaffVars).then((response) => { - const data = response.data; - console.log(data.staff_insert); -}); -``` - -### Using `CreateStaff`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createStaffRef, CreateStaffVariables } from '@dataconnect/generated'; - -// The `CreateStaff` mutation requires an argument of type `CreateStaffVariables`: -const createStaffVars: CreateStaffVariables = { - employeeName: ..., - vendorId: ..., // optional - email: ..., // optional - position: ..., // optional - employmentType: ..., - rating: ..., // optional - reliabilityScore: ..., // optional - backgroundCheckStatus: ..., - certifications: ..., // optional -}; - -// Call the `createStaffRef()` function to get a reference to the mutation. -const ref = createStaffRef(createStaffVars); -// Variables can be defined inline as well. -const ref = createStaffRef({ employeeName: ..., vendorId: ..., email: ..., position: ..., employmentType: ..., rating: ..., reliabilityScore: ..., backgroundCheckStatus: ..., certifications: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createStaffRef(dataConnect, createStaffVars); - -// 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.staff_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.staff_insert); -}); -``` - -## CreateVendor -You can execute the `CreateVendor` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createVendor(vars: CreateVendorVariables): MutationPromise; - -interface CreateVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorVariables): MutationRef; -} -export const createVendorRef: CreateVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createVendor(dc: DataConnect, vars: CreateVendorVariables): MutationPromise; - -interface CreateVendorRef { - ... - (dc: DataConnect, vars: CreateVendorVariables): MutationRef; -} -export const createVendorRef: CreateVendorRef; -``` - -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 createVendorRef: -```typescript -const name = createVendorRef.operationName; -console.log(name); -``` - -### Variables -The `CreateVendor` mutation requires an argument of type `CreateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateVendorVariables { - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; -} -``` -### Return Type -Recall that executing the `CreateVendor` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateVendorData { - vendor_insert: Vendor_Key; -} -``` -### Using `CreateVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createVendor, CreateVendorVariables } from '@dataconnect/generated'; - -// The `CreateVendor` mutation requires an argument of type `CreateVendorVariables`: -const createVendorVars: CreateVendorVariables = { - vendorNumber: ..., - legalName: ..., - region: ..., - platformType: ..., - primaryContactEmail: ..., - approvalStatus: ..., - isActive: ..., // optional -}; - -// Call the `createVendor()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createVendor(createVendorVars); -// Variables can be defined inline as well. -const { data } = await createVendor({ vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createVendor(dataConnect, createVendorVars); - -console.log(data.vendor_insert); - -// Or, you can use the `Promise` API. -createVendor(createVendorVars).then((response) => { - const data = response.data; - console.log(data.vendor_insert); -}); -``` - -### Using `CreateVendor`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createVendorRef, CreateVendorVariables } from '@dataconnect/generated'; - -// The `CreateVendor` mutation requires an argument of type `CreateVendorVariables`: -const createVendorVars: CreateVendorVariables = { - vendorNumber: ..., - legalName: ..., - region: ..., - platformType: ..., - primaryContactEmail: ..., - approvalStatus: ..., - isActive: ..., // optional -}; - -// Call the `createVendorRef()` function to get a reference to the mutation. -const ref = createVendorRef(createVendorVars); -// Variables can be defined inline as well. -const ref = createVendorRef({ vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createVendorRef(dataConnect, createVendorVars); - -// 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.vendor_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendor_insert); -}); -``` - -## UpdateVendor -You can execute the `UpdateVendor` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateVendor(vars: UpdateVendorVariables): MutationPromise; - -interface UpdateVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorVariables): MutationRef; -} -export const updateVendorRef: UpdateVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateVendor(dc: DataConnect, vars: UpdateVendorVariables): MutationPromise; - -interface UpdateVendorRef { - ... - (dc: DataConnect, vars: UpdateVendorVariables): MutationRef; -} -export const updateVendorRef: UpdateVendorRef; -``` - -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 updateVendorRef: -```typescript -const name = updateVendorRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateVendor` mutation requires an argument of type `UpdateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateVendorVariables { - id: UUIDString; - vendorNumber?: string | null; - legalName?: string | null; - region?: VendorRegion | null; - platformType?: VendorPlatformType | null; - primaryContactEmail?: string | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; -} -``` -### Return Type -Recall that executing the `UpdateVendor` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateVendorData { - vendor_update?: Vendor_Key | null; -} -``` -### Using `UpdateVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateVendor, UpdateVendorVariables } from '@dataconnect/generated'; - -// The `UpdateVendor` mutation requires an argument of type `UpdateVendorVariables`: -const updateVendorVars: UpdateVendorVariables = { - id: ..., - vendorNumber: ..., // optional - legalName: ..., // optional - region: ..., // optional - platformType: ..., // optional - primaryContactEmail: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional -}; - -// Call the `updateVendor()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateVendor(updateVendorVars); -// Variables can be defined inline as well. -const { data } = await updateVendor({ id: ..., vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateVendor(dataConnect, updateVendorVars); - -console.log(data.vendor_update); - -// Or, you can use the `Promise` API. -updateVendor(updateVendorVars).then((response) => { - const data = response.data; - console.log(data.vendor_update); -}); -``` - -### Using `UpdateVendor`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateVendorRef, UpdateVendorVariables } from '@dataconnect/generated'; - -// The `UpdateVendor` mutation requires an argument of type `UpdateVendorVariables`: -const updateVendorVars: UpdateVendorVariables = { - id: ..., - vendorNumber: ..., // optional - legalName: ..., // optional - region: ..., // optional - platformType: ..., // optional - primaryContactEmail: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional -}; - -// Call the `updateVendorRef()` function to get a reference to the mutation. -const ref = updateVendorRef(updateVendorVars); -// Variables can be defined inline as well. -const ref = updateVendorRef({ id: ..., vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateVendorRef(dataConnect, updateVendorVars); - -// 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.vendor_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendor_update); -}); -``` - -## DeleteVendor -You can execute the `DeleteVendor` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteVendor(vars: DeleteVendorVariables): MutationPromise; - -interface DeleteVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorVariables): MutationRef; -} -export const deleteVendorRef: DeleteVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteVendor(dc: DataConnect, vars: DeleteVendorVariables): MutationPromise; - -interface DeleteVendorRef { - ... - (dc: DataConnect, vars: DeleteVendorVariables): MutationRef; -} -export const deleteVendorRef: DeleteVendorRef; -``` - -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 deleteVendorRef: -```typescript -const name = deleteVendorRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteVendor` mutation requires an argument of type `DeleteVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteVendorVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteVendor` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteVendorData { - vendor_delete?: Vendor_Key | null; -} -``` -### Using `DeleteVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteVendor, DeleteVendorVariables } from '@dataconnect/generated'; - -// The `DeleteVendor` mutation requires an argument of type `DeleteVendorVariables`: -const deleteVendorVars: DeleteVendorVariables = { - id: ..., -}; - -// Call the `deleteVendor()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteVendor(deleteVendorVars); -// Variables can be defined inline as well. -const { data } = await deleteVendor({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteVendor(dataConnect, deleteVendorVars); - -console.log(data.vendor_delete); - -// Or, you can use the `Promise` API. -deleteVendor(deleteVendorVars).then((response) => { - const data = response.data; - console.log(data.vendor_delete); -}); -``` - -### Using `DeleteVendor`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorRef, DeleteVendorVariables } from '@dataconnect/generated'; - -// The `DeleteVendor` mutation requires an argument of type `DeleteVendorVariables`: -const deleteVendorVars: DeleteVendorVariables = { - id: ..., -}; - -// Call the `deleteVendorRef()` function to get a reference to the mutation. -const ref = deleteVendorRef(deleteVendorVars); -// Variables can be defined inline as well. -const ref = deleteVendorRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteVendorRef(dataConnect, deleteVendorVars); - -// 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.vendor_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendor_delete); -}); -``` - -## CreateVendorDefaultSetting -You can execute the `CreateVendorDefaultSetting` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createVendorDefaultSetting(vars: CreateVendorDefaultSettingVariables): MutationPromise; - -interface CreateVendorDefaultSettingRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorDefaultSettingVariables): MutationRef; -} -export const createVendorDefaultSettingRef: CreateVendorDefaultSettingRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createVendorDefaultSetting(dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationPromise; - -interface CreateVendorDefaultSettingRef { - ... - (dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationRef; -} -export const createVendorDefaultSettingRef: CreateVendorDefaultSettingRef; -``` - -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 createVendorDefaultSettingRef: -```typescript -const name = createVendorDefaultSettingRef.operationName; -console.log(name); -``` - -### Variables -The `CreateVendorDefaultSetting` mutation requires an argument of type `CreateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateVendorDefaultSettingVariables { - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; -} -``` -### Return Type -Recall that executing the `CreateVendorDefaultSetting` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateVendorDefaultSettingData { - vendorDefaultSetting_insert: VendorDefaultSetting_Key; -} -``` -### Using `CreateVendorDefaultSetting`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createVendorDefaultSetting, CreateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `CreateVendorDefaultSetting` mutation requires an argument of type `CreateVendorDefaultSettingVariables`: -const createVendorDefaultSettingVars: CreateVendorDefaultSettingVariables = { - vendorName: ..., - defaultMarkupPercentage: ..., - defaultVendorFeePercentage: ..., -}; - -// Call the `createVendorDefaultSetting()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createVendorDefaultSetting(createVendorDefaultSettingVars); -// Variables can be defined inline as well. -const { data } = await createVendorDefaultSetting({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createVendorDefaultSetting(dataConnect, createVendorDefaultSettingVars); - -console.log(data.vendorDefaultSetting_insert); - -// Or, you can use the `Promise` API. -createVendorDefaultSetting(createVendorDefaultSettingVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_insert); -}); -``` - -### Using `CreateVendorDefaultSetting`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createVendorDefaultSettingRef, CreateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `CreateVendorDefaultSetting` mutation requires an argument of type `CreateVendorDefaultSettingVariables`: -const createVendorDefaultSettingVars: CreateVendorDefaultSettingVariables = { - vendorName: ..., - defaultMarkupPercentage: ..., - defaultVendorFeePercentage: ..., -}; - -// Call the `createVendorDefaultSettingRef()` function to get a reference to the mutation. -const ref = createVendorDefaultSettingRef(createVendorDefaultSettingVars); -// Variables can be defined inline as well. -const ref = createVendorDefaultSettingRef({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createVendorDefaultSettingRef(dataConnect, createVendorDefaultSettingVars); - -// 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.vendorDefaultSetting_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_insert); -}); -``` - -## UpdateVendorDefaultSetting -You can execute the `UpdateVendorDefaultSetting` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateVendorDefaultSetting(vars: UpdateVendorDefaultSettingVariables): MutationPromise; - -interface UpdateVendorDefaultSettingRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorDefaultSettingVariables): MutationRef; -} -export const updateVendorDefaultSettingRef: UpdateVendorDefaultSettingRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateVendorDefaultSetting(dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationPromise; - -interface UpdateVendorDefaultSettingRef { - ... - (dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationRef; -} -export const updateVendorDefaultSettingRef: UpdateVendorDefaultSettingRef; -``` - -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 updateVendorDefaultSettingRef: -```typescript -const name = updateVendorDefaultSettingRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateVendorDefaultSetting` mutation requires an argument of type `UpdateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateVendorDefaultSettingVariables { - id: UUIDString; - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that executing the `UpdateVendorDefaultSetting` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateVendorDefaultSettingData { - vendorDefaultSetting_update?: VendorDefaultSetting_Key | null; -} -``` -### Using `UpdateVendorDefaultSetting`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateVendorDefaultSetting, UpdateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `UpdateVendorDefaultSetting` mutation requires an argument of type `UpdateVendorDefaultSettingVariables`: -const updateVendorDefaultSettingVars: UpdateVendorDefaultSettingVariables = { - id: ..., - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `updateVendorDefaultSetting()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateVendorDefaultSetting(updateVendorDefaultSettingVars); -// Variables can be defined inline as well. -const { data } = await updateVendorDefaultSetting({ id: ..., vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateVendorDefaultSetting(dataConnect, updateVendorDefaultSettingVars); - -console.log(data.vendorDefaultSetting_update); - -// Or, you can use the `Promise` API. -updateVendorDefaultSetting(updateVendorDefaultSettingVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_update); -}); -``` - -### Using `UpdateVendorDefaultSetting`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateVendorDefaultSettingRef, UpdateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `UpdateVendorDefaultSetting` mutation requires an argument of type `UpdateVendorDefaultSettingVariables`: -const updateVendorDefaultSettingVars: UpdateVendorDefaultSettingVariables = { - id: ..., - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `updateVendorDefaultSettingRef()` function to get a reference to the mutation. -const ref = updateVendorDefaultSettingRef(updateVendorDefaultSettingVars); -// Variables can be defined inline as well. -const ref = updateVendorDefaultSettingRef({ id: ..., vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateVendorDefaultSettingRef(dataConnect, updateVendorDefaultSettingVars); - -// 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.vendorDefaultSetting_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_update); -}); -``` - -## DeleteVendorDefaultSetting -You can execute the `DeleteVendorDefaultSetting` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteVendorDefaultSetting(vars: DeleteVendorDefaultSettingVariables): MutationPromise; - -interface DeleteVendorDefaultSettingRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorDefaultSettingVariables): MutationRef; -} -export const deleteVendorDefaultSettingRef: DeleteVendorDefaultSettingRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteVendorDefaultSetting(dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationPromise; - -interface DeleteVendorDefaultSettingRef { - ... - (dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationRef; -} -export const deleteVendorDefaultSettingRef: DeleteVendorDefaultSettingRef; -``` - -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 deleteVendorDefaultSettingRef: -```typescript -const name = deleteVendorDefaultSettingRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteVendorDefaultSetting` mutation requires an argument of type `DeleteVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteVendorDefaultSettingVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteVendorDefaultSetting` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteVendorDefaultSettingData { - vendorDefaultSetting_delete?: VendorDefaultSetting_Key | null; -} -``` -### Using `DeleteVendorDefaultSetting`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorDefaultSetting, DeleteVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `DeleteVendorDefaultSetting` mutation requires an argument of type `DeleteVendorDefaultSettingVariables`: -const deleteVendorDefaultSettingVars: DeleteVendorDefaultSettingVariables = { - id: ..., -}; - -// Call the `deleteVendorDefaultSetting()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteVendorDefaultSetting(deleteVendorDefaultSettingVars); -// Variables can be defined inline as well. -const { data } = await deleteVendorDefaultSetting({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteVendorDefaultSetting(dataConnect, deleteVendorDefaultSettingVars); - -console.log(data.vendorDefaultSetting_delete); - -// Or, you can use the `Promise` API. -deleteVendorDefaultSetting(deleteVendorDefaultSettingVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_delete); -}); -``` - -### Using `DeleteVendorDefaultSetting`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorDefaultSettingRef, DeleteVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `DeleteVendorDefaultSetting` mutation requires an argument of type `DeleteVendorDefaultSettingVariables`: -const deleteVendorDefaultSettingVars: DeleteVendorDefaultSettingVariables = { - id: ..., -}; - -// Call the `deleteVendorDefaultSettingRef()` function to get a reference to the mutation. -const ref = deleteVendorDefaultSettingRef(deleteVendorDefaultSettingVars); -// Variables can be defined inline as well. -const ref = deleteVendorDefaultSettingRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteVendorDefaultSettingRef(dataConnect, deleteVendorDefaultSettingVars); - -// 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.vendorDefaultSetting_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_delete); -}); -``` - -## CreateBusiness -You can execute the `CreateBusiness` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createBusiness(vars: CreateBusinessVariables): MutationPromise; - -interface CreateBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateBusinessVariables): MutationRef; -} -export const createBusinessRef: CreateBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createBusiness(dc: DataConnect, vars: CreateBusinessVariables): MutationPromise; - -interface CreateBusinessRef { - ... - (dc: DataConnect, vars: CreateBusinessVariables): MutationRef; -} -export const createBusinessRef: CreateBusinessRef; -``` - -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 createBusinessRef: -```typescript -const name = createBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `CreateBusiness` mutation requires an argument of type `CreateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateBusinessVariables { - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that executing the `CreateBusiness` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateBusinessData { - business_insert: Business_Key; -} -``` -### Using `CreateBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createBusiness, CreateBusinessVariables } from '@dataconnect/generated'; - -// The `CreateBusiness` mutation requires an argument of type `CreateBusinessVariables`: -const createBusinessVars: CreateBusinessVariables = { - businessName: ..., - contactName: ..., - email: ..., // optional - sector: ..., // optional - rateGroup: ..., - status: ..., // optional -}; - -// Call the `createBusiness()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createBusiness(createBusinessVars); -// Variables can be defined inline as well. -const { data } = await createBusiness({ businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createBusiness(dataConnect, createBusinessVars); - -console.log(data.business_insert); - -// Or, you can use the `Promise` API. -createBusiness(createBusinessVars).then((response) => { - const data = response.data; - console.log(data.business_insert); -}); -``` - -### Using `CreateBusiness`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createBusinessRef, CreateBusinessVariables } from '@dataconnect/generated'; - -// The `CreateBusiness` mutation requires an argument of type `CreateBusinessVariables`: -const createBusinessVars: CreateBusinessVariables = { - businessName: ..., - contactName: ..., - email: ..., // optional - sector: ..., // optional - rateGroup: ..., - status: ..., // optional -}; - -// Call the `createBusinessRef()` function to get a reference to the mutation. -const ref = createBusinessRef(createBusinessVars); -// Variables can be defined inline as well. -const ref = createBusinessRef({ businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createBusinessRef(dataConnect, createBusinessVars); - -// 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.business_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.business_insert); -}); -``` - -## UpdateBusiness -You can execute the `UpdateBusiness` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateBusiness(vars: UpdateBusinessVariables): MutationPromise; - -interface UpdateBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateBusinessVariables): MutationRef; -} -export const updateBusinessRef: UpdateBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateBusiness(dc: DataConnect, vars: UpdateBusinessVariables): MutationPromise; - -interface UpdateBusinessRef { - ... - (dc: DataConnect, vars: UpdateBusinessVariables): MutationRef; -} -export const updateBusinessRef: UpdateBusinessRef; -``` - -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 updateBusinessRef: -```typescript -const name = updateBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateBusiness` mutation requires an argument of type `UpdateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateBusinessVariables { - id: UUIDString; - businessName?: string | null; - contactName?: string | null; - email?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that executing the `UpdateBusiness` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateBusinessData { - business_update?: Business_Key | null; -} -``` -### Using `UpdateBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateBusiness, UpdateBusinessVariables } from '@dataconnect/generated'; - -// The `UpdateBusiness` mutation requires an argument of type `UpdateBusinessVariables`: -const updateBusinessVars: UpdateBusinessVariables = { - id: ..., - businessName: ..., // optional - contactName: ..., // optional - email: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `updateBusiness()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateBusiness(updateBusinessVars); -// Variables can be defined inline as well. -const { data } = await updateBusiness({ id: ..., businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateBusiness(dataConnect, updateBusinessVars); - -console.log(data.business_update); - -// Or, you can use the `Promise` API. -updateBusiness(updateBusinessVars).then((response) => { - const data = response.data; - console.log(data.business_update); -}); -``` - -### Using `UpdateBusiness`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateBusinessRef, UpdateBusinessVariables } from '@dataconnect/generated'; - -// The `UpdateBusiness` mutation requires an argument of type `UpdateBusinessVariables`: -const updateBusinessVars: UpdateBusinessVariables = { - id: ..., - businessName: ..., // optional - contactName: ..., // optional - email: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `updateBusinessRef()` function to get a reference to the mutation. -const ref = updateBusinessRef(updateBusinessVars); -// Variables can be defined inline as well. -const ref = updateBusinessRef({ id: ..., businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateBusinessRef(dataConnect, updateBusinessVars); - -// 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.business_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.business_update); -}); -``` - -## DeleteBusiness -You can execute the `DeleteBusiness` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteBusiness(vars: DeleteBusinessVariables): MutationPromise; - -interface DeleteBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteBusinessVariables): MutationRef; -} -export const deleteBusinessRef: DeleteBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteBusiness(dc: DataConnect, vars: DeleteBusinessVariables): MutationPromise; - -interface DeleteBusinessRef { - ... - (dc: DataConnect, vars: DeleteBusinessVariables): MutationRef; -} -export const deleteBusinessRef: DeleteBusinessRef; -``` - -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 deleteBusinessRef: -```typescript -const name = deleteBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteBusiness` mutation requires an argument of type `DeleteBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteBusinessVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteBusiness` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteBusinessData { - business_delete?: Business_Key | null; -} -``` -### Using `DeleteBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteBusiness, DeleteBusinessVariables } from '@dataconnect/generated'; - -// The `DeleteBusiness` mutation requires an argument of type `DeleteBusinessVariables`: -const deleteBusinessVars: DeleteBusinessVariables = { - id: ..., -}; - -// Call the `deleteBusiness()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteBusiness(deleteBusinessVars); -// Variables can be defined inline as well. -const { data } = await deleteBusiness({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteBusiness(dataConnect, deleteBusinessVars); - -console.log(data.business_delete); - -// Or, you can use the `Promise` API. -deleteBusiness(deleteBusinessVars).then((response) => { - const data = response.data; - console.log(data.business_delete); -}); -``` - -### Using `DeleteBusiness`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteBusinessRef, DeleteBusinessVariables } from '@dataconnect/generated'; - -// The `DeleteBusiness` mutation requires an argument of type `DeleteBusinessVariables`: -const deleteBusinessVars: DeleteBusinessVariables = { - id: ..., -}; - -// Call the `deleteBusinessRef()` function to get a reference to the mutation. -const ref = deleteBusinessRef(deleteBusinessVars); -// Variables can be defined inline as well. -const ref = deleteBusinessRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteBusinessRef(dataConnect, deleteBusinessVars); - -// 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.business_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.business_delete); -}); -``` - diff --git a/frontend-web/src/dataconnect-generated/esm/index.esm.js b/frontend-web/src/dataconnect-generated/esm/index.esm.js deleted file mode 100644 index 19fba0a5..00000000 --- a/frontend-web/src/dataconnect-generated/esm/index.esm.js +++ /dev/null @@ -1,535 +0,0 @@ -import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; - -export const BackgroundCheckStatus = { - PENDING: "PENDING", - CLEARED: "CLEARED", - FAILED: "FAILED", - EXPIRED: "EXPIRED", -} - -export const BusinessRateGroup = { - STANDARD: "STANDARD", - PREMIUM: "PREMIUM", - ENTERPRISE: "ENTERPRISE", - CUSTOM: "CUSTOM", -} - -export const BusinessSector = { - BON_APPETIT: "BON_APPETIT", - EUREST: "EUREST", - ARAMARK: "ARAMARK", - EPICUREAN_GROUP: "EPICUREAN_GROUP", - CHARTWELLS: "CHARTWELLS", - OTHER: "OTHER", -} - -export const BusinessStatus = { - ACTIVE: "ACTIVE", - INACTIVE: "INACTIVE", - PENDING: "PENDING", -} - -export const ContractType = { - W2: "W2", - C1099: "C1099", - TEMP: "TEMP", - CONTRACT: "CONTRACT", -} - -export const EmploymentType = { - FULL_TIME: "FULL_TIME", - PART_TIME: "PART_TIME", - ON_CALL: "ON_CALL", - CONTRACT: "CONTRACT", -} - -export const EventStatus = { - DRAFT: "DRAFT", - ACTIVE: "ACTIVE", - PENDING: "PENDING", - ASSIGNED: "ASSIGNED", - CONFIRMED: "CONFIRMED", - COMPLETED: "COMPLETED", - CANCELED: "CANCELED", -} - -export const InvoiceStatus = { - DRAFT: "DRAFT", - PENDING_REVIEW: "PENDING_REVIEW", - APPROVED: "APPROVED", - DISPUTED: "DISPUTED", - UNDER_REVIEW: "UNDER_REVIEW", - RESOLVED: "RESOLVED", - OVERDUE: "OVERDUE", - PAID: "PAID", - RECONCILED: "RECONCILED", - CANCELLED: "CANCELLED", -} - -export const RecurrenceType = { - SINGLE: "SINGLE", - DATE_RANGE: "DATE_RANGE", - SCATTER: "SCATTER", -} - -export const VendorApprovalStatus = { - PENDING: "PENDING", - APPROVED: "APPROVED", - SUSPENDED: "SUSPENDED", - TERMINATED: "TERMINATED", -} - -export const VendorPlatformType = { - FULL_PLATFORM: "FULL_PLATFORM", - BUILDING_PLATFORM: "BUILDING_PLATFORM", - PARTIAL_TECH: "PARTIAL_TECH", - TRADITIONAL: "TRADITIONAL", -} - -export const VendorRateCategory = { - KITCHEN_AND_CULINARY: "KITCHEN_AND_CULINARY", - CONCESSIONS: "CONCESSIONS", - FACILITIES: "FACILITIES", - BARTENDING: "BARTENDING", - SECURITY: "SECURITY", - EVENT_STAFF: "EVENT_STAFF", - MANAGEMENT: "MANAGEMENT", - TECHNICAL: "TECHNICAL", - OTHER: "OTHER", -} - -export const VendorRegion = { - NATIONAL: "NATIONAL", - BAY_AREA: "BAY_AREA", - SOUTHERN_CALIFORNIA: "SOUTHERN_CALIFORNIA", - NORTHERN_CALIFORNIA: "NORTHERN_CALIFORNIA", - WEST: "WEST", - EAST: "EAST", - MIDWEST: "MIDWEST", - SOUTH: "SOUTH", -} - -export const connectorConfig = { - connector: 'krow-connector', - service: 'krow-workforce-db', - location: 'us-central1' -}; - -export const listBusinessRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listBusiness'); -} -listBusinessRef.operationName = 'listBusiness'; - -export function listBusiness(dc) { - return executeQuery(listBusinessRef(dc)); -} - -export const getBusinessByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getBusinessById', inputVars); -} -getBusinessByIdRef.operationName = 'getBusinessById'; - -export function getBusinessById(dcOrVars, vars) { - return executeQuery(getBusinessByIdRef(dcOrVars, vars)); -} - -export const filterBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterBusiness', inputVars); -} -filterBusinessRef.operationName = 'filterBusiness'; - -export function filterBusiness(dcOrVars, vars) { - return executeQuery(filterBusinessRef(dcOrVars, vars)); -} - -export const createEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateEvent', inputVars); -} -createEventRef.operationName = 'CreateEvent'; - -export function createEvent(dcOrVars, vars) { - return executeMutation(createEventRef(dcOrVars, vars)); -} - -export const updateEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateEvent', inputVars); -} -updateEventRef.operationName = 'UpdateEvent'; - -export function updateEvent(dcOrVars, vars) { - return executeMutation(updateEventRef(dcOrVars, vars)); -} - -export const deleteEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteEvent', inputVars); -} -deleteEventRef.operationName = 'DeleteEvent'; - -export function deleteEvent(dcOrVars, vars) { - return executeMutation(deleteEventRef(dcOrVars, vars)); -} - -export const listVendorDefaultSettingsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorDefaultSettings'); -} -listVendorDefaultSettingsRef.operationName = 'listVendorDefaultSettings'; - -export function listVendorDefaultSettings(dc) { - return executeQuery(listVendorDefaultSettingsRef(dc)); -} - -export const getVendorDefaultSettingByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorDefaultSettingById', inputVars); -} -getVendorDefaultSettingByIdRef.operationName = 'getVendorDefaultSettingById'; - -export function getVendorDefaultSettingById(dcOrVars, vars) { - return executeQuery(getVendorDefaultSettingByIdRef(dcOrVars, vars)); -} - -export const filterVendorDefaultSettingsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorDefaultSettings', inputVars); -} -filterVendorDefaultSettingsRef.operationName = 'filterVendorDefaultSettings'; - -export function filterVendorDefaultSettings(dcOrVars, vars) { - return executeQuery(filterVendorDefaultSettingsRef(dcOrVars, vars)); -} - -export const createVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorRate', inputVars); -} -createVendorRateRef.operationName = 'CreateVendorRate'; - -export function createVendorRate(dcOrVars, vars) { - return executeMutation(createVendorRateRef(dcOrVars, vars)); -} - -export const updateVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorRate', inputVars); -} -updateVendorRateRef.operationName = 'UpdateVendorRate'; - -export function updateVendorRate(dcOrVars, vars) { - return executeMutation(updateVendorRateRef(dcOrVars, vars)); -} - -export const deleteVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorRate', inputVars); -} -deleteVendorRateRef.operationName = 'DeleteVendorRate'; - -export function deleteVendorRate(dcOrVars, vars) { - return executeMutation(deleteVendorRateRef(dcOrVars, vars)); -} - -export const listVendorRateRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorRate'); -} -listVendorRateRef.operationName = 'listVendorRate'; - -export function listVendorRate(dc) { - return executeQuery(listVendorRateRef(dc)); -} - -export const getVendorRateByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorRateById', inputVars); -} -getVendorRateByIdRef.operationName = 'getVendorRateById'; - -export function getVendorRateById(dcOrVars, vars) { - return executeQuery(getVendorRateByIdRef(dcOrVars, vars)); -} - -export const filterVendorRatesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorRates', inputVars); -} -filterVendorRatesRef.operationName = 'filterVendorRates'; - -export function filterVendorRates(dcOrVars, vars) { - return executeQuery(filterVendorRatesRef(dcOrVars, vars)); -} - -export const listEventsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listEvents'); -} -listEventsRef.operationName = 'listEvents'; - -export function listEvents(dc) { - return executeQuery(listEventsRef(dc)); -} - -export const getEventByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getEventById', inputVars); -} -getEventByIdRef.operationName = 'getEventById'; - -export function getEventById(dcOrVars, vars) { - return executeQuery(getEventByIdRef(dcOrVars, vars)); -} - -export const filterEventsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterEvents', inputVars); -} -filterEventsRef.operationName = 'filterEvents'; - -export function filterEvents(dcOrVars, vars) { - return executeQuery(filterEventsRef(dcOrVars, vars)); -} - -export const createInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateInvoice', inputVars); -} -createInvoiceRef.operationName = 'CreateInvoice'; - -export function createInvoice(dcOrVars, vars) { - return executeMutation(createInvoiceRef(dcOrVars, vars)); -} - -export const updateInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateInvoice', inputVars); -} -updateInvoiceRef.operationName = 'UpdateInvoice'; - -export function updateInvoice(dcOrVars, vars) { - return executeMutation(updateInvoiceRef(dcOrVars, vars)); -} - -export const deleteInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteInvoice', inputVars); -} -deleteInvoiceRef.operationName = 'DeleteInvoice'; - -export function deleteInvoice(dcOrVars, vars) { - return executeMutation(deleteInvoiceRef(dcOrVars, vars)); -} - -export const listInvoiceRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listInvoice'); -} -listInvoiceRef.operationName = 'listInvoice'; - -export function listInvoice(dc) { - return executeQuery(listInvoiceRef(dc)); -} - -export const getInvoiceByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getInvoiceById', inputVars); -} -getInvoiceByIdRef.operationName = 'getInvoiceById'; - -export function getInvoiceById(dcOrVars, vars) { - return executeQuery(getInvoiceByIdRef(dcOrVars, vars)); -} - -export const filterInvoicesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterInvoices', inputVars); -} -filterInvoicesRef.operationName = 'filterInvoices'; - -export function filterInvoices(dcOrVars, vars) { - return executeQuery(filterInvoicesRef(dcOrVars, vars)); -} - -export const createStaffRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateStaff', inputVars); -} -createStaffRef.operationName = 'CreateStaff'; - -export function createStaff(dcOrVars, vars) { - return executeMutation(createStaffRef(dcOrVars, vars)); -} - -export const listStaffRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listStaff'); -} -listStaffRef.operationName = 'listStaff'; - -export function listStaff(dc) { - return executeQuery(listStaffRef(dc)); -} - -export const createVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendor', inputVars); -} -createVendorRef.operationName = 'CreateVendor'; - -export function createVendor(dcOrVars, vars) { - return executeMutation(createVendorRef(dcOrVars, vars)); -} - -export const updateVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendor', inputVars); -} -updateVendorRef.operationName = 'UpdateVendor'; - -export function updateVendor(dcOrVars, vars) { - return executeMutation(updateVendorRef(dcOrVars, vars)); -} - -export const deleteVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendor', inputVars); -} -deleteVendorRef.operationName = 'DeleteVendor'; - -export function deleteVendor(dcOrVars, vars) { - return executeMutation(deleteVendorRef(dcOrVars, vars)); -} - -export const listVendorRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendor'); -} -listVendorRef.operationName = 'listVendor'; - -export function listVendor(dc) { - return executeQuery(listVendorRef(dc)); -} - -export const getVendorByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorById', inputVars); -} -getVendorByIdRef.operationName = 'getVendorById'; - -export function getVendorById(dcOrVars, vars) { - return executeQuery(getVendorByIdRef(dcOrVars, vars)); -} - -export const filterVendorsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendors', inputVars); -} -filterVendorsRef.operationName = 'filterVendors'; - -export function filterVendors(dcOrVars, vars) { - return executeQuery(filterVendorsRef(dcOrVars, vars)); -} - -export const createVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorDefaultSetting', inputVars); -} -createVendorDefaultSettingRef.operationName = 'CreateVendorDefaultSetting'; - -export function createVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(createVendorDefaultSettingRef(dcOrVars, vars)); -} - -export const updateVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorDefaultSetting', inputVars); -} -updateVendorDefaultSettingRef.operationName = 'UpdateVendorDefaultSetting'; - -export function updateVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(updateVendorDefaultSettingRef(dcOrVars, vars)); -} - -export const deleteVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorDefaultSetting', inputVars); -} -deleteVendorDefaultSettingRef.operationName = 'DeleteVendorDefaultSetting'; - -export function deleteVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(deleteVendorDefaultSettingRef(dcOrVars, vars)); -} - -export const createBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateBusiness', inputVars); -} -createBusinessRef.operationName = 'CreateBusiness'; - -export function createBusiness(dcOrVars, vars) { - return executeMutation(createBusinessRef(dcOrVars, vars)); -} - -export const updateBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateBusiness', inputVars); -} -updateBusinessRef.operationName = 'UpdateBusiness'; - -export function updateBusiness(dcOrVars, vars) { - return executeMutation(updateBusinessRef(dcOrVars, vars)); -} - -export const deleteBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteBusiness', inputVars); -} -deleteBusinessRef.operationName = 'DeleteBusiness'; - -export function deleteBusiness(dcOrVars, vars) { - return executeMutation(deleteBusinessRef(dcOrVars, vars)); -} - diff --git a/frontend-web/src/dataconnect-generated/esm/package.json b/frontend-web/src/dataconnect-generated/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/frontend-web/src/dataconnect-generated/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/frontend-web/src/dataconnect-generated/index.cjs.js b/frontend-web/src/dataconnect-generated/index.cjs.js deleted file mode 100644 index 97caf790..00000000 --- a/frontend-web/src/dataconnect-generated/index.cjs.js +++ /dev/null @@ -1,586 +0,0 @@ -const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); - -const BackgroundCheckStatus = { - PENDING: "PENDING", - CLEARED: "CLEARED", - FAILED: "FAILED", - EXPIRED: "EXPIRED", -} -exports.BackgroundCheckStatus = BackgroundCheckStatus; - -const BusinessRateGroup = { - STANDARD: "STANDARD", - PREMIUM: "PREMIUM", - ENTERPRISE: "ENTERPRISE", - CUSTOM: "CUSTOM", -} -exports.BusinessRateGroup = BusinessRateGroup; - -const BusinessSector = { - BON_APPETIT: "BON_APPETIT", - EUREST: "EUREST", - ARAMARK: "ARAMARK", - EPICUREAN_GROUP: "EPICUREAN_GROUP", - CHARTWELLS: "CHARTWELLS", - OTHER: "OTHER", -} -exports.BusinessSector = BusinessSector; - -const BusinessStatus = { - ACTIVE: "ACTIVE", - INACTIVE: "INACTIVE", - PENDING: "PENDING", -} -exports.BusinessStatus = BusinessStatus; - -const ContractType = { - W2: "W2", - C1099: "C1099", - TEMP: "TEMP", - CONTRACT: "CONTRACT", -} -exports.ContractType = ContractType; - -const EmploymentType = { - FULL_TIME: "FULL_TIME", - PART_TIME: "PART_TIME", - ON_CALL: "ON_CALL", - CONTRACT: "CONTRACT", -} -exports.EmploymentType = EmploymentType; - -const EventStatus = { - DRAFT: "DRAFT", - ACTIVE: "ACTIVE", - PENDING: "PENDING", - ASSIGNED: "ASSIGNED", - CONFIRMED: "CONFIRMED", - COMPLETED: "COMPLETED", - CANCELED: "CANCELED", -} -exports.EventStatus = EventStatus; - -const InvoiceStatus = { - DRAFT: "DRAFT", - PENDING_REVIEW: "PENDING_REVIEW", - APPROVED: "APPROVED", - DISPUTED: "DISPUTED", - UNDER_REVIEW: "UNDER_REVIEW", - RESOLVED: "RESOLVED", - OVERDUE: "OVERDUE", - PAID: "PAID", - RECONCILED: "RECONCILED", - CANCELLED: "CANCELLED", -} -exports.InvoiceStatus = InvoiceStatus; - -const RecurrenceType = { - SINGLE: "SINGLE", - DATE_RANGE: "DATE_RANGE", - SCATTER: "SCATTER", -} -exports.RecurrenceType = RecurrenceType; - -const VendorApprovalStatus = { - PENDING: "PENDING", - APPROVED: "APPROVED", - SUSPENDED: "SUSPENDED", - TERMINATED: "TERMINATED", -} -exports.VendorApprovalStatus = VendorApprovalStatus; - -const VendorPlatformType = { - FULL_PLATFORM: "FULL_PLATFORM", - BUILDING_PLATFORM: "BUILDING_PLATFORM", - PARTIAL_TECH: "PARTIAL_TECH", - TRADITIONAL: "TRADITIONAL", -} -exports.VendorPlatformType = VendorPlatformType; - -const VendorRateCategory = { - KITCHEN_AND_CULINARY: "KITCHEN_AND_CULINARY", - CONCESSIONS: "CONCESSIONS", - FACILITIES: "FACILITIES", - BARTENDING: "BARTENDING", - SECURITY: "SECURITY", - EVENT_STAFF: "EVENT_STAFF", - MANAGEMENT: "MANAGEMENT", - TECHNICAL: "TECHNICAL", - OTHER: "OTHER", -} -exports.VendorRateCategory = VendorRateCategory; - -const VendorRegion = { - NATIONAL: "NATIONAL", - BAY_AREA: "BAY_AREA", - SOUTHERN_CALIFORNIA: "SOUTHERN_CALIFORNIA", - NORTHERN_CALIFORNIA: "NORTHERN_CALIFORNIA", - WEST: "WEST", - EAST: "EAST", - MIDWEST: "MIDWEST", - SOUTH: "SOUTH", -} -exports.VendorRegion = VendorRegion; - -const connectorConfig = { - connector: 'krow-connector', - service: 'krow-workforce-db', - location: 'us-central1' -}; -exports.connectorConfig = connectorConfig; - -const listBusinessRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listBusiness'); -} -listBusinessRef.operationName = 'listBusiness'; -exports.listBusinessRef = listBusinessRef; - -exports.listBusiness = function listBusiness(dc) { - return executeQuery(listBusinessRef(dc)); -}; - -const getBusinessByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getBusinessById', inputVars); -} -getBusinessByIdRef.operationName = 'getBusinessById'; -exports.getBusinessByIdRef = getBusinessByIdRef; - -exports.getBusinessById = function getBusinessById(dcOrVars, vars) { - return executeQuery(getBusinessByIdRef(dcOrVars, vars)); -}; - -const filterBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterBusiness', inputVars); -} -filterBusinessRef.operationName = 'filterBusiness'; -exports.filterBusinessRef = filterBusinessRef; - -exports.filterBusiness = function filterBusiness(dcOrVars, vars) { - return executeQuery(filterBusinessRef(dcOrVars, vars)); -}; - -const createEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateEvent', inputVars); -} -createEventRef.operationName = 'CreateEvent'; -exports.createEventRef = createEventRef; - -exports.createEvent = function createEvent(dcOrVars, vars) { - return executeMutation(createEventRef(dcOrVars, vars)); -}; - -const updateEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateEvent', inputVars); -} -updateEventRef.operationName = 'UpdateEvent'; -exports.updateEventRef = updateEventRef; - -exports.updateEvent = function updateEvent(dcOrVars, vars) { - return executeMutation(updateEventRef(dcOrVars, vars)); -}; - -const deleteEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteEvent', inputVars); -} -deleteEventRef.operationName = 'DeleteEvent'; -exports.deleteEventRef = deleteEventRef; - -exports.deleteEvent = function deleteEvent(dcOrVars, vars) { - return executeMutation(deleteEventRef(dcOrVars, vars)); -}; - -const listVendorDefaultSettingsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorDefaultSettings'); -} -listVendorDefaultSettingsRef.operationName = 'listVendorDefaultSettings'; -exports.listVendorDefaultSettingsRef = listVendorDefaultSettingsRef; - -exports.listVendorDefaultSettings = function listVendorDefaultSettings(dc) { - return executeQuery(listVendorDefaultSettingsRef(dc)); -}; - -const getVendorDefaultSettingByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorDefaultSettingById', inputVars); -} -getVendorDefaultSettingByIdRef.operationName = 'getVendorDefaultSettingById'; -exports.getVendorDefaultSettingByIdRef = getVendorDefaultSettingByIdRef; - -exports.getVendorDefaultSettingById = function getVendorDefaultSettingById(dcOrVars, vars) { - return executeQuery(getVendorDefaultSettingByIdRef(dcOrVars, vars)); -}; - -const filterVendorDefaultSettingsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorDefaultSettings', inputVars); -} -filterVendorDefaultSettingsRef.operationName = 'filterVendorDefaultSettings'; -exports.filterVendorDefaultSettingsRef = filterVendorDefaultSettingsRef; - -exports.filterVendorDefaultSettings = function filterVendorDefaultSettings(dcOrVars, vars) { - return executeQuery(filterVendorDefaultSettingsRef(dcOrVars, vars)); -}; - -const createVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorRate', inputVars); -} -createVendorRateRef.operationName = 'CreateVendorRate'; -exports.createVendorRateRef = createVendorRateRef; - -exports.createVendorRate = function createVendorRate(dcOrVars, vars) { - return executeMutation(createVendorRateRef(dcOrVars, vars)); -}; - -const updateVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorRate', inputVars); -} -updateVendorRateRef.operationName = 'UpdateVendorRate'; -exports.updateVendorRateRef = updateVendorRateRef; - -exports.updateVendorRate = function updateVendorRate(dcOrVars, vars) { - return executeMutation(updateVendorRateRef(dcOrVars, vars)); -}; - -const deleteVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorRate', inputVars); -} -deleteVendorRateRef.operationName = 'DeleteVendorRate'; -exports.deleteVendorRateRef = deleteVendorRateRef; - -exports.deleteVendorRate = function deleteVendorRate(dcOrVars, vars) { - return executeMutation(deleteVendorRateRef(dcOrVars, vars)); -}; - -const listVendorRateRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorRate'); -} -listVendorRateRef.operationName = 'listVendorRate'; -exports.listVendorRateRef = listVendorRateRef; - -exports.listVendorRate = function listVendorRate(dc) { - return executeQuery(listVendorRateRef(dc)); -}; - -const getVendorRateByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorRateById', inputVars); -} -getVendorRateByIdRef.operationName = 'getVendorRateById'; -exports.getVendorRateByIdRef = getVendorRateByIdRef; - -exports.getVendorRateById = function getVendorRateById(dcOrVars, vars) { - return executeQuery(getVendorRateByIdRef(dcOrVars, vars)); -}; - -const filterVendorRatesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorRates', inputVars); -} -filterVendorRatesRef.operationName = 'filterVendorRates'; -exports.filterVendorRatesRef = filterVendorRatesRef; - -exports.filterVendorRates = function filterVendorRates(dcOrVars, vars) { - return executeQuery(filterVendorRatesRef(dcOrVars, vars)); -}; - -const listEventsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listEvents'); -} -listEventsRef.operationName = 'listEvents'; -exports.listEventsRef = listEventsRef; - -exports.listEvents = function listEvents(dc) { - return executeQuery(listEventsRef(dc)); -}; - -const getEventByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getEventById', inputVars); -} -getEventByIdRef.operationName = 'getEventById'; -exports.getEventByIdRef = getEventByIdRef; - -exports.getEventById = function getEventById(dcOrVars, vars) { - return executeQuery(getEventByIdRef(dcOrVars, vars)); -}; - -const filterEventsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterEvents', inputVars); -} -filterEventsRef.operationName = 'filterEvents'; -exports.filterEventsRef = filterEventsRef; - -exports.filterEvents = function filterEvents(dcOrVars, vars) { - return executeQuery(filterEventsRef(dcOrVars, vars)); -}; - -const createInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateInvoice', inputVars); -} -createInvoiceRef.operationName = 'CreateInvoice'; -exports.createInvoiceRef = createInvoiceRef; - -exports.createInvoice = function createInvoice(dcOrVars, vars) { - return executeMutation(createInvoiceRef(dcOrVars, vars)); -}; - -const updateInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateInvoice', inputVars); -} -updateInvoiceRef.operationName = 'UpdateInvoice'; -exports.updateInvoiceRef = updateInvoiceRef; - -exports.updateInvoice = function updateInvoice(dcOrVars, vars) { - return executeMutation(updateInvoiceRef(dcOrVars, vars)); -}; - -const deleteInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteInvoice', inputVars); -} -deleteInvoiceRef.operationName = 'DeleteInvoice'; -exports.deleteInvoiceRef = deleteInvoiceRef; - -exports.deleteInvoice = function deleteInvoice(dcOrVars, vars) { - return executeMutation(deleteInvoiceRef(dcOrVars, vars)); -}; - -const listInvoiceRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listInvoice'); -} -listInvoiceRef.operationName = 'listInvoice'; -exports.listInvoiceRef = listInvoiceRef; - -exports.listInvoice = function listInvoice(dc) { - return executeQuery(listInvoiceRef(dc)); -}; - -const getInvoiceByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getInvoiceById', inputVars); -} -getInvoiceByIdRef.operationName = 'getInvoiceById'; -exports.getInvoiceByIdRef = getInvoiceByIdRef; - -exports.getInvoiceById = function getInvoiceById(dcOrVars, vars) { - return executeQuery(getInvoiceByIdRef(dcOrVars, vars)); -}; - -const filterInvoicesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterInvoices', inputVars); -} -filterInvoicesRef.operationName = 'filterInvoices'; -exports.filterInvoicesRef = filterInvoicesRef; - -exports.filterInvoices = function filterInvoices(dcOrVars, vars) { - return executeQuery(filterInvoicesRef(dcOrVars, vars)); -}; - -const createStaffRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateStaff', inputVars); -} -createStaffRef.operationName = 'CreateStaff'; -exports.createStaffRef = createStaffRef; - -exports.createStaff = function createStaff(dcOrVars, vars) { - return executeMutation(createStaffRef(dcOrVars, vars)); -}; - -const listStaffRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listStaff'); -} -listStaffRef.operationName = 'listStaff'; -exports.listStaffRef = listStaffRef; - -exports.listStaff = function listStaff(dc) { - return executeQuery(listStaffRef(dc)); -}; - -const createVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendor', inputVars); -} -createVendorRef.operationName = 'CreateVendor'; -exports.createVendorRef = createVendorRef; - -exports.createVendor = function createVendor(dcOrVars, vars) { - return executeMutation(createVendorRef(dcOrVars, vars)); -}; - -const updateVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendor', inputVars); -} -updateVendorRef.operationName = 'UpdateVendor'; -exports.updateVendorRef = updateVendorRef; - -exports.updateVendor = function updateVendor(dcOrVars, vars) { - return executeMutation(updateVendorRef(dcOrVars, vars)); -}; - -const deleteVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendor', inputVars); -} -deleteVendorRef.operationName = 'DeleteVendor'; -exports.deleteVendorRef = deleteVendorRef; - -exports.deleteVendor = function deleteVendor(dcOrVars, vars) { - return executeMutation(deleteVendorRef(dcOrVars, vars)); -}; - -const listVendorRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendor'); -} -listVendorRef.operationName = 'listVendor'; -exports.listVendorRef = listVendorRef; - -exports.listVendor = function listVendor(dc) { - return executeQuery(listVendorRef(dc)); -}; - -const getVendorByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorById', inputVars); -} -getVendorByIdRef.operationName = 'getVendorById'; -exports.getVendorByIdRef = getVendorByIdRef; - -exports.getVendorById = function getVendorById(dcOrVars, vars) { - return executeQuery(getVendorByIdRef(dcOrVars, vars)); -}; - -const filterVendorsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendors', inputVars); -} -filterVendorsRef.operationName = 'filterVendors'; -exports.filterVendorsRef = filterVendorsRef; - -exports.filterVendors = function filterVendors(dcOrVars, vars) { - return executeQuery(filterVendorsRef(dcOrVars, vars)); -}; - -const createVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorDefaultSetting', inputVars); -} -createVendorDefaultSettingRef.operationName = 'CreateVendorDefaultSetting'; -exports.createVendorDefaultSettingRef = createVendorDefaultSettingRef; - -exports.createVendorDefaultSetting = function createVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(createVendorDefaultSettingRef(dcOrVars, vars)); -}; - -const updateVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorDefaultSetting', inputVars); -} -updateVendorDefaultSettingRef.operationName = 'UpdateVendorDefaultSetting'; -exports.updateVendorDefaultSettingRef = updateVendorDefaultSettingRef; - -exports.updateVendorDefaultSetting = function updateVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(updateVendorDefaultSettingRef(dcOrVars, vars)); -}; - -const deleteVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorDefaultSetting', inputVars); -} -deleteVendorDefaultSettingRef.operationName = 'DeleteVendorDefaultSetting'; -exports.deleteVendorDefaultSettingRef = deleteVendorDefaultSettingRef; - -exports.deleteVendorDefaultSetting = function deleteVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(deleteVendorDefaultSettingRef(dcOrVars, vars)); -}; - -const createBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateBusiness', inputVars); -} -createBusinessRef.operationName = 'CreateBusiness'; -exports.createBusinessRef = createBusinessRef; - -exports.createBusiness = function createBusiness(dcOrVars, vars) { - return executeMutation(createBusinessRef(dcOrVars, vars)); -}; - -const updateBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateBusiness', inputVars); -} -updateBusinessRef.operationName = 'UpdateBusiness'; -exports.updateBusinessRef = updateBusinessRef; - -exports.updateBusiness = function updateBusiness(dcOrVars, vars) { - return executeMutation(updateBusinessRef(dcOrVars, vars)); -}; - -const deleteBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteBusiness', inputVars); -} -deleteBusinessRef.operationName = 'DeleteBusiness'; -exports.deleteBusinessRef = deleteBusinessRef; - -exports.deleteBusiness = function deleteBusiness(dcOrVars, vars) { - return executeMutation(deleteBusinessRef(dcOrVars, vars)); -}; diff --git a/frontend-web/src/dataconnect-generated/index.d.ts b/frontend-web/src/dataconnect-generated/index.d.ts deleted file mode 100644 index ae0b3539..00000000 --- a/frontend-web/src/dataconnect-generated/index.d.ts +++ /dev/null @@ -1,1288 +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 enum BackgroundCheckStatus { - PENDING = "PENDING", - CLEARED = "CLEARED", - FAILED = "FAILED", - EXPIRED = "EXPIRED", -}; - -export enum BusinessRateGroup { - STANDARD = "STANDARD", - PREMIUM = "PREMIUM", - ENTERPRISE = "ENTERPRISE", - CUSTOM = "CUSTOM", -}; - -export enum BusinessSector { - BON_APPETIT = "BON_APPETIT", - EUREST = "EUREST", - ARAMARK = "ARAMARK", - EPICUREAN_GROUP = "EPICUREAN_GROUP", - CHARTWELLS = "CHARTWELLS", - OTHER = "OTHER", -}; - -export enum BusinessStatus { - ACTIVE = "ACTIVE", - INACTIVE = "INACTIVE", - PENDING = "PENDING", -}; - -export enum ContractType { - W2 = "W2", - C1099 = "C1099", - TEMP = "TEMP", - CONTRACT = "CONTRACT", -}; - -export enum EmploymentType { - FULL_TIME = "FULL_TIME", - PART_TIME = "PART_TIME", - ON_CALL = "ON_CALL", - CONTRACT = "CONTRACT", -}; - -export enum EventStatus { - DRAFT = "DRAFT", - ACTIVE = "ACTIVE", - PENDING = "PENDING", - ASSIGNED = "ASSIGNED", - CONFIRMED = "CONFIRMED", - COMPLETED = "COMPLETED", - CANCELED = "CANCELED", -}; - -export enum InvoiceStatus { - DRAFT = "DRAFT", - PENDING_REVIEW = "PENDING_REVIEW", - APPROVED = "APPROVED", - DISPUTED = "DISPUTED", - UNDER_REVIEW = "UNDER_REVIEW", - RESOLVED = "RESOLVED", - OVERDUE = "OVERDUE", - PAID = "PAID", - RECONCILED = "RECONCILED", - CANCELLED = "CANCELLED", -}; - -export enum RecurrenceType { - SINGLE = "SINGLE", - DATE_RANGE = "DATE_RANGE", - SCATTER = "SCATTER", -}; - -export enum VendorApprovalStatus { - PENDING = "PENDING", - APPROVED = "APPROVED", - SUSPENDED = "SUSPENDED", - TERMINATED = "TERMINATED", -}; - -export enum VendorPlatformType { - FULL_PLATFORM = "FULL_PLATFORM", - BUILDING_PLATFORM = "BUILDING_PLATFORM", - PARTIAL_TECH = "PARTIAL_TECH", - TRADITIONAL = "TRADITIONAL", -}; - -export enum VendorRateCategory { - KITCHEN_AND_CULINARY = "KITCHEN_AND_CULINARY", - CONCESSIONS = "CONCESSIONS", - FACILITIES = "FACILITIES", - BARTENDING = "BARTENDING", - SECURITY = "SECURITY", - EVENT_STAFF = "EVENT_STAFF", - MANAGEMENT = "MANAGEMENT", - TECHNICAL = "TECHNICAL", - OTHER = "OTHER", -}; - -export enum VendorRegion { - NATIONAL = "NATIONAL", - BAY_AREA = "BAY_AREA", - SOUTHERN_CALIFORNIA = "SOUTHERN_CALIFORNIA", - NORTHERN_CALIFORNIA = "NORTHERN_CALIFORNIA", - WEST = "WEST", - EAST = "EAST", - MIDWEST = "MIDWEST", - SOUTH = "SOUTH", -}; - - - -export interface Business_Key { - id: UUIDString; - __typename?: 'Business_Key'; -} - -export interface CreateBusinessData { - business_insert: Business_Key; -} - -export interface CreateBusinessVariables { - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; -} - -export interface CreateEventData { - event_insert: Event_Key; -} - -export interface CreateEventVariables { - eventName: string; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status: EventStatus; - date: TimestampString; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} - -export interface CreateInvoiceData { - invoice_insert: Invoice_Key; -} - -export interface CreateInvoiceVariables { - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} - -export interface CreateStaffData { - staff_insert: Staff_Key; -} - -export interface CreateStaffVariables { - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; -} - -export interface CreateVendorData { - vendor_insert: Vendor_Key; -} - -export interface CreateVendorDefaultSettingData { - vendorDefaultSetting_insert: VendorDefaultSetting_Key; -} - -export interface CreateVendorDefaultSettingVariables { - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; -} - -export interface CreateVendorRateData { - vendorRate_insert: VendorRate_Key; -} - -export interface CreateVendorRateVariables { - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; -} - -export interface CreateVendorVariables { - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; -} - -export interface DeleteBusinessData { - business_delete?: Business_Key | null; -} - -export interface DeleteBusinessVariables { - id: UUIDString; -} - -export interface DeleteEventData { - event_delete?: Event_Key | null; -} - -export interface DeleteEventVariables { - id: UUIDString; -} - -export interface DeleteInvoiceData { - invoice_delete?: Invoice_Key | null; -} - -export interface DeleteInvoiceVariables { - id: UUIDString; -} - -export interface DeleteVendorData { - vendor_delete?: Vendor_Key | null; -} - -export interface DeleteVendorDefaultSettingData { - vendorDefaultSetting_delete?: VendorDefaultSetting_Key | null; -} - -export interface DeleteVendorDefaultSettingVariables { - id: UUIDString; -} - -export interface DeleteVendorRateData { - vendorRate_delete?: VendorRate_Key | null; -} - -export interface DeleteVendorRateVariables { - id: UUIDString; -} - -export interface DeleteVendorVariables { - id: UUIDString; -} - -export interface Event_Key { - id: UUIDString; - __typename?: 'Event_Key'; -} - -export interface FilterBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} - -export interface FilterBusinessVariables { - businessName?: string | null; - contactName?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} - -export interface FilterEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} - -export interface FilterEventsVariables { - status?: EventStatus | null; - businessId?: UUIDString | null; - vendorId?: UUIDString | null; - isRecurring?: boolean | null; - isRapid?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - date?: TimestampString | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - clientEmail?: string | null; -} - -export interface FilterInvoicesData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} - -export interface FilterInvoicesVariables { - invoiceNumber?: string | null; - status?: InvoiceStatus | null; - isAutoGenerated?: boolean | null; - amount?: number | null; -} - -export interface FilterVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} - -export interface FilterVendorDefaultSettingsVariables { - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} - -export interface FilterVendorRatesData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} - -export interface FilterVendorRatesVariables { - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - minClientRate?: number | null; - maxClientRate?: number | null; -} - -export interface FilterVendorsData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} - -export interface FilterVendorsVariables { - region?: VendorRegion | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; - vendorNumber?: string | null; - primaryContactEmail?: string | null; - legalName?: string | null; - platformType?: VendorPlatformType | null; -} - -export interface GetBusinessByIdData { - business?: { - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key; -} - -export interface GetBusinessByIdVariables { - id: UUIDString; -} - -export interface GetEventByIdData { - event?: { - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key; -} - -export interface GetEventByIdVariables { - id: UUIDString; -} - -export interface GetInvoiceByIdData { - invoice?: { - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; - } & Invoice_Key; -} - -export interface GetInvoiceByIdVariables { - id: UUIDString; -} - -export interface GetVendorByIdData { - vendor?: { - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key; -} - -export interface GetVendorByIdVariables { - id: UUIDString; -} - -export interface GetVendorDefaultSettingByIdData { - vendorDefaultSetting?: { - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key; -} - -export interface GetVendorDefaultSettingByIdVariables { - id: UUIDString; -} - -export interface GetVendorRateByIdData { - vendorRate?: { - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - createdDate?: TimestampString | null; - updatedDate?: TimestampString | null; - createdBy?: string | null; - } & VendorRate_Key; -} - -export interface GetVendorRateByIdVariables { - id: UUIDString; -} - -export interface Invoice_Key { - id: UUIDString; - __typename?: 'Invoice_Key'; -} - -export interface ListBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} - -export interface ListEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} - -export interface ListInvoiceData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} - -export interface ListStaffData { - staffs: ({ - id: UUIDString; - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; - } & Staff_Key)[]; -} - -export interface ListVendorData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} - -export interface ListVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} - -export interface ListVendorRateData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} - -export interface Staff_Key { - id: UUIDString; - __typename?: 'Staff_Key'; -} - -export interface UpdateBusinessData { - business_update?: Business_Key | null; -} - -export interface UpdateBusinessVariables { - id: UUIDString; - businessName?: string | null; - contactName?: string | null; - email?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} - -export interface UpdateEventData { - event_update?: Event_Key | null; -} - -export interface UpdateEventVariables { - id: UUIDString; - eventName?: string | null; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId?: UUIDString | null; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status?: EventStatus | null; - date?: TimestampString | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} - -export interface UpdateInvoiceData { - invoice_update?: Invoice_Key | null; -} - -export interface UpdateInvoiceVariables { - id: UUIDString; - invoiceNumber?: string | null; - amount?: number | null; - status?: InvoiceStatus | null; - issueDate?: TimestampString | null; - dueDate?: TimestampString | null; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} - -export interface UpdateVendorData { - vendor_update?: Vendor_Key | null; -} - -export interface UpdateVendorDefaultSettingData { - vendorDefaultSetting_update?: VendorDefaultSetting_Key | null; -} - -export interface UpdateVendorDefaultSettingVariables { - id: UUIDString; - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} - -export interface UpdateVendorRateData { - vendorRate_update?: VendorRate_Key | null; -} - -export interface UpdateVendorRateVariables { - id: UUIDString; - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - employeeWage?: number | null; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate?: number | null; -} - -export interface UpdateVendorVariables { - id: UUIDString; - vendorNumber?: string | null; - legalName?: string | null; - region?: VendorRegion | null; - platformType?: VendorPlatformType | null; - primaryContactEmail?: string | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; -} - -export interface VendorDefaultSetting_Key { - id: UUIDString; - __typename?: 'VendorDefaultSetting_Key'; -} - -export interface VendorRate_Key { - id: UUIDString; - __typename?: 'VendorRate_Key'; -} - -export interface Vendor_Key { - id: UUIDString; - __typename?: 'Vendor_Key'; -} - -interface ListBusinessRef { - /* 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 listBusinessRef: ListBusinessRef; - -export function listBusiness(): QueryPromise; -export function listBusiness(dc: DataConnect): QueryPromise; - -interface GetBusinessByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetBusinessByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetBusinessByIdVariables): QueryRef; - operationName: string; -} -export const getBusinessByIdRef: GetBusinessByIdRef; - -export function getBusinessById(vars: GetBusinessByIdVariables): QueryPromise; -export function getBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables): QueryPromise; - -interface FilterBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterBusinessVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterBusinessVariables): QueryRef; - operationName: string; -} -export const filterBusinessRef: FilterBusinessRef; - -export function filterBusiness(vars?: FilterBusinessVariables): QueryPromise; -export function filterBusiness(dc: DataConnect, vars?: FilterBusinessVariables): QueryPromise; - -interface CreateEventRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateEventVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateEventVariables): MutationRef; - operationName: string; -} -export const createEventRef: CreateEventRef; - -export function createEvent(vars: CreateEventVariables): MutationPromise; -export function createEvent(dc: DataConnect, vars: CreateEventVariables): MutationPromise; - -interface UpdateEventRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateEventVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateEventVariables): MutationRef; - operationName: string; -} -export const updateEventRef: UpdateEventRef; - -export function updateEvent(vars: UpdateEventVariables): MutationPromise; -export function updateEvent(dc: DataConnect, vars: UpdateEventVariables): MutationPromise; - -interface DeleteEventRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteEventVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteEventVariables): MutationRef; - operationName: string; -} -export const deleteEventRef: DeleteEventRef; - -export function deleteEvent(vars: DeleteEventVariables): MutationPromise; -export function deleteEvent(dc: DataConnect, vars: DeleteEventVariables): MutationPromise; - -interface ListVendorDefaultSettingsRef { - /* 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 listVendorDefaultSettingsRef: ListVendorDefaultSettingsRef; - -export function listVendorDefaultSettings(): QueryPromise; -export function listVendorDefaultSettings(dc: DataConnect): QueryPromise; - -interface GetVendorDefaultSettingByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorDefaultSettingByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryRef; - operationName: string; -} -export const getVendorDefaultSettingByIdRef: GetVendorDefaultSettingByIdRef; - -export function getVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables): QueryPromise; -export function getVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryPromise; - -interface FilterVendorDefaultSettingsRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorDefaultSettingsVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryRef; - operationName: string; -} -export const filterVendorDefaultSettingsRef: FilterVendorDefaultSettingsRef; - -export function filterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables): QueryPromise; -export function filterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryPromise; - -interface CreateVendorRateRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorRateVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateVendorRateVariables): MutationRef; - operationName: string; -} -export const createVendorRateRef: CreateVendorRateRef; - -export function createVendorRate(vars: CreateVendorRateVariables): MutationPromise; -export function createVendorRate(dc: DataConnect, vars: CreateVendorRateVariables): MutationPromise; - -interface UpdateVendorRateRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorRateVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateVendorRateVariables): MutationRef; - operationName: string; -} -export const updateVendorRateRef: UpdateVendorRateRef; - -export function updateVendorRate(vars: UpdateVendorRateVariables): MutationPromise; -export function updateVendorRate(dc: DataConnect, vars: UpdateVendorRateVariables): MutationPromise; - -interface DeleteVendorRateRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorRateVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteVendorRateVariables): MutationRef; - operationName: string; -} -export const deleteVendorRateRef: DeleteVendorRateRef; - -export function deleteVendorRate(vars: DeleteVendorRateVariables): MutationPromise; -export function deleteVendorRate(dc: DataConnect, vars: DeleteVendorRateVariables): MutationPromise; - -interface ListVendorRateRef { - /* 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 listVendorRateRef: ListVendorRateRef; - -export function listVendorRate(): QueryPromise; -export function listVendorRate(dc: DataConnect): QueryPromise; - -interface GetVendorRateByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorRateByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetVendorRateByIdVariables): QueryRef; - operationName: string; -} -export const getVendorRateByIdRef: GetVendorRateByIdRef; - -export function getVendorRateById(vars: GetVendorRateByIdVariables): QueryPromise; -export function getVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables): QueryPromise; - -interface FilterVendorRatesRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorRatesVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterVendorRatesVariables): QueryRef; - operationName: string; -} -export const filterVendorRatesRef: FilterVendorRatesRef; - -export function filterVendorRates(vars?: FilterVendorRatesVariables): QueryPromise; -export function filterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables): QueryPromise; - -interface ListEventsRef { - /* 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 listEventsRef: ListEventsRef; - -export function listEvents(): QueryPromise; -export function listEvents(dc: DataConnect): QueryPromise; - -interface GetEventByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetEventByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetEventByIdVariables): QueryRef; - operationName: string; -} -export const getEventByIdRef: GetEventByIdRef; - -export function getEventById(vars: GetEventByIdVariables): QueryPromise; -export function getEventById(dc: DataConnect, vars: GetEventByIdVariables): QueryPromise; - -interface FilterEventsRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterEventsVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterEventsVariables): QueryRef; - operationName: string; -} -export const filterEventsRef: FilterEventsRef; - -export function filterEvents(vars?: FilterEventsVariables): QueryPromise; -export function filterEvents(dc: DataConnect, vars?: FilterEventsVariables): QueryPromise; - -interface CreateInvoiceRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateInvoiceVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateInvoiceVariables): MutationRef; - operationName: string; -} -export const createInvoiceRef: CreateInvoiceRef; - -export function createInvoice(vars: CreateInvoiceVariables): MutationPromise; -export function createInvoice(dc: DataConnect, vars: CreateInvoiceVariables): MutationPromise; - -interface UpdateInvoiceRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateInvoiceVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateInvoiceVariables): MutationRef; - operationName: string; -} -export const updateInvoiceRef: UpdateInvoiceRef; - -export function updateInvoice(vars: UpdateInvoiceVariables): MutationPromise; -export function updateInvoice(dc: DataConnect, vars: UpdateInvoiceVariables): MutationPromise; - -interface DeleteInvoiceRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteInvoiceVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteInvoiceVariables): MutationRef; - operationName: string; -} -export const deleteInvoiceRef: DeleteInvoiceRef; - -export function deleteInvoice(vars: DeleteInvoiceVariables): MutationPromise; -export function deleteInvoice(dc: DataConnect, vars: DeleteInvoiceVariables): MutationPromise; - -interface ListInvoiceRef { - /* 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 listInvoiceRef: ListInvoiceRef; - -export function listInvoice(): QueryPromise; -export function listInvoice(dc: DataConnect): QueryPromise; - -interface GetInvoiceByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetInvoiceByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetInvoiceByIdVariables): QueryRef; - operationName: string; -} -export const getInvoiceByIdRef: GetInvoiceByIdRef; - -export function getInvoiceById(vars: GetInvoiceByIdVariables): QueryPromise; -export function getInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables): QueryPromise; - -interface FilterInvoicesRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterInvoicesVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterInvoicesVariables): QueryRef; - operationName: string; -} -export const filterInvoicesRef: FilterInvoicesRef; - -export function filterInvoices(vars?: FilterInvoicesVariables): QueryPromise; -export function filterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables): QueryPromise; - -interface CreateStaffRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateStaffVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateStaffVariables): MutationRef; - operationName: string; -} -export const createStaffRef: CreateStaffRef; - -export function createStaff(vars: CreateStaffVariables): MutationPromise; -export function createStaff(dc: DataConnect, vars: CreateStaffVariables): MutationPromise; - -interface ListStaffRef { - /* 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 listStaffRef: ListStaffRef; - -export function listStaff(): QueryPromise; -export function listStaff(dc: DataConnect): QueryPromise; - -interface CreateVendorRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateVendorVariables): MutationRef; - operationName: string; -} -export const createVendorRef: CreateVendorRef; - -export function createVendor(vars: CreateVendorVariables): MutationPromise; -export function createVendor(dc: DataConnect, vars: CreateVendorVariables): MutationPromise; - -interface UpdateVendorRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateVendorVariables): MutationRef; - operationName: string; -} -export const updateVendorRef: UpdateVendorRef; - -export function updateVendor(vars: UpdateVendorVariables): MutationPromise; -export function updateVendor(dc: DataConnect, vars: UpdateVendorVariables): MutationPromise; - -interface DeleteVendorRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteVendorVariables): MutationRef; - operationName: string; -} -export const deleteVendorRef: DeleteVendorRef; - -export function deleteVendor(vars: DeleteVendorVariables): MutationPromise; -export function deleteVendor(dc: DataConnect, vars: DeleteVendorVariables): MutationPromise; - -interface ListVendorRef { - /* 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 listVendorRef: ListVendorRef; - -export function listVendor(): QueryPromise; -export function listVendor(dc: DataConnect): QueryPromise; - -interface GetVendorByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetVendorByIdVariables): QueryRef; - operationName: string; -} -export const getVendorByIdRef: GetVendorByIdRef; - -export function getVendorById(vars: GetVendorByIdVariables): QueryPromise; -export function getVendorById(dc: DataConnect, vars: GetVendorByIdVariables): QueryPromise; - -interface FilterVendorsRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorsVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterVendorsVariables): QueryRef; - operationName: string; -} -export const filterVendorsRef: FilterVendorsRef; - -export function filterVendors(vars?: FilterVendorsVariables): QueryPromise; -export function filterVendors(dc: DataConnect, vars?: FilterVendorsVariables): QueryPromise; - -interface CreateVendorDefaultSettingRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorDefaultSettingVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationRef; - operationName: string; -} -export const createVendorDefaultSettingRef: CreateVendorDefaultSettingRef; - -export function createVendorDefaultSetting(vars: CreateVendorDefaultSettingVariables): MutationPromise; -export function createVendorDefaultSetting(dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationPromise; - -interface UpdateVendorDefaultSettingRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorDefaultSettingVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationRef; - operationName: string; -} -export const updateVendorDefaultSettingRef: UpdateVendorDefaultSettingRef; - -export function updateVendorDefaultSetting(vars: UpdateVendorDefaultSettingVariables): MutationPromise; -export function updateVendorDefaultSetting(dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationPromise; - -interface DeleteVendorDefaultSettingRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorDefaultSettingVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationRef; - operationName: string; -} -export const deleteVendorDefaultSettingRef: DeleteVendorDefaultSettingRef; - -export function deleteVendorDefaultSetting(vars: DeleteVendorDefaultSettingVariables): MutationPromise; -export function deleteVendorDefaultSetting(dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationPromise; - -interface CreateBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateBusinessVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateBusinessVariables): MutationRef; - operationName: string; -} -export const createBusinessRef: CreateBusinessRef; - -export function createBusiness(vars: CreateBusinessVariables): MutationPromise; -export function createBusiness(dc: DataConnect, vars: CreateBusinessVariables): MutationPromise; - -interface UpdateBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateBusinessVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateBusinessVariables): MutationRef; - operationName: string; -} -export const updateBusinessRef: UpdateBusinessRef; - -export function updateBusiness(vars: UpdateBusinessVariables): MutationPromise; -export function updateBusiness(dc: DataConnect, vars: UpdateBusinessVariables): MutationPromise; - -interface DeleteBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteBusinessVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteBusinessVariables): MutationRef; - operationName: string; -} -export const deleteBusinessRef: DeleteBusinessRef; - -export function deleteBusiness(vars: DeleteBusinessVariables): MutationPromise; -export function deleteBusiness(dc: DataConnect, vars: DeleteBusinessVariables): MutationPromise; - diff --git a/frontend-web/src/dataconnect-generated/package.json b/frontend-web/src/dataconnect-generated/package.json deleted file mode 100644 index b686c0a0..00000000 --- a/frontend-web/src/dataconnect-generated/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@dataconnect/generated", - "version": "1.0.0", - "author": "Firebase (https://firebase.google.com/)", - "description": "Generated SDK For krow-connector", - "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" - }, - "./react": { - "types": "./react/index.d.ts", - "require": "./react/index.cjs.js", - "import": "./react/esm/index.esm.js", - "default": "./react/esm/index.esm.js" - }, - "./package.json": "./package.json" - }, - "peerDependencies": { - "firebase": "^11.3.0 || ^12.0.0", - "@tanstack-query-firebase/react": "^2.0.0" - } -} \ No newline at end of file diff --git a/frontend-web/src/dataconnect-generated/react/README.md b/frontend-web/src/dataconnect-generated/react/README.md deleted file mode 100644 index 268de00b..00000000 --- a/frontend-web/src/dataconnect-generated/react/README.md +++ /dev/null @@ -1,4023 +0,0 @@ -# Generated React README -This README will guide you through the process of using the generated React SDK package for the connector `krow-connector`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. - -**If you're looking for the `JavaScript README`, you can find it at [`dataconnect-generated/README.md`](../README.md)** - -***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.* - -You can use this generated SDK by importing from the package `@dataconnect/generated/react` 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#react). - -# Table of Contents -- [**Overview**](#generated-react-readme) -- [**TanStack Query Firebase & TanStack React Query**](#tanstack-query-firebase-tanstack-react-query) - - [*Package Installation*](#installing-tanstack-query-firebase-and-tanstack-react-query-packages) - - [*Configuring TanStack Query*](#configuring-tanstack-query) -- [**Accessing the connector**](#accessing-the-connector) - - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) -- [**Queries**](#queries) - - [*listBusiness*](#listbusiness) - - [*getBusinessById*](#getbusinessbyid) - - [*filterBusiness*](#filterbusiness) - - [*listVendorDefaultSettings*](#listvendordefaultsettings) - - [*getVendorDefaultSettingById*](#getvendordefaultsettingbyid) - - [*filterVendorDefaultSettings*](#filtervendordefaultsettings) - - [*listVendorRate*](#listvendorrate) - - [*getVendorRateById*](#getvendorratebyid) - - [*filterVendorRates*](#filtervendorrates) - - [*listEvents*](#listevents) - - [*getEventById*](#geteventbyid) - - [*filterEvents*](#filterevents) - - [*listInvoice*](#listinvoice) - - [*getInvoiceById*](#getinvoicebyid) - - [*filterInvoices*](#filterinvoices) - - [*listStaff*](#liststaff) - - [*listVendor*](#listvendor) - - [*getVendorById*](#getvendorbyid) - - [*filterVendors*](#filtervendors) -- [**Mutations**](#mutations) - - [*CreateEvent*](#createevent) - - [*UpdateEvent*](#updateevent) - - [*DeleteEvent*](#deleteevent) - - [*CreateVendorRate*](#createvendorrate) - - [*UpdateVendorRate*](#updatevendorrate) - - [*DeleteVendorRate*](#deletevendorrate) - - [*CreateInvoice*](#createinvoice) - - [*UpdateInvoice*](#updateinvoice) - - [*DeleteInvoice*](#deleteinvoice) - - [*CreateStaff*](#createstaff) - - [*CreateVendor*](#createvendor) - - [*UpdateVendor*](#updatevendor) - - [*DeleteVendor*](#deletevendor) - - [*CreateVendorDefaultSetting*](#createvendordefaultsetting) - - [*UpdateVendorDefaultSetting*](#updatevendordefaultsetting) - - [*DeleteVendorDefaultSetting*](#deletevendordefaultsetting) - - [*CreateBusiness*](#createbusiness) - - [*UpdateBusiness*](#updatebusiness) - - [*DeleteBusiness*](#deletebusiness) - -# TanStack Query Firebase & TanStack React Query -This SDK provides [React](https://react.dev/) hooks generated specific to your application, for the operations found in the connector `krow-connector`. These hooks are generated using [TanStack Query Firebase](https://react-query-firebase.invertase.dev/) by our partners at Invertase, a library built on top of [TanStack React Query v5](https://tanstack.com/query/v5/docs/framework/react/overview). - -***You do not need to be familiar with Tanstack Query or Tanstack Query Firebase to use this SDK.*** However, you may find it useful to learn more about them, as they will empower you as a user of this Generated React SDK. - -## Installing TanStack Query Firebase and TanStack React Query Packages -In order to use the React generated SDK, you must install the `TanStack React Query` and `TanStack Query Firebase` packages. -```bash -npm i --save @tanstack/react-query @tanstack-query-firebase/react -``` -```bash -npm i --save firebase@latest # Note: React has a peer dependency on ^11.3.0 -``` - -You can also follow the installation instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#tanstack-install), or the [TanStack Query Firebase documentation](https://react-query-firebase.invertase.dev/react) and [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/installation). - -## Configuring TanStack Query -In order to use the React generated SDK in your application, you must wrap your application's component tree in a `QueryClientProvider` component from TanStack React Query. None of your generated React SDK hooks will work without this provider. - -```javascript -import { QueryClientProvider } from '@tanstack/react-query'; - -// Create a TanStack Query client instance -const queryClient = new QueryClient() - -function App() { - return ( - // Provide the client to your App - - - - ) -} -``` - -To learn more about `QueryClientProvider`, see the [TanStack React Query documentation](https://tanstack.com/query/latest/docs/framework/react/quick-start) and the [TanStack Query Firebase documentation](https://invertase.docs.page/tanstack-query-firebase/react#usage). - -# 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 `krow-connector`. - -You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; - -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#emulator-react-angular). - -```javascript -import { connectDataConnectEmulator, getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; - -const dataConnect = getDataConnect(connectorConfig); -connectDataConnectEmulator(dataConnect, 'localhost', 9399); -``` - -After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) using the hooks provided from your generated React SDK. - -# Queries - -The React generated SDK provides Query hook functions that call and return [`useDataConnectQuery`](https://react-query-firebase.invertase.dev/react/data-connect/querying) hooks from TanStack Query Firebase. - -Calling these hook functions will return a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and the most recent data returned by the Query, among other things. To learn more about these hooks and how to use them, see the [TanStack Query Firebase documentation](https://react-query-firebase.invertase.dev/react/data-connect/querying). - -TanStack React Query caches the results of your Queries, so using the same Query hook function in multiple places in your application allows the entire application to automatically see updates to that Query's data. - -Query hooks execute their Queries automatically when called, and periodically refresh, unless you change the `queryOptions` for the Query. To learn how to stop a Query from automatically executing, including how to make a query "lazy", see the [TanStack React Query documentation](https://tanstack.com/query/latest/docs/framework/react/guides/disabling-queries). - -To learn more about TanStack React Query's Queries, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/queries). - -## Using Query Hooks -Here's a general overview of how to use the generated Query hooks in your code: - -- If the Query has no variables, the Query hook function does not require arguments. -- If the Query has any required variables, the Query hook function will require at least one argument: an object that contains all the required variables for the Query. -- If the Query has some required and some optional variables, only required variables are necessary in the variables argument object, and optional variables may be provided as well. -- If all of the Query's variables are optional, the Query hook function does not require any arguments. -- Query hook 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. -- Query hooks functions can be called with or without passing in an `options` argument of type `useDataConnectQueryOptions`. To learn more about the `options` argument, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/query-options). - - ***Special case:*** If the Query has all optional variables and you would like to provide an `options` argument to the Query hook function without providing any variables, you must pass `undefined` where you would normally pass the Query's variables, and then may provide the `options` argument. - -Below are examples of how to use the `krow-connector` connector's generated Query hook 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#operations-react-angular). - -## listBusiness -You can execute the `listBusiness` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListBusiness(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListBusiness(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listBusiness` Query has no variables. -### Return Type -Recall that calling the `listBusiness` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listBusiness` Query is of type `ListBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listBusiness`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListBusiness } from '@dataconnect/generated/react' - -export default function ListBusinessComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListBusiness(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListBusiness(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListBusiness(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.businesses); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getBusinessById -You can execute the `getBusinessById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetBusinessById(vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getBusinessById` Query requires an argument of type `GetBusinessByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetBusinessByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getBusinessById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getBusinessById` Query is of type `GetBusinessByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetBusinessByIdData { - business?: { - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getBusinessById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetBusinessByIdVariables } from '@dataconnect/generated'; -import { useGetBusinessById } from '@dataconnect/generated/react' - -export default function GetBusinessByIdComponent() { - // The `useGetBusinessById` Query hook requires an argument of type `GetBusinessByIdVariables`: - const getBusinessByIdVars: GetBusinessByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetBusinessById(getBusinessByIdVars); - // Variables can be defined inline as well. - const query = useGetBusinessById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetBusinessById(dataConnect, getBusinessByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetBusinessById(getBusinessByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetBusinessById(dataConnect, getBusinessByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.business); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterBusiness -You can execute the `filterBusiness` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterBusiness(dc: DataConnect, vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterBusiness(vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterBusiness` Query has an optional argument of type `FilterBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterBusinessVariables { - businessName?: string | null; - contactName?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that calling the `filterBusiness` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterBusiness` Query is of type `FilterBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterBusiness`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterBusinessVariables } from '@dataconnect/generated'; -import { useFilterBusiness } from '@dataconnect/generated/react' - -export default function FilterBusinessComponent() { - // The `useFilterBusiness` Query hook has an optional argument of type `FilterBusinessVariables`: - const filterBusinessVars: FilterBusinessVariables = { - businessName: ..., // optional - contactName: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterBusiness(filterBusinessVars); - // Variables can be defined inline as well. - const query = useFilterBusiness({ businessName: ..., contactName: ..., sector: ..., rateGroup: ..., status: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterBusinessVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterBusiness(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterBusiness(dataConnect, filterBusinessVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterBusiness(filterBusinessVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterBusiness(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterBusiness(dataConnect, filterBusinessVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.businesses); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listVendorDefaultSettings -You can execute the `listVendorDefaultSettings` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListVendorDefaultSettings(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListVendorDefaultSettings(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listVendorDefaultSettings` Query has no variables. -### Return Type -Recall that calling the `listVendorDefaultSettings` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listVendorDefaultSettings` Query is of type `ListVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listVendorDefaultSettings`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListVendorDefaultSettings } from '@dataconnect/generated/react' - -export default function ListVendorDefaultSettingsComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListVendorDefaultSettings(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListVendorDefaultSettings(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListVendorDefaultSettings(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListVendorDefaultSettings(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorDefaultSettings); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getVendorDefaultSettingById -You can execute the `getVendorDefaultSettingById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getVendorDefaultSettingById` Query requires an argument of type `GetVendorDefaultSettingByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetVendorDefaultSettingByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getVendorDefaultSettingById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getVendorDefaultSettingById` Query is of type `GetVendorDefaultSettingByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetVendorDefaultSettingByIdData { - vendorDefaultSetting?: { - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getVendorDefaultSettingById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetVendorDefaultSettingByIdVariables } from '@dataconnect/generated'; -import { useGetVendorDefaultSettingById } from '@dataconnect/generated/react' - -export default function GetVendorDefaultSettingByIdComponent() { - // The `useGetVendorDefaultSettingById` Query hook requires an argument of type `GetVendorDefaultSettingByIdVariables`: - const getVendorDefaultSettingByIdVars: GetVendorDefaultSettingByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetVendorDefaultSettingById(getVendorDefaultSettingByIdVars); - // Variables can be defined inline as well. - const query = useGetVendorDefaultSettingById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorDefaultSettingById(getVendorDefaultSettingByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorDefaultSetting); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterVendorDefaultSettings -You can execute the `filterVendorDefaultSettings` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterVendorDefaultSettings` Query has an optional argument of type `FilterVendorDefaultSettingsVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterVendorDefaultSettingsVariables { - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that calling the `filterVendorDefaultSettings` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterVendorDefaultSettings` Query is of type `FilterVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterVendorDefaultSettings`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterVendorDefaultSettingsVariables } from '@dataconnect/generated'; -import { useFilterVendorDefaultSettings } from '@dataconnect/generated/react' - -export default function FilterVendorDefaultSettingsComponent() { - // The `useFilterVendorDefaultSettings` Query hook has an optional argument of type `FilterVendorDefaultSettingsVariables`: - const filterVendorDefaultSettingsVars: FilterVendorDefaultSettingsVariables = { - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterVendorDefaultSettings(filterVendorDefaultSettingsVars); - // Variables can be defined inline as well. - const query = useFilterVendorDefaultSettings({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterVendorDefaultSettingsVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterVendorDefaultSettings(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorDefaultSettings(filterVendorDefaultSettingsVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterVendorDefaultSettings(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorDefaultSettings); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listVendorRate -You can execute the `listVendorRate` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListVendorRate(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListVendorRate(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listVendorRate` Query has no variables. -### Return Type -Recall that calling the `listVendorRate` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listVendorRate` Query is of type `ListVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListVendorRateData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listVendorRate`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListVendorRate } from '@dataconnect/generated/react' - -export default function ListVendorRateComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListVendorRate(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListVendorRate(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListVendorRate(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorRates); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getVendorRateById -You can execute the `getVendorRateById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetVendorRateById(vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getVendorRateById` Query requires an argument of type `GetVendorRateByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetVendorRateByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getVendorRateById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getVendorRateById` Query is of type `GetVendorRateByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetVendorRateByIdData { - vendorRate?: { - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - createdDate?: TimestampString | null; - updatedDate?: TimestampString | null; - createdBy?: string | null; - } & VendorRate_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getVendorRateById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetVendorRateByIdVariables } from '@dataconnect/generated'; -import { useGetVendorRateById } from '@dataconnect/generated/react' - -export default function GetVendorRateByIdComponent() { - // The `useGetVendorRateById` Query hook requires an argument of type `GetVendorRateByIdVariables`: - const getVendorRateByIdVars: GetVendorRateByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetVendorRateById(getVendorRateByIdVars); - // Variables can be defined inline as well. - const query = useGetVendorRateById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetVendorRateById(dataConnect, getVendorRateByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorRateById(getVendorRateByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorRateById(dataConnect, getVendorRateByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorRate); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterVendorRates -You can execute the `filterVendorRates` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterVendorRates(vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterVendorRates` Query has an optional argument of type `FilterVendorRatesVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterVendorRatesVariables { - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - minClientRate?: number | null; - maxClientRate?: number | null; -} -``` -### Return Type -Recall that calling the `filterVendorRates` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterVendorRates` Query is of type `FilterVendorRatesData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterVendorRatesData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterVendorRates`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterVendorRatesVariables } from '@dataconnect/generated'; -import { useFilterVendorRates } from '@dataconnect/generated/react' - -export default function FilterVendorRatesComponent() { - // The `useFilterVendorRates` Query hook has an optional argument of type `FilterVendorRatesVariables`: - const filterVendorRatesVars: FilterVendorRatesVariables = { - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - minClientRate: ..., // optional - maxClientRate: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterVendorRates(filterVendorRatesVars); - // Variables can be defined inline as well. - const query = useFilterVendorRates({ vendorName: ..., category: ..., roleName: ..., minClientRate: ..., maxClientRate: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterVendorRatesVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterVendorRates(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterVendorRates(dataConnect, filterVendorRatesVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorRates(filterVendorRatesVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterVendorRates(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorRates(dataConnect, filterVendorRatesVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorRates); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listEvents -You can execute the `listEvents` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListEvents(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListEvents(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listEvents` Query has no variables. -### Return Type -Recall that calling the `listEvents` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listEvents` Query is of type `ListEventsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listEvents`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListEvents } from '@dataconnect/generated/react' - -export default function ListEventsComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListEvents(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListEvents(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListEvents(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListEvents(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.events); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getEventById -You can execute the `getEventById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetEventById(dc: DataConnect, vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetEventById(vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getEventById` Query requires an argument of type `GetEventByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetEventByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getEventById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getEventById` Query is of type `GetEventByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetEventByIdData { - event?: { - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getEventById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetEventByIdVariables } from '@dataconnect/generated'; -import { useGetEventById } from '@dataconnect/generated/react' - -export default function GetEventByIdComponent() { - // The `useGetEventById` Query hook requires an argument of type `GetEventByIdVariables`: - const getEventByIdVars: GetEventByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetEventById(getEventByIdVars); - // Variables can be defined inline as well. - const query = useGetEventById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetEventById(dataConnect, getEventByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetEventById(getEventByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetEventById(dataConnect, getEventByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.event); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterEvents -You can execute the `filterEvents` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterEvents(dc: DataConnect, vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterEvents(vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterEvents` Query has an optional argument of type `FilterEventsVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterEventsVariables { - status?: EventStatus | null; - businessId?: UUIDString | null; - vendorId?: UUIDString | null; - isRecurring?: boolean | null; - isRapid?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - date?: TimestampString | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - clientEmail?: string | null; -} -``` -### Return Type -Recall that calling the `filterEvents` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterEvents` Query is of type `FilterEventsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterEvents`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterEventsVariables } from '@dataconnect/generated'; -import { useFilterEvents } from '@dataconnect/generated/react' - -export default function FilterEventsComponent() { - // The `useFilterEvents` Query hook has an optional argument of type `FilterEventsVariables`: - const filterEventsVars: FilterEventsVariables = { - status: ..., // optional - businessId: ..., // optional - vendorId: ..., // optional - isRecurring: ..., // optional - isRapid: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - date: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - clientEmail: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterEvents(filterEventsVars); - // Variables can be defined inline as well. - const query = useFilterEvents({ status: ..., businessId: ..., vendorId: ..., isRecurring: ..., isRapid: ..., isMultiDay: ..., recurrenceType: ..., date: ..., hub: ..., eventLocation: ..., contractType: ..., clientEmail: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterEventsVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterEvents(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterEvents(dataConnect, filterEventsVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterEvents(filterEventsVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterEvents(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterEvents(dataConnect, filterEventsVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.events); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listInvoice -You can execute the `listInvoice` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListInvoice(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListInvoice(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listInvoice` Query has no variables. -### Return Type -Recall that calling the `listInvoice` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listInvoice` Query is of type `ListInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListInvoiceData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listInvoice`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListInvoice } from '@dataconnect/generated/react' - -export default function ListInvoiceComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListInvoice(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListInvoice(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListInvoice(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.invoices); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getInvoiceById -You can execute the `getInvoiceById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetInvoiceById(vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getInvoiceById` Query requires an argument of type `GetInvoiceByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetInvoiceByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getInvoiceById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getInvoiceById` Query is of type `GetInvoiceByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetInvoiceByIdData { - invoice?: { - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; - } & Invoice_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getInvoiceById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetInvoiceByIdVariables } from '@dataconnect/generated'; -import { useGetInvoiceById } from '@dataconnect/generated/react' - -export default function GetInvoiceByIdComponent() { - // The `useGetInvoiceById` Query hook requires an argument of type `GetInvoiceByIdVariables`: - const getInvoiceByIdVars: GetInvoiceByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetInvoiceById(getInvoiceByIdVars); - // Variables can be defined inline as well. - const query = useGetInvoiceById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetInvoiceById(dataConnect, getInvoiceByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetInvoiceById(getInvoiceByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetInvoiceById(dataConnect, getInvoiceByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.invoice); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterInvoices -You can execute the `filterInvoices` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterInvoices(vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterInvoices` Query has an optional argument of type `FilterInvoicesVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterInvoicesVariables { - invoiceNumber?: string | null; - status?: InvoiceStatus | null; - isAutoGenerated?: boolean | null; - amount?: number | null; -} -``` -### Return Type -Recall that calling the `filterInvoices` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterInvoices` Query is of type `FilterInvoicesData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterInvoicesData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterInvoices`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterInvoicesVariables } from '@dataconnect/generated'; -import { useFilterInvoices } from '@dataconnect/generated/react' - -export default function FilterInvoicesComponent() { - // The `useFilterInvoices` Query hook has an optional argument of type `FilterInvoicesVariables`: - const filterInvoicesVars: FilterInvoicesVariables = { - invoiceNumber: ..., // optional - status: ..., // optional - isAutoGenerated: ..., // optional - amount: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterInvoices(filterInvoicesVars); - // Variables can be defined inline as well. - const query = useFilterInvoices({ invoiceNumber: ..., status: ..., isAutoGenerated: ..., amount: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterInvoicesVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterInvoices(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterInvoices(dataConnect, filterInvoicesVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterInvoices(filterInvoicesVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterInvoices(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterInvoices(dataConnect, filterInvoicesVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.invoices); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listStaff -You can execute the `listStaff` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListStaff(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListStaff(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listStaff` Query has no variables. -### Return Type -Recall that calling the `listStaff` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listStaff` Query is of type `ListStaffData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListStaffData { - staffs: ({ - id: UUIDString; - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; - } & Staff_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listStaff`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListStaff } from '@dataconnect/generated/react' - -export default function ListStaffComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListStaff(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListStaff(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListStaff(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListStaff(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.staffs); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listVendor -You can execute the `listVendor` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListVendor(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListVendor(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listVendor` Query has no variables. -### Return Type -Recall that calling the `listVendor` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listVendor` Query is of type `ListVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListVendorData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listVendor`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListVendor } from '@dataconnect/generated/react' - -export default function ListVendorComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListVendor(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListVendor(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListVendor(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendors); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getVendorById -You can execute the `getVendorById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetVendorById(dc: DataConnect, vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetVendorById(vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getVendorById` Query requires an argument of type `GetVendorByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetVendorByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getVendorById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getVendorById` Query is of type `GetVendorByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetVendorByIdData { - vendor?: { - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getVendorById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetVendorByIdVariables } from '@dataconnect/generated'; -import { useGetVendorById } from '@dataconnect/generated/react' - -export default function GetVendorByIdComponent() { - // The `useGetVendorById` Query hook requires an argument of type `GetVendorByIdVariables`: - const getVendorByIdVars: GetVendorByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetVendorById(getVendorByIdVars); - // Variables can be defined inline as well. - const query = useGetVendorById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetVendorById(dataConnect, getVendorByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorById(getVendorByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorById(dataConnect, getVendorByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendor); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterVendors -You can execute the `filterVendors` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterVendors(dc: DataConnect, vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterVendors(vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterVendors` Query has an optional argument of type `FilterVendorsVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterVendorsVariables { - region?: VendorRegion | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; - vendorNumber?: string | null; - primaryContactEmail?: string | null; - legalName?: string | null; - platformType?: VendorPlatformType | null; -} -``` -### Return Type -Recall that calling the `filterVendors` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterVendors` Query is of type `FilterVendorsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterVendorsData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterVendors`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterVendorsVariables } from '@dataconnect/generated'; -import { useFilterVendors } from '@dataconnect/generated/react' - -export default function FilterVendorsComponent() { - // The `useFilterVendors` Query hook has an optional argument of type `FilterVendorsVariables`: - const filterVendorsVars: FilterVendorsVariables = { - region: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - vendorNumber: ..., // optional - primaryContactEmail: ..., // optional - legalName: ..., // optional - platformType: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterVendors(filterVendorsVars); - // Variables can be defined inline as well. - const query = useFilterVendors({ region: ..., approvalStatus: ..., isActive: ..., vendorNumber: ..., primaryContactEmail: ..., legalName: ..., platformType: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterVendorsVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterVendors(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterVendors(dataConnect, filterVendorsVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendors(filterVendorsVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterVendors(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendors(dataConnect, filterVendorsVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendors); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -# Mutations - -The React generated SDK provides Mutations hook functions that call and return [`useDataConnectMutation`](https://react-query-firebase.invertase.dev/react/data-connect/mutations) hooks from TanStack Query Firebase. - -Calling these hook functions will return a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, and the most recent data returned by the Mutation, among other things. To learn more about these hooks and how to use them, see the [TanStack Query Firebase documentation](https://react-query-firebase.invertase.dev/react/data-connect/mutations). - -Mutation hooks do not execute their Mutations automatically when called. Rather, after calling the Mutation hook function and getting a `UseMutationResult` object, you must call the `UseMutationResult.mutate()` function to execute the Mutation. - -To learn more about TanStack React Query's Mutations, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/mutations). - -## Using Mutation Hooks -Here's a general overview of how to use the generated Mutation hooks in your code: - -- Mutation hook functions are not called with the arguments to the Mutation. Instead, arguments are passed to `UseMutationResult.mutate()`. -- If the Mutation has no variables, the `mutate()` function does not require arguments. -- If the Mutation has any required variables, the `mutate()` function will require at least one argument: an object that contains all the required variables for the Mutation. -- If the Mutation has some required and some optional variables, only required variables are necessary in the variables argument object, and optional variables may be provided as well. -- If all of the Mutation's variables are optional, the Mutation hook function does not require any arguments. -- Mutation hook 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. -- Mutation hooks also accept an `options` argument of type `useDataConnectMutationOptions`. To learn more about the `options` argument, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/mutations#mutation-side-effects). - - `UseMutationResult.mutate()` also accepts an `options` argument of type `useDataConnectMutationOptions`. - - ***Special case:*** If the Mutation has no arguments (or all optional arguments and you wish to provide none), and you want to pass `options` to `UseMutationResult.mutate()`, you must pass `undefined` where you would normally pass the Mutation's arguments, and then may provide the options argument. - -Below are examples of how to use the `krow-connector` connector's generated Mutation hook 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#operations-react-angular). - -## CreateEvent -You can execute the `CreateEvent` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateEvent` Mutation requires an argument of type `CreateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateEventVariables { - eventName: string; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status: EventStatus; - date: TimestampString; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that calling the `CreateEvent` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateEvent` Mutation is of type `CreateEventData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateEventData { - event_insert: Event_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateEvent`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateEventVariables } from '@dataconnect/generated'; -import { useCreateEvent } from '@dataconnect/generated/react' - -export default function CreateEventComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateEvent(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateEvent(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateEvent(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateEvent(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateEvent` Mutation requires an argument of type `CreateEventVariables`: - const createEventVars: CreateEventVariables = { - eventName: ..., - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., - date: ..., - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional - }; - mutation.mutate(createEventVars); - // Variables can be defined inline as well. - mutation.mutate({ eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createEventVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.event_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateEvent -You can execute the `UpdateEvent` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateEvent` Mutation requires an argument of type `UpdateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateEventVariables { - id: UUIDString; - eventName?: string | null; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId?: UUIDString | null; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status?: EventStatus | null; - date?: TimestampString | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that calling the `UpdateEvent` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateEvent` Mutation is of type `UpdateEventData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateEventData { - event_update?: Event_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateEvent`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateEventVariables } from '@dataconnect/generated'; -import { useUpdateEvent } from '@dataconnect/generated/react' - -export default function UpdateEventComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateEvent(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateEvent(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateEvent(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateEvent(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateEvent` Mutation requires an argument of type `UpdateEventVariables`: - const updateEventVars: UpdateEventVariables = { - id: ..., - eventName: ..., // optional - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., // optional - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., // optional - date: ..., // optional - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional - }; - mutation.mutate(updateEventVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateEventVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.event_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteEvent -You can execute the `DeleteEvent` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteEvent` Mutation requires an argument of type `DeleteEventVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteEventVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteEvent` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteEvent` Mutation is of type `DeleteEventData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteEventData { - event_delete?: Event_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteEvent`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteEventVariables } from '@dataconnect/generated'; -import { useDeleteEvent } from '@dataconnect/generated/react' - -export default function DeleteEventComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteEvent(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteEvent(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteEvent(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteEvent(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteEvent` Mutation requires an argument of type `DeleteEventVariables`: - const deleteEventVars: DeleteEventVariables = { - id: ..., - }; - mutation.mutate(deleteEventVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteEventVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.event_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateVendorRate -You can execute the `CreateVendorRate` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateVendorRate` Mutation requires an argument of type `CreateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateVendorRateVariables { - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; -} -``` -### Return Type -Recall that calling the `CreateVendorRate` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateVendorRate` Mutation is of type `CreateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateVendorRateData { - vendorRate_insert: VendorRate_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateVendorRate`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateVendorRateVariables } from '@dataconnect/generated'; -import { useCreateVendorRate } from '@dataconnect/generated/react' - -export default function CreateVendorRateComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateVendorRate(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateVendorRate(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorRate(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateVendorRate` Mutation requires an argument of type `CreateVendorRateVariables`: - const createVendorRateVars: CreateVendorRateVariables = { - vendorName: ..., - category: ..., - roleName: ..., - employeeWage: ..., - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., - }; - mutation.mutate(createVendorRateVars); - // Variables can be defined inline as well. - mutation.mutate({ vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createVendorRateVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorRate_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateVendorRate -You can execute the `UpdateVendorRate` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateVendorRate` Mutation requires an argument of type `UpdateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateVendorRateVariables { - id: UUIDString; - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - employeeWage?: number | null; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate?: number | null; -} -``` -### Return Type -Recall that calling the `UpdateVendorRate` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateVendorRate` Mutation is of type `UpdateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateVendorRateData { - vendorRate_update?: VendorRate_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateVendorRate`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateVendorRateVariables } from '@dataconnect/generated'; -import { useUpdateVendorRate } from '@dataconnect/generated/react' - -export default function UpdateVendorRateComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateVendorRate(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateVendorRate(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorRate(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateVendorRate` Mutation requires an argument of type `UpdateVendorRateVariables`: - const updateVendorRateVars: UpdateVendorRateVariables = { - id: ..., - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - employeeWage: ..., // optional - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., // optional - }; - mutation.mutate(updateVendorRateVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateVendorRateVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorRate_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteVendorRate -You can execute the `DeleteVendorRate` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteVendorRate` Mutation requires an argument of type `DeleteVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteVendorRateVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteVendorRate` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteVendorRate` Mutation is of type `DeleteVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteVendorRateData { - vendorRate_delete?: VendorRate_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteVendorRate`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteVendorRateVariables } from '@dataconnect/generated'; -import { useDeleteVendorRate } from '@dataconnect/generated/react' - -export default function DeleteVendorRateComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteVendorRate(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteVendorRate(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorRate(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteVendorRate` Mutation requires an argument of type `DeleteVendorRateVariables`: - const deleteVendorRateVars: DeleteVendorRateVariables = { - id: ..., - }; - mutation.mutate(deleteVendorRateVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteVendorRateVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorRate_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateInvoice -You can execute the `CreateInvoice` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateInvoice` Mutation requires an argument of type `CreateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateInvoiceVariables { - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that calling the `CreateInvoice` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateInvoice` Mutation is of type `CreateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateInvoiceData { - invoice_insert: Invoice_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateInvoice`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateInvoiceVariables } from '@dataconnect/generated'; -import { useCreateInvoice } from '@dataconnect/generated/react' - -export default function CreateInvoiceComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateInvoice(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateInvoice(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateInvoice(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateInvoice` Mutation requires an argument of type `CreateInvoiceVariables`: - const createInvoiceVars: CreateInvoiceVariables = { - invoiceNumber: ..., - amount: ..., - status: ..., - issueDate: ..., - dueDate: ..., - disputedItems: ..., // optional - isAutoGenerated: ..., // optional - }; - mutation.mutate(createInvoiceVars); - // Variables can be defined inline as well. - mutation.mutate({ invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createInvoiceVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.invoice_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateInvoice -You can execute the `UpdateInvoice` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateInvoice` Mutation requires an argument of type `UpdateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateInvoiceVariables { - id: UUIDString; - invoiceNumber?: string | null; - amount?: number | null; - status?: InvoiceStatus | null; - issueDate?: TimestampString | null; - dueDate?: TimestampString | null; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that calling the `UpdateInvoice` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateInvoice` Mutation is of type `UpdateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateInvoiceData { - invoice_update?: Invoice_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateInvoice`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateInvoiceVariables } from '@dataconnect/generated'; -import { useUpdateInvoice } from '@dataconnect/generated/react' - -export default function UpdateInvoiceComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateInvoice(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateInvoice(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateInvoice(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateInvoice` Mutation requires an argument of type `UpdateInvoiceVariables`: - const updateInvoiceVars: UpdateInvoiceVariables = { - id: ..., - invoiceNumber: ..., // optional - amount: ..., // optional - status: ..., // optional - issueDate: ..., // optional - dueDate: ..., // optional - disputedItems: ..., // optional - isAutoGenerated: ..., // optional - }; - mutation.mutate(updateInvoiceVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateInvoiceVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.invoice_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteInvoice -You can execute the `DeleteInvoice` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteInvoice` Mutation requires an argument of type `DeleteInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteInvoiceVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteInvoice` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteInvoice` Mutation is of type `DeleteInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteInvoiceData { - invoice_delete?: Invoice_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteInvoice`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteInvoiceVariables } from '@dataconnect/generated'; -import { useDeleteInvoice } from '@dataconnect/generated/react' - -export default function DeleteInvoiceComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteInvoice(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteInvoice(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteInvoice(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteInvoice` Mutation requires an argument of type `DeleteInvoiceVariables`: - const deleteInvoiceVars: DeleteInvoiceVariables = { - id: ..., - }; - mutation.mutate(deleteInvoiceVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteInvoiceVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.invoice_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateStaff -You can execute the `CreateStaff` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateStaff(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateStaff(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateStaff` Mutation requires an argument of type `CreateStaffVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateStaffVariables { - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; -} -``` -### Return Type -Recall that calling the `CreateStaff` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateStaff` Mutation is of type `CreateStaffData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateStaffData { - staff_insert: Staff_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateStaff`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateStaffVariables } from '@dataconnect/generated'; -import { useCreateStaff } from '@dataconnect/generated/react' - -export default function CreateStaffComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateStaff(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateStaff(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateStaff(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateStaff(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateStaff` Mutation requires an argument of type `CreateStaffVariables`: - const createStaffVars: CreateStaffVariables = { - employeeName: ..., - vendorId: ..., // optional - email: ..., // optional - position: ..., // optional - employmentType: ..., - rating: ..., // optional - reliabilityScore: ..., // optional - backgroundCheckStatus: ..., - certifications: ..., // optional - }; - mutation.mutate(createStaffVars); - // Variables can be defined inline as well. - mutation.mutate({ employeeName: ..., vendorId: ..., email: ..., position: ..., employmentType: ..., rating: ..., reliabilityScore: ..., backgroundCheckStatus: ..., certifications: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createStaffVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.staff_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateVendor -You can execute the `CreateVendor` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateVendor` Mutation requires an argument of type `CreateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateVendorVariables { - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; -} -``` -### Return Type -Recall that calling the `CreateVendor` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateVendor` Mutation is of type `CreateVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateVendorData { - vendor_insert: Vendor_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateVendor`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateVendorVariables } from '@dataconnect/generated'; -import { useCreateVendor } from '@dataconnect/generated/react' - -export default function CreateVendorComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateVendor(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateVendor(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendor(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateVendor` Mutation requires an argument of type `CreateVendorVariables`: - const createVendorVars: CreateVendorVariables = { - vendorNumber: ..., - legalName: ..., - region: ..., - platformType: ..., - primaryContactEmail: ..., - approvalStatus: ..., - isActive: ..., // optional - }; - mutation.mutate(createVendorVars); - // Variables can be defined inline as well. - mutation.mutate({ vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createVendorVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendor_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateVendor -You can execute the `UpdateVendor` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateVendor` Mutation requires an argument of type `UpdateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateVendorVariables { - id: UUIDString; - vendorNumber?: string | null; - legalName?: string | null; - region?: VendorRegion | null; - platformType?: VendorPlatformType | null; - primaryContactEmail?: string | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; -} -``` -### Return Type -Recall that calling the `UpdateVendor` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateVendor` Mutation is of type `UpdateVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateVendorData { - vendor_update?: Vendor_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateVendor`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateVendorVariables } from '@dataconnect/generated'; -import { useUpdateVendor } from '@dataconnect/generated/react' - -export default function UpdateVendorComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateVendor(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateVendor(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendor(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateVendor` Mutation requires an argument of type `UpdateVendorVariables`: - const updateVendorVars: UpdateVendorVariables = { - id: ..., - vendorNumber: ..., // optional - legalName: ..., // optional - region: ..., // optional - platformType: ..., // optional - primaryContactEmail: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - }; - mutation.mutate(updateVendorVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateVendorVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendor_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteVendor -You can execute the `DeleteVendor` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteVendor` Mutation requires an argument of type `DeleteVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteVendorVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteVendor` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteVendor` Mutation is of type `DeleteVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteVendorData { - vendor_delete?: Vendor_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteVendor`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteVendorVariables } from '@dataconnect/generated'; -import { useDeleteVendor } from '@dataconnect/generated/react' - -export default function DeleteVendorComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteVendor(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteVendor(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendor(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteVendor` Mutation requires an argument of type `DeleteVendorVariables`: - const deleteVendorVars: DeleteVendorVariables = { - id: ..., - }; - mutation.mutate(deleteVendorVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteVendorVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendor_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateVendorDefaultSetting -You can execute the `CreateVendorDefaultSetting` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateVendorDefaultSetting` Mutation requires an argument of type `CreateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateVendorDefaultSettingVariables { - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; -} -``` -### Return Type -Recall that calling the `CreateVendorDefaultSetting` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateVendorDefaultSetting` Mutation is of type `CreateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateVendorDefaultSettingData { - vendorDefaultSetting_insert: VendorDefaultSetting_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateVendorDefaultSetting`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateVendorDefaultSettingVariables } from '@dataconnect/generated'; -import { useCreateVendorDefaultSetting } from '@dataconnect/generated/react' - -export default function CreateVendorDefaultSettingComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateVendorDefaultSetting(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateVendorDefaultSetting(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorDefaultSetting(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorDefaultSetting(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateVendorDefaultSetting` Mutation requires an argument of type `CreateVendorDefaultSettingVariables`: - const createVendorDefaultSettingVars: CreateVendorDefaultSettingVariables = { - vendorName: ..., - defaultMarkupPercentage: ..., - defaultVendorFeePercentage: ..., - }; - mutation.mutate(createVendorDefaultSettingVars); - // Variables can be defined inline as well. - mutation.mutate({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createVendorDefaultSettingVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorDefaultSetting_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateVendorDefaultSetting -You can execute the `UpdateVendorDefaultSetting` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateVendorDefaultSetting` Mutation requires an argument of type `UpdateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateVendorDefaultSettingVariables { - id: UUIDString; - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that calling the `UpdateVendorDefaultSetting` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateVendorDefaultSetting` Mutation is of type `UpdateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateVendorDefaultSettingData { - vendorDefaultSetting_update?: VendorDefaultSetting_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateVendorDefaultSetting`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateVendorDefaultSettingVariables } from '@dataconnect/generated'; -import { useUpdateVendorDefaultSetting } from '@dataconnect/generated/react' - -export default function UpdateVendorDefaultSettingComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateVendorDefaultSetting(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateVendorDefaultSetting(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorDefaultSetting(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorDefaultSetting(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateVendorDefaultSetting` Mutation requires an argument of type `UpdateVendorDefaultSettingVariables`: - const updateVendorDefaultSettingVars: UpdateVendorDefaultSettingVariables = { - id: ..., - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional - }; - mutation.mutate(updateVendorDefaultSettingVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateVendorDefaultSettingVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorDefaultSetting_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteVendorDefaultSetting -You can execute the `DeleteVendorDefaultSetting` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteVendorDefaultSetting` Mutation requires an argument of type `DeleteVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteVendorDefaultSettingVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteVendorDefaultSetting` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteVendorDefaultSetting` Mutation is of type `DeleteVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteVendorDefaultSettingData { - vendorDefaultSetting_delete?: VendorDefaultSetting_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteVendorDefaultSetting`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteVendorDefaultSettingVariables } from '@dataconnect/generated'; -import { useDeleteVendorDefaultSetting } from '@dataconnect/generated/react' - -export default function DeleteVendorDefaultSettingComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteVendorDefaultSetting(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteVendorDefaultSetting(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorDefaultSetting(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorDefaultSetting(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteVendorDefaultSetting` Mutation requires an argument of type `DeleteVendorDefaultSettingVariables`: - const deleteVendorDefaultSettingVars: DeleteVendorDefaultSettingVariables = { - id: ..., - }; - mutation.mutate(deleteVendorDefaultSettingVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteVendorDefaultSettingVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorDefaultSetting_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateBusiness -You can execute the `CreateBusiness` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateBusiness` Mutation requires an argument of type `CreateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateBusinessVariables { - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that calling the `CreateBusiness` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateBusiness` Mutation is of type `CreateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateBusinessData { - business_insert: Business_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateBusiness`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateBusinessVariables } from '@dataconnect/generated'; -import { useCreateBusiness } from '@dataconnect/generated/react' - -export default function CreateBusinessComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateBusiness(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateBusiness(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateBusiness(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateBusiness` Mutation requires an argument of type `CreateBusinessVariables`: - const createBusinessVars: CreateBusinessVariables = { - businessName: ..., - contactName: ..., - email: ..., // optional - sector: ..., // optional - rateGroup: ..., - status: ..., // optional - }; - mutation.mutate(createBusinessVars); - // Variables can be defined inline as well. - mutation.mutate({ businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createBusinessVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.business_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateBusiness -You can execute the `UpdateBusiness` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateBusiness` Mutation requires an argument of type `UpdateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateBusinessVariables { - id: UUIDString; - businessName?: string | null; - contactName?: string | null; - email?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that calling the `UpdateBusiness` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateBusiness` Mutation is of type `UpdateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateBusinessData { - business_update?: Business_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateBusiness`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateBusinessVariables } from '@dataconnect/generated'; -import { useUpdateBusiness } from '@dataconnect/generated/react' - -export default function UpdateBusinessComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateBusiness(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateBusiness(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateBusiness(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateBusiness` Mutation requires an argument of type `UpdateBusinessVariables`: - const updateBusinessVars: UpdateBusinessVariables = { - id: ..., - businessName: ..., // optional - contactName: ..., // optional - email: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional - }; - mutation.mutate(updateBusinessVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateBusinessVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.business_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteBusiness -You can execute the `DeleteBusiness` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteBusiness` Mutation requires an argument of type `DeleteBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteBusinessVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteBusiness` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteBusiness` Mutation is of type `DeleteBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteBusinessData { - business_delete?: Business_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteBusiness`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteBusinessVariables } from '@dataconnect/generated'; -import { useDeleteBusiness } from '@dataconnect/generated/react' - -export default function DeleteBusinessComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteBusiness(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteBusiness(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteBusiness(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteBusiness` Mutation requires an argument of type `DeleteBusinessVariables`: - const deleteBusinessVars: DeleteBusinessVariables = { - id: ..., - }; - mutation.mutate(deleteBusinessVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteBusinessVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.business_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - diff --git a/frontend-web/src/dataconnect-generated/react/esm/index.esm.js b/frontend-web/src/dataconnect-generated/react/esm/index.esm.js deleted file mode 100644 index 8fcd37c9..00000000 --- a/frontend-web/src/dataconnect-generated/react/esm/index.esm.js +++ /dev/null @@ -1,269 +0,0 @@ -import { listBusinessRef, getBusinessByIdRef, filterBusinessRef, createEventRef, updateEventRef, deleteEventRef, listVendorDefaultSettingsRef, getVendorDefaultSettingByIdRef, filterVendorDefaultSettingsRef, createVendorRateRef, updateVendorRateRef, deleteVendorRateRef, listVendorRateRef, getVendorRateByIdRef, filterVendorRatesRef, listEventsRef, getEventByIdRef, filterEventsRef, createInvoiceRef, updateInvoiceRef, deleteInvoiceRef, listInvoiceRef, getInvoiceByIdRef, filterInvoicesRef, createStaffRef, listStaffRef, createVendorRef, updateVendorRef, deleteVendorRef, listVendorRef, getVendorByIdRef, filterVendorsRef, createVendorDefaultSettingRef, updateVendorDefaultSettingRef, deleteVendorDefaultSettingRef, createBusinessRef, updateBusinessRef, deleteBusinessRef, connectorConfig } from '../../esm/index.esm.js'; -import { validateArgs, CallerSdkTypeEnum } from 'firebase/data-connect'; -import { useDataConnectQuery, useDataConnectMutation, validateReactArgs } from '@tanstack-query-firebase/react/data-connect'; - - -export function useListBusiness(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listBusinessRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetBusinessById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getBusinessByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterBusiness(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterBusinessRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListVendorDefaultSettings(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorDefaultSettingsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetVendorDefaultSettingById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorDefaultSettingByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterVendorDefaultSettings(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorDefaultSettingsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListVendorRate(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRateRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetVendorRateById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorRateByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterVendorRates(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorRatesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useListEvents(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listEventsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetEventById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getEventByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterEvents(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterEventsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListInvoice(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listInvoiceRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetInvoiceById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getInvoiceByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterInvoices(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterInvoicesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateStaff(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createStaffRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListStaff(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listStaffRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListVendor(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetVendorById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterVendors(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useCreateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} diff --git a/frontend-web/src/dataconnect-generated/react/esm/package.json b/frontend-web/src/dataconnect-generated/react/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/frontend-web/src/dataconnect-generated/react/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/frontend-web/src/dataconnect-generated/react/index.cjs.js b/frontend-web/src/dataconnect-generated/react/index.cjs.js deleted file mode 100644 index 3ecd5152..00000000 --- a/frontend-web/src/dataconnect-generated/react/index.cjs.js +++ /dev/null @@ -1,269 +0,0 @@ -const { listBusinessRef, getBusinessByIdRef, filterBusinessRef, createEventRef, updateEventRef, deleteEventRef, listVendorDefaultSettingsRef, getVendorDefaultSettingByIdRef, filterVendorDefaultSettingsRef, createVendorRateRef, updateVendorRateRef, deleteVendorRateRef, listVendorRateRef, getVendorRateByIdRef, filterVendorRatesRef, listEventsRef, getEventByIdRef, filterEventsRef, createInvoiceRef, updateInvoiceRef, deleteInvoiceRef, listInvoiceRef, getInvoiceByIdRef, filterInvoicesRef, createStaffRef, listStaffRef, createVendorRef, updateVendorRef, deleteVendorRef, listVendorRef, getVendorByIdRef, filterVendorsRef, createVendorDefaultSettingRef, updateVendorDefaultSettingRef, deleteVendorDefaultSettingRef, createBusinessRef, updateBusinessRef, deleteBusinessRef, connectorConfig } = require('../index.cjs.js'); -const { validateArgs, CallerSdkTypeEnum } = require('firebase/data-connect'); -const { useDataConnectQuery, useDataConnectMutation, validateReactArgs } = require('@tanstack-query-firebase/react/data-connect'); - - -exports.useListBusiness = function useListBusiness(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listBusinessRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetBusinessById = function useGetBusinessById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getBusinessByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterBusiness = function useFilterBusiness(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterBusinessRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateEvent = function useCreateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateEvent = function useUpdateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteEvent = function useDeleteEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListVendorDefaultSettings = function useListVendorDefaultSettings(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorDefaultSettingsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetVendorDefaultSettingById = function useGetVendorDefaultSettingById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorDefaultSettingByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterVendorDefaultSettings = function useFilterVendorDefaultSettings(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorDefaultSettingsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateVendorRate = function useCreateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateVendorRate = function useUpdateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteVendorRate = function useDeleteVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListVendorRate = function useListVendorRate(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRateRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetVendorRateById = function useGetVendorRateById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorRateByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterVendorRates = function useFilterVendorRates(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorRatesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useListEvents = function useListEvents(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listEventsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetEventById = function useGetEventById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getEventByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterEvents = function useFilterEvents(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterEventsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateInvoice = function useCreateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateInvoice = function useUpdateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteInvoice = function useDeleteInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListInvoice = function useListInvoice(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listInvoiceRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetInvoiceById = function useGetInvoiceById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getInvoiceByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterInvoices = function useFilterInvoices(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterInvoicesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateStaff = function useCreateStaff(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createStaffRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListStaff = function useListStaff(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listStaffRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateVendor = function useCreateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateVendor = function useUpdateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteVendor = function useDeleteVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListVendor = function useListVendor(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetVendorById = function useGetVendorById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterVendors = function useFilterVendors(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateVendorDefaultSetting = function useCreateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateVendorDefaultSetting = function useUpdateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteVendorDefaultSetting = function useDeleteVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useCreateBusiness = function useCreateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateBusiness = function useUpdateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteBusiness = function useDeleteBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} diff --git a/frontend-web/src/dataconnect-generated/react/index.d.ts b/frontend-web/src/dataconnect-generated/react/index.d.ts deleted file mode 100644 index 18a7afb1..00000000 --- a/frontend-web/src/dataconnect-generated/react/index.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { ListBusinessData, GetBusinessByIdData, GetBusinessByIdVariables, FilterBusinessData, FilterBusinessVariables, CreateEventData, CreateEventVariables, UpdateEventData, UpdateEventVariables, DeleteEventData, DeleteEventVariables, ListVendorDefaultSettingsData, GetVendorDefaultSettingByIdData, GetVendorDefaultSettingByIdVariables, FilterVendorDefaultSettingsData, FilterVendorDefaultSettingsVariables, CreateVendorRateData, CreateVendorRateVariables, UpdateVendorRateData, UpdateVendorRateVariables, DeleteVendorRateData, DeleteVendorRateVariables, ListVendorRateData, GetVendorRateByIdData, GetVendorRateByIdVariables, FilterVendorRatesData, FilterVendorRatesVariables, ListEventsData, GetEventByIdData, GetEventByIdVariables, FilterEventsData, FilterEventsVariables, CreateInvoiceData, CreateInvoiceVariables, UpdateInvoiceData, UpdateInvoiceVariables, DeleteInvoiceData, DeleteInvoiceVariables, ListInvoiceData, GetInvoiceByIdData, GetInvoiceByIdVariables, FilterInvoicesData, FilterInvoicesVariables, CreateStaffData, CreateStaffVariables, ListStaffData, CreateVendorData, CreateVendorVariables, UpdateVendorData, UpdateVendorVariables, DeleteVendorData, DeleteVendorVariables, ListVendorData, GetVendorByIdData, GetVendorByIdVariables, FilterVendorsData, FilterVendorsVariables, CreateVendorDefaultSettingData, CreateVendorDefaultSettingVariables, UpdateVendorDefaultSettingData, UpdateVendorDefaultSettingVariables, DeleteVendorDefaultSettingData, DeleteVendorDefaultSettingVariables, CreateBusinessData, CreateBusinessVariables, UpdateBusinessData, UpdateBusinessVariables, DeleteBusinessData, DeleteBusinessVariables } from '../'; -import { UseDataConnectQueryResult, useDataConnectQueryOptions, UseDataConnectMutationResult, useDataConnectMutationOptions} from '@tanstack-query-firebase/react/data-connect'; -import { UseQueryResult, UseMutationResult} from '@tanstack/react-query'; -import { DataConnect } from 'firebase/data-connect'; -import { FirebaseError } from 'firebase/app'; - - -export function useListBusiness(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListBusiness(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetBusinessById(vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterBusiness(vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterBusiness(dc: DataConnect, vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListVendorDefaultSettings(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListVendorDefaultSettings(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListVendorRate(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListVendorRate(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetVendorRateById(vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterVendorRates(vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useListEvents(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListEvents(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetEventById(vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetEventById(dc: DataConnect, vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterEvents(vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterEvents(dc: DataConnect, vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListInvoice(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListInvoice(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetInvoiceById(vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterInvoices(vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateStaff(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateStaff(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListStaff(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListStaff(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListVendor(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListVendor(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetVendorById(vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetVendorById(dc: DataConnect, vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterVendors(vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterVendors(dc: DataConnect, vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useCreateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; diff --git a/frontend-web/src/dataconnect-generated/react/package.json b/frontend-web/src/dataconnect-generated/react/package.json deleted file mode 100644 index 512c7ec3..00000000 --- a/frontend-web/src/dataconnect-generated/react/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@dataconnect/generated-react", - "version": "1.0.0", - "author": "Firebase (https://firebase.google.com/)", - "description": "Generated SDK For krow-connector", - "license": "Apache-2.0", - "engines": { - "node": " >=18.0" - }, - "typings": "index.d.ts", - "main": "index.cjs.js", - "module": "esm/index.esm.js", - "browser": "esm/index.esm.js", - "peerDependencies": { - "@tanstack-query-firebase/react": "^2.0.0" - } -} \ No newline at end of file diff --git a/internal-api-harness/src/dataconnect-generated/.guides/config.json b/internal-api-harness/src/dataconnect-generated/.guides/config.json deleted file mode 100644 index e37ed06f..00000000 --- a/internal-api-harness/src/dataconnect-generated/.guides/config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "description": "A set of guides for interacting with the generated firebase dataconnect sdk", - "mcpServers": { - "firebase": { - "command": "npx", - "args": ["-y", "firebase-tools@latest", "experimental:mcp"] - } - } -} diff --git a/internal-api-harness/src/dataconnect-generated/.guides/setup.md b/internal-api-harness/src/dataconnect-generated/.guides/setup.md deleted file mode 100644 index 64a49286..00000000 --- a/internal-api-harness/src/dataconnect-generated/.guides/setup.md +++ /dev/null @@ -1,62 +0,0 @@ -# Setup - -If the user hasn't already installed the SDK, always run the user's node package manager of choice, and install the package in the directory ../package.json. -For more information on where the library is located, look at the connector.yaml file. - -```ts -import { initializeApp } from 'firebase/app'; - -initializeApp({ - // fill in your project config here using the values from your Firebase project or from the `firebase_get_sdk_config` tool from the Firebase MCP server. -}); -``` - -Then, you can run the SDK as needed. -```ts -import { ... } from '@dataconnect/generated'; -``` - - - - -## React -### Setup - -The user should make sure to install the `@tanstack/react-query` package, along with `@tanstack-query-firebase/react` and `firebase`. - -Then, they should initialize Firebase: -```ts -import { initializeApp } from 'firebase/app'; -initializeApp(firebaseConfig); /* your config here. To generate this, you can use the `firebase_sdk_config` MCP tool */ -``` - -Then, they should add a `QueryClientProvider` to their root of their application. - -Here's an example: - -```ts -import { initializeApp } from 'firebase/app'; -import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; - -const firebaseConfig = { - /* your config here. To generate this, you can use the `firebase_sdk_config` MCP tool */ -}; - -// Initialize Firebase -const app = initializeApp(firebaseConfig); - -// Create a TanStack Query client instance -const queryClient = new QueryClient(); - -function App() { - return ( - // Provide the client to your App - - - - ) -} - -render(, document.getElementById('root')); -``` - diff --git a/internal-api-harness/src/dataconnect-generated/.guides/usage.md b/internal-api-harness/src/dataconnect-generated/.guides/usage.md deleted file mode 100644 index 76991bc0..00000000 --- a/internal-api-harness/src/dataconnect-generated/.guides/usage.md +++ /dev/null @@ -1,109 +0,0 @@ -# Basic Usage - -Always prioritize using a supported framework over using the generated SDK -directly. Supported frameworks simplify the developer experience and help ensure -best practices are followed. - - - - -### React -For each operation, there is a wrapper hook that can be used to call the operation. - -Here are all of the hooks that get generated: -```ts -import { useListBusiness, useGetBusinessById, useFilterBusiness, useCreateEvent, useUpdateEvent, useDeleteEvent, useListVendorDefaultSettings, useGetVendorDefaultSettingById, useFilterVendorDefaultSettings, useCreateVendorRate } from '@dataconnect/generated/react'; -// The types of these hooks are available in react/index.d.ts - -const { data, isPending, isSuccess, isError, error } = useListBusiness(); - -const { data, isPending, isSuccess, isError, error } = useGetBusinessById(getBusinessByIdVars); - -const { data, isPending, isSuccess, isError, error } = useFilterBusiness(filterBusinessVars); - -const { data, isPending, isSuccess, isError, error } = useCreateEvent(createEventVars); - -const { data, isPending, isSuccess, isError, error } = useUpdateEvent(updateEventVars); - -const { data, isPending, isSuccess, isError, error } = useDeleteEvent(deleteEventVars); - -const { data, isPending, isSuccess, isError, error } = useListVendorDefaultSettings(); - -const { data, isPending, isSuccess, isError, error } = useGetVendorDefaultSettingById(getVendorDefaultSettingByIdVars); - -const { data, isPending, isSuccess, isError, error } = useFilterVendorDefaultSettings(filterVendorDefaultSettingsVars); - -const { data, isPending, isSuccess, isError, error } = useCreateVendorRate(createVendorRateVars); - -``` - -Here's an example from a different generated SDK: - -```ts -import { useListAllMovies } from '@dataconnect/generated/react'; - -function MyComponent() { - const { isLoading, data, error } = useListAllMovies(); - if(isLoading) { - return
Loading...
- } - if(error) { - return
An Error Occurred: {error}
- } -} - -// App.tsx -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import MyComponent from './my-component'; - -function App() { - const queryClient = new QueryClient(); - return - - -} -``` - - - -## Advanced Usage -If a user is not using a supported framework, they can use the generated SDK directly. - -Here's an example of how to use it with the first 5 operations: - -```js -import { listBusiness, getBusinessById, filterBusiness, createEvent, updateEvent, deleteEvent, listVendorDefaultSettings, getVendorDefaultSettingById, filterVendorDefaultSettings, createVendorRate } from '@dataconnect/generated'; - - -// Operation listBusiness: -const { data } = await ListBusiness(dataConnect); - -// Operation getBusinessById: For variables, look at type GetBusinessByIdVars in ../index.d.ts -const { data } = await GetBusinessById(dataConnect, getBusinessByIdVars); - -// Operation filterBusiness: For variables, look at type FilterBusinessVars in ../index.d.ts -const { data } = await FilterBusiness(dataConnect, filterBusinessVars); - -// Operation CreateEvent: For variables, look at type CreateEventVars in ../index.d.ts -const { data } = await CreateEvent(dataConnect, createEventVars); - -// Operation UpdateEvent: For variables, look at type UpdateEventVars in ../index.d.ts -const { data } = await UpdateEvent(dataConnect, updateEventVars); - -// Operation DeleteEvent: For variables, look at type DeleteEventVars in ../index.d.ts -const { data } = await DeleteEvent(dataConnect, deleteEventVars); - -// Operation listVendorDefaultSettings: -const { data } = await ListVendorDefaultSettings(dataConnect); - -// Operation getVendorDefaultSettingById: For variables, look at type GetVendorDefaultSettingByIdVars in ../index.d.ts -const { data } = await GetVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars); - -// Operation filterVendorDefaultSettings: For variables, look at type FilterVendorDefaultSettingsVars in ../index.d.ts -const { data } = await FilterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars); - -// Operation CreateVendorRate: For variables, look at type CreateVendorRateVars in ../index.d.ts -const { data } = await CreateVendorRate(dataConnect, createVendorRateVars); - - -``` \ No newline at end of file diff --git a/internal-api-harness/src/dataconnect-generated/README.md b/internal-api-harness/src/dataconnect-generated/README.md deleted file mode 100644 index 165ef7f8..00000000 --- a/internal-api-harness/src/dataconnect-generated/README.md +++ /dev/null @@ -1,4872 +0,0 @@ -# Generated TypeScript README -This README will guide you through the process of using the generated JavaScript SDK package for the connector `krow-connector`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. - -**If you're looking for the `React README`, you can find it at [`dataconnect-generated/react/README.md`](./react/README.md)** - -***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) - - [*listBusiness*](#listbusiness) - - [*getBusinessById*](#getbusinessbyid) - - [*filterBusiness*](#filterbusiness) - - [*listVendorDefaultSettings*](#listvendordefaultsettings) - - [*getVendorDefaultSettingById*](#getvendordefaultsettingbyid) - - [*filterVendorDefaultSettings*](#filtervendordefaultsettings) - - [*listVendorRate*](#listvendorrate) - - [*getVendorRateById*](#getvendorratebyid) - - [*filterVendorRates*](#filtervendorrates) - - [*listEvents*](#listevents) - - [*getEventById*](#geteventbyid) - - [*filterEvents*](#filterevents) - - [*listInvoice*](#listinvoice) - - [*getInvoiceById*](#getinvoicebyid) - - [*filterInvoices*](#filterinvoices) - - [*listStaff*](#liststaff) - - [*listVendor*](#listvendor) - - [*getVendorById*](#getvendorbyid) - - [*filterVendors*](#filtervendors) -- [**Mutations**](#mutations) - - [*CreateEvent*](#createevent) - - [*UpdateEvent*](#updateevent) - - [*DeleteEvent*](#deleteevent) - - [*CreateVendorRate*](#createvendorrate) - - [*UpdateVendorRate*](#updatevendorrate) - - [*DeleteVendorRate*](#deletevendorrate) - - [*CreateInvoice*](#createinvoice) - - [*UpdateInvoice*](#updateinvoice) - - [*DeleteInvoice*](#deleteinvoice) - - [*CreateStaff*](#createstaff) - - [*CreateVendor*](#createvendor) - - [*UpdateVendor*](#updatevendor) - - [*DeleteVendor*](#deletevendor) - - [*CreateVendorDefaultSetting*](#createvendordefaultsetting) - - [*UpdateVendorDefaultSetting*](#updatevendordefaultsetting) - - [*DeleteVendorDefaultSetting*](#deletevendordefaultsetting) - - [*CreateBusiness*](#createbusiness) - - [*UpdateBusiness*](#updatebusiness) - - [*DeleteBusiness*](#deletebusiness) - -# 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 `krow-connector`. 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/generated` 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/generated'; - -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/generated'; - -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 `krow-connector` 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). - -## listBusiness -You can execute the `listBusiness` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listBusiness(): QueryPromise; - -interface ListBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listBusinessRef: ListBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listBusiness(dc: DataConnect): QueryPromise; - -interface ListBusinessRef { - ... - (dc: DataConnect): QueryRef; -} -export const listBusinessRef: ListBusinessRef; -``` - -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 listBusinessRef: -```typescript -const name = listBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `listBusiness` query has no variables. -### Return Type -Recall that executing the `listBusiness` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` -### Using `listBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listBusiness } from '@dataconnect/generated'; - - -// Call the `listBusiness()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listBusiness(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listBusiness(dataConnect); - -console.log(data.businesses); - -// Or, you can use the `Promise` API. -listBusiness().then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -### Using `listBusiness`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listBusinessRef } from '@dataconnect/generated'; - - -// Call the `listBusinessRef()` function to get a reference to the query. -const ref = listBusinessRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listBusinessRef(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.businesses); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -## getBusinessById -You can execute the `getBusinessById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getBusinessById(vars: GetBusinessByIdVariables): QueryPromise; - -interface GetBusinessByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetBusinessByIdVariables): QueryRef; -} -export const getBusinessByIdRef: GetBusinessByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables): QueryPromise; - -interface GetBusinessByIdRef { - ... - (dc: DataConnect, vars: GetBusinessByIdVariables): QueryRef; -} -export const getBusinessByIdRef: GetBusinessByIdRef; -``` - -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 getBusinessByIdRef: -```typescript -const name = getBusinessByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getBusinessById` query requires an argument of type `GetBusinessByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetBusinessByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getBusinessById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetBusinessByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetBusinessByIdData { - business?: { - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key; -} -``` -### Using `getBusinessById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getBusinessById, GetBusinessByIdVariables } from '@dataconnect/generated'; - -// The `getBusinessById` query requires an argument of type `GetBusinessByIdVariables`: -const getBusinessByIdVars: GetBusinessByIdVariables = { - id: ..., -}; - -// Call the `getBusinessById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getBusinessById(getBusinessByIdVars); -// Variables can be defined inline as well. -const { data } = await getBusinessById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getBusinessById(dataConnect, getBusinessByIdVars); - -console.log(data.business); - -// Or, you can use the `Promise` API. -getBusinessById(getBusinessByIdVars).then((response) => { - const data = response.data; - console.log(data.business); -}); -``` - -### Using `getBusinessById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getBusinessByIdRef, GetBusinessByIdVariables } from '@dataconnect/generated'; - -// The `getBusinessById` query requires an argument of type `GetBusinessByIdVariables`: -const getBusinessByIdVars: GetBusinessByIdVariables = { - id: ..., -}; - -// Call the `getBusinessByIdRef()` function to get a reference to the query. -const ref = getBusinessByIdRef(getBusinessByIdVars); -// Variables can be defined inline as well. -const ref = getBusinessByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getBusinessByIdRef(dataConnect, getBusinessByIdVars); - -// 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.business); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.business); -}); -``` - -## filterBusiness -You can execute the `filterBusiness` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterBusiness(vars?: FilterBusinessVariables): QueryPromise; - -interface FilterBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterBusinessVariables): QueryRef; -} -export const filterBusinessRef: FilterBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterBusiness(dc: DataConnect, vars?: FilterBusinessVariables): QueryPromise; - -interface FilterBusinessRef { - ... - (dc: DataConnect, vars?: FilterBusinessVariables): QueryRef; -} -export const filterBusinessRef: FilterBusinessRef; -``` - -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 filterBusinessRef: -```typescript -const name = filterBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `filterBusiness` query has an optional argument of type `FilterBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterBusinessVariables { - businessName?: string | null; - contactName?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that executing the `filterBusiness` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` -### Using `filterBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterBusiness, FilterBusinessVariables } from '@dataconnect/generated'; - -// The `filterBusiness` query has an optional argument of type `FilterBusinessVariables`: -const filterBusinessVars: FilterBusinessVariables = { - businessName: ..., // optional - contactName: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `filterBusiness()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterBusiness(filterBusinessVars); -// Variables can be defined inline as well. -const { data } = await filterBusiness({ businessName: ..., contactName: ..., sector: ..., rateGroup: ..., status: ..., }); -// Since all variables are optional for this query, you can omit the `FilterBusinessVariables` argument. -const { data } = await filterBusiness(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterBusiness(dataConnect, filterBusinessVars); - -console.log(data.businesses); - -// Or, you can use the `Promise` API. -filterBusiness(filterBusinessVars).then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -### Using `filterBusiness`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterBusinessRef, FilterBusinessVariables } from '@dataconnect/generated'; - -// The `filterBusiness` query has an optional argument of type `FilterBusinessVariables`: -const filterBusinessVars: FilterBusinessVariables = { - businessName: ..., // optional - contactName: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `filterBusinessRef()` function to get a reference to the query. -const ref = filterBusinessRef(filterBusinessVars); -// Variables can be defined inline as well. -const ref = filterBusinessRef({ businessName: ..., contactName: ..., sector: ..., rateGroup: ..., status: ..., }); -// Since all variables are optional for this query, you can omit the `FilterBusinessVariables` argument. -const ref = filterBusinessRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterBusinessRef(dataConnect, filterBusinessVars); - -// 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.businesses); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.businesses); -}); -``` - -## listVendorDefaultSettings -You can execute the `listVendorDefaultSettings` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listVendorDefaultSettings(): QueryPromise; - -interface ListVendorDefaultSettingsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listVendorDefaultSettingsRef: ListVendorDefaultSettingsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listVendorDefaultSettings(dc: DataConnect): QueryPromise; - -interface ListVendorDefaultSettingsRef { - ... - (dc: DataConnect): QueryRef; -} -export const listVendorDefaultSettingsRef: ListVendorDefaultSettingsRef; -``` - -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 listVendorDefaultSettingsRef: -```typescript -const name = listVendorDefaultSettingsRef.operationName; -console.log(name); -``` - -### Variables -The `listVendorDefaultSettings` query has no variables. -### Return Type -Recall that executing the `listVendorDefaultSettings` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` -### Using `listVendorDefaultSettings`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listVendorDefaultSettings } from '@dataconnect/generated'; - - -// Call the `listVendorDefaultSettings()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listVendorDefaultSettings(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listVendorDefaultSettings(dataConnect); - -console.log(data.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -listVendorDefaultSettings().then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -### Using `listVendorDefaultSettings`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listVendorDefaultSettingsRef } from '@dataconnect/generated'; - - -// Call the `listVendorDefaultSettingsRef()` function to get a reference to the query. -const ref = listVendorDefaultSettingsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listVendorDefaultSettingsRef(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.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -## getVendorDefaultSettingById -You can execute the `getVendorDefaultSettingById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables): QueryPromise; - -interface GetVendorDefaultSettingByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorDefaultSettingByIdVariables): QueryRef; -} -export const getVendorDefaultSettingByIdRef: GetVendorDefaultSettingByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryPromise; - -interface GetVendorDefaultSettingByIdRef { - ... - (dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryRef; -} -export const getVendorDefaultSettingByIdRef: GetVendorDefaultSettingByIdRef; -``` - -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 getVendorDefaultSettingByIdRef: -```typescript -const name = getVendorDefaultSettingByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getVendorDefaultSettingById` query requires an argument of type `GetVendorDefaultSettingByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetVendorDefaultSettingByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getVendorDefaultSettingById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetVendorDefaultSettingByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetVendorDefaultSettingByIdData { - vendorDefaultSetting?: { - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key; -} -``` -### Using `getVendorDefaultSettingById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getVendorDefaultSettingById, GetVendorDefaultSettingByIdVariables } from '@dataconnect/generated'; - -// The `getVendorDefaultSettingById` query requires an argument of type `GetVendorDefaultSettingByIdVariables`: -const getVendorDefaultSettingByIdVars: GetVendorDefaultSettingByIdVariables = { - id: ..., -}; - -// Call the `getVendorDefaultSettingById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getVendorDefaultSettingById(getVendorDefaultSettingByIdVars); -// Variables can be defined inline as well. -const { data } = await getVendorDefaultSettingById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars); - -console.log(data.vendorDefaultSetting); - -// Or, you can use the `Promise` API. -getVendorDefaultSettingById(getVendorDefaultSettingByIdVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting); -}); -``` - -### Using `getVendorDefaultSettingById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getVendorDefaultSettingByIdRef, GetVendorDefaultSettingByIdVariables } from '@dataconnect/generated'; - -// The `getVendorDefaultSettingById` query requires an argument of type `GetVendorDefaultSettingByIdVariables`: -const getVendorDefaultSettingByIdVars: GetVendorDefaultSettingByIdVariables = { - id: ..., -}; - -// Call the `getVendorDefaultSettingByIdRef()` function to get a reference to the query. -const ref = getVendorDefaultSettingByIdRef(getVendorDefaultSettingByIdVars); -// Variables can be defined inline as well. -const ref = getVendorDefaultSettingByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getVendorDefaultSettingByIdRef(dataConnect, getVendorDefaultSettingByIdVars); - -// 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.vendorDefaultSetting); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting); -}); -``` - -## filterVendorDefaultSettings -You can execute the `filterVendorDefaultSettings` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables): QueryPromise; - -interface FilterVendorDefaultSettingsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorDefaultSettingsVariables): QueryRef; -} -export const filterVendorDefaultSettingsRef: FilterVendorDefaultSettingsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryPromise; - -interface FilterVendorDefaultSettingsRef { - ... - (dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryRef; -} -export const filterVendorDefaultSettingsRef: FilterVendorDefaultSettingsRef; -``` - -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 filterVendorDefaultSettingsRef: -```typescript -const name = filterVendorDefaultSettingsRef.operationName; -console.log(name); -``` - -### Variables -The `filterVendorDefaultSettings` query has an optional argument of type `FilterVendorDefaultSettingsVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterVendorDefaultSettingsVariables { - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that executing the `filterVendorDefaultSettings` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` -### Using `filterVendorDefaultSettings`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterVendorDefaultSettings, FilterVendorDefaultSettingsVariables } from '@dataconnect/generated'; - -// The `filterVendorDefaultSettings` query has an optional argument of type `FilterVendorDefaultSettingsVariables`: -const filterVendorDefaultSettingsVars: FilterVendorDefaultSettingsVariables = { - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `filterVendorDefaultSettings()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterVendorDefaultSettings(filterVendorDefaultSettingsVars); -// Variables can be defined inline as well. -const { data } = await filterVendorDefaultSettings({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorDefaultSettingsVariables` argument. -const { data } = await filterVendorDefaultSettings(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars); - -console.log(data.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -filterVendorDefaultSettings(filterVendorDefaultSettingsVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -### Using `filterVendorDefaultSettings`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterVendorDefaultSettingsRef, FilterVendorDefaultSettingsVariables } from '@dataconnect/generated'; - -// The `filterVendorDefaultSettings` query has an optional argument of type `FilterVendorDefaultSettingsVariables`: -const filterVendorDefaultSettingsVars: FilterVendorDefaultSettingsVariables = { - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `filterVendorDefaultSettingsRef()` function to get a reference to the query. -const ref = filterVendorDefaultSettingsRef(filterVendorDefaultSettingsVars); -// Variables can be defined inline as well. -const ref = filterVendorDefaultSettingsRef({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorDefaultSettingsVariables` argument. -const ref = filterVendorDefaultSettingsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterVendorDefaultSettingsRef(dataConnect, filterVendorDefaultSettingsVars); - -// 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.vendorDefaultSettings); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSettings); -}); -``` - -## listVendorRate -You can execute the `listVendorRate` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listVendorRate(): QueryPromise; - -interface ListVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listVendorRateRef: ListVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listVendorRate(dc: DataConnect): QueryPromise; - -interface ListVendorRateRef { - ... - (dc: DataConnect): QueryRef; -} -export const listVendorRateRef: ListVendorRateRef; -``` - -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 listVendorRateRef: -```typescript -const name = listVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `listVendorRate` query has no variables. -### Return Type -Recall that executing the `listVendorRate` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListVendorRateData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` -### Using `listVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listVendorRate } from '@dataconnect/generated'; - - -// Call the `listVendorRate()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listVendorRate(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listVendorRate(dataConnect); - -console.log(data.vendorRates); - -// Or, you can use the `Promise` API. -listVendorRate().then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -### Using `listVendorRate`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listVendorRateRef } from '@dataconnect/generated'; - - -// Call the `listVendorRateRef()` function to get a reference to the query. -const ref = listVendorRateRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listVendorRateRef(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.vendorRates); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -## getVendorRateById -You can execute the `getVendorRateById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getVendorRateById(vars: GetVendorRateByIdVariables): QueryPromise; - -interface GetVendorRateByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorRateByIdVariables): QueryRef; -} -export const getVendorRateByIdRef: GetVendorRateByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables): QueryPromise; - -interface GetVendorRateByIdRef { - ... - (dc: DataConnect, vars: GetVendorRateByIdVariables): QueryRef; -} -export const getVendorRateByIdRef: GetVendorRateByIdRef; -``` - -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 getVendorRateByIdRef: -```typescript -const name = getVendorRateByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getVendorRateById` query requires an argument of type `GetVendorRateByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetVendorRateByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getVendorRateById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetVendorRateByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetVendorRateByIdData { - vendorRate?: { - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - createdDate?: TimestampString | null; - updatedDate?: TimestampString | null; - createdBy?: string | null; - } & VendorRate_Key; -} -``` -### Using `getVendorRateById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getVendorRateById, GetVendorRateByIdVariables } from '@dataconnect/generated'; - -// The `getVendorRateById` query requires an argument of type `GetVendorRateByIdVariables`: -const getVendorRateByIdVars: GetVendorRateByIdVariables = { - id: ..., -}; - -// Call the `getVendorRateById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getVendorRateById(getVendorRateByIdVars); -// Variables can be defined inline as well. -const { data } = await getVendorRateById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getVendorRateById(dataConnect, getVendorRateByIdVars); - -console.log(data.vendorRate); - -// Or, you can use the `Promise` API. -getVendorRateById(getVendorRateByIdVars).then((response) => { - const data = response.data; - console.log(data.vendorRate); -}); -``` - -### Using `getVendorRateById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getVendorRateByIdRef, GetVendorRateByIdVariables } from '@dataconnect/generated'; - -// The `getVendorRateById` query requires an argument of type `GetVendorRateByIdVariables`: -const getVendorRateByIdVars: GetVendorRateByIdVariables = { - id: ..., -}; - -// Call the `getVendorRateByIdRef()` function to get a reference to the query. -const ref = getVendorRateByIdRef(getVendorRateByIdVars); -// Variables can be defined inline as well. -const ref = getVendorRateByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getVendorRateByIdRef(dataConnect, getVendorRateByIdVars); - -// 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.vendorRate); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate); -}); -``` - -## filterVendorRates -You can execute the `filterVendorRates` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterVendorRates(vars?: FilterVendorRatesVariables): QueryPromise; - -interface FilterVendorRatesRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorRatesVariables): QueryRef; -} -export const filterVendorRatesRef: FilterVendorRatesRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables): QueryPromise; - -interface FilterVendorRatesRef { - ... - (dc: DataConnect, vars?: FilterVendorRatesVariables): QueryRef; -} -export const filterVendorRatesRef: FilterVendorRatesRef; -``` - -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 filterVendorRatesRef: -```typescript -const name = filterVendorRatesRef.operationName; -console.log(name); -``` - -### Variables -The `filterVendorRates` query has an optional argument of type `FilterVendorRatesVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterVendorRatesVariables { - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - minClientRate?: number | null; - maxClientRate?: number | null; -} -``` -### Return Type -Recall that executing the `filterVendorRates` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterVendorRatesData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterVendorRatesData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` -### Using `filterVendorRates`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterVendorRates, FilterVendorRatesVariables } from '@dataconnect/generated'; - -// The `filterVendorRates` query has an optional argument of type `FilterVendorRatesVariables`: -const filterVendorRatesVars: FilterVendorRatesVariables = { - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - minClientRate: ..., // optional - maxClientRate: ..., // optional -}; - -// Call the `filterVendorRates()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterVendorRates(filterVendorRatesVars); -// Variables can be defined inline as well. -const { data } = await filterVendorRates({ vendorName: ..., category: ..., roleName: ..., minClientRate: ..., maxClientRate: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorRatesVariables` argument. -const { data } = await filterVendorRates(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterVendorRates(dataConnect, filterVendorRatesVars); - -console.log(data.vendorRates); - -// Or, you can use the `Promise` API. -filterVendorRates(filterVendorRatesVars).then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -### Using `filterVendorRates`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterVendorRatesRef, FilterVendorRatesVariables } from '@dataconnect/generated'; - -// The `filterVendorRates` query has an optional argument of type `FilterVendorRatesVariables`: -const filterVendorRatesVars: FilterVendorRatesVariables = { - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - minClientRate: ..., // optional - maxClientRate: ..., // optional -}; - -// Call the `filterVendorRatesRef()` function to get a reference to the query. -const ref = filterVendorRatesRef(filterVendorRatesVars); -// Variables can be defined inline as well. -const ref = filterVendorRatesRef({ vendorName: ..., category: ..., roleName: ..., minClientRate: ..., maxClientRate: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorRatesVariables` argument. -const ref = filterVendorRatesRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterVendorRatesRef(dataConnect, filterVendorRatesVars); - -// 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.vendorRates); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendorRates); -}); -``` - -## listEvents -You can execute the `listEvents` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listEvents(): QueryPromise; - -interface ListEventsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listEventsRef: ListEventsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listEvents(dc: DataConnect): QueryPromise; - -interface ListEventsRef { - ... - (dc: DataConnect): QueryRef; -} -export const listEventsRef: ListEventsRef; -``` - -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 listEventsRef: -```typescript -const name = listEventsRef.operationName; -console.log(name); -``` - -### Variables -The `listEvents` query has no variables. -### Return Type -Recall that executing the `listEvents` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListEventsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` -### Using `listEvents`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listEvents } from '@dataconnect/generated'; - - -// Call the `listEvents()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listEvents(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listEvents(dataConnect); - -console.log(data.events); - -// Or, you can use the `Promise` API. -listEvents().then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -### Using `listEvents`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listEventsRef } from '@dataconnect/generated'; - - -// Call the `listEventsRef()` function to get a reference to the query. -const ref = listEventsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listEventsRef(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.events); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -## getEventById -You can execute the `getEventById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getEventById(vars: GetEventByIdVariables): QueryPromise; - -interface GetEventByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetEventByIdVariables): QueryRef; -} -export const getEventByIdRef: GetEventByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getEventById(dc: DataConnect, vars: GetEventByIdVariables): QueryPromise; - -interface GetEventByIdRef { - ... - (dc: DataConnect, vars: GetEventByIdVariables): QueryRef; -} -export const getEventByIdRef: GetEventByIdRef; -``` - -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 getEventByIdRef: -```typescript -const name = getEventByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getEventById` query requires an argument of type `GetEventByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetEventByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getEventById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetEventByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetEventByIdData { - event?: { - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key; -} -``` -### Using `getEventById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getEventById, GetEventByIdVariables } from '@dataconnect/generated'; - -// The `getEventById` query requires an argument of type `GetEventByIdVariables`: -const getEventByIdVars: GetEventByIdVariables = { - id: ..., -}; - -// Call the `getEventById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getEventById(getEventByIdVars); -// Variables can be defined inline as well. -const { data } = await getEventById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getEventById(dataConnect, getEventByIdVars); - -console.log(data.event); - -// Or, you can use the `Promise` API. -getEventById(getEventByIdVars).then((response) => { - const data = response.data; - console.log(data.event); -}); -``` - -### Using `getEventById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getEventByIdRef, GetEventByIdVariables } from '@dataconnect/generated'; - -// The `getEventById` query requires an argument of type `GetEventByIdVariables`: -const getEventByIdVars: GetEventByIdVariables = { - id: ..., -}; - -// Call the `getEventByIdRef()` function to get a reference to the query. -const ref = getEventByIdRef(getEventByIdVars); -// Variables can be defined inline as well. -const ref = getEventByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getEventByIdRef(dataConnect, getEventByIdVars); - -// 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.event); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.event); -}); -``` - -## filterEvents -You can execute the `filterEvents` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterEvents(vars?: FilterEventsVariables): QueryPromise; - -interface FilterEventsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterEventsVariables): QueryRef; -} -export const filterEventsRef: FilterEventsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterEvents(dc: DataConnect, vars?: FilterEventsVariables): QueryPromise; - -interface FilterEventsRef { - ... - (dc: DataConnect, vars?: FilterEventsVariables): QueryRef; -} -export const filterEventsRef: FilterEventsRef; -``` - -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 filterEventsRef: -```typescript -const name = filterEventsRef.operationName; -console.log(name); -``` - -### Variables -The `filterEvents` query has an optional argument of type `FilterEventsVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterEventsVariables { - status?: EventStatus | null; - businessId?: UUIDString | null; - vendorId?: UUIDString | null; - isRecurring?: boolean | null; - isRapid?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - date?: TimestampString | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - clientEmail?: string | null; -} -``` -### Return Type -Recall that executing the `filterEvents` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterEventsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` -### Using `filterEvents`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterEvents, FilterEventsVariables } from '@dataconnect/generated'; - -// The `filterEvents` query has an optional argument of type `FilterEventsVariables`: -const filterEventsVars: FilterEventsVariables = { - status: ..., // optional - businessId: ..., // optional - vendorId: ..., // optional - isRecurring: ..., // optional - isRapid: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - date: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - clientEmail: ..., // optional -}; - -// Call the `filterEvents()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterEvents(filterEventsVars); -// Variables can be defined inline as well. -const { data } = await filterEvents({ status: ..., businessId: ..., vendorId: ..., isRecurring: ..., isRapid: ..., isMultiDay: ..., recurrenceType: ..., date: ..., hub: ..., eventLocation: ..., contractType: ..., clientEmail: ..., }); -// Since all variables are optional for this query, you can omit the `FilterEventsVariables` argument. -const { data } = await filterEvents(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterEvents(dataConnect, filterEventsVars); - -console.log(data.events); - -// Or, you can use the `Promise` API. -filterEvents(filterEventsVars).then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -### Using `filterEvents`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterEventsRef, FilterEventsVariables } from '@dataconnect/generated'; - -// The `filterEvents` query has an optional argument of type `FilterEventsVariables`: -const filterEventsVars: FilterEventsVariables = { - status: ..., // optional - businessId: ..., // optional - vendorId: ..., // optional - isRecurring: ..., // optional - isRapid: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - date: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - clientEmail: ..., // optional -}; - -// Call the `filterEventsRef()` function to get a reference to the query. -const ref = filterEventsRef(filterEventsVars); -// Variables can be defined inline as well. -const ref = filterEventsRef({ status: ..., businessId: ..., vendorId: ..., isRecurring: ..., isRapid: ..., isMultiDay: ..., recurrenceType: ..., date: ..., hub: ..., eventLocation: ..., contractType: ..., clientEmail: ..., }); -// Since all variables are optional for this query, you can omit the `FilterEventsVariables` argument. -const ref = filterEventsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterEventsRef(dataConnect, filterEventsVars); - -// 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.events); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.events); -}); -``` - -## listInvoice -You can execute the `listInvoice` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listInvoice(): QueryPromise; - -interface ListInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listInvoiceRef: ListInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listInvoice(dc: DataConnect): QueryPromise; - -interface ListInvoiceRef { - ... - (dc: DataConnect): QueryRef; -} -export const listInvoiceRef: ListInvoiceRef; -``` - -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 listInvoiceRef: -```typescript -const name = listInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `listInvoice` query has no variables. -### Return Type -Recall that executing the `listInvoice` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListInvoiceData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` -### Using `listInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listInvoice } from '@dataconnect/generated'; - - -// Call the `listInvoice()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listInvoice(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listInvoice(dataConnect); - -console.log(data.invoices); - -// Or, you can use the `Promise` API. -listInvoice().then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -### Using `listInvoice`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listInvoiceRef } from '@dataconnect/generated'; - - -// Call the `listInvoiceRef()` function to get a reference to the query. -const ref = listInvoiceRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listInvoiceRef(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.invoices); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -## getInvoiceById -You can execute the `getInvoiceById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getInvoiceById(vars: GetInvoiceByIdVariables): QueryPromise; - -interface GetInvoiceByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetInvoiceByIdVariables): QueryRef; -} -export const getInvoiceByIdRef: GetInvoiceByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables): QueryPromise; - -interface GetInvoiceByIdRef { - ... - (dc: DataConnect, vars: GetInvoiceByIdVariables): QueryRef; -} -export const getInvoiceByIdRef: GetInvoiceByIdRef; -``` - -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 getInvoiceByIdRef: -```typescript -const name = getInvoiceByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getInvoiceById` query requires an argument of type `GetInvoiceByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetInvoiceByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getInvoiceById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetInvoiceByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetInvoiceByIdData { - invoice?: { - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; - } & Invoice_Key; -} -``` -### Using `getInvoiceById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getInvoiceById, GetInvoiceByIdVariables } from '@dataconnect/generated'; - -// The `getInvoiceById` query requires an argument of type `GetInvoiceByIdVariables`: -const getInvoiceByIdVars: GetInvoiceByIdVariables = { - id: ..., -}; - -// Call the `getInvoiceById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getInvoiceById(getInvoiceByIdVars); -// Variables can be defined inline as well. -const { data } = await getInvoiceById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getInvoiceById(dataConnect, getInvoiceByIdVars); - -console.log(data.invoice); - -// Or, you can use the `Promise` API. -getInvoiceById(getInvoiceByIdVars).then((response) => { - const data = response.data; - console.log(data.invoice); -}); -``` - -### Using `getInvoiceById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getInvoiceByIdRef, GetInvoiceByIdVariables } from '@dataconnect/generated'; - -// The `getInvoiceById` query requires an argument of type `GetInvoiceByIdVariables`: -const getInvoiceByIdVars: GetInvoiceByIdVariables = { - id: ..., -}; - -// Call the `getInvoiceByIdRef()` function to get a reference to the query. -const ref = getInvoiceByIdRef(getInvoiceByIdVars); -// Variables can be defined inline as well. -const ref = getInvoiceByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getInvoiceByIdRef(dataConnect, getInvoiceByIdVars); - -// 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.invoice); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.invoice); -}); -``` - -## filterInvoices -You can execute the `filterInvoices` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterInvoices(vars?: FilterInvoicesVariables): QueryPromise; - -interface FilterInvoicesRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterInvoicesVariables): QueryRef; -} -export const filterInvoicesRef: FilterInvoicesRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables): QueryPromise; - -interface FilterInvoicesRef { - ... - (dc: DataConnect, vars?: FilterInvoicesVariables): QueryRef; -} -export const filterInvoicesRef: FilterInvoicesRef; -``` - -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 filterInvoicesRef: -```typescript -const name = filterInvoicesRef.operationName; -console.log(name); -``` - -### Variables -The `filterInvoices` query has an optional argument of type `FilterInvoicesVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterInvoicesVariables { - invoiceNumber?: string | null; - status?: InvoiceStatus | null; - isAutoGenerated?: boolean | null; - amount?: number | null; -} -``` -### Return Type -Recall that executing the `filterInvoices` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterInvoicesData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterInvoicesData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` -### Using `filterInvoices`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterInvoices, FilterInvoicesVariables } from '@dataconnect/generated'; - -// The `filterInvoices` query has an optional argument of type `FilterInvoicesVariables`: -const filterInvoicesVars: FilterInvoicesVariables = { - invoiceNumber: ..., // optional - status: ..., // optional - isAutoGenerated: ..., // optional - amount: ..., // optional -}; - -// Call the `filterInvoices()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterInvoices(filterInvoicesVars); -// Variables can be defined inline as well. -const { data } = await filterInvoices({ invoiceNumber: ..., status: ..., isAutoGenerated: ..., amount: ..., }); -// Since all variables are optional for this query, you can omit the `FilterInvoicesVariables` argument. -const { data } = await filterInvoices(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterInvoices(dataConnect, filterInvoicesVars); - -console.log(data.invoices); - -// Or, you can use the `Promise` API. -filterInvoices(filterInvoicesVars).then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -### Using `filterInvoices`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterInvoicesRef, FilterInvoicesVariables } from '@dataconnect/generated'; - -// The `filterInvoices` query has an optional argument of type `FilterInvoicesVariables`: -const filterInvoicesVars: FilterInvoicesVariables = { - invoiceNumber: ..., // optional - status: ..., // optional - isAutoGenerated: ..., // optional - amount: ..., // optional -}; - -// Call the `filterInvoicesRef()` function to get a reference to the query. -const ref = filterInvoicesRef(filterInvoicesVars); -// Variables can be defined inline as well. -const ref = filterInvoicesRef({ invoiceNumber: ..., status: ..., isAutoGenerated: ..., amount: ..., }); -// Since all variables are optional for this query, you can omit the `FilterInvoicesVariables` argument. -const ref = filterInvoicesRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterInvoicesRef(dataConnect, filterInvoicesVars); - -// 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.invoices); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.invoices); -}); -``` - -## listStaff -You can execute the `listStaff` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listStaff(): QueryPromise; - -interface ListStaffRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listStaffRef: ListStaffRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listStaff(dc: DataConnect): QueryPromise; - -interface ListStaffRef { - ... - (dc: DataConnect): QueryRef; -} -export const listStaffRef: ListStaffRef; -``` - -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 listStaffRef: -```typescript -const name = listStaffRef.operationName; -console.log(name); -``` - -### Variables -The `listStaff` query has no variables. -### Return Type -Recall that executing the `listStaff` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListStaffData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListStaffData { - staffs: ({ - id: UUIDString; - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; - } & Staff_Key)[]; -} -``` -### Using `listStaff`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listStaff } from '@dataconnect/generated'; - - -// Call the `listStaff()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listStaff(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listStaff(dataConnect); - -console.log(data.staffs); - -// Or, you can use the `Promise` API. -listStaff().then((response) => { - const data = response.data; - console.log(data.staffs); -}); -``` - -### Using `listStaff`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listStaffRef } from '@dataconnect/generated'; - - -// Call the `listStaffRef()` function to get a reference to the query. -const ref = listStaffRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listStaffRef(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.staffs); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.staffs); -}); -``` - -## listVendor -You can execute the `listVendor` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -listVendor(): QueryPromise; - -interface ListVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (): QueryRef; -} -export const listVendorRef: ListVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -listVendor(dc: DataConnect): QueryPromise; - -interface ListVendorRef { - ... - (dc: DataConnect): QueryRef; -} -export const listVendorRef: ListVendorRef; -``` - -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 listVendorRef: -```typescript -const name = listVendorRef.operationName; -console.log(name); -``` - -### Variables -The `listVendor` query has no variables. -### Return Type -Recall that executing the `listVendor` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface ListVendorData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` -### Using `listVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, listVendor } from '@dataconnect/generated'; - - -// Call the `listVendor()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listVendor(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listVendor(dataConnect); - -console.log(data.vendors); - -// Or, you can use the `Promise` API. -listVendor().then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -### Using `listVendor`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listVendorRef } from '@dataconnect/generated'; - - -// Call the `listVendorRef()` function to get a reference to the query. -const ref = listVendorRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listVendorRef(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.vendors); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -## getVendorById -You can execute the `getVendorById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -getVendorById(vars: GetVendorByIdVariables): QueryPromise; - -interface GetVendorByIdRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorByIdVariables): QueryRef; -} -export const getVendorByIdRef: GetVendorByIdRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -getVendorById(dc: DataConnect, vars: GetVendorByIdVariables): QueryPromise; - -interface GetVendorByIdRef { - ... - (dc: DataConnect, vars: GetVendorByIdVariables): QueryRef; -} -export const getVendorByIdRef: GetVendorByIdRef; -``` - -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 getVendorByIdRef: -```typescript -const name = getVendorByIdRef.operationName; -console.log(name); -``` - -### Variables -The `getVendorById` query requires an argument of type `GetVendorByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface GetVendorByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `getVendorById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetVendorByIdData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface GetVendorByIdData { - vendor?: { - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key; -} -``` -### Using `getVendorById`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, getVendorById, GetVendorByIdVariables } from '@dataconnect/generated'; - -// The `getVendorById` query requires an argument of type `GetVendorByIdVariables`: -const getVendorByIdVars: GetVendorByIdVariables = { - id: ..., -}; - -// Call the `getVendorById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getVendorById(getVendorByIdVars); -// Variables can be defined inline as well. -const { data } = await getVendorById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getVendorById(dataConnect, getVendorByIdVars); - -console.log(data.vendor); - -// Or, you can use the `Promise` API. -getVendorById(getVendorByIdVars).then((response) => { - const data = response.data; - console.log(data.vendor); -}); -``` - -### Using `getVendorById`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getVendorByIdRef, GetVendorByIdVariables } from '@dataconnect/generated'; - -// The `getVendorById` query requires an argument of type `GetVendorByIdVariables`: -const getVendorByIdVars: GetVendorByIdVariables = { - id: ..., -}; - -// Call the `getVendorByIdRef()` function to get a reference to the query. -const ref = getVendorByIdRef(getVendorByIdVars); -// Variables can be defined inline as well. -const ref = getVendorByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getVendorByIdRef(dataConnect, getVendorByIdVars); - -// 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.vendor); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendor); -}); -``` - -## filterVendors -You can execute the `filterVendors` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -filterVendors(vars?: FilterVendorsVariables): QueryPromise; - -interface FilterVendorsRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorsVariables): QueryRef; -} -export const filterVendorsRef: FilterVendorsRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```typescript -filterVendors(dc: DataConnect, vars?: FilterVendorsVariables): QueryPromise; - -interface FilterVendorsRef { - ... - (dc: DataConnect, vars?: FilterVendorsVariables): QueryRef; -} -export const filterVendorsRef: FilterVendorsRef; -``` - -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 filterVendorsRef: -```typescript -const name = filterVendorsRef.operationName; -console.log(name); -``` - -### Variables -The `filterVendors` query has an optional argument of type `FilterVendorsVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface FilterVendorsVariables { - region?: VendorRegion | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; - vendorNumber?: string | null; - primaryContactEmail?: string | null; - legalName?: string | null; - platformType?: VendorPlatformType | null; -} -``` -### Return Type -Recall that executing the `filterVendors` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `FilterVendorsData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface FilterVendorsData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` -### Using `filterVendors`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, filterVendors, FilterVendorsVariables } from '@dataconnect/generated'; - -// The `filterVendors` query has an optional argument of type `FilterVendorsVariables`: -const filterVendorsVars: FilterVendorsVariables = { - region: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - vendorNumber: ..., // optional - primaryContactEmail: ..., // optional - legalName: ..., // optional - platformType: ..., // optional -}; - -// Call the `filterVendors()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await filterVendors(filterVendorsVars); -// Variables can be defined inline as well. -const { data } = await filterVendors({ region: ..., approvalStatus: ..., isActive: ..., vendorNumber: ..., primaryContactEmail: ..., legalName: ..., platformType: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorsVariables` argument. -const { data } = await filterVendors(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await filterVendors(dataConnect, filterVendorsVars); - -console.log(data.vendors); - -// Or, you can use the `Promise` API. -filterVendors(filterVendorsVars).then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -### Using `filterVendors`'s `QueryRef` function - -```typescript -import { getDataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, filterVendorsRef, FilterVendorsVariables } from '@dataconnect/generated'; - -// The `filterVendors` query has an optional argument of type `FilterVendorsVariables`: -const filterVendorsVars: FilterVendorsVariables = { - region: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - vendorNumber: ..., // optional - primaryContactEmail: ..., // optional - legalName: ..., // optional - platformType: ..., // optional -}; - -// Call the `filterVendorsRef()` function to get a reference to the query. -const ref = filterVendorsRef(filterVendorsVars); -// Variables can be defined inline as well. -const ref = filterVendorsRef({ region: ..., approvalStatus: ..., isActive: ..., vendorNumber: ..., primaryContactEmail: ..., legalName: ..., platformType: ..., }); -// Since all variables are optional for this query, you can omit the `FilterVendorsVariables` argument. -const ref = filterVendorsRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = filterVendorsRef(dataConnect, filterVendorsVars); - -// 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.vendors); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.vendors); -}); -``` - -# 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 `krow-connector` 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). - -## CreateEvent -You can execute the `CreateEvent` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createEvent(vars: CreateEventVariables): MutationPromise; - -interface CreateEventRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateEventVariables): MutationRef; -} -export const createEventRef: CreateEventRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createEvent(dc: DataConnect, vars: CreateEventVariables): MutationPromise; - -interface CreateEventRef { - ... - (dc: DataConnect, vars: CreateEventVariables): MutationRef; -} -export const createEventRef: CreateEventRef; -``` - -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 createEventRef: -```typescript -const name = createEventRef.operationName; -console.log(name); -``` - -### Variables -The `CreateEvent` mutation requires an argument of type `CreateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateEventVariables { - eventName: string; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status: EventStatus; - date: TimestampString; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that executing the `CreateEvent` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateEventData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateEventData { - event_insert: Event_Key; -} -``` -### Using `CreateEvent`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createEvent, CreateEventVariables } from '@dataconnect/generated'; - -// The `CreateEvent` mutation requires an argument of type `CreateEventVariables`: -const createEventVars: CreateEventVariables = { - eventName: ..., - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., - date: ..., - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `createEvent()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createEvent(createEventVars); -// Variables can be defined inline as well. -const { data } = await createEvent({ eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createEvent(dataConnect, createEventVars); - -console.log(data.event_insert); - -// Or, you can use the `Promise` API. -createEvent(createEventVars).then((response) => { - const data = response.data; - console.log(data.event_insert); -}); -``` - -### Using `CreateEvent`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createEventRef, CreateEventVariables } from '@dataconnect/generated'; - -// The `CreateEvent` mutation requires an argument of type `CreateEventVariables`: -const createEventVars: CreateEventVariables = { - eventName: ..., - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., - date: ..., - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `createEventRef()` function to get a reference to the mutation. -const ref = createEventRef(createEventVars); -// Variables can be defined inline as well. -const ref = createEventRef({ eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createEventRef(dataConnect, createEventVars); - -// 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.event_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.event_insert); -}); -``` - -## UpdateEvent -You can execute the `UpdateEvent` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateEvent(vars: UpdateEventVariables): MutationPromise; - -interface UpdateEventRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateEventVariables): MutationRef; -} -export const updateEventRef: UpdateEventRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateEvent(dc: DataConnect, vars: UpdateEventVariables): MutationPromise; - -interface UpdateEventRef { - ... - (dc: DataConnect, vars: UpdateEventVariables): MutationRef; -} -export const updateEventRef: UpdateEventRef; -``` - -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 updateEventRef: -```typescript -const name = updateEventRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateEvent` mutation requires an argument of type `UpdateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateEventVariables { - id: UUIDString; - eventName?: string | null; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId?: UUIDString | null; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status?: EventStatus | null; - date?: TimestampString | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that executing the `UpdateEvent` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateEventData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateEventData { - event_update?: Event_Key | null; -} -``` -### Using `UpdateEvent`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateEvent, UpdateEventVariables } from '@dataconnect/generated'; - -// The `UpdateEvent` mutation requires an argument of type `UpdateEventVariables`: -const updateEventVars: UpdateEventVariables = { - id: ..., - eventName: ..., // optional - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., // optional - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., // optional - date: ..., // optional - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `updateEvent()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateEvent(updateEventVars); -// Variables can be defined inline as well. -const { data } = await updateEvent({ id: ..., eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateEvent(dataConnect, updateEventVars); - -console.log(data.event_update); - -// Or, you can use the `Promise` API. -updateEvent(updateEventVars).then((response) => { - const data = response.data; - console.log(data.event_update); -}); -``` - -### Using `UpdateEvent`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateEventRef, UpdateEventVariables } from '@dataconnect/generated'; - -// The `UpdateEvent` mutation requires an argument of type `UpdateEventVariables`: -const updateEventVars: UpdateEventVariables = { - id: ..., - eventName: ..., // optional - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., // optional - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., // optional - date: ..., // optional - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional -}; - -// Call the `updateEventRef()` function to get a reference to the mutation. -const ref = updateEventRef(updateEventVars); -// Variables can be defined inline as well. -const ref = updateEventRef({ id: ..., eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateEventRef(dataConnect, updateEventVars); - -// 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.event_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.event_update); -}); -``` - -## DeleteEvent -You can execute the `DeleteEvent` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteEvent(vars: DeleteEventVariables): MutationPromise; - -interface DeleteEventRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteEventVariables): MutationRef; -} -export const deleteEventRef: DeleteEventRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteEvent(dc: DataConnect, vars: DeleteEventVariables): MutationPromise; - -interface DeleteEventRef { - ... - (dc: DataConnect, vars: DeleteEventVariables): MutationRef; -} -export const deleteEventRef: DeleteEventRef; -``` - -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 deleteEventRef: -```typescript -const name = deleteEventRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteEvent` mutation requires an argument of type `DeleteEventVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteEventVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteEvent` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteEventData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteEventData { - event_delete?: Event_Key | null; -} -``` -### Using `DeleteEvent`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteEvent, DeleteEventVariables } from '@dataconnect/generated'; - -// The `DeleteEvent` mutation requires an argument of type `DeleteEventVariables`: -const deleteEventVars: DeleteEventVariables = { - id: ..., -}; - -// Call the `deleteEvent()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteEvent(deleteEventVars); -// Variables can be defined inline as well. -const { data } = await deleteEvent({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteEvent(dataConnect, deleteEventVars); - -console.log(data.event_delete); - -// Or, you can use the `Promise` API. -deleteEvent(deleteEventVars).then((response) => { - const data = response.data; - console.log(data.event_delete); -}); -``` - -### Using `DeleteEvent`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteEventRef, DeleteEventVariables } from '@dataconnect/generated'; - -// The `DeleteEvent` mutation requires an argument of type `DeleteEventVariables`: -const deleteEventVars: DeleteEventVariables = { - id: ..., -}; - -// Call the `deleteEventRef()` function to get a reference to the mutation. -const ref = deleteEventRef(deleteEventVars); -// Variables can be defined inline as well. -const ref = deleteEventRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteEventRef(dataConnect, deleteEventVars); - -// 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.event_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.event_delete); -}); -``` - -## CreateVendorRate -You can execute the `CreateVendorRate` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createVendorRate(vars: CreateVendorRateVariables): MutationPromise; - -interface CreateVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorRateVariables): MutationRef; -} -export const createVendorRateRef: CreateVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createVendorRate(dc: DataConnect, vars: CreateVendorRateVariables): MutationPromise; - -interface CreateVendorRateRef { - ... - (dc: DataConnect, vars: CreateVendorRateVariables): MutationRef; -} -export const createVendorRateRef: CreateVendorRateRef; -``` - -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 createVendorRateRef: -```typescript -const name = createVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `CreateVendorRate` mutation requires an argument of type `CreateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateVendorRateVariables { - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; -} -``` -### Return Type -Recall that executing the `CreateVendorRate` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateVendorRateData { - vendorRate_insert: VendorRate_Key; -} -``` -### Using `CreateVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createVendorRate, CreateVendorRateVariables } from '@dataconnect/generated'; - -// The `CreateVendorRate` mutation requires an argument of type `CreateVendorRateVariables`: -const createVendorRateVars: CreateVendorRateVariables = { - vendorName: ..., - category: ..., - roleName: ..., - employeeWage: ..., - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., -}; - -// Call the `createVendorRate()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createVendorRate(createVendorRateVars); -// Variables can be defined inline as well. -const { data } = await createVendorRate({ vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createVendorRate(dataConnect, createVendorRateVars); - -console.log(data.vendorRate_insert); - -// Or, you can use the `Promise` API. -createVendorRate(createVendorRateVars).then((response) => { - const data = response.data; - console.log(data.vendorRate_insert); -}); -``` - -### Using `CreateVendorRate`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createVendorRateRef, CreateVendorRateVariables } from '@dataconnect/generated'; - -// The `CreateVendorRate` mutation requires an argument of type `CreateVendorRateVariables`: -const createVendorRateVars: CreateVendorRateVariables = { - vendorName: ..., - category: ..., - roleName: ..., - employeeWage: ..., - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., -}; - -// Call the `createVendorRateRef()` function to get a reference to the mutation. -const ref = createVendorRateRef(createVendorRateVars); -// Variables can be defined inline as well. -const ref = createVendorRateRef({ vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createVendorRateRef(dataConnect, createVendorRateVars); - -// 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.vendorRate_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate_insert); -}); -``` - -## UpdateVendorRate -You can execute the `UpdateVendorRate` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateVendorRate(vars: UpdateVendorRateVariables): MutationPromise; - -interface UpdateVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorRateVariables): MutationRef; -} -export const updateVendorRateRef: UpdateVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateVendorRate(dc: DataConnect, vars: UpdateVendorRateVariables): MutationPromise; - -interface UpdateVendorRateRef { - ... - (dc: DataConnect, vars: UpdateVendorRateVariables): MutationRef; -} -export const updateVendorRateRef: UpdateVendorRateRef; -``` - -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 updateVendorRateRef: -```typescript -const name = updateVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateVendorRate` mutation requires an argument of type `UpdateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateVendorRateVariables { - id: UUIDString; - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - employeeWage?: number | null; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate?: number | null; -} -``` -### Return Type -Recall that executing the `UpdateVendorRate` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateVendorRateData { - vendorRate_update?: VendorRate_Key | null; -} -``` -### Using `UpdateVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateVendorRate, UpdateVendorRateVariables } from '@dataconnect/generated'; - -// The `UpdateVendorRate` mutation requires an argument of type `UpdateVendorRateVariables`: -const updateVendorRateVars: UpdateVendorRateVariables = { - id: ..., - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - employeeWage: ..., // optional - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., // optional -}; - -// Call the `updateVendorRate()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateVendorRate(updateVendorRateVars); -// Variables can be defined inline as well. -const { data } = await updateVendorRate({ id: ..., vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateVendorRate(dataConnect, updateVendorRateVars); - -console.log(data.vendorRate_update); - -// Or, you can use the `Promise` API. -updateVendorRate(updateVendorRateVars).then((response) => { - const data = response.data; - console.log(data.vendorRate_update); -}); -``` - -### Using `UpdateVendorRate`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateVendorRateRef, UpdateVendorRateVariables } from '@dataconnect/generated'; - -// The `UpdateVendorRate` mutation requires an argument of type `UpdateVendorRateVariables`: -const updateVendorRateVars: UpdateVendorRateVariables = { - id: ..., - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - employeeWage: ..., // optional - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., // optional -}; - -// Call the `updateVendorRateRef()` function to get a reference to the mutation. -const ref = updateVendorRateRef(updateVendorRateVars); -// Variables can be defined inline as well. -const ref = updateVendorRateRef({ id: ..., vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateVendorRateRef(dataConnect, updateVendorRateVars); - -// 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.vendorRate_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate_update); -}); -``` - -## DeleteVendorRate -You can execute the `DeleteVendorRate` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteVendorRate(vars: DeleteVendorRateVariables): MutationPromise; - -interface DeleteVendorRateRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorRateVariables): MutationRef; -} -export const deleteVendorRateRef: DeleteVendorRateRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteVendorRate(dc: DataConnect, vars: DeleteVendorRateVariables): MutationPromise; - -interface DeleteVendorRateRef { - ... - (dc: DataConnect, vars: DeleteVendorRateVariables): MutationRef; -} -export const deleteVendorRateRef: DeleteVendorRateRef; -``` - -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 deleteVendorRateRef: -```typescript -const name = deleteVendorRateRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteVendorRate` mutation requires an argument of type `DeleteVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteVendorRateVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteVendorRate` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteVendorRateData { - vendorRate_delete?: VendorRate_Key | null; -} -``` -### Using `DeleteVendorRate`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorRate, DeleteVendorRateVariables } from '@dataconnect/generated'; - -// The `DeleteVendorRate` mutation requires an argument of type `DeleteVendorRateVariables`: -const deleteVendorRateVars: DeleteVendorRateVariables = { - id: ..., -}; - -// Call the `deleteVendorRate()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteVendorRate(deleteVendorRateVars); -// Variables can be defined inline as well. -const { data } = await deleteVendorRate({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteVendorRate(dataConnect, deleteVendorRateVars); - -console.log(data.vendorRate_delete); - -// Or, you can use the `Promise` API. -deleteVendorRate(deleteVendorRateVars).then((response) => { - const data = response.data; - console.log(data.vendorRate_delete); -}); -``` - -### Using `DeleteVendorRate`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorRateRef, DeleteVendorRateVariables } from '@dataconnect/generated'; - -// The `DeleteVendorRate` mutation requires an argument of type `DeleteVendorRateVariables`: -const deleteVendorRateVars: DeleteVendorRateVariables = { - id: ..., -}; - -// Call the `deleteVendorRateRef()` function to get a reference to the mutation. -const ref = deleteVendorRateRef(deleteVendorRateVars); -// Variables can be defined inline as well. -const ref = deleteVendorRateRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteVendorRateRef(dataConnect, deleteVendorRateVars); - -// 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.vendorRate_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorRate_delete); -}); -``` - -## CreateInvoice -You can execute the `CreateInvoice` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createInvoice(vars: CreateInvoiceVariables): MutationPromise; - -interface CreateInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateInvoiceVariables): MutationRef; -} -export const createInvoiceRef: CreateInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createInvoice(dc: DataConnect, vars: CreateInvoiceVariables): MutationPromise; - -interface CreateInvoiceRef { - ... - (dc: DataConnect, vars: CreateInvoiceVariables): MutationRef; -} -export const createInvoiceRef: CreateInvoiceRef; -``` - -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 createInvoiceRef: -```typescript -const name = createInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `CreateInvoice` mutation requires an argument of type `CreateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateInvoiceVariables { - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that executing the `CreateInvoice` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateInvoiceData { - invoice_insert: Invoice_Key; -} -``` -### Using `CreateInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createInvoice, CreateInvoiceVariables } from '@dataconnect/generated'; - -// The `CreateInvoice` mutation requires an argument of type `CreateInvoiceVariables`: -const createInvoiceVars: CreateInvoiceVariables = { - invoiceNumber: ..., - amount: ..., - status: ..., - issueDate: ..., - dueDate: ..., - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `createInvoice()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createInvoice(createInvoiceVars); -// Variables can be defined inline as well. -const { data } = await createInvoice({ invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createInvoice(dataConnect, createInvoiceVars); - -console.log(data.invoice_insert); - -// Or, you can use the `Promise` API. -createInvoice(createInvoiceVars).then((response) => { - const data = response.data; - console.log(data.invoice_insert); -}); -``` - -### Using `CreateInvoice`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createInvoiceRef, CreateInvoiceVariables } from '@dataconnect/generated'; - -// The `CreateInvoice` mutation requires an argument of type `CreateInvoiceVariables`: -const createInvoiceVars: CreateInvoiceVariables = { - invoiceNumber: ..., - amount: ..., - status: ..., - issueDate: ..., - dueDate: ..., - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `createInvoiceRef()` function to get a reference to the mutation. -const ref = createInvoiceRef(createInvoiceVars); -// Variables can be defined inline as well. -const ref = createInvoiceRef({ invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createInvoiceRef(dataConnect, createInvoiceVars); - -// 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.invoice_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.invoice_insert); -}); -``` - -## UpdateInvoice -You can execute the `UpdateInvoice` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateInvoice(vars: UpdateInvoiceVariables): MutationPromise; - -interface UpdateInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateInvoiceVariables): MutationRef; -} -export const updateInvoiceRef: UpdateInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateInvoice(dc: DataConnect, vars: UpdateInvoiceVariables): MutationPromise; - -interface UpdateInvoiceRef { - ... - (dc: DataConnect, vars: UpdateInvoiceVariables): MutationRef; -} -export const updateInvoiceRef: UpdateInvoiceRef; -``` - -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 updateInvoiceRef: -```typescript -const name = updateInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateInvoice` mutation requires an argument of type `UpdateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateInvoiceVariables { - id: UUIDString; - invoiceNumber?: string | null; - amount?: number | null; - status?: InvoiceStatus | null; - issueDate?: TimestampString | null; - dueDate?: TimestampString | null; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that executing the `UpdateInvoice` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateInvoiceData { - invoice_update?: Invoice_Key | null; -} -``` -### Using `UpdateInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateInvoice, UpdateInvoiceVariables } from '@dataconnect/generated'; - -// The `UpdateInvoice` mutation requires an argument of type `UpdateInvoiceVariables`: -const updateInvoiceVars: UpdateInvoiceVariables = { - id: ..., - invoiceNumber: ..., // optional - amount: ..., // optional - status: ..., // optional - issueDate: ..., // optional - dueDate: ..., // optional - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `updateInvoice()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateInvoice(updateInvoiceVars); -// Variables can be defined inline as well. -const { data } = await updateInvoice({ id: ..., invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateInvoice(dataConnect, updateInvoiceVars); - -console.log(data.invoice_update); - -// Or, you can use the `Promise` API. -updateInvoice(updateInvoiceVars).then((response) => { - const data = response.data; - console.log(data.invoice_update); -}); -``` - -### Using `UpdateInvoice`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateInvoiceRef, UpdateInvoiceVariables } from '@dataconnect/generated'; - -// The `UpdateInvoice` mutation requires an argument of type `UpdateInvoiceVariables`: -const updateInvoiceVars: UpdateInvoiceVariables = { - id: ..., - invoiceNumber: ..., // optional - amount: ..., // optional - status: ..., // optional - issueDate: ..., // optional - dueDate: ..., // optional - disputedItems: ..., // optional - isAutoGenerated: ..., // optional -}; - -// Call the `updateInvoiceRef()` function to get a reference to the mutation. -const ref = updateInvoiceRef(updateInvoiceVars); -// Variables can be defined inline as well. -const ref = updateInvoiceRef({ id: ..., invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateInvoiceRef(dataConnect, updateInvoiceVars); - -// 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.invoice_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.invoice_update); -}); -``` - -## DeleteInvoice -You can execute the `DeleteInvoice` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteInvoice(vars: DeleteInvoiceVariables): MutationPromise; - -interface DeleteInvoiceRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteInvoiceVariables): MutationRef; -} -export const deleteInvoiceRef: DeleteInvoiceRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteInvoice(dc: DataConnect, vars: DeleteInvoiceVariables): MutationPromise; - -interface DeleteInvoiceRef { - ... - (dc: DataConnect, vars: DeleteInvoiceVariables): MutationRef; -} -export const deleteInvoiceRef: DeleteInvoiceRef; -``` - -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 deleteInvoiceRef: -```typescript -const name = deleteInvoiceRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteInvoice` mutation requires an argument of type `DeleteInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteInvoiceVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteInvoice` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteInvoiceData { - invoice_delete?: Invoice_Key | null; -} -``` -### Using `DeleteInvoice`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteInvoice, DeleteInvoiceVariables } from '@dataconnect/generated'; - -// The `DeleteInvoice` mutation requires an argument of type `DeleteInvoiceVariables`: -const deleteInvoiceVars: DeleteInvoiceVariables = { - id: ..., -}; - -// Call the `deleteInvoice()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteInvoice(deleteInvoiceVars); -// Variables can be defined inline as well. -const { data } = await deleteInvoice({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteInvoice(dataConnect, deleteInvoiceVars); - -console.log(data.invoice_delete); - -// Or, you can use the `Promise` API. -deleteInvoice(deleteInvoiceVars).then((response) => { - const data = response.data; - console.log(data.invoice_delete); -}); -``` - -### Using `DeleteInvoice`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteInvoiceRef, DeleteInvoiceVariables } from '@dataconnect/generated'; - -// The `DeleteInvoice` mutation requires an argument of type `DeleteInvoiceVariables`: -const deleteInvoiceVars: DeleteInvoiceVariables = { - id: ..., -}; - -// Call the `deleteInvoiceRef()` function to get a reference to the mutation. -const ref = deleteInvoiceRef(deleteInvoiceVars); -// Variables can be defined inline as well. -const ref = deleteInvoiceRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteInvoiceRef(dataConnect, deleteInvoiceVars); - -// 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.invoice_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.invoice_delete); -}); -``` - -## CreateStaff -You can execute the `CreateStaff` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createStaff(vars: CreateStaffVariables): MutationPromise; - -interface CreateStaffRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateStaffVariables): MutationRef; -} -export const createStaffRef: CreateStaffRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createStaff(dc: DataConnect, vars: CreateStaffVariables): MutationPromise; - -interface CreateStaffRef { - ... - (dc: DataConnect, vars: CreateStaffVariables): MutationRef; -} -export const createStaffRef: CreateStaffRef; -``` - -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 createStaffRef: -```typescript -const name = createStaffRef.operationName; -console.log(name); -``` - -### Variables -The `CreateStaff` mutation requires an argument of type `CreateStaffVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateStaffVariables { - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; -} -``` -### Return Type -Recall that executing the `CreateStaff` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateStaffData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateStaffData { - staff_insert: Staff_Key; -} -``` -### Using `CreateStaff`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createStaff, CreateStaffVariables } from '@dataconnect/generated'; - -// The `CreateStaff` mutation requires an argument of type `CreateStaffVariables`: -const createStaffVars: CreateStaffVariables = { - employeeName: ..., - vendorId: ..., // optional - email: ..., // optional - position: ..., // optional - employmentType: ..., - rating: ..., // optional - reliabilityScore: ..., // optional - backgroundCheckStatus: ..., - certifications: ..., // optional -}; - -// Call the `createStaff()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createStaff(createStaffVars); -// Variables can be defined inline as well. -const { data } = await createStaff({ employeeName: ..., vendorId: ..., email: ..., position: ..., employmentType: ..., rating: ..., reliabilityScore: ..., backgroundCheckStatus: ..., certifications: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createStaff(dataConnect, createStaffVars); - -console.log(data.staff_insert); - -// Or, you can use the `Promise` API. -createStaff(createStaffVars).then((response) => { - const data = response.data; - console.log(data.staff_insert); -}); -``` - -### Using `CreateStaff`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createStaffRef, CreateStaffVariables } from '@dataconnect/generated'; - -// The `CreateStaff` mutation requires an argument of type `CreateStaffVariables`: -const createStaffVars: CreateStaffVariables = { - employeeName: ..., - vendorId: ..., // optional - email: ..., // optional - position: ..., // optional - employmentType: ..., - rating: ..., // optional - reliabilityScore: ..., // optional - backgroundCheckStatus: ..., - certifications: ..., // optional -}; - -// Call the `createStaffRef()` function to get a reference to the mutation. -const ref = createStaffRef(createStaffVars); -// Variables can be defined inline as well. -const ref = createStaffRef({ employeeName: ..., vendorId: ..., email: ..., position: ..., employmentType: ..., rating: ..., reliabilityScore: ..., backgroundCheckStatus: ..., certifications: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createStaffRef(dataConnect, createStaffVars); - -// 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.staff_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.staff_insert); -}); -``` - -## CreateVendor -You can execute the `CreateVendor` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createVendor(vars: CreateVendorVariables): MutationPromise; - -interface CreateVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorVariables): MutationRef; -} -export const createVendorRef: CreateVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createVendor(dc: DataConnect, vars: CreateVendorVariables): MutationPromise; - -interface CreateVendorRef { - ... - (dc: DataConnect, vars: CreateVendorVariables): MutationRef; -} -export const createVendorRef: CreateVendorRef; -``` - -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 createVendorRef: -```typescript -const name = createVendorRef.operationName; -console.log(name); -``` - -### Variables -The `CreateVendor` mutation requires an argument of type `CreateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateVendorVariables { - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; -} -``` -### Return Type -Recall that executing the `CreateVendor` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateVendorData { - vendor_insert: Vendor_Key; -} -``` -### Using `CreateVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createVendor, CreateVendorVariables } from '@dataconnect/generated'; - -// The `CreateVendor` mutation requires an argument of type `CreateVendorVariables`: -const createVendorVars: CreateVendorVariables = { - vendorNumber: ..., - legalName: ..., - region: ..., - platformType: ..., - primaryContactEmail: ..., - approvalStatus: ..., - isActive: ..., // optional -}; - -// Call the `createVendor()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createVendor(createVendorVars); -// Variables can be defined inline as well. -const { data } = await createVendor({ vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createVendor(dataConnect, createVendorVars); - -console.log(data.vendor_insert); - -// Or, you can use the `Promise` API. -createVendor(createVendorVars).then((response) => { - const data = response.data; - console.log(data.vendor_insert); -}); -``` - -### Using `CreateVendor`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createVendorRef, CreateVendorVariables } from '@dataconnect/generated'; - -// The `CreateVendor` mutation requires an argument of type `CreateVendorVariables`: -const createVendorVars: CreateVendorVariables = { - vendorNumber: ..., - legalName: ..., - region: ..., - platformType: ..., - primaryContactEmail: ..., - approvalStatus: ..., - isActive: ..., // optional -}; - -// Call the `createVendorRef()` function to get a reference to the mutation. -const ref = createVendorRef(createVendorVars); -// Variables can be defined inline as well. -const ref = createVendorRef({ vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createVendorRef(dataConnect, createVendorVars); - -// 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.vendor_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendor_insert); -}); -``` - -## UpdateVendor -You can execute the `UpdateVendor` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateVendor(vars: UpdateVendorVariables): MutationPromise; - -interface UpdateVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorVariables): MutationRef; -} -export const updateVendorRef: UpdateVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateVendor(dc: DataConnect, vars: UpdateVendorVariables): MutationPromise; - -interface UpdateVendorRef { - ... - (dc: DataConnect, vars: UpdateVendorVariables): MutationRef; -} -export const updateVendorRef: UpdateVendorRef; -``` - -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 updateVendorRef: -```typescript -const name = updateVendorRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateVendor` mutation requires an argument of type `UpdateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateVendorVariables { - id: UUIDString; - vendorNumber?: string | null; - legalName?: string | null; - region?: VendorRegion | null; - platformType?: VendorPlatformType | null; - primaryContactEmail?: string | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; -} -``` -### Return Type -Recall that executing the `UpdateVendor` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateVendorData { - vendor_update?: Vendor_Key | null; -} -``` -### Using `UpdateVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateVendor, UpdateVendorVariables } from '@dataconnect/generated'; - -// The `UpdateVendor` mutation requires an argument of type `UpdateVendorVariables`: -const updateVendorVars: UpdateVendorVariables = { - id: ..., - vendorNumber: ..., // optional - legalName: ..., // optional - region: ..., // optional - platformType: ..., // optional - primaryContactEmail: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional -}; - -// Call the `updateVendor()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateVendor(updateVendorVars); -// Variables can be defined inline as well. -const { data } = await updateVendor({ id: ..., vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateVendor(dataConnect, updateVendorVars); - -console.log(data.vendor_update); - -// Or, you can use the `Promise` API. -updateVendor(updateVendorVars).then((response) => { - const data = response.data; - console.log(data.vendor_update); -}); -``` - -### Using `UpdateVendor`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateVendorRef, UpdateVendorVariables } from '@dataconnect/generated'; - -// The `UpdateVendor` mutation requires an argument of type `UpdateVendorVariables`: -const updateVendorVars: UpdateVendorVariables = { - id: ..., - vendorNumber: ..., // optional - legalName: ..., // optional - region: ..., // optional - platformType: ..., // optional - primaryContactEmail: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional -}; - -// Call the `updateVendorRef()` function to get a reference to the mutation. -const ref = updateVendorRef(updateVendorVars); -// Variables can be defined inline as well. -const ref = updateVendorRef({ id: ..., vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateVendorRef(dataConnect, updateVendorVars); - -// 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.vendor_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendor_update); -}); -``` - -## DeleteVendor -You can execute the `DeleteVendor` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteVendor(vars: DeleteVendorVariables): MutationPromise; - -interface DeleteVendorRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorVariables): MutationRef; -} -export const deleteVendorRef: DeleteVendorRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteVendor(dc: DataConnect, vars: DeleteVendorVariables): MutationPromise; - -interface DeleteVendorRef { - ... - (dc: DataConnect, vars: DeleteVendorVariables): MutationRef; -} -export const deleteVendorRef: DeleteVendorRef; -``` - -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 deleteVendorRef: -```typescript -const name = deleteVendorRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteVendor` mutation requires an argument of type `DeleteVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteVendorVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteVendor` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteVendorData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteVendorData { - vendor_delete?: Vendor_Key | null; -} -``` -### Using `DeleteVendor`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteVendor, DeleteVendorVariables } from '@dataconnect/generated'; - -// The `DeleteVendor` mutation requires an argument of type `DeleteVendorVariables`: -const deleteVendorVars: DeleteVendorVariables = { - id: ..., -}; - -// Call the `deleteVendor()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteVendor(deleteVendorVars); -// Variables can be defined inline as well. -const { data } = await deleteVendor({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteVendor(dataConnect, deleteVendorVars); - -console.log(data.vendor_delete); - -// Or, you can use the `Promise` API. -deleteVendor(deleteVendorVars).then((response) => { - const data = response.data; - console.log(data.vendor_delete); -}); -``` - -### Using `DeleteVendor`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorRef, DeleteVendorVariables } from '@dataconnect/generated'; - -// The `DeleteVendor` mutation requires an argument of type `DeleteVendorVariables`: -const deleteVendorVars: DeleteVendorVariables = { - id: ..., -}; - -// Call the `deleteVendorRef()` function to get a reference to the mutation. -const ref = deleteVendorRef(deleteVendorVars); -// Variables can be defined inline as well. -const ref = deleteVendorRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteVendorRef(dataConnect, deleteVendorVars); - -// 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.vendor_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendor_delete); -}); -``` - -## CreateVendorDefaultSetting -You can execute the `CreateVendorDefaultSetting` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createVendorDefaultSetting(vars: CreateVendorDefaultSettingVariables): MutationPromise; - -interface CreateVendorDefaultSettingRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorDefaultSettingVariables): MutationRef; -} -export const createVendorDefaultSettingRef: CreateVendorDefaultSettingRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createVendorDefaultSetting(dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationPromise; - -interface CreateVendorDefaultSettingRef { - ... - (dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationRef; -} -export const createVendorDefaultSettingRef: CreateVendorDefaultSettingRef; -``` - -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 createVendorDefaultSettingRef: -```typescript -const name = createVendorDefaultSettingRef.operationName; -console.log(name); -``` - -### Variables -The `CreateVendorDefaultSetting` mutation requires an argument of type `CreateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateVendorDefaultSettingVariables { - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; -} -``` -### Return Type -Recall that executing the `CreateVendorDefaultSetting` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateVendorDefaultSettingData { - vendorDefaultSetting_insert: VendorDefaultSetting_Key; -} -``` -### Using `CreateVendorDefaultSetting`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createVendorDefaultSetting, CreateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `CreateVendorDefaultSetting` mutation requires an argument of type `CreateVendorDefaultSettingVariables`: -const createVendorDefaultSettingVars: CreateVendorDefaultSettingVariables = { - vendorName: ..., - defaultMarkupPercentage: ..., - defaultVendorFeePercentage: ..., -}; - -// Call the `createVendorDefaultSetting()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createVendorDefaultSetting(createVendorDefaultSettingVars); -// Variables can be defined inline as well. -const { data } = await createVendorDefaultSetting({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createVendorDefaultSetting(dataConnect, createVendorDefaultSettingVars); - -console.log(data.vendorDefaultSetting_insert); - -// Or, you can use the `Promise` API. -createVendorDefaultSetting(createVendorDefaultSettingVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_insert); -}); -``` - -### Using `CreateVendorDefaultSetting`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createVendorDefaultSettingRef, CreateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `CreateVendorDefaultSetting` mutation requires an argument of type `CreateVendorDefaultSettingVariables`: -const createVendorDefaultSettingVars: CreateVendorDefaultSettingVariables = { - vendorName: ..., - defaultMarkupPercentage: ..., - defaultVendorFeePercentage: ..., -}; - -// Call the `createVendorDefaultSettingRef()` function to get a reference to the mutation. -const ref = createVendorDefaultSettingRef(createVendorDefaultSettingVars); -// Variables can be defined inline as well. -const ref = createVendorDefaultSettingRef({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createVendorDefaultSettingRef(dataConnect, createVendorDefaultSettingVars); - -// 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.vendorDefaultSetting_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_insert); -}); -``` - -## UpdateVendorDefaultSetting -You can execute the `UpdateVendorDefaultSetting` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateVendorDefaultSetting(vars: UpdateVendorDefaultSettingVariables): MutationPromise; - -interface UpdateVendorDefaultSettingRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorDefaultSettingVariables): MutationRef; -} -export const updateVendorDefaultSettingRef: UpdateVendorDefaultSettingRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateVendorDefaultSetting(dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationPromise; - -interface UpdateVendorDefaultSettingRef { - ... - (dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationRef; -} -export const updateVendorDefaultSettingRef: UpdateVendorDefaultSettingRef; -``` - -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 updateVendorDefaultSettingRef: -```typescript -const name = updateVendorDefaultSettingRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateVendorDefaultSetting` mutation requires an argument of type `UpdateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateVendorDefaultSettingVariables { - id: UUIDString; - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that executing the `UpdateVendorDefaultSetting` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateVendorDefaultSettingData { - vendorDefaultSetting_update?: VendorDefaultSetting_Key | null; -} -``` -### Using `UpdateVendorDefaultSetting`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateVendorDefaultSetting, UpdateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `UpdateVendorDefaultSetting` mutation requires an argument of type `UpdateVendorDefaultSettingVariables`: -const updateVendorDefaultSettingVars: UpdateVendorDefaultSettingVariables = { - id: ..., - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `updateVendorDefaultSetting()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateVendorDefaultSetting(updateVendorDefaultSettingVars); -// Variables can be defined inline as well. -const { data } = await updateVendorDefaultSetting({ id: ..., vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateVendorDefaultSetting(dataConnect, updateVendorDefaultSettingVars); - -console.log(data.vendorDefaultSetting_update); - -// Or, you can use the `Promise` API. -updateVendorDefaultSetting(updateVendorDefaultSettingVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_update); -}); -``` - -### Using `UpdateVendorDefaultSetting`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateVendorDefaultSettingRef, UpdateVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `UpdateVendorDefaultSetting` mutation requires an argument of type `UpdateVendorDefaultSettingVariables`: -const updateVendorDefaultSettingVars: UpdateVendorDefaultSettingVariables = { - id: ..., - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional -}; - -// Call the `updateVendorDefaultSettingRef()` function to get a reference to the mutation. -const ref = updateVendorDefaultSettingRef(updateVendorDefaultSettingVars); -// Variables can be defined inline as well. -const ref = updateVendorDefaultSettingRef({ id: ..., vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateVendorDefaultSettingRef(dataConnect, updateVendorDefaultSettingVars); - -// 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.vendorDefaultSetting_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_update); -}); -``` - -## DeleteVendorDefaultSetting -You can execute the `DeleteVendorDefaultSetting` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteVendorDefaultSetting(vars: DeleteVendorDefaultSettingVariables): MutationPromise; - -interface DeleteVendorDefaultSettingRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorDefaultSettingVariables): MutationRef; -} -export const deleteVendorDefaultSettingRef: DeleteVendorDefaultSettingRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteVendorDefaultSetting(dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationPromise; - -interface DeleteVendorDefaultSettingRef { - ... - (dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationRef; -} -export const deleteVendorDefaultSettingRef: DeleteVendorDefaultSettingRef; -``` - -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 deleteVendorDefaultSettingRef: -```typescript -const name = deleteVendorDefaultSettingRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteVendorDefaultSetting` mutation requires an argument of type `DeleteVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteVendorDefaultSettingVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteVendorDefaultSetting` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteVendorDefaultSettingData { - vendorDefaultSetting_delete?: VendorDefaultSetting_Key | null; -} -``` -### Using `DeleteVendorDefaultSetting`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorDefaultSetting, DeleteVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `DeleteVendorDefaultSetting` mutation requires an argument of type `DeleteVendorDefaultSettingVariables`: -const deleteVendorDefaultSettingVars: DeleteVendorDefaultSettingVariables = { - id: ..., -}; - -// Call the `deleteVendorDefaultSetting()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteVendorDefaultSetting(deleteVendorDefaultSettingVars); -// Variables can be defined inline as well. -const { data } = await deleteVendorDefaultSetting({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteVendorDefaultSetting(dataConnect, deleteVendorDefaultSettingVars); - -console.log(data.vendorDefaultSetting_delete); - -// Or, you can use the `Promise` API. -deleteVendorDefaultSetting(deleteVendorDefaultSettingVars).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_delete); -}); -``` - -### Using `DeleteVendorDefaultSetting`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteVendorDefaultSettingRef, DeleteVendorDefaultSettingVariables } from '@dataconnect/generated'; - -// The `DeleteVendorDefaultSetting` mutation requires an argument of type `DeleteVendorDefaultSettingVariables`: -const deleteVendorDefaultSettingVars: DeleteVendorDefaultSettingVariables = { - id: ..., -}; - -// Call the `deleteVendorDefaultSettingRef()` function to get a reference to the mutation. -const ref = deleteVendorDefaultSettingRef(deleteVendorDefaultSettingVars); -// Variables can be defined inline as well. -const ref = deleteVendorDefaultSettingRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteVendorDefaultSettingRef(dataConnect, deleteVendorDefaultSettingVars); - -// 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.vendorDefaultSetting_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.vendorDefaultSetting_delete); -}); -``` - -## CreateBusiness -You can execute the `CreateBusiness` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -createBusiness(vars: CreateBusinessVariables): MutationPromise; - -interface CreateBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateBusinessVariables): MutationRef; -} -export const createBusinessRef: CreateBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -createBusiness(dc: DataConnect, vars: CreateBusinessVariables): MutationPromise; - -interface CreateBusinessRef { - ... - (dc: DataConnect, vars: CreateBusinessVariables): MutationRef; -} -export const createBusinessRef: CreateBusinessRef; -``` - -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 createBusinessRef: -```typescript -const name = createBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `CreateBusiness` mutation requires an argument of type `CreateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface CreateBusinessVariables { - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that executing the `CreateBusiness` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface CreateBusinessData { - business_insert: Business_Key; -} -``` -### Using `CreateBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, createBusiness, CreateBusinessVariables } from '@dataconnect/generated'; - -// The `CreateBusiness` mutation requires an argument of type `CreateBusinessVariables`: -const createBusinessVars: CreateBusinessVariables = { - businessName: ..., - contactName: ..., - email: ..., // optional - sector: ..., // optional - rateGroup: ..., - status: ..., // optional -}; - -// Call the `createBusiness()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createBusiness(createBusinessVars); -// Variables can be defined inline as well. -const { data } = await createBusiness({ businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createBusiness(dataConnect, createBusinessVars); - -console.log(data.business_insert); - -// Or, you can use the `Promise` API. -createBusiness(createBusinessVars).then((response) => { - const data = response.data; - console.log(data.business_insert); -}); -``` - -### Using `CreateBusiness`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createBusinessRef, CreateBusinessVariables } from '@dataconnect/generated'; - -// The `CreateBusiness` mutation requires an argument of type `CreateBusinessVariables`: -const createBusinessVars: CreateBusinessVariables = { - businessName: ..., - contactName: ..., - email: ..., // optional - sector: ..., // optional - rateGroup: ..., - status: ..., // optional -}; - -// Call the `createBusinessRef()` function to get a reference to the mutation. -const ref = createBusinessRef(createBusinessVars); -// Variables can be defined inline as well. -const ref = createBusinessRef({ businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createBusinessRef(dataConnect, createBusinessVars); - -// 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.business_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.business_insert); -}); -``` - -## UpdateBusiness -You can execute the `UpdateBusiness` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -updateBusiness(vars: UpdateBusinessVariables): MutationPromise; - -interface UpdateBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateBusinessVariables): MutationRef; -} -export const updateBusinessRef: UpdateBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -updateBusiness(dc: DataConnect, vars: UpdateBusinessVariables): MutationPromise; - -interface UpdateBusinessRef { - ... - (dc: DataConnect, vars: UpdateBusinessVariables): MutationRef; -} -export const updateBusinessRef: UpdateBusinessRef; -``` - -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 updateBusinessRef: -```typescript -const name = updateBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `UpdateBusiness` mutation requires an argument of type `UpdateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface UpdateBusinessVariables { - id: UUIDString; - businessName?: string | null; - contactName?: string | null; - email?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that executing the `UpdateBusiness` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface UpdateBusinessData { - business_update?: Business_Key | null; -} -``` -### Using `UpdateBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateBusiness, UpdateBusinessVariables } from '@dataconnect/generated'; - -// The `UpdateBusiness` mutation requires an argument of type `UpdateBusinessVariables`: -const updateBusinessVars: UpdateBusinessVariables = { - id: ..., - businessName: ..., // optional - contactName: ..., // optional - email: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `updateBusiness()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateBusiness(updateBusinessVars); -// Variables can be defined inline as well. -const { data } = await updateBusiness({ id: ..., businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateBusiness(dataConnect, updateBusinessVars); - -console.log(data.business_update); - -// Or, you can use the `Promise` API. -updateBusiness(updateBusinessVars).then((response) => { - const data = response.data; - console.log(data.business_update); -}); -``` - -### Using `UpdateBusiness`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateBusinessRef, UpdateBusinessVariables } from '@dataconnect/generated'; - -// The `UpdateBusiness` mutation requires an argument of type `UpdateBusinessVariables`: -const updateBusinessVars: UpdateBusinessVariables = { - id: ..., - businessName: ..., // optional - contactName: ..., // optional - email: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional -}; - -// Call the `updateBusinessRef()` function to get a reference to the mutation. -const ref = updateBusinessRef(updateBusinessVars); -// Variables can be defined inline as well. -const ref = updateBusinessRef({ id: ..., businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateBusinessRef(dataConnect, updateBusinessVars); - -// 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.business_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.business_update); -}); -``` - -## DeleteBusiness -You can execute the `DeleteBusiness` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [dataconnect-generated/index.d.ts](./index.d.ts): -```typescript -deleteBusiness(vars: DeleteBusinessVariables): MutationPromise; - -interface DeleteBusinessRef { - ... - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteBusinessVariables): MutationRef; -} -export const deleteBusinessRef: DeleteBusinessRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```typescript -deleteBusiness(dc: DataConnect, vars: DeleteBusinessVariables): MutationPromise; - -interface DeleteBusinessRef { - ... - (dc: DataConnect, vars: DeleteBusinessVariables): MutationRef; -} -export const deleteBusinessRef: DeleteBusinessRef; -``` - -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 deleteBusinessRef: -```typescript -const name = deleteBusinessRef.operationName; -console.log(name); -``` - -### Variables -The `DeleteBusiness` mutation requires an argument of type `DeleteBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: - -```typescript -export interface DeleteBusinessVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `DeleteBusiness` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `DeleteBusinessData`, which is defined in [dataconnect-generated/index.d.ts](./index.d.ts). It has the following fields: -```typescript -export interface DeleteBusinessData { - business_delete?: Business_Key | null; -} -``` -### Using `DeleteBusiness`'s action shortcut function - -```typescript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, deleteBusiness, DeleteBusinessVariables } from '@dataconnect/generated'; - -// The `DeleteBusiness` mutation requires an argument of type `DeleteBusinessVariables`: -const deleteBusinessVars: DeleteBusinessVariables = { - id: ..., -}; - -// Call the `deleteBusiness()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await deleteBusiness(deleteBusinessVars); -// Variables can be defined inline as well. -const { data } = await deleteBusiness({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await deleteBusiness(dataConnect, deleteBusinessVars); - -console.log(data.business_delete); - -// Or, you can use the `Promise` API. -deleteBusiness(deleteBusinessVars).then((response) => { - const data = response.data; - console.log(data.business_delete); -}); -``` - -### Using `DeleteBusiness`'s `MutationRef` function - -```typescript -import { getDataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, deleteBusinessRef, DeleteBusinessVariables } from '@dataconnect/generated'; - -// The `DeleteBusiness` mutation requires an argument of type `DeleteBusinessVariables`: -const deleteBusinessVars: DeleteBusinessVariables = { - id: ..., -}; - -// Call the `deleteBusinessRef()` function to get a reference to the mutation. -const ref = deleteBusinessRef(deleteBusinessVars); -// Variables can be defined inline as well. -const ref = deleteBusinessRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = deleteBusinessRef(dataConnect, deleteBusinessVars); - -// 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.business_delete); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.business_delete); -}); -``` - diff --git a/internal-api-harness/src/dataconnect-generated/esm/index.esm.js b/internal-api-harness/src/dataconnect-generated/esm/index.esm.js deleted file mode 100644 index 19fba0a5..00000000 --- a/internal-api-harness/src/dataconnect-generated/esm/index.esm.js +++ /dev/null @@ -1,535 +0,0 @@ -import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; - -export const BackgroundCheckStatus = { - PENDING: "PENDING", - CLEARED: "CLEARED", - FAILED: "FAILED", - EXPIRED: "EXPIRED", -} - -export const BusinessRateGroup = { - STANDARD: "STANDARD", - PREMIUM: "PREMIUM", - ENTERPRISE: "ENTERPRISE", - CUSTOM: "CUSTOM", -} - -export const BusinessSector = { - BON_APPETIT: "BON_APPETIT", - EUREST: "EUREST", - ARAMARK: "ARAMARK", - EPICUREAN_GROUP: "EPICUREAN_GROUP", - CHARTWELLS: "CHARTWELLS", - OTHER: "OTHER", -} - -export const BusinessStatus = { - ACTIVE: "ACTIVE", - INACTIVE: "INACTIVE", - PENDING: "PENDING", -} - -export const ContractType = { - W2: "W2", - C1099: "C1099", - TEMP: "TEMP", - CONTRACT: "CONTRACT", -} - -export const EmploymentType = { - FULL_TIME: "FULL_TIME", - PART_TIME: "PART_TIME", - ON_CALL: "ON_CALL", - CONTRACT: "CONTRACT", -} - -export const EventStatus = { - DRAFT: "DRAFT", - ACTIVE: "ACTIVE", - PENDING: "PENDING", - ASSIGNED: "ASSIGNED", - CONFIRMED: "CONFIRMED", - COMPLETED: "COMPLETED", - CANCELED: "CANCELED", -} - -export const InvoiceStatus = { - DRAFT: "DRAFT", - PENDING_REVIEW: "PENDING_REVIEW", - APPROVED: "APPROVED", - DISPUTED: "DISPUTED", - UNDER_REVIEW: "UNDER_REVIEW", - RESOLVED: "RESOLVED", - OVERDUE: "OVERDUE", - PAID: "PAID", - RECONCILED: "RECONCILED", - CANCELLED: "CANCELLED", -} - -export const RecurrenceType = { - SINGLE: "SINGLE", - DATE_RANGE: "DATE_RANGE", - SCATTER: "SCATTER", -} - -export const VendorApprovalStatus = { - PENDING: "PENDING", - APPROVED: "APPROVED", - SUSPENDED: "SUSPENDED", - TERMINATED: "TERMINATED", -} - -export const VendorPlatformType = { - FULL_PLATFORM: "FULL_PLATFORM", - BUILDING_PLATFORM: "BUILDING_PLATFORM", - PARTIAL_TECH: "PARTIAL_TECH", - TRADITIONAL: "TRADITIONAL", -} - -export const VendorRateCategory = { - KITCHEN_AND_CULINARY: "KITCHEN_AND_CULINARY", - CONCESSIONS: "CONCESSIONS", - FACILITIES: "FACILITIES", - BARTENDING: "BARTENDING", - SECURITY: "SECURITY", - EVENT_STAFF: "EVENT_STAFF", - MANAGEMENT: "MANAGEMENT", - TECHNICAL: "TECHNICAL", - OTHER: "OTHER", -} - -export const VendorRegion = { - NATIONAL: "NATIONAL", - BAY_AREA: "BAY_AREA", - SOUTHERN_CALIFORNIA: "SOUTHERN_CALIFORNIA", - NORTHERN_CALIFORNIA: "NORTHERN_CALIFORNIA", - WEST: "WEST", - EAST: "EAST", - MIDWEST: "MIDWEST", - SOUTH: "SOUTH", -} - -export const connectorConfig = { - connector: 'krow-connector', - service: 'krow-workforce-db', - location: 'us-central1' -}; - -export const listBusinessRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listBusiness'); -} -listBusinessRef.operationName = 'listBusiness'; - -export function listBusiness(dc) { - return executeQuery(listBusinessRef(dc)); -} - -export const getBusinessByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getBusinessById', inputVars); -} -getBusinessByIdRef.operationName = 'getBusinessById'; - -export function getBusinessById(dcOrVars, vars) { - return executeQuery(getBusinessByIdRef(dcOrVars, vars)); -} - -export const filterBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterBusiness', inputVars); -} -filterBusinessRef.operationName = 'filterBusiness'; - -export function filterBusiness(dcOrVars, vars) { - return executeQuery(filterBusinessRef(dcOrVars, vars)); -} - -export const createEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateEvent', inputVars); -} -createEventRef.operationName = 'CreateEvent'; - -export function createEvent(dcOrVars, vars) { - return executeMutation(createEventRef(dcOrVars, vars)); -} - -export const updateEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateEvent', inputVars); -} -updateEventRef.operationName = 'UpdateEvent'; - -export function updateEvent(dcOrVars, vars) { - return executeMutation(updateEventRef(dcOrVars, vars)); -} - -export const deleteEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteEvent', inputVars); -} -deleteEventRef.operationName = 'DeleteEvent'; - -export function deleteEvent(dcOrVars, vars) { - return executeMutation(deleteEventRef(dcOrVars, vars)); -} - -export const listVendorDefaultSettingsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorDefaultSettings'); -} -listVendorDefaultSettingsRef.operationName = 'listVendorDefaultSettings'; - -export function listVendorDefaultSettings(dc) { - return executeQuery(listVendorDefaultSettingsRef(dc)); -} - -export const getVendorDefaultSettingByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorDefaultSettingById', inputVars); -} -getVendorDefaultSettingByIdRef.operationName = 'getVendorDefaultSettingById'; - -export function getVendorDefaultSettingById(dcOrVars, vars) { - return executeQuery(getVendorDefaultSettingByIdRef(dcOrVars, vars)); -} - -export const filterVendorDefaultSettingsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorDefaultSettings', inputVars); -} -filterVendorDefaultSettingsRef.operationName = 'filterVendorDefaultSettings'; - -export function filterVendorDefaultSettings(dcOrVars, vars) { - return executeQuery(filterVendorDefaultSettingsRef(dcOrVars, vars)); -} - -export const createVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorRate', inputVars); -} -createVendorRateRef.operationName = 'CreateVendorRate'; - -export function createVendorRate(dcOrVars, vars) { - return executeMutation(createVendorRateRef(dcOrVars, vars)); -} - -export const updateVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorRate', inputVars); -} -updateVendorRateRef.operationName = 'UpdateVendorRate'; - -export function updateVendorRate(dcOrVars, vars) { - return executeMutation(updateVendorRateRef(dcOrVars, vars)); -} - -export const deleteVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorRate', inputVars); -} -deleteVendorRateRef.operationName = 'DeleteVendorRate'; - -export function deleteVendorRate(dcOrVars, vars) { - return executeMutation(deleteVendorRateRef(dcOrVars, vars)); -} - -export const listVendorRateRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorRate'); -} -listVendorRateRef.operationName = 'listVendorRate'; - -export function listVendorRate(dc) { - return executeQuery(listVendorRateRef(dc)); -} - -export const getVendorRateByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorRateById', inputVars); -} -getVendorRateByIdRef.operationName = 'getVendorRateById'; - -export function getVendorRateById(dcOrVars, vars) { - return executeQuery(getVendorRateByIdRef(dcOrVars, vars)); -} - -export const filterVendorRatesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorRates', inputVars); -} -filterVendorRatesRef.operationName = 'filterVendorRates'; - -export function filterVendorRates(dcOrVars, vars) { - return executeQuery(filterVendorRatesRef(dcOrVars, vars)); -} - -export const listEventsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listEvents'); -} -listEventsRef.operationName = 'listEvents'; - -export function listEvents(dc) { - return executeQuery(listEventsRef(dc)); -} - -export const getEventByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getEventById', inputVars); -} -getEventByIdRef.operationName = 'getEventById'; - -export function getEventById(dcOrVars, vars) { - return executeQuery(getEventByIdRef(dcOrVars, vars)); -} - -export const filterEventsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterEvents', inputVars); -} -filterEventsRef.operationName = 'filterEvents'; - -export function filterEvents(dcOrVars, vars) { - return executeQuery(filterEventsRef(dcOrVars, vars)); -} - -export const createInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateInvoice', inputVars); -} -createInvoiceRef.operationName = 'CreateInvoice'; - -export function createInvoice(dcOrVars, vars) { - return executeMutation(createInvoiceRef(dcOrVars, vars)); -} - -export const updateInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateInvoice', inputVars); -} -updateInvoiceRef.operationName = 'UpdateInvoice'; - -export function updateInvoice(dcOrVars, vars) { - return executeMutation(updateInvoiceRef(dcOrVars, vars)); -} - -export const deleteInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteInvoice', inputVars); -} -deleteInvoiceRef.operationName = 'DeleteInvoice'; - -export function deleteInvoice(dcOrVars, vars) { - return executeMutation(deleteInvoiceRef(dcOrVars, vars)); -} - -export const listInvoiceRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listInvoice'); -} -listInvoiceRef.operationName = 'listInvoice'; - -export function listInvoice(dc) { - return executeQuery(listInvoiceRef(dc)); -} - -export const getInvoiceByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getInvoiceById', inputVars); -} -getInvoiceByIdRef.operationName = 'getInvoiceById'; - -export function getInvoiceById(dcOrVars, vars) { - return executeQuery(getInvoiceByIdRef(dcOrVars, vars)); -} - -export const filterInvoicesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterInvoices', inputVars); -} -filterInvoicesRef.operationName = 'filterInvoices'; - -export function filterInvoices(dcOrVars, vars) { - return executeQuery(filterInvoicesRef(dcOrVars, vars)); -} - -export const createStaffRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateStaff', inputVars); -} -createStaffRef.operationName = 'CreateStaff'; - -export function createStaff(dcOrVars, vars) { - return executeMutation(createStaffRef(dcOrVars, vars)); -} - -export const listStaffRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listStaff'); -} -listStaffRef.operationName = 'listStaff'; - -export function listStaff(dc) { - return executeQuery(listStaffRef(dc)); -} - -export const createVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendor', inputVars); -} -createVendorRef.operationName = 'CreateVendor'; - -export function createVendor(dcOrVars, vars) { - return executeMutation(createVendorRef(dcOrVars, vars)); -} - -export const updateVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendor', inputVars); -} -updateVendorRef.operationName = 'UpdateVendor'; - -export function updateVendor(dcOrVars, vars) { - return executeMutation(updateVendorRef(dcOrVars, vars)); -} - -export const deleteVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendor', inputVars); -} -deleteVendorRef.operationName = 'DeleteVendor'; - -export function deleteVendor(dcOrVars, vars) { - return executeMutation(deleteVendorRef(dcOrVars, vars)); -} - -export const listVendorRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendor'); -} -listVendorRef.operationName = 'listVendor'; - -export function listVendor(dc) { - return executeQuery(listVendorRef(dc)); -} - -export const getVendorByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorById', inputVars); -} -getVendorByIdRef.operationName = 'getVendorById'; - -export function getVendorById(dcOrVars, vars) { - return executeQuery(getVendorByIdRef(dcOrVars, vars)); -} - -export const filterVendorsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendors', inputVars); -} -filterVendorsRef.operationName = 'filterVendors'; - -export function filterVendors(dcOrVars, vars) { - return executeQuery(filterVendorsRef(dcOrVars, vars)); -} - -export const createVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorDefaultSetting', inputVars); -} -createVendorDefaultSettingRef.operationName = 'CreateVendorDefaultSetting'; - -export function createVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(createVendorDefaultSettingRef(dcOrVars, vars)); -} - -export const updateVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorDefaultSetting', inputVars); -} -updateVendorDefaultSettingRef.operationName = 'UpdateVendorDefaultSetting'; - -export function updateVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(updateVendorDefaultSettingRef(dcOrVars, vars)); -} - -export const deleteVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorDefaultSetting', inputVars); -} -deleteVendorDefaultSettingRef.operationName = 'DeleteVendorDefaultSetting'; - -export function deleteVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(deleteVendorDefaultSettingRef(dcOrVars, vars)); -} - -export const createBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateBusiness', inputVars); -} -createBusinessRef.operationName = 'CreateBusiness'; - -export function createBusiness(dcOrVars, vars) { - return executeMutation(createBusinessRef(dcOrVars, vars)); -} - -export const updateBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateBusiness', inputVars); -} -updateBusinessRef.operationName = 'UpdateBusiness'; - -export function updateBusiness(dcOrVars, vars) { - return executeMutation(updateBusinessRef(dcOrVars, vars)); -} - -export const deleteBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteBusiness', inputVars); -} -deleteBusinessRef.operationName = 'DeleteBusiness'; - -export function deleteBusiness(dcOrVars, vars) { - return executeMutation(deleteBusinessRef(dcOrVars, vars)); -} - diff --git a/internal-api-harness/src/dataconnect-generated/esm/package.json b/internal-api-harness/src/dataconnect-generated/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/internal-api-harness/src/dataconnect-generated/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/internal-api-harness/src/dataconnect-generated/index.cjs.js b/internal-api-harness/src/dataconnect-generated/index.cjs.js deleted file mode 100644 index 97caf790..00000000 --- a/internal-api-harness/src/dataconnect-generated/index.cjs.js +++ /dev/null @@ -1,586 +0,0 @@ -const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); - -const BackgroundCheckStatus = { - PENDING: "PENDING", - CLEARED: "CLEARED", - FAILED: "FAILED", - EXPIRED: "EXPIRED", -} -exports.BackgroundCheckStatus = BackgroundCheckStatus; - -const BusinessRateGroup = { - STANDARD: "STANDARD", - PREMIUM: "PREMIUM", - ENTERPRISE: "ENTERPRISE", - CUSTOM: "CUSTOM", -} -exports.BusinessRateGroup = BusinessRateGroup; - -const BusinessSector = { - BON_APPETIT: "BON_APPETIT", - EUREST: "EUREST", - ARAMARK: "ARAMARK", - EPICUREAN_GROUP: "EPICUREAN_GROUP", - CHARTWELLS: "CHARTWELLS", - OTHER: "OTHER", -} -exports.BusinessSector = BusinessSector; - -const BusinessStatus = { - ACTIVE: "ACTIVE", - INACTIVE: "INACTIVE", - PENDING: "PENDING", -} -exports.BusinessStatus = BusinessStatus; - -const ContractType = { - W2: "W2", - C1099: "C1099", - TEMP: "TEMP", - CONTRACT: "CONTRACT", -} -exports.ContractType = ContractType; - -const EmploymentType = { - FULL_TIME: "FULL_TIME", - PART_TIME: "PART_TIME", - ON_CALL: "ON_CALL", - CONTRACT: "CONTRACT", -} -exports.EmploymentType = EmploymentType; - -const EventStatus = { - DRAFT: "DRAFT", - ACTIVE: "ACTIVE", - PENDING: "PENDING", - ASSIGNED: "ASSIGNED", - CONFIRMED: "CONFIRMED", - COMPLETED: "COMPLETED", - CANCELED: "CANCELED", -} -exports.EventStatus = EventStatus; - -const InvoiceStatus = { - DRAFT: "DRAFT", - PENDING_REVIEW: "PENDING_REVIEW", - APPROVED: "APPROVED", - DISPUTED: "DISPUTED", - UNDER_REVIEW: "UNDER_REVIEW", - RESOLVED: "RESOLVED", - OVERDUE: "OVERDUE", - PAID: "PAID", - RECONCILED: "RECONCILED", - CANCELLED: "CANCELLED", -} -exports.InvoiceStatus = InvoiceStatus; - -const RecurrenceType = { - SINGLE: "SINGLE", - DATE_RANGE: "DATE_RANGE", - SCATTER: "SCATTER", -} -exports.RecurrenceType = RecurrenceType; - -const VendorApprovalStatus = { - PENDING: "PENDING", - APPROVED: "APPROVED", - SUSPENDED: "SUSPENDED", - TERMINATED: "TERMINATED", -} -exports.VendorApprovalStatus = VendorApprovalStatus; - -const VendorPlatformType = { - FULL_PLATFORM: "FULL_PLATFORM", - BUILDING_PLATFORM: "BUILDING_PLATFORM", - PARTIAL_TECH: "PARTIAL_TECH", - TRADITIONAL: "TRADITIONAL", -} -exports.VendorPlatformType = VendorPlatformType; - -const VendorRateCategory = { - KITCHEN_AND_CULINARY: "KITCHEN_AND_CULINARY", - CONCESSIONS: "CONCESSIONS", - FACILITIES: "FACILITIES", - BARTENDING: "BARTENDING", - SECURITY: "SECURITY", - EVENT_STAFF: "EVENT_STAFF", - MANAGEMENT: "MANAGEMENT", - TECHNICAL: "TECHNICAL", - OTHER: "OTHER", -} -exports.VendorRateCategory = VendorRateCategory; - -const VendorRegion = { - NATIONAL: "NATIONAL", - BAY_AREA: "BAY_AREA", - SOUTHERN_CALIFORNIA: "SOUTHERN_CALIFORNIA", - NORTHERN_CALIFORNIA: "NORTHERN_CALIFORNIA", - WEST: "WEST", - EAST: "EAST", - MIDWEST: "MIDWEST", - SOUTH: "SOUTH", -} -exports.VendorRegion = VendorRegion; - -const connectorConfig = { - connector: 'krow-connector', - service: 'krow-workforce-db', - location: 'us-central1' -}; -exports.connectorConfig = connectorConfig; - -const listBusinessRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listBusiness'); -} -listBusinessRef.operationName = 'listBusiness'; -exports.listBusinessRef = listBusinessRef; - -exports.listBusiness = function listBusiness(dc) { - return executeQuery(listBusinessRef(dc)); -}; - -const getBusinessByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getBusinessById', inputVars); -} -getBusinessByIdRef.operationName = 'getBusinessById'; -exports.getBusinessByIdRef = getBusinessByIdRef; - -exports.getBusinessById = function getBusinessById(dcOrVars, vars) { - return executeQuery(getBusinessByIdRef(dcOrVars, vars)); -}; - -const filterBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterBusiness', inputVars); -} -filterBusinessRef.operationName = 'filterBusiness'; -exports.filterBusinessRef = filterBusinessRef; - -exports.filterBusiness = function filterBusiness(dcOrVars, vars) { - return executeQuery(filterBusinessRef(dcOrVars, vars)); -}; - -const createEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateEvent', inputVars); -} -createEventRef.operationName = 'CreateEvent'; -exports.createEventRef = createEventRef; - -exports.createEvent = function createEvent(dcOrVars, vars) { - return executeMutation(createEventRef(dcOrVars, vars)); -}; - -const updateEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateEvent', inputVars); -} -updateEventRef.operationName = 'UpdateEvent'; -exports.updateEventRef = updateEventRef; - -exports.updateEvent = function updateEvent(dcOrVars, vars) { - return executeMutation(updateEventRef(dcOrVars, vars)); -}; - -const deleteEventRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteEvent', inputVars); -} -deleteEventRef.operationName = 'DeleteEvent'; -exports.deleteEventRef = deleteEventRef; - -exports.deleteEvent = function deleteEvent(dcOrVars, vars) { - return executeMutation(deleteEventRef(dcOrVars, vars)); -}; - -const listVendorDefaultSettingsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorDefaultSettings'); -} -listVendorDefaultSettingsRef.operationName = 'listVendorDefaultSettings'; -exports.listVendorDefaultSettingsRef = listVendorDefaultSettingsRef; - -exports.listVendorDefaultSettings = function listVendorDefaultSettings(dc) { - return executeQuery(listVendorDefaultSettingsRef(dc)); -}; - -const getVendorDefaultSettingByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorDefaultSettingById', inputVars); -} -getVendorDefaultSettingByIdRef.operationName = 'getVendorDefaultSettingById'; -exports.getVendorDefaultSettingByIdRef = getVendorDefaultSettingByIdRef; - -exports.getVendorDefaultSettingById = function getVendorDefaultSettingById(dcOrVars, vars) { - return executeQuery(getVendorDefaultSettingByIdRef(dcOrVars, vars)); -}; - -const filterVendorDefaultSettingsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorDefaultSettings', inputVars); -} -filterVendorDefaultSettingsRef.operationName = 'filterVendorDefaultSettings'; -exports.filterVendorDefaultSettingsRef = filterVendorDefaultSettingsRef; - -exports.filterVendorDefaultSettings = function filterVendorDefaultSettings(dcOrVars, vars) { - return executeQuery(filterVendorDefaultSettingsRef(dcOrVars, vars)); -}; - -const createVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorRate', inputVars); -} -createVendorRateRef.operationName = 'CreateVendorRate'; -exports.createVendorRateRef = createVendorRateRef; - -exports.createVendorRate = function createVendorRate(dcOrVars, vars) { - return executeMutation(createVendorRateRef(dcOrVars, vars)); -}; - -const updateVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorRate', inputVars); -} -updateVendorRateRef.operationName = 'UpdateVendorRate'; -exports.updateVendorRateRef = updateVendorRateRef; - -exports.updateVendorRate = function updateVendorRate(dcOrVars, vars) { - return executeMutation(updateVendorRateRef(dcOrVars, vars)); -}; - -const deleteVendorRateRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorRate', inputVars); -} -deleteVendorRateRef.operationName = 'DeleteVendorRate'; -exports.deleteVendorRateRef = deleteVendorRateRef; - -exports.deleteVendorRate = function deleteVendorRate(dcOrVars, vars) { - return executeMutation(deleteVendorRateRef(dcOrVars, vars)); -}; - -const listVendorRateRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendorRate'); -} -listVendorRateRef.operationName = 'listVendorRate'; -exports.listVendorRateRef = listVendorRateRef; - -exports.listVendorRate = function listVendorRate(dc) { - return executeQuery(listVendorRateRef(dc)); -}; - -const getVendorRateByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorRateById', inputVars); -} -getVendorRateByIdRef.operationName = 'getVendorRateById'; -exports.getVendorRateByIdRef = getVendorRateByIdRef; - -exports.getVendorRateById = function getVendorRateById(dcOrVars, vars) { - return executeQuery(getVendorRateByIdRef(dcOrVars, vars)); -}; - -const filterVendorRatesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendorRates', inputVars); -} -filterVendorRatesRef.operationName = 'filterVendorRates'; -exports.filterVendorRatesRef = filterVendorRatesRef; - -exports.filterVendorRates = function filterVendorRates(dcOrVars, vars) { - return executeQuery(filterVendorRatesRef(dcOrVars, vars)); -}; - -const listEventsRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listEvents'); -} -listEventsRef.operationName = 'listEvents'; -exports.listEventsRef = listEventsRef; - -exports.listEvents = function listEvents(dc) { - return executeQuery(listEventsRef(dc)); -}; - -const getEventByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getEventById', inputVars); -} -getEventByIdRef.operationName = 'getEventById'; -exports.getEventByIdRef = getEventByIdRef; - -exports.getEventById = function getEventById(dcOrVars, vars) { - return executeQuery(getEventByIdRef(dcOrVars, vars)); -}; - -const filterEventsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterEvents', inputVars); -} -filterEventsRef.operationName = 'filterEvents'; -exports.filterEventsRef = filterEventsRef; - -exports.filterEvents = function filterEvents(dcOrVars, vars) { - return executeQuery(filterEventsRef(dcOrVars, vars)); -}; - -const createInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateInvoice', inputVars); -} -createInvoiceRef.operationName = 'CreateInvoice'; -exports.createInvoiceRef = createInvoiceRef; - -exports.createInvoice = function createInvoice(dcOrVars, vars) { - return executeMutation(createInvoiceRef(dcOrVars, vars)); -}; - -const updateInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateInvoice', inputVars); -} -updateInvoiceRef.operationName = 'UpdateInvoice'; -exports.updateInvoiceRef = updateInvoiceRef; - -exports.updateInvoice = function updateInvoice(dcOrVars, vars) { - return executeMutation(updateInvoiceRef(dcOrVars, vars)); -}; - -const deleteInvoiceRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteInvoice', inputVars); -} -deleteInvoiceRef.operationName = 'DeleteInvoice'; -exports.deleteInvoiceRef = deleteInvoiceRef; - -exports.deleteInvoice = function deleteInvoice(dcOrVars, vars) { - return executeMutation(deleteInvoiceRef(dcOrVars, vars)); -}; - -const listInvoiceRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listInvoice'); -} -listInvoiceRef.operationName = 'listInvoice'; -exports.listInvoiceRef = listInvoiceRef; - -exports.listInvoice = function listInvoice(dc) { - return executeQuery(listInvoiceRef(dc)); -}; - -const getInvoiceByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getInvoiceById', inputVars); -} -getInvoiceByIdRef.operationName = 'getInvoiceById'; -exports.getInvoiceByIdRef = getInvoiceByIdRef; - -exports.getInvoiceById = function getInvoiceById(dcOrVars, vars) { - return executeQuery(getInvoiceByIdRef(dcOrVars, vars)); -}; - -const filterInvoicesRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterInvoices', inputVars); -} -filterInvoicesRef.operationName = 'filterInvoices'; -exports.filterInvoicesRef = filterInvoicesRef; - -exports.filterInvoices = function filterInvoices(dcOrVars, vars) { - return executeQuery(filterInvoicesRef(dcOrVars, vars)); -}; - -const createStaffRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateStaff', inputVars); -} -createStaffRef.operationName = 'CreateStaff'; -exports.createStaffRef = createStaffRef; - -exports.createStaff = function createStaff(dcOrVars, vars) { - return executeMutation(createStaffRef(dcOrVars, vars)); -}; - -const listStaffRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listStaff'); -} -listStaffRef.operationName = 'listStaff'; -exports.listStaffRef = listStaffRef; - -exports.listStaff = function listStaff(dc) { - return executeQuery(listStaffRef(dc)); -}; - -const createVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendor', inputVars); -} -createVendorRef.operationName = 'CreateVendor'; -exports.createVendorRef = createVendorRef; - -exports.createVendor = function createVendor(dcOrVars, vars) { - return executeMutation(createVendorRef(dcOrVars, vars)); -}; - -const updateVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendor', inputVars); -} -updateVendorRef.operationName = 'UpdateVendor'; -exports.updateVendorRef = updateVendorRef; - -exports.updateVendor = function updateVendor(dcOrVars, vars) { - return executeMutation(updateVendorRef(dcOrVars, vars)); -}; - -const deleteVendorRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendor', inputVars); -} -deleteVendorRef.operationName = 'DeleteVendor'; -exports.deleteVendorRef = deleteVendorRef; - -exports.deleteVendor = function deleteVendor(dcOrVars, vars) { - return executeMutation(deleteVendorRef(dcOrVars, vars)); -}; - -const listVendorRef = (dc) => { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'listVendor'); -} -listVendorRef.operationName = 'listVendor'; -exports.listVendorRef = listVendorRef; - -exports.listVendor = function listVendor(dc) { - return executeQuery(listVendorRef(dc)); -}; - -const getVendorByIdRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'getVendorById', inputVars); -} -getVendorByIdRef.operationName = 'getVendorById'; -exports.getVendorByIdRef = getVendorByIdRef; - -exports.getVendorById = function getVendorById(dcOrVars, vars) { - return executeQuery(getVendorByIdRef(dcOrVars, vars)); -}; - -const filterVendorsRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'filterVendors', inputVars); -} -filterVendorsRef.operationName = 'filterVendors'; -exports.filterVendorsRef = filterVendorsRef; - -exports.filterVendors = function filterVendors(dcOrVars, vars) { - return executeQuery(filterVendorsRef(dcOrVars, vars)); -}; - -const createVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateVendorDefaultSetting', inputVars); -} -createVendorDefaultSettingRef.operationName = 'CreateVendorDefaultSetting'; -exports.createVendorDefaultSettingRef = createVendorDefaultSettingRef; - -exports.createVendorDefaultSetting = function createVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(createVendorDefaultSettingRef(dcOrVars, vars)); -}; - -const updateVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateVendorDefaultSetting', inputVars); -} -updateVendorDefaultSettingRef.operationName = 'UpdateVendorDefaultSetting'; -exports.updateVendorDefaultSettingRef = updateVendorDefaultSettingRef; - -exports.updateVendorDefaultSetting = function updateVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(updateVendorDefaultSettingRef(dcOrVars, vars)); -}; - -const deleteVendorDefaultSettingRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteVendorDefaultSetting', inputVars); -} -deleteVendorDefaultSettingRef.operationName = 'DeleteVendorDefaultSetting'; -exports.deleteVendorDefaultSettingRef = deleteVendorDefaultSettingRef; - -exports.deleteVendorDefaultSetting = function deleteVendorDefaultSetting(dcOrVars, vars) { - return executeMutation(deleteVendorDefaultSettingRef(dcOrVars, vars)); -}; - -const createBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateBusiness', inputVars); -} -createBusinessRef.operationName = 'CreateBusiness'; -exports.createBusinessRef = createBusinessRef; - -exports.createBusiness = function createBusiness(dcOrVars, vars) { - return executeMutation(createBusinessRef(dcOrVars, vars)); -}; - -const updateBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateBusiness', inputVars); -} -updateBusinessRef.operationName = 'UpdateBusiness'; -exports.updateBusinessRef = updateBusinessRef; - -exports.updateBusiness = function updateBusiness(dcOrVars, vars) { - return executeMutation(updateBusinessRef(dcOrVars, vars)); -}; - -const deleteBusinessRef = (dcOrVars, vars) => { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'DeleteBusiness', inputVars); -} -deleteBusinessRef.operationName = 'DeleteBusiness'; -exports.deleteBusinessRef = deleteBusinessRef; - -exports.deleteBusiness = function deleteBusiness(dcOrVars, vars) { - return executeMutation(deleteBusinessRef(dcOrVars, vars)); -}; diff --git a/internal-api-harness/src/dataconnect-generated/index.d.ts b/internal-api-harness/src/dataconnect-generated/index.d.ts deleted file mode 100644 index ae0b3539..00000000 --- a/internal-api-harness/src/dataconnect-generated/index.d.ts +++ /dev/null @@ -1,1288 +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 enum BackgroundCheckStatus { - PENDING = "PENDING", - CLEARED = "CLEARED", - FAILED = "FAILED", - EXPIRED = "EXPIRED", -}; - -export enum BusinessRateGroup { - STANDARD = "STANDARD", - PREMIUM = "PREMIUM", - ENTERPRISE = "ENTERPRISE", - CUSTOM = "CUSTOM", -}; - -export enum BusinessSector { - BON_APPETIT = "BON_APPETIT", - EUREST = "EUREST", - ARAMARK = "ARAMARK", - EPICUREAN_GROUP = "EPICUREAN_GROUP", - CHARTWELLS = "CHARTWELLS", - OTHER = "OTHER", -}; - -export enum BusinessStatus { - ACTIVE = "ACTIVE", - INACTIVE = "INACTIVE", - PENDING = "PENDING", -}; - -export enum ContractType { - W2 = "W2", - C1099 = "C1099", - TEMP = "TEMP", - CONTRACT = "CONTRACT", -}; - -export enum EmploymentType { - FULL_TIME = "FULL_TIME", - PART_TIME = "PART_TIME", - ON_CALL = "ON_CALL", - CONTRACT = "CONTRACT", -}; - -export enum EventStatus { - DRAFT = "DRAFT", - ACTIVE = "ACTIVE", - PENDING = "PENDING", - ASSIGNED = "ASSIGNED", - CONFIRMED = "CONFIRMED", - COMPLETED = "COMPLETED", - CANCELED = "CANCELED", -}; - -export enum InvoiceStatus { - DRAFT = "DRAFT", - PENDING_REVIEW = "PENDING_REVIEW", - APPROVED = "APPROVED", - DISPUTED = "DISPUTED", - UNDER_REVIEW = "UNDER_REVIEW", - RESOLVED = "RESOLVED", - OVERDUE = "OVERDUE", - PAID = "PAID", - RECONCILED = "RECONCILED", - CANCELLED = "CANCELLED", -}; - -export enum RecurrenceType { - SINGLE = "SINGLE", - DATE_RANGE = "DATE_RANGE", - SCATTER = "SCATTER", -}; - -export enum VendorApprovalStatus { - PENDING = "PENDING", - APPROVED = "APPROVED", - SUSPENDED = "SUSPENDED", - TERMINATED = "TERMINATED", -}; - -export enum VendorPlatformType { - FULL_PLATFORM = "FULL_PLATFORM", - BUILDING_PLATFORM = "BUILDING_PLATFORM", - PARTIAL_TECH = "PARTIAL_TECH", - TRADITIONAL = "TRADITIONAL", -}; - -export enum VendorRateCategory { - KITCHEN_AND_CULINARY = "KITCHEN_AND_CULINARY", - CONCESSIONS = "CONCESSIONS", - FACILITIES = "FACILITIES", - BARTENDING = "BARTENDING", - SECURITY = "SECURITY", - EVENT_STAFF = "EVENT_STAFF", - MANAGEMENT = "MANAGEMENT", - TECHNICAL = "TECHNICAL", - OTHER = "OTHER", -}; - -export enum VendorRegion { - NATIONAL = "NATIONAL", - BAY_AREA = "BAY_AREA", - SOUTHERN_CALIFORNIA = "SOUTHERN_CALIFORNIA", - NORTHERN_CALIFORNIA = "NORTHERN_CALIFORNIA", - WEST = "WEST", - EAST = "EAST", - MIDWEST = "MIDWEST", - SOUTH = "SOUTH", -}; - - - -export interface Business_Key { - id: UUIDString; - __typename?: 'Business_Key'; -} - -export interface CreateBusinessData { - business_insert: Business_Key; -} - -export interface CreateBusinessVariables { - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; -} - -export interface CreateEventData { - event_insert: Event_Key; -} - -export interface CreateEventVariables { - eventName: string; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status: EventStatus; - date: TimestampString; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} - -export interface CreateInvoiceData { - invoice_insert: Invoice_Key; -} - -export interface CreateInvoiceVariables { - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} - -export interface CreateStaffData { - staff_insert: Staff_Key; -} - -export interface CreateStaffVariables { - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; -} - -export interface CreateVendorData { - vendor_insert: Vendor_Key; -} - -export interface CreateVendorDefaultSettingData { - vendorDefaultSetting_insert: VendorDefaultSetting_Key; -} - -export interface CreateVendorDefaultSettingVariables { - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; -} - -export interface CreateVendorRateData { - vendorRate_insert: VendorRate_Key; -} - -export interface CreateVendorRateVariables { - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; -} - -export interface CreateVendorVariables { - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; -} - -export interface DeleteBusinessData { - business_delete?: Business_Key | null; -} - -export interface DeleteBusinessVariables { - id: UUIDString; -} - -export interface DeleteEventData { - event_delete?: Event_Key | null; -} - -export interface DeleteEventVariables { - id: UUIDString; -} - -export interface DeleteInvoiceData { - invoice_delete?: Invoice_Key | null; -} - -export interface DeleteInvoiceVariables { - id: UUIDString; -} - -export interface DeleteVendorData { - vendor_delete?: Vendor_Key | null; -} - -export interface DeleteVendorDefaultSettingData { - vendorDefaultSetting_delete?: VendorDefaultSetting_Key | null; -} - -export interface DeleteVendorDefaultSettingVariables { - id: UUIDString; -} - -export interface DeleteVendorRateData { - vendorRate_delete?: VendorRate_Key | null; -} - -export interface DeleteVendorRateVariables { - id: UUIDString; -} - -export interface DeleteVendorVariables { - id: UUIDString; -} - -export interface Event_Key { - id: UUIDString; - __typename?: 'Event_Key'; -} - -export interface FilterBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} - -export interface FilterBusinessVariables { - businessName?: string | null; - contactName?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} - -export interface FilterEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} - -export interface FilterEventsVariables { - status?: EventStatus | null; - businessId?: UUIDString | null; - vendorId?: UUIDString | null; - isRecurring?: boolean | null; - isRapid?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - date?: TimestampString | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - clientEmail?: string | null; -} - -export interface FilterInvoicesData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} - -export interface FilterInvoicesVariables { - invoiceNumber?: string | null; - status?: InvoiceStatus | null; - isAutoGenerated?: boolean | null; - amount?: number | null; -} - -export interface FilterVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} - -export interface FilterVendorDefaultSettingsVariables { - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} - -export interface FilterVendorRatesData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} - -export interface FilterVendorRatesVariables { - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - minClientRate?: number | null; - maxClientRate?: number | null; -} - -export interface FilterVendorsData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} - -export interface FilterVendorsVariables { - region?: VendorRegion | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; - vendorNumber?: string | null; - primaryContactEmail?: string | null; - legalName?: string | null; - platformType?: VendorPlatformType | null; -} - -export interface GetBusinessByIdData { - business?: { - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key; -} - -export interface GetBusinessByIdVariables { - id: UUIDString; -} - -export interface GetEventByIdData { - event?: { - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key; -} - -export interface GetEventByIdVariables { - id: UUIDString; -} - -export interface GetInvoiceByIdData { - invoice?: { - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; - } & Invoice_Key; -} - -export interface GetInvoiceByIdVariables { - id: UUIDString; -} - -export interface GetVendorByIdData { - vendor?: { - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key; -} - -export interface GetVendorByIdVariables { - id: UUIDString; -} - -export interface GetVendorDefaultSettingByIdData { - vendorDefaultSetting?: { - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key; -} - -export interface GetVendorDefaultSettingByIdVariables { - id: UUIDString; -} - -export interface GetVendorRateByIdData { - vendorRate?: { - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - createdDate?: TimestampString | null; - updatedDate?: TimestampString | null; - createdBy?: string | null; - } & VendorRate_Key; -} - -export interface GetVendorRateByIdVariables { - id: UUIDString; -} - -export interface Invoice_Key { - id: UUIDString; - __typename?: 'Invoice_Key'; -} - -export interface ListBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} - -export interface ListEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} - -export interface ListInvoiceData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} - -export interface ListStaffData { - staffs: ({ - id: UUIDString; - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; - } & Staff_Key)[]; -} - -export interface ListVendorData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} - -export interface ListVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} - -export interface ListVendorRateData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} - -export interface Staff_Key { - id: UUIDString; - __typename?: 'Staff_Key'; -} - -export interface UpdateBusinessData { - business_update?: Business_Key | null; -} - -export interface UpdateBusinessVariables { - id: UUIDString; - businessName?: string | null; - contactName?: string | null; - email?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} - -export interface UpdateEventData { - event_update?: Event_Key | null; -} - -export interface UpdateEventVariables { - id: UUIDString; - eventName?: string | null; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId?: UUIDString | null; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status?: EventStatus | null; - date?: TimestampString | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} - -export interface UpdateInvoiceData { - invoice_update?: Invoice_Key | null; -} - -export interface UpdateInvoiceVariables { - id: UUIDString; - invoiceNumber?: string | null; - amount?: number | null; - status?: InvoiceStatus | null; - issueDate?: TimestampString | null; - dueDate?: TimestampString | null; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} - -export interface UpdateVendorData { - vendor_update?: Vendor_Key | null; -} - -export interface UpdateVendorDefaultSettingData { - vendorDefaultSetting_update?: VendorDefaultSetting_Key | null; -} - -export interface UpdateVendorDefaultSettingVariables { - id: UUIDString; - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} - -export interface UpdateVendorRateData { - vendorRate_update?: VendorRate_Key | null; -} - -export interface UpdateVendorRateVariables { - id: UUIDString; - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - employeeWage?: number | null; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate?: number | null; -} - -export interface UpdateVendorVariables { - id: UUIDString; - vendorNumber?: string | null; - legalName?: string | null; - region?: VendorRegion | null; - platformType?: VendorPlatformType | null; - primaryContactEmail?: string | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; -} - -export interface VendorDefaultSetting_Key { - id: UUIDString; - __typename?: 'VendorDefaultSetting_Key'; -} - -export interface VendorRate_Key { - id: UUIDString; - __typename?: 'VendorRate_Key'; -} - -export interface Vendor_Key { - id: UUIDString; - __typename?: 'Vendor_Key'; -} - -interface ListBusinessRef { - /* 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 listBusinessRef: ListBusinessRef; - -export function listBusiness(): QueryPromise; -export function listBusiness(dc: DataConnect): QueryPromise; - -interface GetBusinessByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetBusinessByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetBusinessByIdVariables): QueryRef; - operationName: string; -} -export const getBusinessByIdRef: GetBusinessByIdRef; - -export function getBusinessById(vars: GetBusinessByIdVariables): QueryPromise; -export function getBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables): QueryPromise; - -interface FilterBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterBusinessVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterBusinessVariables): QueryRef; - operationName: string; -} -export const filterBusinessRef: FilterBusinessRef; - -export function filterBusiness(vars?: FilterBusinessVariables): QueryPromise; -export function filterBusiness(dc: DataConnect, vars?: FilterBusinessVariables): QueryPromise; - -interface CreateEventRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateEventVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateEventVariables): MutationRef; - operationName: string; -} -export const createEventRef: CreateEventRef; - -export function createEvent(vars: CreateEventVariables): MutationPromise; -export function createEvent(dc: DataConnect, vars: CreateEventVariables): MutationPromise; - -interface UpdateEventRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateEventVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateEventVariables): MutationRef; - operationName: string; -} -export const updateEventRef: UpdateEventRef; - -export function updateEvent(vars: UpdateEventVariables): MutationPromise; -export function updateEvent(dc: DataConnect, vars: UpdateEventVariables): MutationPromise; - -interface DeleteEventRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteEventVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteEventVariables): MutationRef; - operationName: string; -} -export const deleteEventRef: DeleteEventRef; - -export function deleteEvent(vars: DeleteEventVariables): MutationPromise; -export function deleteEvent(dc: DataConnect, vars: DeleteEventVariables): MutationPromise; - -interface ListVendorDefaultSettingsRef { - /* 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 listVendorDefaultSettingsRef: ListVendorDefaultSettingsRef; - -export function listVendorDefaultSettings(): QueryPromise; -export function listVendorDefaultSettings(dc: DataConnect): QueryPromise; - -interface GetVendorDefaultSettingByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorDefaultSettingByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryRef; - operationName: string; -} -export const getVendorDefaultSettingByIdRef: GetVendorDefaultSettingByIdRef; - -export function getVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables): QueryPromise; -export function getVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables): QueryPromise; - -interface FilterVendorDefaultSettingsRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorDefaultSettingsVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryRef; - operationName: string; -} -export const filterVendorDefaultSettingsRef: FilterVendorDefaultSettingsRef; - -export function filterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables): QueryPromise; -export function filterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables): QueryPromise; - -interface CreateVendorRateRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorRateVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateVendorRateVariables): MutationRef; - operationName: string; -} -export const createVendorRateRef: CreateVendorRateRef; - -export function createVendorRate(vars: CreateVendorRateVariables): MutationPromise; -export function createVendorRate(dc: DataConnect, vars: CreateVendorRateVariables): MutationPromise; - -interface UpdateVendorRateRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorRateVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateVendorRateVariables): MutationRef; - operationName: string; -} -export const updateVendorRateRef: UpdateVendorRateRef; - -export function updateVendorRate(vars: UpdateVendorRateVariables): MutationPromise; -export function updateVendorRate(dc: DataConnect, vars: UpdateVendorRateVariables): MutationPromise; - -interface DeleteVendorRateRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorRateVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteVendorRateVariables): MutationRef; - operationName: string; -} -export const deleteVendorRateRef: DeleteVendorRateRef; - -export function deleteVendorRate(vars: DeleteVendorRateVariables): MutationPromise; -export function deleteVendorRate(dc: DataConnect, vars: DeleteVendorRateVariables): MutationPromise; - -interface ListVendorRateRef { - /* 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 listVendorRateRef: ListVendorRateRef; - -export function listVendorRate(): QueryPromise; -export function listVendorRate(dc: DataConnect): QueryPromise; - -interface GetVendorRateByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorRateByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetVendorRateByIdVariables): QueryRef; - operationName: string; -} -export const getVendorRateByIdRef: GetVendorRateByIdRef; - -export function getVendorRateById(vars: GetVendorRateByIdVariables): QueryPromise; -export function getVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables): QueryPromise; - -interface FilterVendorRatesRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorRatesVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterVendorRatesVariables): QueryRef; - operationName: string; -} -export const filterVendorRatesRef: FilterVendorRatesRef; - -export function filterVendorRates(vars?: FilterVendorRatesVariables): QueryPromise; -export function filterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables): QueryPromise; - -interface ListEventsRef { - /* 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 listEventsRef: ListEventsRef; - -export function listEvents(): QueryPromise; -export function listEvents(dc: DataConnect): QueryPromise; - -interface GetEventByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetEventByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetEventByIdVariables): QueryRef; - operationName: string; -} -export const getEventByIdRef: GetEventByIdRef; - -export function getEventById(vars: GetEventByIdVariables): QueryPromise; -export function getEventById(dc: DataConnect, vars: GetEventByIdVariables): QueryPromise; - -interface FilterEventsRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterEventsVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterEventsVariables): QueryRef; - operationName: string; -} -export const filterEventsRef: FilterEventsRef; - -export function filterEvents(vars?: FilterEventsVariables): QueryPromise; -export function filterEvents(dc: DataConnect, vars?: FilterEventsVariables): QueryPromise; - -interface CreateInvoiceRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateInvoiceVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateInvoiceVariables): MutationRef; - operationName: string; -} -export const createInvoiceRef: CreateInvoiceRef; - -export function createInvoice(vars: CreateInvoiceVariables): MutationPromise; -export function createInvoice(dc: DataConnect, vars: CreateInvoiceVariables): MutationPromise; - -interface UpdateInvoiceRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateInvoiceVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateInvoiceVariables): MutationRef; - operationName: string; -} -export const updateInvoiceRef: UpdateInvoiceRef; - -export function updateInvoice(vars: UpdateInvoiceVariables): MutationPromise; -export function updateInvoice(dc: DataConnect, vars: UpdateInvoiceVariables): MutationPromise; - -interface DeleteInvoiceRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteInvoiceVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteInvoiceVariables): MutationRef; - operationName: string; -} -export const deleteInvoiceRef: DeleteInvoiceRef; - -export function deleteInvoice(vars: DeleteInvoiceVariables): MutationPromise; -export function deleteInvoice(dc: DataConnect, vars: DeleteInvoiceVariables): MutationPromise; - -interface ListInvoiceRef { - /* 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 listInvoiceRef: ListInvoiceRef; - -export function listInvoice(): QueryPromise; -export function listInvoice(dc: DataConnect): QueryPromise; - -interface GetInvoiceByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetInvoiceByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetInvoiceByIdVariables): QueryRef; - operationName: string; -} -export const getInvoiceByIdRef: GetInvoiceByIdRef; - -export function getInvoiceById(vars: GetInvoiceByIdVariables): QueryPromise; -export function getInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables): QueryPromise; - -interface FilterInvoicesRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterInvoicesVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterInvoicesVariables): QueryRef; - operationName: string; -} -export const filterInvoicesRef: FilterInvoicesRef; - -export function filterInvoices(vars?: FilterInvoicesVariables): QueryPromise; -export function filterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables): QueryPromise; - -interface CreateStaffRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateStaffVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateStaffVariables): MutationRef; - operationName: string; -} -export const createStaffRef: CreateStaffRef; - -export function createStaff(vars: CreateStaffVariables): MutationPromise; -export function createStaff(dc: DataConnect, vars: CreateStaffVariables): MutationPromise; - -interface ListStaffRef { - /* 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 listStaffRef: ListStaffRef; - -export function listStaff(): QueryPromise; -export function listStaff(dc: DataConnect): QueryPromise; - -interface CreateVendorRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateVendorVariables): MutationRef; - operationName: string; -} -export const createVendorRef: CreateVendorRef; - -export function createVendor(vars: CreateVendorVariables): MutationPromise; -export function createVendor(dc: DataConnect, vars: CreateVendorVariables): MutationPromise; - -interface UpdateVendorRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateVendorVariables): MutationRef; - operationName: string; -} -export const updateVendorRef: UpdateVendorRef; - -export function updateVendor(vars: UpdateVendorVariables): MutationPromise; -export function updateVendor(dc: DataConnect, vars: UpdateVendorVariables): MutationPromise; - -interface DeleteVendorRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteVendorVariables): MutationRef; - operationName: string; -} -export const deleteVendorRef: DeleteVendorRef; - -export function deleteVendor(vars: DeleteVendorVariables): MutationPromise; -export function deleteVendor(dc: DataConnect, vars: DeleteVendorVariables): MutationPromise; - -interface ListVendorRef { - /* 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 listVendorRef: ListVendorRef; - -export function listVendor(): QueryPromise; -export function listVendor(dc: DataConnect): QueryPromise; - -interface GetVendorByIdRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: GetVendorByIdVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: GetVendorByIdVariables): QueryRef; - operationName: string; -} -export const getVendorByIdRef: GetVendorByIdRef; - -export function getVendorById(vars: GetVendorByIdVariables): QueryPromise; -export function getVendorById(dc: DataConnect, vars: GetVendorByIdVariables): QueryPromise; - -interface FilterVendorsRef { - /* Allow users to create refs without passing in DataConnect */ - (vars?: FilterVendorsVariables): QueryRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars?: FilterVendorsVariables): QueryRef; - operationName: string; -} -export const filterVendorsRef: FilterVendorsRef; - -export function filterVendors(vars?: FilterVendorsVariables): QueryPromise; -export function filterVendors(dc: DataConnect, vars?: FilterVendorsVariables): QueryPromise; - -interface CreateVendorDefaultSettingRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateVendorDefaultSettingVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationRef; - operationName: string; -} -export const createVendorDefaultSettingRef: CreateVendorDefaultSettingRef; - -export function createVendorDefaultSetting(vars: CreateVendorDefaultSettingVariables): MutationPromise; -export function createVendorDefaultSetting(dc: DataConnect, vars: CreateVendorDefaultSettingVariables): MutationPromise; - -interface UpdateVendorDefaultSettingRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateVendorDefaultSettingVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationRef; - operationName: string; -} -export const updateVendorDefaultSettingRef: UpdateVendorDefaultSettingRef; - -export function updateVendorDefaultSetting(vars: UpdateVendorDefaultSettingVariables): MutationPromise; -export function updateVendorDefaultSetting(dc: DataConnect, vars: UpdateVendorDefaultSettingVariables): MutationPromise; - -interface DeleteVendorDefaultSettingRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteVendorDefaultSettingVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationRef; - operationName: string; -} -export const deleteVendorDefaultSettingRef: DeleteVendorDefaultSettingRef; - -export function deleteVendorDefaultSetting(vars: DeleteVendorDefaultSettingVariables): MutationPromise; -export function deleteVendorDefaultSetting(dc: DataConnect, vars: DeleteVendorDefaultSettingVariables): MutationPromise; - -interface CreateBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: CreateBusinessVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: CreateBusinessVariables): MutationRef; - operationName: string; -} -export const createBusinessRef: CreateBusinessRef; - -export function createBusiness(vars: CreateBusinessVariables): MutationPromise; -export function createBusiness(dc: DataConnect, vars: CreateBusinessVariables): MutationPromise; - -interface UpdateBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: UpdateBusinessVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: UpdateBusinessVariables): MutationRef; - operationName: string; -} -export const updateBusinessRef: UpdateBusinessRef; - -export function updateBusiness(vars: UpdateBusinessVariables): MutationPromise; -export function updateBusiness(dc: DataConnect, vars: UpdateBusinessVariables): MutationPromise; - -interface DeleteBusinessRef { - /* Allow users to create refs without passing in DataConnect */ - (vars: DeleteBusinessVariables): MutationRef; - /* Allow users to pass in custom DataConnect instances */ - (dc: DataConnect, vars: DeleteBusinessVariables): MutationRef; - operationName: string; -} -export const deleteBusinessRef: DeleteBusinessRef; - -export function deleteBusiness(vars: DeleteBusinessVariables): MutationPromise; -export function deleteBusiness(dc: DataConnect, vars: DeleteBusinessVariables): MutationPromise; - diff --git a/internal-api-harness/src/dataconnect-generated/package.json b/internal-api-harness/src/dataconnect-generated/package.json deleted file mode 100644 index b686c0a0..00000000 --- a/internal-api-harness/src/dataconnect-generated/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@dataconnect/generated", - "version": "1.0.0", - "author": "Firebase (https://firebase.google.com/)", - "description": "Generated SDK For krow-connector", - "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" - }, - "./react": { - "types": "./react/index.d.ts", - "require": "./react/index.cjs.js", - "import": "./react/esm/index.esm.js", - "default": "./react/esm/index.esm.js" - }, - "./package.json": "./package.json" - }, - "peerDependencies": { - "firebase": "^11.3.0 || ^12.0.0", - "@tanstack-query-firebase/react": "^2.0.0" - } -} \ No newline at end of file diff --git a/internal-api-harness/src/dataconnect-generated/react/README.md b/internal-api-harness/src/dataconnect-generated/react/README.md deleted file mode 100644 index 268de00b..00000000 --- a/internal-api-harness/src/dataconnect-generated/react/README.md +++ /dev/null @@ -1,4023 +0,0 @@ -# Generated React README -This README will guide you through the process of using the generated React SDK package for the connector `krow-connector`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. - -**If you're looking for the `JavaScript README`, you can find it at [`dataconnect-generated/README.md`](../README.md)** - -***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.* - -You can use this generated SDK by importing from the package `@dataconnect/generated/react` 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#react). - -# Table of Contents -- [**Overview**](#generated-react-readme) -- [**TanStack Query Firebase & TanStack React Query**](#tanstack-query-firebase-tanstack-react-query) - - [*Package Installation*](#installing-tanstack-query-firebase-and-tanstack-react-query-packages) - - [*Configuring TanStack Query*](#configuring-tanstack-query) -- [**Accessing the connector**](#accessing-the-connector) - - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) -- [**Queries**](#queries) - - [*listBusiness*](#listbusiness) - - [*getBusinessById*](#getbusinessbyid) - - [*filterBusiness*](#filterbusiness) - - [*listVendorDefaultSettings*](#listvendordefaultsettings) - - [*getVendorDefaultSettingById*](#getvendordefaultsettingbyid) - - [*filterVendorDefaultSettings*](#filtervendordefaultsettings) - - [*listVendorRate*](#listvendorrate) - - [*getVendorRateById*](#getvendorratebyid) - - [*filterVendorRates*](#filtervendorrates) - - [*listEvents*](#listevents) - - [*getEventById*](#geteventbyid) - - [*filterEvents*](#filterevents) - - [*listInvoice*](#listinvoice) - - [*getInvoiceById*](#getinvoicebyid) - - [*filterInvoices*](#filterinvoices) - - [*listStaff*](#liststaff) - - [*listVendor*](#listvendor) - - [*getVendorById*](#getvendorbyid) - - [*filterVendors*](#filtervendors) -- [**Mutations**](#mutations) - - [*CreateEvent*](#createevent) - - [*UpdateEvent*](#updateevent) - - [*DeleteEvent*](#deleteevent) - - [*CreateVendorRate*](#createvendorrate) - - [*UpdateVendorRate*](#updatevendorrate) - - [*DeleteVendorRate*](#deletevendorrate) - - [*CreateInvoice*](#createinvoice) - - [*UpdateInvoice*](#updateinvoice) - - [*DeleteInvoice*](#deleteinvoice) - - [*CreateStaff*](#createstaff) - - [*CreateVendor*](#createvendor) - - [*UpdateVendor*](#updatevendor) - - [*DeleteVendor*](#deletevendor) - - [*CreateVendorDefaultSetting*](#createvendordefaultsetting) - - [*UpdateVendorDefaultSetting*](#updatevendordefaultsetting) - - [*DeleteVendorDefaultSetting*](#deletevendordefaultsetting) - - [*CreateBusiness*](#createbusiness) - - [*UpdateBusiness*](#updatebusiness) - - [*DeleteBusiness*](#deletebusiness) - -# TanStack Query Firebase & TanStack React Query -This SDK provides [React](https://react.dev/) hooks generated specific to your application, for the operations found in the connector `krow-connector`. These hooks are generated using [TanStack Query Firebase](https://react-query-firebase.invertase.dev/) by our partners at Invertase, a library built on top of [TanStack React Query v5](https://tanstack.com/query/v5/docs/framework/react/overview). - -***You do not need to be familiar with Tanstack Query or Tanstack Query Firebase to use this SDK.*** However, you may find it useful to learn more about them, as they will empower you as a user of this Generated React SDK. - -## Installing TanStack Query Firebase and TanStack React Query Packages -In order to use the React generated SDK, you must install the `TanStack React Query` and `TanStack Query Firebase` packages. -```bash -npm i --save @tanstack/react-query @tanstack-query-firebase/react -``` -```bash -npm i --save firebase@latest # Note: React has a peer dependency on ^11.3.0 -``` - -You can also follow the installation instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#tanstack-install), or the [TanStack Query Firebase documentation](https://react-query-firebase.invertase.dev/react) and [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/installation). - -## Configuring TanStack Query -In order to use the React generated SDK in your application, you must wrap your application's component tree in a `QueryClientProvider` component from TanStack React Query. None of your generated React SDK hooks will work without this provider. - -```javascript -import { QueryClientProvider } from '@tanstack/react-query'; - -// Create a TanStack Query client instance -const queryClient = new QueryClient() - -function App() { - return ( - // Provide the client to your App - - - - ) -} -``` - -To learn more about `QueryClientProvider`, see the [TanStack React Query documentation](https://tanstack.com/query/latest/docs/framework/react/quick-start) and the [TanStack Query Firebase documentation](https://invertase.docs.page/tanstack-query-firebase/react#usage). - -# 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 `krow-connector`. - -You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; - -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#emulator-react-angular). - -```javascript -import { connectDataConnectEmulator, getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; - -const dataConnect = getDataConnect(connectorConfig); -connectDataConnectEmulator(dataConnect, 'localhost', 9399); -``` - -After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) using the hooks provided from your generated React SDK. - -# Queries - -The React generated SDK provides Query hook functions that call and return [`useDataConnectQuery`](https://react-query-firebase.invertase.dev/react/data-connect/querying) hooks from TanStack Query Firebase. - -Calling these hook functions will return a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and the most recent data returned by the Query, among other things. To learn more about these hooks and how to use them, see the [TanStack Query Firebase documentation](https://react-query-firebase.invertase.dev/react/data-connect/querying). - -TanStack React Query caches the results of your Queries, so using the same Query hook function in multiple places in your application allows the entire application to automatically see updates to that Query's data. - -Query hooks execute their Queries automatically when called, and periodically refresh, unless you change the `queryOptions` for the Query. To learn how to stop a Query from automatically executing, including how to make a query "lazy", see the [TanStack React Query documentation](https://tanstack.com/query/latest/docs/framework/react/guides/disabling-queries). - -To learn more about TanStack React Query's Queries, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/queries). - -## Using Query Hooks -Here's a general overview of how to use the generated Query hooks in your code: - -- If the Query has no variables, the Query hook function does not require arguments. -- If the Query has any required variables, the Query hook function will require at least one argument: an object that contains all the required variables for the Query. -- If the Query has some required and some optional variables, only required variables are necessary in the variables argument object, and optional variables may be provided as well. -- If all of the Query's variables are optional, the Query hook function does not require any arguments. -- Query hook 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. -- Query hooks functions can be called with or without passing in an `options` argument of type `useDataConnectQueryOptions`. To learn more about the `options` argument, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/query-options). - - ***Special case:*** If the Query has all optional variables and you would like to provide an `options` argument to the Query hook function without providing any variables, you must pass `undefined` where you would normally pass the Query's variables, and then may provide the `options` argument. - -Below are examples of how to use the `krow-connector` connector's generated Query hook 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#operations-react-angular). - -## listBusiness -You can execute the `listBusiness` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListBusiness(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListBusiness(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listBusiness` Query has no variables. -### Return Type -Recall that calling the `listBusiness` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listBusiness` Query is of type `ListBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listBusiness`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListBusiness } from '@dataconnect/generated/react' - -export default function ListBusinessComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListBusiness(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListBusiness(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListBusiness(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.businesses); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getBusinessById -You can execute the `getBusinessById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetBusinessById(vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getBusinessById` Query requires an argument of type `GetBusinessByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetBusinessByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getBusinessById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getBusinessById` Query is of type `GetBusinessByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetBusinessByIdData { - business?: { - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getBusinessById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetBusinessByIdVariables } from '@dataconnect/generated'; -import { useGetBusinessById } from '@dataconnect/generated/react' - -export default function GetBusinessByIdComponent() { - // The `useGetBusinessById` Query hook requires an argument of type `GetBusinessByIdVariables`: - const getBusinessByIdVars: GetBusinessByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetBusinessById(getBusinessByIdVars); - // Variables can be defined inline as well. - const query = useGetBusinessById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetBusinessById(dataConnect, getBusinessByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetBusinessById(getBusinessByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetBusinessById(dataConnect, getBusinessByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.business); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterBusiness -You can execute the `filterBusiness` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterBusiness(dc: DataConnect, vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterBusiness(vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterBusiness` Query has an optional argument of type `FilterBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterBusinessVariables { - businessName?: string | null; - contactName?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that calling the `filterBusiness` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterBusiness` Query is of type `FilterBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterBusinessData { - businesses: ({ - id: UUIDString; - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; - } & Business_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterBusiness`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterBusinessVariables } from '@dataconnect/generated'; -import { useFilterBusiness } from '@dataconnect/generated/react' - -export default function FilterBusinessComponent() { - // The `useFilterBusiness` Query hook has an optional argument of type `FilterBusinessVariables`: - const filterBusinessVars: FilterBusinessVariables = { - businessName: ..., // optional - contactName: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterBusiness(filterBusinessVars); - // Variables can be defined inline as well. - const query = useFilterBusiness({ businessName: ..., contactName: ..., sector: ..., rateGroup: ..., status: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterBusinessVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterBusiness(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterBusiness(dataConnect, filterBusinessVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterBusiness(filterBusinessVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterBusiness(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterBusiness(dataConnect, filterBusinessVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.businesses); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listVendorDefaultSettings -You can execute the `listVendorDefaultSettings` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListVendorDefaultSettings(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListVendorDefaultSettings(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listVendorDefaultSettings` Query has no variables. -### Return Type -Recall that calling the `listVendorDefaultSettings` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listVendorDefaultSettings` Query is of type `ListVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listVendorDefaultSettings`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListVendorDefaultSettings } from '@dataconnect/generated/react' - -export default function ListVendorDefaultSettingsComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListVendorDefaultSettings(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListVendorDefaultSettings(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListVendorDefaultSettings(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListVendorDefaultSettings(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorDefaultSettings); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getVendorDefaultSettingById -You can execute the `getVendorDefaultSettingById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getVendorDefaultSettingById` Query requires an argument of type `GetVendorDefaultSettingByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetVendorDefaultSettingByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getVendorDefaultSettingById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getVendorDefaultSettingById` Query is of type `GetVendorDefaultSettingByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetVendorDefaultSettingByIdData { - vendorDefaultSetting?: { - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getVendorDefaultSettingById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetVendorDefaultSettingByIdVariables } from '@dataconnect/generated'; -import { useGetVendorDefaultSettingById } from '@dataconnect/generated/react' - -export default function GetVendorDefaultSettingByIdComponent() { - // The `useGetVendorDefaultSettingById` Query hook requires an argument of type `GetVendorDefaultSettingByIdVariables`: - const getVendorDefaultSettingByIdVars: GetVendorDefaultSettingByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetVendorDefaultSettingById(getVendorDefaultSettingByIdVars); - // Variables can be defined inline as well. - const query = useGetVendorDefaultSettingById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorDefaultSettingById(getVendorDefaultSettingByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorDefaultSettingById(dataConnect, getVendorDefaultSettingByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorDefaultSetting); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterVendorDefaultSettings -You can execute the `filterVendorDefaultSettings` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterVendorDefaultSettings` Query has an optional argument of type `FilterVendorDefaultSettingsVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterVendorDefaultSettingsVariables { - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that calling the `filterVendorDefaultSettings` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterVendorDefaultSettings` Query is of type `FilterVendorDefaultSettingsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterVendorDefaultSettingsData { - vendorDefaultSettings: ({ - id: UUIDString; - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; - } & VendorDefaultSetting_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterVendorDefaultSettings`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterVendorDefaultSettingsVariables } from '@dataconnect/generated'; -import { useFilterVendorDefaultSettings } from '@dataconnect/generated/react' - -export default function FilterVendorDefaultSettingsComponent() { - // The `useFilterVendorDefaultSettings` Query hook has an optional argument of type `FilterVendorDefaultSettingsVariables`: - const filterVendorDefaultSettingsVars: FilterVendorDefaultSettingsVariables = { - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterVendorDefaultSettings(filterVendorDefaultSettingsVars); - // Variables can be defined inline as well. - const query = useFilterVendorDefaultSettings({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterVendorDefaultSettingsVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterVendorDefaultSettings(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorDefaultSettings(filterVendorDefaultSettingsVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterVendorDefaultSettings(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorDefaultSettings(dataConnect, filterVendorDefaultSettingsVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorDefaultSettings); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listVendorRate -You can execute the `listVendorRate` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListVendorRate(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListVendorRate(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listVendorRate` Query has no variables. -### Return Type -Recall that calling the `listVendorRate` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listVendorRate` Query is of type `ListVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListVendorRateData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listVendorRate`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListVendorRate } from '@dataconnect/generated/react' - -export default function ListVendorRateComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListVendorRate(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListVendorRate(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListVendorRate(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorRates); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getVendorRateById -You can execute the `getVendorRateById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetVendorRateById(vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getVendorRateById` Query requires an argument of type `GetVendorRateByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetVendorRateByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getVendorRateById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getVendorRateById` Query is of type `GetVendorRateByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetVendorRateByIdData { - vendorRate?: { - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - createdDate?: TimestampString | null; - updatedDate?: TimestampString | null; - createdBy?: string | null; - } & VendorRate_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getVendorRateById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetVendorRateByIdVariables } from '@dataconnect/generated'; -import { useGetVendorRateById } from '@dataconnect/generated/react' - -export default function GetVendorRateByIdComponent() { - // The `useGetVendorRateById` Query hook requires an argument of type `GetVendorRateByIdVariables`: - const getVendorRateByIdVars: GetVendorRateByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetVendorRateById(getVendorRateByIdVars); - // Variables can be defined inline as well. - const query = useGetVendorRateById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetVendorRateById(dataConnect, getVendorRateByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorRateById(getVendorRateByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorRateById(dataConnect, getVendorRateByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorRate); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterVendorRates -You can execute the `filterVendorRates` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterVendorRates(vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterVendorRates` Query has an optional argument of type `FilterVendorRatesVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterVendorRatesVariables { - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - minClientRate?: number | null; - maxClientRate?: number | null; -} -``` -### Return Type -Recall that calling the `filterVendorRates` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterVendorRates` Query is of type `FilterVendorRatesData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterVendorRatesData { - vendorRates: ({ - id: UUIDString; - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; - } & VendorRate_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterVendorRates`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterVendorRatesVariables } from '@dataconnect/generated'; -import { useFilterVendorRates } from '@dataconnect/generated/react' - -export default function FilterVendorRatesComponent() { - // The `useFilterVendorRates` Query hook has an optional argument of type `FilterVendorRatesVariables`: - const filterVendorRatesVars: FilterVendorRatesVariables = { - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - minClientRate: ..., // optional - maxClientRate: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterVendorRates(filterVendorRatesVars); - // Variables can be defined inline as well. - const query = useFilterVendorRates({ vendorName: ..., category: ..., roleName: ..., minClientRate: ..., maxClientRate: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterVendorRatesVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterVendorRates(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterVendorRates(dataConnect, filterVendorRatesVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorRates(filterVendorRatesVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterVendorRates(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendorRates(dataConnect, filterVendorRatesVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendorRates); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listEvents -You can execute the `listEvents` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListEvents(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListEvents(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listEvents` Query has no variables. -### Return Type -Recall that calling the `listEvents` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listEvents` Query is of type `ListEventsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listEvents`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListEvents } from '@dataconnect/generated/react' - -export default function ListEventsComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListEvents(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListEvents(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListEvents(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListEvents(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.events); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getEventById -You can execute the `getEventById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetEventById(dc: DataConnect, vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetEventById(vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getEventById` Query requires an argument of type `GetEventByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetEventByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getEventById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getEventById` Query is of type `GetEventByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetEventByIdData { - event?: { - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getEventById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetEventByIdVariables } from '@dataconnect/generated'; -import { useGetEventById } from '@dataconnect/generated/react' - -export default function GetEventByIdComponent() { - // The `useGetEventById` Query hook requires an argument of type `GetEventByIdVariables`: - const getEventByIdVars: GetEventByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetEventById(getEventByIdVars); - // Variables can be defined inline as well. - const query = useGetEventById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetEventById(dataConnect, getEventByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetEventById(getEventByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetEventById(dataConnect, getEventByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.event); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterEvents -You can execute the `filterEvents` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterEvents(dc: DataConnect, vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterEvents(vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterEvents` Query has an optional argument of type `FilterEventsVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterEventsVariables { - status?: EventStatus | null; - businessId?: UUIDString | null; - vendorId?: UUIDString | null; - isRecurring?: boolean | null; - isRapid?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - date?: TimestampString | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - clientEmail?: string | null; -} -``` -### Return Type -Recall that calling the `filterEvents` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterEvents` Query is of type `FilterEventsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterEventsData { - events: ({ - id: UUIDString; - eventName: string; - status: EventStatus; - date: TimestampString; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; - } & Event_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterEvents`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterEventsVariables } from '@dataconnect/generated'; -import { useFilterEvents } from '@dataconnect/generated/react' - -export default function FilterEventsComponent() { - // The `useFilterEvents` Query hook has an optional argument of type `FilterEventsVariables`: - const filterEventsVars: FilterEventsVariables = { - status: ..., // optional - businessId: ..., // optional - vendorId: ..., // optional - isRecurring: ..., // optional - isRapid: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - date: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - clientEmail: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterEvents(filterEventsVars); - // Variables can be defined inline as well. - const query = useFilterEvents({ status: ..., businessId: ..., vendorId: ..., isRecurring: ..., isRapid: ..., isMultiDay: ..., recurrenceType: ..., date: ..., hub: ..., eventLocation: ..., contractType: ..., clientEmail: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterEventsVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterEvents(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterEvents(dataConnect, filterEventsVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterEvents(filterEventsVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterEvents(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterEvents(dataConnect, filterEventsVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.events); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listInvoice -You can execute the `listInvoice` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListInvoice(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListInvoice(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listInvoice` Query has no variables. -### Return Type -Recall that calling the `listInvoice` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listInvoice` Query is of type `ListInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListInvoiceData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listInvoice`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListInvoice } from '@dataconnect/generated/react' - -export default function ListInvoiceComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListInvoice(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListInvoice(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListInvoice(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.invoices); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getInvoiceById -You can execute the `getInvoiceById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetInvoiceById(vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getInvoiceById` Query requires an argument of type `GetInvoiceByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetInvoiceByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getInvoiceById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getInvoiceById` Query is of type `GetInvoiceByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetInvoiceByIdData { - invoice?: { - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; - } & Invoice_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getInvoiceById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetInvoiceByIdVariables } from '@dataconnect/generated'; -import { useGetInvoiceById } from '@dataconnect/generated/react' - -export default function GetInvoiceByIdComponent() { - // The `useGetInvoiceById` Query hook requires an argument of type `GetInvoiceByIdVariables`: - const getInvoiceByIdVars: GetInvoiceByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetInvoiceById(getInvoiceByIdVars); - // Variables can be defined inline as well. - const query = useGetInvoiceById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetInvoiceById(dataConnect, getInvoiceByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetInvoiceById(getInvoiceByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetInvoiceById(dataConnect, getInvoiceByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.invoice); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterInvoices -You can execute the `filterInvoices` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterInvoices(vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterInvoices` Query has an optional argument of type `FilterInvoicesVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterInvoicesVariables { - invoiceNumber?: string | null; - status?: InvoiceStatus | null; - isAutoGenerated?: boolean | null; - amount?: number | null; -} -``` -### Return Type -Recall that calling the `filterInvoices` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterInvoices` Query is of type `FilterInvoicesData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterInvoicesData { - invoices: ({ - id: UUIDString; - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - isAutoGenerated?: boolean | null; - } & Invoice_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterInvoices`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterInvoicesVariables } from '@dataconnect/generated'; -import { useFilterInvoices } from '@dataconnect/generated/react' - -export default function FilterInvoicesComponent() { - // The `useFilterInvoices` Query hook has an optional argument of type `FilterInvoicesVariables`: - const filterInvoicesVars: FilterInvoicesVariables = { - invoiceNumber: ..., // optional - status: ..., // optional - isAutoGenerated: ..., // optional - amount: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterInvoices(filterInvoicesVars); - // Variables can be defined inline as well. - const query = useFilterInvoices({ invoiceNumber: ..., status: ..., isAutoGenerated: ..., amount: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterInvoicesVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterInvoices(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterInvoices(dataConnect, filterInvoicesVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterInvoices(filterInvoicesVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterInvoices(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterInvoices(dataConnect, filterInvoicesVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.invoices); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listStaff -You can execute the `listStaff` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListStaff(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListStaff(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listStaff` Query has no variables. -### Return Type -Recall that calling the `listStaff` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listStaff` Query is of type `ListStaffData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListStaffData { - staffs: ({ - id: UUIDString; - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; - } & Staff_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listStaff`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListStaff } from '@dataconnect/generated/react' - -export default function ListStaffComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListStaff(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListStaff(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListStaff(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListStaff(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.staffs); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## listVendor -You can execute the `listVendor` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useListVendor(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useListVendor(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `listVendor` Query has no variables. -### Return Type -Recall that calling the `listVendor` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `listVendor` Query is of type `ListVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface ListVendorData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `listVendor`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@dataconnect/generated'; -import { useListVendor } from '@dataconnect/generated/react' - -export default function ListVendorComponent() { - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useListVendor(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useListVendor(dataConnect); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useListVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useListVendor(dataConnect, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendors); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## getVendorById -You can execute the `getVendorById` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useGetVendorById(dc: DataConnect, vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useGetVendorById(vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `getVendorById` Query requires an argument of type `GetVendorByIdVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface GetVendorByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `getVendorById` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `getVendorById` Query is of type `GetVendorByIdData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface GetVendorByIdData { - vendor?: { - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `getVendorById`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, GetVendorByIdVariables } from '@dataconnect/generated'; -import { useGetVendorById } from '@dataconnect/generated/react' - -export default function GetVendorByIdComponent() { - // The `useGetVendorById` Query hook requires an argument of type `GetVendorByIdVariables`: - const getVendorByIdVars: GetVendorByIdVariables = { - id: ..., - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useGetVendorById(getVendorByIdVars); - // Variables can be defined inline as well. - const query = useGetVendorById({ id: ..., }); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useGetVendorById(dataConnect, getVendorByIdVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorById(getVendorByIdVars, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useGetVendorById(dataConnect, getVendorByIdVars, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendor); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## filterVendors -You can execute the `filterVendors` Query using the following Query hook function, which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts): - -```javascript -useFilterVendors(dc: DataConnect, vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` -You can also pass in a `DataConnect` instance to the Query hook function. -```javascript -useFilterVendors(vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -``` - -### Variables -The `filterVendors` Query has an optional argument of type `FilterVendorsVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface FilterVendorsVariables { - region?: VendorRegion | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; - vendorNumber?: string | null; - primaryContactEmail?: string | null; - legalName?: string | null; - platformType?: VendorPlatformType | null; -} -``` -### Return Type -Recall that calling the `filterVendors` Query hook function returns a `UseQueryResult` object. This object holds the state of your Query, including whether the Query is loading, has completed, or has succeeded/failed, and any data returned by the Query, among other things. - -To check the status of a Query, use the `UseQueryResult.status` field. You can also check for pending / success / error status using the `UseQueryResult.isPending`, `UseQueryResult.isSuccess`, and `UseQueryResult.isError` fields. - -To access the data returned by a Query, use the `UseQueryResult.data` field. The data for the `filterVendors` Query is of type `FilterVendorsData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface FilterVendorsData { - vendors: ({ - id: UUIDString; - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; - } & Vendor_Key)[]; -} -``` - -To learn more about the `UseQueryResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useQuery). - -### Using `filterVendors`'s Query hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, FilterVendorsVariables } from '@dataconnect/generated'; -import { useFilterVendors } from '@dataconnect/generated/react' - -export default function FilterVendorsComponent() { - // The `useFilterVendors` Query hook has an optional argument of type `FilterVendorsVariables`: - const filterVendorsVars: FilterVendorsVariables = { - region: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - vendorNumber: ..., // optional - primaryContactEmail: ..., // optional - legalName: ..., // optional - platformType: ..., // optional - }; - - // You don't have to do anything to "execute" the Query. - // Call the Query hook function to get a `UseQueryResult` object which holds the state of your Query. - const query = useFilterVendors(filterVendorsVars); - // Variables can be defined inline as well. - const query = useFilterVendors({ region: ..., approvalStatus: ..., isActive: ..., vendorNumber: ..., primaryContactEmail: ..., legalName: ..., platformType: ..., }); - // Since all variables are optional for this Query, you can omit the `FilterVendorsVariables` argument. - // (as long as you don't want to provide any `options`!) - const query = useFilterVendors(); - - // You can also pass in a `DataConnect` instance to the Query hook function. - const dataConnect = getDataConnect(connectorConfig); - const query = useFilterVendors(dataConnect, filterVendorsVars); - - // You can also pass in a `useDataConnectQueryOptions` object to the Query hook function. - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendors(filterVendorsVars, options); - // If you'd like to provide options without providing any variables, you must - // pass `undefined` where you would normally pass the variables. - const query = useFilterVendors(undefined, options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectQueryOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { staleTime: 5 * 1000 }; - const query = useFilterVendors(dataConnect, filterVendorsVars /** or undefined */, options); - - // Then, you can render your component dynamically based on the status of the Query. - if (query.isPending) { - return
Loading...
; - } - - if (query.isError) { - return
Error: {query.error.message}
; - } - - // If the Query is successful, you can access the data returned using the `UseQueryResult.data` field. - if (query.isSuccess) { - console.log(query.data.vendors); - } - return
Query execution {query.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -# Mutations - -The React generated SDK provides Mutations hook functions that call and return [`useDataConnectMutation`](https://react-query-firebase.invertase.dev/react/data-connect/mutations) hooks from TanStack Query Firebase. - -Calling these hook functions will return a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, and the most recent data returned by the Mutation, among other things. To learn more about these hooks and how to use them, see the [TanStack Query Firebase documentation](https://react-query-firebase.invertase.dev/react/data-connect/mutations). - -Mutation hooks do not execute their Mutations automatically when called. Rather, after calling the Mutation hook function and getting a `UseMutationResult` object, you must call the `UseMutationResult.mutate()` function to execute the Mutation. - -To learn more about TanStack React Query's Mutations, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/mutations). - -## Using Mutation Hooks -Here's a general overview of how to use the generated Mutation hooks in your code: - -- Mutation hook functions are not called with the arguments to the Mutation. Instead, arguments are passed to `UseMutationResult.mutate()`. -- If the Mutation has no variables, the `mutate()` function does not require arguments. -- If the Mutation has any required variables, the `mutate()` function will require at least one argument: an object that contains all the required variables for the Mutation. -- If the Mutation has some required and some optional variables, only required variables are necessary in the variables argument object, and optional variables may be provided as well. -- If all of the Mutation's variables are optional, the Mutation hook function does not require any arguments. -- Mutation hook 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. -- Mutation hooks also accept an `options` argument of type `useDataConnectMutationOptions`. To learn more about the `options` argument, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/guides/mutations#mutation-side-effects). - - `UseMutationResult.mutate()` also accepts an `options` argument of type `useDataConnectMutationOptions`. - - ***Special case:*** If the Mutation has no arguments (or all optional arguments and you wish to provide none), and you want to pass `options` to `UseMutationResult.mutate()`, you must pass `undefined` where you would normally pass the Mutation's arguments, and then may provide the options argument. - -Below are examples of how to use the `krow-connector` connector's generated Mutation hook 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#operations-react-angular). - -## CreateEvent -You can execute the `CreateEvent` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateEvent` Mutation requires an argument of type `CreateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateEventVariables { - eventName: string; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId: UUIDString; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status: EventStatus; - date: TimestampString; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that calling the `CreateEvent` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateEvent` Mutation is of type `CreateEventData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateEventData { - event_insert: Event_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateEvent`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateEventVariables } from '@dataconnect/generated'; -import { useCreateEvent } from '@dataconnect/generated/react' - -export default function CreateEventComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateEvent(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateEvent(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateEvent(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateEvent(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateEvent` Mutation requires an argument of type `CreateEventVariables`: - const createEventVars: CreateEventVariables = { - eventName: ..., - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., - date: ..., - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional - }; - mutation.mutate(createEventVars); - // Variables can be defined inline as well. - mutation.mutate({ eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createEventVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.event_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateEvent -You can execute the `UpdateEvent` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateEvent` Mutation requires an argument of type `UpdateEventVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateEventVariables { - id: UUIDString; - eventName?: string | null; - isRapid?: boolean | null; - isRecurring?: boolean | null; - isMultiDay?: boolean | null; - recurrenceType?: RecurrenceType | null; - recurrenceStartDate?: TimestampString | null; - recurrenceEndDate?: TimestampString | null; - scatterDates?: string | null; - multiDayStartDate?: TimestampString | null; - multiDayEndDate?: TimestampString | null; - bufferTimeBefore?: number | null; - bufferTimeAfter?: number | null; - conflictDetectionEnabled?: boolean | null; - detectedConflicts?: string | null; - businessId?: UUIDString | null; - businessName?: string | null; - vendorId?: UUIDString | null; - vendorName?: string | null; - hub?: string | null; - eventLocation?: string | null; - contractType?: ContractType | null; - poReference?: string | null; - status?: EventStatus | null; - date?: TimestampString | null; - shifts?: string | null; - addons?: string | null; - total?: number | null; - clientName?: string | null; - clientEmail?: string | null; - clientPhone?: string | null; - invoiceId?: UUIDString | null; - notes?: string | null; - requested?: number | null; - assignedStaff?: string | null; -} -``` -### Return Type -Recall that calling the `UpdateEvent` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateEvent` Mutation is of type `UpdateEventData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateEventData { - event_update?: Event_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateEvent`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateEventVariables } from '@dataconnect/generated'; -import { useUpdateEvent } from '@dataconnect/generated/react' - -export default function UpdateEventComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateEvent(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateEvent(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateEvent(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateEvent(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateEvent` Mutation requires an argument of type `UpdateEventVariables`: - const updateEventVars: UpdateEventVariables = { - id: ..., - eventName: ..., // optional - isRapid: ..., // optional - isRecurring: ..., // optional - isMultiDay: ..., // optional - recurrenceType: ..., // optional - recurrenceStartDate: ..., // optional - recurrenceEndDate: ..., // optional - scatterDates: ..., // optional - multiDayStartDate: ..., // optional - multiDayEndDate: ..., // optional - bufferTimeBefore: ..., // optional - bufferTimeAfter: ..., // optional - conflictDetectionEnabled: ..., // optional - detectedConflicts: ..., // optional - businessId: ..., // optional - businessName: ..., // optional - vendorId: ..., // optional - vendorName: ..., // optional - hub: ..., // optional - eventLocation: ..., // optional - contractType: ..., // optional - poReference: ..., // optional - status: ..., // optional - date: ..., // optional - shifts: ..., // optional - addons: ..., // optional - total: ..., // optional - clientName: ..., // optional - clientEmail: ..., // optional - clientPhone: ..., // optional - invoiceId: ..., // optional - notes: ..., // optional - requested: ..., // optional - assignedStaff: ..., // optional - }; - mutation.mutate(updateEventVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., eventName: ..., isRapid: ..., isRecurring: ..., isMultiDay: ..., recurrenceType: ..., recurrenceStartDate: ..., recurrenceEndDate: ..., scatterDates: ..., multiDayStartDate: ..., multiDayEndDate: ..., bufferTimeBefore: ..., bufferTimeAfter: ..., conflictDetectionEnabled: ..., detectedConflicts: ..., businessId: ..., businessName: ..., vendorId: ..., vendorName: ..., hub: ..., eventLocation: ..., contractType: ..., poReference: ..., status: ..., date: ..., shifts: ..., addons: ..., total: ..., clientName: ..., clientEmail: ..., clientPhone: ..., invoiceId: ..., notes: ..., requested: ..., assignedStaff: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateEventVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.event_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteEvent -You can execute the `DeleteEvent` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteEvent` Mutation requires an argument of type `DeleteEventVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteEventVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteEvent` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteEvent` Mutation is of type `DeleteEventData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteEventData { - event_delete?: Event_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteEvent`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteEventVariables } from '@dataconnect/generated'; -import { useDeleteEvent } from '@dataconnect/generated/react' - -export default function DeleteEventComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteEvent(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteEvent(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteEvent(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteEvent(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteEvent` Mutation requires an argument of type `DeleteEventVariables`: - const deleteEventVars: DeleteEventVariables = { - id: ..., - }; - mutation.mutate(deleteEventVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteEventVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.event_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateVendorRate -You can execute the `CreateVendorRate` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateVendorRate` Mutation requires an argument of type `CreateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateVendorRateVariables { - vendorName: string; - category: VendorRateCategory; - roleName: string; - employeeWage: number; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate: number; -} -``` -### Return Type -Recall that calling the `CreateVendorRate` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateVendorRate` Mutation is of type `CreateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateVendorRateData { - vendorRate_insert: VendorRate_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateVendorRate`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateVendorRateVariables } from '@dataconnect/generated'; -import { useCreateVendorRate } from '@dataconnect/generated/react' - -export default function CreateVendorRateComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateVendorRate(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateVendorRate(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorRate(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateVendorRate` Mutation requires an argument of type `CreateVendorRateVariables`: - const createVendorRateVars: CreateVendorRateVariables = { - vendorName: ..., - category: ..., - roleName: ..., - employeeWage: ..., - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., - }; - mutation.mutate(createVendorRateVars); - // Variables can be defined inline as well. - mutation.mutate({ vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createVendorRateVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorRate_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateVendorRate -You can execute the `UpdateVendorRate` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateVendorRate` Mutation requires an argument of type `UpdateVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateVendorRateVariables { - id: UUIDString; - vendorName?: string | null; - category?: VendorRateCategory | null; - roleName?: string | null; - employeeWage?: number | null; - markupPercentage?: number | null; - vendorFeePercentage?: number | null; - clientRate?: number | null; -} -``` -### Return Type -Recall that calling the `UpdateVendorRate` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateVendorRate` Mutation is of type `UpdateVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateVendorRateData { - vendorRate_update?: VendorRate_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateVendorRate`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateVendorRateVariables } from '@dataconnect/generated'; -import { useUpdateVendorRate } from '@dataconnect/generated/react' - -export default function UpdateVendorRateComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateVendorRate(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateVendorRate(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorRate(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateVendorRate` Mutation requires an argument of type `UpdateVendorRateVariables`: - const updateVendorRateVars: UpdateVendorRateVariables = { - id: ..., - vendorName: ..., // optional - category: ..., // optional - roleName: ..., // optional - employeeWage: ..., // optional - markupPercentage: ..., // optional - vendorFeePercentage: ..., // optional - clientRate: ..., // optional - }; - mutation.mutate(updateVendorRateVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., vendorName: ..., category: ..., roleName: ..., employeeWage: ..., markupPercentage: ..., vendorFeePercentage: ..., clientRate: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateVendorRateVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorRate_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteVendorRate -You can execute the `DeleteVendorRate` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteVendorRate` Mutation requires an argument of type `DeleteVendorRateVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteVendorRateVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteVendorRate` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteVendorRate` Mutation is of type `DeleteVendorRateData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteVendorRateData { - vendorRate_delete?: VendorRate_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteVendorRate`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteVendorRateVariables } from '@dataconnect/generated'; -import { useDeleteVendorRate } from '@dataconnect/generated/react' - -export default function DeleteVendorRateComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteVendorRate(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteVendorRate(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorRate(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorRate(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteVendorRate` Mutation requires an argument of type `DeleteVendorRateVariables`: - const deleteVendorRateVars: DeleteVendorRateVariables = { - id: ..., - }; - mutation.mutate(deleteVendorRateVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteVendorRateVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorRate_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateInvoice -You can execute the `CreateInvoice` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateInvoice` Mutation requires an argument of type `CreateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateInvoiceVariables { - invoiceNumber: string; - amount: number; - status: InvoiceStatus; - issueDate: TimestampString; - dueDate: TimestampString; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that calling the `CreateInvoice` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateInvoice` Mutation is of type `CreateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateInvoiceData { - invoice_insert: Invoice_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateInvoice`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateInvoiceVariables } from '@dataconnect/generated'; -import { useCreateInvoice } from '@dataconnect/generated/react' - -export default function CreateInvoiceComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateInvoice(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateInvoice(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateInvoice(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateInvoice` Mutation requires an argument of type `CreateInvoiceVariables`: - const createInvoiceVars: CreateInvoiceVariables = { - invoiceNumber: ..., - amount: ..., - status: ..., - issueDate: ..., - dueDate: ..., - disputedItems: ..., // optional - isAutoGenerated: ..., // optional - }; - mutation.mutate(createInvoiceVars); - // Variables can be defined inline as well. - mutation.mutate({ invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createInvoiceVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.invoice_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateInvoice -You can execute the `UpdateInvoice` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateInvoice` Mutation requires an argument of type `UpdateInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateInvoiceVariables { - id: UUIDString; - invoiceNumber?: string | null; - amount?: number | null; - status?: InvoiceStatus | null; - issueDate?: TimestampString | null; - dueDate?: TimestampString | null; - disputedItems?: string | null; - isAutoGenerated?: boolean | null; -} -``` -### Return Type -Recall that calling the `UpdateInvoice` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateInvoice` Mutation is of type `UpdateInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateInvoiceData { - invoice_update?: Invoice_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateInvoice`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateInvoiceVariables } from '@dataconnect/generated'; -import { useUpdateInvoice } from '@dataconnect/generated/react' - -export default function UpdateInvoiceComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateInvoice(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateInvoice(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateInvoice(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateInvoice` Mutation requires an argument of type `UpdateInvoiceVariables`: - const updateInvoiceVars: UpdateInvoiceVariables = { - id: ..., - invoiceNumber: ..., // optional - amount: ..., // optional - status: ..., // optional - issueDate: ..., // optional - dueDate: ..., // optional - disputedItems: ..., // optional - isAutoGenerated: ..., // optional - }; - mutation.mutate(updateInvoiceVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., invoiceNumber: ..., amount: ..., status: ..., issueDate: ..., dueDate: ..., disputedItems: ..., isAutoGenerated: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateInvoiceVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.invoice_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteInvoice -You can execute the `DeleteInvoice` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteInvoice` Mutation requires an argument of type `DeleteInvoiceVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteInvoiceVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteInvoice` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteInvoice` Mutation is of type `DeleteInvoiceData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteInvoiceData { - invoice_delete?: Invoice_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteInvoice`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteInvoiceVariables } from '@dataconnect/generated'; -import { useDeleteInvoice } from '@dataconnect/generated/react' - -export default function DeleteInvoiceComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteInvoice(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteInvoice(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteInvoice(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteInvoice(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteInvoice` Mutation requires an argument of type `DeleteInvoiceVariables`: - const deleteInvoiceVars: DeleteInvoiceVariables = { - id: ..., - }; - mutation.mutate(deleteInvoiceVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteInvoiceVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.invoice_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateStaff -You can execute the `CreateStaff` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateStaff(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateStaff(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateStaff` Mutation requires an argument of type `CreateStaffVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateStaffVariables { - employeeName: string; - vendorId?: UUIDString | null; - email?: string | null; - position?: string | null; - employmentType: EmploymentType; - rating?: number | null; - reliabilityScore?: number | null; - backgroundCheckStatus: BackgroundCheckStatus; - certifications?: string | null; -} -``` -### Return Type -Recall that calling the `CreateStaff` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateStaff` Mutation is of type `CreateStaffData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateStaffData { - staff_insert: Staff_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateStaff`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateStaffVariables } from '@dataconnect/generated'; -import { useCreateStaff } from '@dataconnect/generated/react' - -export default function CreateStaffComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateStaff(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateStaff(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateStaff(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateStaff(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateStaff` Mutation requires an argument of type `CreateStaffVariables`: - const createStaffVars: CreateStaffVariables = { - employeeName: ..., - vendorId: ..., // optional - email: ..., // optional - position: ..., // optional - employmentType: ..., - rating: ..., // optional - reliabilityScore: ..., // optional - backgroundCheckStatus: ..., - certifications: ..., // optional - }; - mutation.mutate(createStaffVars); - // Variables can be defined inline as well. - mutation.mutate({ employeeName: ..., vendorId: ..., email: ..., position: ..., employmentType: ..., rating: ..., reliabilityScore: ..., backgroundCheckStatus: ..., certifications: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createStaffVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.staff_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateVendor -You can execute the `CreateVendor` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateVendor` Mutation requires an argument of type `CreateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateVendorVariables { - vendorNumber: string; - legalName: string; - region: VendorRegion; - platformType: VendorPlatformType; - primaryContactEmail: string; - approvalStatus: VendorApprovalStatus; - isActive?: boolean | null; -} -``` -### Return Type -Recall that calling the `CreateVendor` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateVendor` Mutation is of type `CreateVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateVendorData { - vendor_insert: Vendor_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateVendor`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateVendorVariables } from '@dataconnect/generated'; -import { useCreateVendor } from '@dataconnect/generated/react' - -export default function CreateVendorComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateVendor(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateVendor(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendor(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateVendor` Mutation requires an argument of type `CreateVendorVariables`: - const createVendorVars: CreateVendorVariables = { - vendorNumber: ..., - legalName: ..., - region: ..., - platformType: ..., - primaryContactEmail: ..., - approvalStatus: ..., - isActive: ..., // optional - }; - mutation.mutate(createVendorVars); - // Variables can be defined inline as well. - mutation.mutate({ vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createVendorVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendor_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateVendor -You can execute the `UpdateVendor` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateVendor` Mutation requires an argument of type `UpdateVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateVendorVariables { - id: UUIDString; - vendorNumber?: string | null; - legalName?: string | null; - region?: VendorRegion | null; - platformType?: VendorPlatformType | null; - primaryContactEmail?: string | null; - approvalStatus?: VendorApprovalStatus | null; - isActive?: boolean | null; -} -``` -### Return Type -Recall that calling the `UpdateVendor` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateVendor` Mutation is of type `UpdateVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateVendorData { - vendor_update?: Vendor_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateVendor`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateVendorVariables } from '@dataconnect/generated'; -import { useUpdateVendor } from '@dataconnect/generated/react' - -export default function UpdateVendorComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateVendor(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateVendor(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendor(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateVendor` Mutation requires an argument of type `UpdateVendorVariables`: - const updateVendorVars: UpdateVendorVariables = { - id: ..., - vendorNumber: ..., // optional - legalName: ..., // optional - region: ..., // optional - platformType: ..., // optional - primaryContactEmail: ..., // optional - approvalStatus: ..., // optional - isActive: ..., // optional - }; - mutation.mutate(updateVendorVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., vendorNumber: ..., legalName: ..., region: ..., platformType: ..., primaryContactEmail: ..., approvalStatus: ..., isActive: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateVendorVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendor_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteVendor -You can execute the `DeleteVendor` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteVendor` Mutation requires an argument of type `DeleteVendorVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteVendorVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteVendor` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteVendor` Mutation is of type `DeleteVendorData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteVendorData { - vendor_delete?: Vendor_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteVendor`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteVendorVariables } from '@dataconnect/generated'; -import { useDeleteVendor } from '@dataconnect/generated/react' - -export default function DeleteVendorComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteVendor(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteVendor(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendor(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendor(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteVendor` Mutation requires an argument of type `DeleteVendorVariables`: - const deleteVendorVars: DeleteVendorVariables = { - id: ..., - }; - mutation.mutate(deleteVendorVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteVendorVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendor_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateVendorDefaultSetting -You can execute the `CreateVendorDefaultSetting` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateVendorDefaultSetting` Mutation requires an argument of type `CreateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateVendorDefaultSettingVariables { - vendorName: string; - defaultMarkupPercentage: number; - defaultVendorFeePercentage: number; -} -``` -### Return Type -Recall that calling the `CreateVendorDefaultSetting` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateVendorDefaultSetting` Mutation is of type `CreateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateVendorDefaultSettingData { - vendorDefaultSetting_insert: VendorDefaultSetting_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateVendorDefaultSetting`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateVendorDefaultSettingVariables } from '@dataconnect/generated'; -import { useCreateVendorDefaultSetting } from '@dataconnect/generated/react' - -export default function CreateVendorDefaultSettingComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateVendorDefaultSetting(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateVendorDefaultSetting(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorDefaultSetting(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateVendorDefaultSetting(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateVendorDefaultSetting` Mutation requires an argument of type `CreateVendorDefaultSettingVariables`: - const createVendorDefaultSettingVars: CreateVendorDefaultSettingVariables = { - vendorName: ..., - defaultMarkupPercentage: ..., - defaultVendorFeePercentage: ..., - }; - mutation.mutate(createVendorDefaultSettingVars); - // Variables can be defined inline as well. - mutation.mutate({ vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createVendorDefaultSettingVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorDefaultSetting_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateVendorDefaultSetting -You can execute the `UpdateVendorDefaultSetting` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateVendorDefaultSetting` Mutation requires an argument of type `UpdateVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateVendorDefaultSettingVariables { - id: UUIDString; - vendorName?: string | null; - defaultMarkupPercentage?: number | null; - defaultVendorFeePercentage?: number | null; -} -``` -### Return Type -Recall that calling the `UpdateVendorDefaultSetting` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateVendorDefaultSetting` Mutation is of type `UpdateVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateVendorDefaultSettingData { - vendorDefaultSetting_update?: VendorDefaultSetting_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateVendorDefaultSetting`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateVendorDefaultSettingVariables } from '@dataconnect/generated'; -import { useUpdateVendorDefaultSetting } from '@dataconnect/generated/react' - -export default function UpdateVendorDefaultSettingComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateVendorDefaultSetting(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateVendorDefaultSetting(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorDefaultSetting(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateVendorDefaultSetting(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateVendorDefaultSetting` Mutation requires an argument of type `UpdateVendorDefaultSettingVariables`: - const updateVendorDefaultSettingVars: UpdateVendorDefaultSettingVariables = { - id: ..., - vendorName: ..., // optional - defaultMarkupPercentage: ..., // optional - defaultVendorFeePercentage: ..., // optional - }; - mutation.mutate(updateVendorDefaultSettingVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., vendorName: ..., defaultMarkupPercentage: ..., defaultVendorFeePercentage: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateVendorDefaultSettingVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorDefaultSetting_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteVendorDefaultSetting -You can execute the `DeleteVendorDefaultSetting` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteVendorDefaultSetting` Mutation requires an argument of type `DeleteVendorDefaultSettingVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteVendorDefaultSettingVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteVendorDefaultSetting` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteVendorDefaultSetting` Mutation is of type `DeleteVendorDefaultSettingData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteVendorDefaultSettingData { - vendorDefaultSetting_delete?: VendorDefaultSetting_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteVendorDefaultSetting`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteVendorDefaultSettingVariables } from '@dataconnect/generated'; -import { useDeleteVendorDefaultSetting } from '@dataconnect/generated/react' - -export default function DeleteVendorDefaultSettingComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteVendorDefaultSetting(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteVendorDefaultSetting(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorDefaultSetting(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteVendorDefaultSetting(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteVendorDefaultSetting` Mutation requires an argument of type `DeleteVendorDefaultSettingVariables`: - const deleteVendorDefaultSettingVars: DeleteVendorDefaultSettingVariables = { - id: ..., - }; - mutation.mutate(deleteVendorDefaultSettingVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteVendorDefaultSettingVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.vendorDefaultSetting_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## CreateBusiness -You can execute the `CreateBusiness` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useCreateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useCreateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `CreateBusiness` Mutation requires an argument of type `CreateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface CreateBusinessVariables { - businessName: string; - contactName: string; - email?: string | null; - sector?: BusinessSector | null; - rateGroup: BusinessRateGroup; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that calling the `CreateBusiness` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `CreateBusiness` Mutation is of type `CreateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface CreateBusinessData { - business_insert: Business_Key; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `CreateBusiness`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, CreateBusinessVariables } from '@dataconnect/generated'; -import { useCreateBusiness } from '@dataconnect/generated/react' - -export default function CreateBusinessComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useCreateBusiness(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useCreateBusiness(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useCreateBusiness(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useCreateBusiness` Mutation requires an argument of type `CreateBusinessVariables`: - const createBusinessVars: CreateBusinessVariables = { - businessName: ..., - contactName: ..., - email: ..., // optional - sector: ..., // optional - rateGroup: ..., - status: ..., // optional - }; - mutation.mutate(createBusinessVars); - // Variables can be defined inline as well. - mutation.mutate({ businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(createBusinessVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.business_insert); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## UpdateBusiness -You can execute the `UpdateBusiness` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useUpdateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useUpdateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `UpdateBusiness` Mutation requires an argument of type `UpdateBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface UpdateBusinessVariables { - id: UUIDString; - businessName?: string | null; - contactName?: string | null; - email?: string | null; - sector?: BusinessSector | null; - rateGroup?: BusinessRateGroup | null; - status?: BusinessStatus | null; -} -``` -### Return Type -Recall that calling the `UpdateBusiness` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `UpdateBusiness` Mutation is of type `UpdateBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface UpdateBusinessData { - business_update?: Business_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `UpdateBusiness`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, UpdateBusinessVariables } from '@dataconnect/generated'; -import { useUpdateBusiness } from '@dataconnect/generated/react' - -export default function UpdateBusinessComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useUpdateBusiness(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useUpdateBusiness(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useUpdateBusiness(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useUpdateBusiness` Mutation requires an argument of type `UpdateBusinessVariables`: - const updateBusinessVars: UpdateBusinessVariables = { - id: ..., - businessName: ..., // optional - contactName: ..., // optional - email: ..., // optional - sector: ..., // optional - rateGroup: ..., // optional - status: ..., // optional - }; - mutation.mutate(updateBusinessVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., businessName: ..., contactName: ..., email: ..., sector: ..., rateGroup: ..., status: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(updateBusinessVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.business_update); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - -## DeleteBusiness -You can execute the `DeleteBusiness` Mutation using the `UseMutationResult` object returned by the following Mutation hook function (which is defined in [dataconnect-generated/react/index.d.ts](./index.d.ts)): -```javascript -useDeleteBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` -You can also pass in a `DataConnect` instance to the Mutation hook function. -```javascript -useDeleteBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -``` - -### Variables -The `DeleteBusiness` Mutation requires an argument of type `DeleteBusinessVariables`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: - -```javascript -export interface DeleteBusinessVariables { - id: UUIDString; -} -``` -### Return Type -Recall that calling the `DeleteBusiness` Mutation hook function returns a `UseMutationResult` object. This object holds the state of your Mutation, including whether the Mutation is loading, has completed, or has succeeded/failed, among other things. - -To check the status of a Mutation, use the `UseMutationResult.status` field. You can also check for pending / success / error status using the `UseMutationResult.isPending`, `UseMutationResult.isSuccess`, and `UseMutationResult.isError` fields. - -To execute the Mutation, call `UseMutationResult.mutate()`. This function executes the Mutation, but does not return the data from the Mutation. - -To access the data returned by a Mutation, use the `UseMutationResult.data` field. The data for the `DeleteBusiness` Mutation is of type `DeleteBusinessData`, which is defined in [dataconnect-generated/index.d.ts](../index.d.ts). It has the following fields: -```javascript -export interface DeleteBusinessData { - business_delete?: Business_Key | null; -} -``` - -To learn more about the `UseMutationResult` object, see the [TanStack React Query documentation](https://tanstack.com/query/v5/docs/framework/react/reference/useMutation). - -### Using `DeleteBusiness`'s Mutation hook function - -```javascript -import { getDataConnect } from 'firebase/data-connect'; -import { connectorConfig, DeleteBusinessVariables } from '@dataconnect/generated'; -import { useDeleteBusiness } from '@dataconnect/generated/react' - -export default function DeleteBusinessComponent() { - // Call the Mutation hook function to get a `UseMutationResult` object which holds the state of your Mutation. - const mutation = useDeleteBusiness(); - - // You can also pass in a `DataConnect` instance to the Mutation hook function. - const dataConnect = getDataConnect(connectorConfig); - const mutation = useDeleteBusiness(dataConnect); - - // You can also pass in a `useDataConnectMutationOptions` object to the Mutation hook function. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteBusiness(options); - - // You can also pass both a `DataConnect` instance and a `useDataConnectMutationOptions` object. - const dataConnect = getDataConnect(connectorConfig); - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - const mutation = useDeleteBusiness(dataConnect, options); - - // After calling the Mutation hook function, you must call `UseMutationResult.mutate()` to execute the Mutation. - // The `useDeleteBusiness` Mutation requires an argument of type `DeleteBusinessVariables`: - const deleteBusinessVars: DeleteBusinessVariables = { - id: ..., - }; - mutation.mutate(deleteBusinessVars); - // Variables can be defined inline as well. - mutation.mutate({ id: ..., }); - - // You can also pass in a `useDataConnectMutationOptions` object to `UseMutationResult.mutate()`. - const options = { - onSuccess: () => { console.log('Mutation succeeded!'); } - }; - mutation.mutate(deleteBusinessVars, options); - - // Then, you can render your component dynamically based on the status of the Mutation. - if (mutation.isPending) { - return
Loading...
; - } - - if (mutation.isError) { - return
Error: {mutation.error.message}
; - } - - // If the Mutation is successful, you can access the data returned using the `UseMutationResult.data` field. - if (mutation.isSuccess) { - console.log(mutation.data.business_delete); - } - return
Mutation execution {mutation.isSuccess ? 'successful' : 'failed'}!
; -} -``` - diff --git a/internal-api-harness/src/dataconnect-generated/react/esm/index.esm.js b/internal-api-harness/src/dataconnect-generated/react/esm/index.esm.js deleted file mode 100644 index 8fcd37c9..00000000 --- a/internal-api-harness/src/dataconnect-generated/react/esm/index.esm.js +++ /dev/null @@ -1,269 +0,0 @@ -import { listBusinessRef, getBusinessByIdRef, filterBusinessRef, createEventRef, updateEventRef, deleteEventRef, listVendorDefaultSettingsRef, getVendorDefaultSettingByIdRef, filterVendorDefaultSettingsRef, createVendorRateRef, updateVendorRateRef, deleteVendorRateRef, listVendorRateRef, getVendorRateByIdRef, filterVendorRatesRef, listEventsRef, getEventByIdRef, filterEventsRef, createInvoiceRef, updateInvoiceRef, deleteInvoiceRef, listInvoiceRef, getInvoiceByIdRef, filterInvoicesRef, createStaffRef, listStaffRef, createVendorRef, updateVendorRef, deleteVendorRef, listVendorRef, getVendorByIdRef, filterVendorsRef, createVendorDefaultSettingRef, updateVendorDefaultSettingRef, deleteVendorDefaultSettingRef, createBusinessRef, updateBusinessRef, deleteBusinessRef, connectorConfig } from '../../esm/index.esm.js'; -import { validateArgs, CallerSdkTypeEnum } from 'firebase/data-connect'; -import { useDataConnectQuery, useDataConnectMutation, validateReactArgs } from '@tanstack-query-firebase/react/data-connect'; - - -export function useListBusiness(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listBusinessRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetBusinessById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getBusinessByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterBusiness(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterBusinessRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListVendorDefaultSettings(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorDefaultSettingsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetVendorDefaultSettingById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorDefaultSettingByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterVendorDefaultSettings(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorDefaultSettingsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListVendorRate(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRateRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetVendorRateById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorRateByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterVendorRates(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorRatesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useListEvents(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listEventsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetEventById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getEventByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterEvents(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterEventsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListInvoice(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listInvoiceRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetInvoiceById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getInvoiceByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterInvoices(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterInvoicesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateStaff(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createStaffRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListStaff(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listStaffRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -export function useListVendor(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useGetVendorById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useFilterVendors(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -export function useCreateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useCreateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useUpdateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -export function useDeleteBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} diff --git a/internal-api-harness/src/dataconnect-generated/react/esm/package.json b/internal-api-harness/src/dataconnect-generated/react/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/internal-api-harness/src/dataconnect-generated/react/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/internal-api-harness/src/dataconnect-generated/react/index.cjs.js b/internal-api-harness/src/dataconnect-generated/react/index.cjs.js deleted file mode 100644 index 3ecd5152..00000000 --- a/internal-api-harness/src/dataconnect-generated/react/index.cjs.js +++ /dev/null @@ -1,269 +0,0 @@ -const { listBusinessRef, getBusinessByIdRef, filterBusinessRef, createEventRef, updateEventRef, deleteEventRef, listVendorDefaultSettingsRef, getVendorDefaultSettingByIdRef, filterVendorDefaultSettingsRef, createVendorRateRef, updateVendorRateRef, deleteVendorRateRef, listVendorRateRef, getVendorRateByIdRef, filterVendorRatesRef, listEventsRef, getEventByIdRef, filterEventsRef, createInvoiceRef, updateInvoiceRef, deleteInvoiceRef, listInvoiceRef, getInvoiceByIdRef, filterInvoicesRef, createStaffRef, listStaffRef, createVendorRef, updateVendorRef, deleteVendorRef, listVendorRef, getVendorByIdRef, filterVendorsRef, createVendorDefaultSettingRef, updateVendorDefaultSettingRef, deleteVendorDefaultSettingRef, createBusinessRef, updateBusinessRef, deleteBusinessRef, connectorConfig } = require('../index.cjs.js'); -const { validateArgs, CallerSdkTypeEnum } = require('firebase/data-connect'); -const { useDataConnectQuery, useDataConnectMutation, validateReactArgs } = require('@tanstack-query-firebase/react/data-connect'); - - -exports.useListBusiness = function useListBusiness(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listBusinessRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetBusinessById = function useGetBusinessById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getBusinessByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterBusiness = function useFilterBusiness(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterBusinessRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateEvent = function useCreateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateEvent = function useUpdateEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteEvent = function useDeleteEvent(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteEventRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListVendorDefaultSettings = function useListVendorDefaultSettings(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorDefaultSettingsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetVendorDefaultSettingById = function useGetVendorDefaultSettingById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorDefaultSettingByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterVendorDefaultSettings = function useFilterVendorDefaultSettings(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorDefaultSettingsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateVendorRate = function useCreateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateVendorRate = function useUpdateVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteVendorRate = function useDeleteVendorRate(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRateRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListVendorRate = function useListVendorRate(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRateRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetVendorRateById = function useGetVendorRateById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorRateByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterVendorRates = function useFilterVendorRates(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorRatesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useListEvents = function useListEvents(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listEventsRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetEventById = function useGetEventById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getEventByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterEvents = function useFilterEvents(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterEventsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateInvoice = function useCreateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateInvoice = function useUpdateInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteInvoice = function useDeleteInvoice(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteInvoiceRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListInvoice = function useListInvoice(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listInvoiceRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetInvoiceById = function useGetInvoiceById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getInvoiceByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterInvoices = function useFilterInvoices(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterInvoicesRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateStaff = function useCreateStaff(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createStaffRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListStaff = function useListStaff(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listStaffRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateVendor = function useCreateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateVendor = function useUpdateVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteVendor = function useDeleteVendor(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - - -exports.useListVendor = function useListVendor(dcOrOptions, options) { - const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); - const ref = listVendorRef(dcInstance); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useGetVendorById = function useGetVendorById(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); - const ref = getVendorByIdRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useFilterVendors = function useFilterVendors(dcOrVars, varsOrOptions, options) { - const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, false); - const ref = filterVendorsRef(dcInstance, inputVars); - return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} -exports.useCreateVendorDefaultSetting = function useCreateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateVendorDefaultSetting = function useUpdateVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteVendorDefaultSetting = function useDeleteVendorDefaultSetting(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteVendorDefaultSettingRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useCreateBusiness = function useCreateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return createBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useUpdateBusiness = function useUpdateBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return updateBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} - -exports.useDeleteBusiness = function useDeleteBusiness(dcOrOptions, options) { - const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); - function refFactory(vars) { - return deleteBusinessRef(dcInstance, vars); - } - return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); -} diff --git a/internal-api-harness/src/dataconnect-generated/react/index.d.ts b/internal-api-harness/src/dataconnect-generated/react/index.d.ts deleted file mode 100644 index 18a7afb1..00000000 --- a/internal-api-harness/src/dataconnect-generated/react/index.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { ListBusinessData, GetBusinessByIdData, GetBusinessByIdVariables, FilterBusinessData, FilterBusinessVariables, CreateEventData, CreateEventVariables, UpdateEventData, UpdateEventVariables, DeleteEventData, DeleteEventVariables, ListVendorDefaultSettingsData, GetVendorDefaultSettingByIdData, GetVendorDefaultSettingByIdVariables, FilterVendorDefaultSettingsData, FilterVendorDefaultSettingsVariables, CreateVendorRateData, CreateVendorRateVariables, UpdateVendorRateData, UpdateVendorRateVariables, DeleteVendorRateData, DeleteVendorRateVariables, ListVendorRateData, GetVendorRateByIdData, GetVendorRateByIdVariables, FilterVendorRatesData, FilterVendorRatesVariables, ListEventsData, GetEventByIdData, GetEventByIdVariables, FilterEventsData, FilterEventsVariables, CreateInvoiceData, CreateInvoiceVariables, UpdateInvoiceData, UpdateInvoiceVariables, DeleteInvoiceData, DeleteInvoiceVariables, ListInvoiceData, GetInvoiceByIdData, GetInvoiceByIdVariables, FilterInvoicesData, FilterInvoicesVariables, CreateStaffData, CreateStaffVariables, ListStaffData, CreateVendorData, CreateVendorVariables, UpdateVendorData, UpdateVendorVariables, DeleteVendorData, DeleteVendorVariables, ListVendorData, GetVendorByIdData, GetVendorByIdVariables, FilterVendorsData, FilterVendorsVariables, CreateVendorDefaultSettingData, CreateVendorDefaultSettingVariables, UpdateVendorDefaultSettingData, UpdateVendorDefaultSettingVariables, DeleteVendorDefaultSettingData, DeleteVendorDefaultSettingVariables, CreateBusinessData, CreateBusinessVariables, UpdateBusinessData, UpdateBusinessVariables, DeleteBusinessData, DeleteBusinessVariables } from '../'; -import { UseDataConnectQueryResult, useDataConnectQueryOptions, UseDataConnectMutationResult, useDataConnectMutationOptions} from '@tanstack-query-firebase/react/data-connect'; -import { UseQueryResult, UseMutationResult} from '@tanstack/react-query'; -import { DataConnect } from 'firebase/data-connect'; -import { FirebaseError } from 'firebase/app'; - - -export function useListBusiness(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListBusiness(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetBusinessById(vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetBusinessById(dc: DataConnect, vars: GetBusinessByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterBusiness(vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterBusiness(dc: DataConnect, vars?: FilterBusinessVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteEvent(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteEvent(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListVendorDefaultSettings(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListVendorDefaultSettings(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetVendorDefaultSettingById(vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetVendorDefaultSettingById(dc: DataConnect, vars: GetVendorDefaultSettingByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterVendorDefaultSettings(vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterVendorDefaultSettings(dc: DataConnect, vars?: FilterVendorDefaultSettingsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteVendorRate(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteVendorRate(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListVendorRate(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListVendorRate(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetVendorRateById(vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetVendorRateById(dc: DataConnect, vars: GetVendorRateByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterVendorRates(vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterVendorRates(dc: DataConnect, vars?: FilterVendorRatesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useListEvents(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListEvents(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetEventById(vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetEventById(dc: DataConnect, vars: GetEventByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterEvents(vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterEvents(dc: DataConnect, vars?: FilterEventsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteInvoice(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteInvoice(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListInvoice(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListInvoice(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetInvoiceById(vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetInvoiceById(dc: DataConnect, vars: GetInvoiceByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterInvoices(vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterInvoices(dc: DataConnect, vars?: FilterInvoicesVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateStaff(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateStaff(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListStaff(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListStaff(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteVendor(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteVendor(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useListVendor(options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useListVendor(dc: DataConnect, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useGetVendorById(vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useGetVendorById(dc: DataConnect, vars: GetVendorByIdVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useFilterVendors(vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; -export function useFilterVendors(dc: DataConnect, vars?: FilterVendorsVariables, options?: useDataConnectQueryOptions): UseDataConnectQueryResult; - -export function useCreateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteVendorDefaultSetting(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteVendorDefaultSetting(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useCreateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useCreateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useUpdateBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useUpdateBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; - -export function useDeleteBusiness(options?: useDataConnectMutationOptions): UseDataConnectMutationResult; -export function useDeleteBusiness(dc: DataConnect, options?: useDataConnectMutationOptions): UseDataConnectMutationResult; diff --git a/internal-api-harness/src/dataconnect-generated/react/package.json b/internal-api-harness/src/dataconnect-generated/react/package.json deleted file mode 100644 index 512c7ec3..00000000 --- a/internal-api-harness/src/dataconnect-generated/react/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@dataconnect/generated-react", - "version": "1.0.0", - "author": "Firebase (https://firebase.google.com/)", - "description": "Generated SDK For krow-connector", - "license": "Apache-2.0", - "engines": { - "node": " >=18.0" - }, - "typings": "index.d.ts", - "main": "index.cjs.js", - "module": "esm/index.esm.js", - "browser": "esm/index.esm.js", - "peerDependencies": { - "@tanstack-query-firebase/react": "^2.0.0" - } -} \ No newline at end of file