From 0a0aca3c5de5771609dd4ac83960cabec511479b Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 3 Jul 2024 11:15:05 -0700 Subject: [PATCH 1/2] Removed unnecessary rtdb changes --- .../data-connect.authtokenprovider.md | 61 ++ .../data-connect.cancellableoperation.md | 43 ++ docs-devsite/data-connect.connectorconfig.md | 51 ++ docs-devsite/data-connect.dataconnect.md | 124 ++++ .../data-connect.dataconnectoptions.md | 34 ++ .../data-connect.dataconnectresult.md | 32 ++ .../data-connect.dataconnectsubscription.md | 51 ++ .../data-connect.dataconnecttransport.md | 104 ++++ .../data-connect.firebaseauthprovider.md | 105 ++++ docs-devsite/data-connect.md | 536 ++++++++++++++++++ docs-devsite/data-connect.mutationpromise.md | 21 + docs-devsite/data-connect.mutationref.md | 32 ++ docs-devsite/data-connect.mutationresponse.md | 19 + docs-devsite/data-connect.mutationresult.md | 34 ++ docs-devsite/data-connect.operationref.md | 58 ++ docs-devsite/data-connect.opresult.md | 49 ++ docs-devsite/data-connect.querypromise.md | 21 + docs-devsite/data-connect.queryref.md | 34 ++ docs-devsite/data-connect.queryresponse.md | 19 + docs-devsite/data-connect.queryresult.md | 43 ++ docs-devsite/data-connect.refinfo.md | 51 ++ docs-devsite/data-connect.sender.md | 40 ++ docs-devsite/data-connect.serializedref.md | 34 ++ .../data-connect.subscriptionoptions.md | 51 ++ docs-devsite/data-connect.transportoptions.md | 51 ++ packages/data-connect/karma.conf.js | 34 ++ packages/database/src/api/Reference_impl.ts | 1 - .../database/test/exp/integration.test.ts | 29 +- 28 files changed, 1735 insertions(+), 27 deletions(-) create mode 100644 docs-devsite/data-connect.authtokenprovider.md create mode 100644 docs-devsite/data-connect.cancellableoperation.md create mode 100644 docs-devsite/data-connect.connectorconfig.md create mode 100644 docs-devsite/data-connect.dataconnect.md create mode 100644 docs-devsite/data-connect.dataconnectoptions.md create mode 100644 docs-devsite/data-connect.dataconnectresult.md create mode 100644 docs-devsite/data-connect.dataconnectsubscription.md create mode 100644 docs-devsite/data-connect.dataconnecttransport.md create mode 100644 docs-devsite/data-connect.firebaseauthprovider.md create mode 100644 docs-devsite/data-connect.md create mode 100644 docs-devsite/data-connect.mutationpromise.md create mode 100644 docs-devsite/data-connect.mutationref.md create mode 100644 docs-devsite/data-connect.mutationresponse.md create mode 100644 docs-devsite/data-connect.mutationresult.md create mode 100644 docs-devsite/data-connect.operationref.md create mode 100644 docs-devsite/data-connect.opresult.md create mode 100644 docs-devsite/data-connect.querypromise.md create mode 100644 docs-devsite/data-connect.queryref.md create mode 100644 docs-devsite/data-connect.queryresponse.md create mode 100644 docs-devsite/data-connect.queryresult.md create mode 100644 docs-devsite/data-connect.refinfo.md create mode 100644 docs-devsite/data-connect.sender.md create mode 100644 docs-devsite/data-connect.serializedref.md create mode 100644 docs-devsite/data-connect.subscriptionoptions.md create mode 100644 docs-devsite/data-connect.transportoptions.md create mode 100644 packages/data-connect/karma.conf.js diff --git a/docs-devsite/data-connect.authtokenprovider.md b/docs-devsite/data-connect.authtokenprovider.md new file mode 100644 index 00000000000..0dd0a7ae6f4 --- /dev/null +++ b/docs-devsite/data-connect.authtokenprovider.md @@ -0,0 +1,61 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# AuthTokenProvider interface +Signature: + +```typescript +export declare interface AuthTokenProvider +``` + +## Methods + +| Method | Description | +| --- | --- | +| [addTokenChangeListener(listener)](./data-connect.authtokenprovider.md#authtokenprovideraddtokenchangelistener) | | +| [getToken(forceRefresh)](./data-connect.authtokenprovider.md#authtokenprovidergettoken) | | + +## AuthTokenProvider.addTokenChangeListener() + +Signature: + +```typescript +addTokenChangeListener(listener: AuthTokenListener): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| listener | [AuthTokenListener](./data-connect.md#authtokenlistener) | | + +Returns: + +void + +## AuthTokenProvider.getToken() + +Signature: + +```typescript +getToken(forceRefresh: boolean): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| forceRefresh | boolean | | + +Returns: + +Promise<FirebaseAuthTokenData \| null> + diff --git a/docs-devsite/data-connect.cancellableoperation.md b/docs-devsite/data-connect.cancellableoperation.md new file mode 100644 index 00000000000..3c5e89a42c0 --- /dev/null +++ b/docs-devsite/data-connect.cancellableoperation.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# CancellableOperation interface +Signature: + +```typescript +export declare interface CancellableOperation extends PromiseLike<{ + data: T; +}> +``` +Extends: PromiseLike<{ data: T; }> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [cancel](./data-connect.cancellableoperation.md#cancellableoperationcancel) | () => void | | +| [data](./data-connect.cancellableoperation.md#cancellableoperationdata) | T | | + +## CancellableOperation.cancel + +Signature: + +```typescript +cancel: () => void; +``` + +## CancellableOperation.data + +Signature: + +```typescript +data: T; +``` diff --git a/docs-devsite/data-connect.connectorconfig.md b/docs-devsite/data-connect.connectorconfig.md new file mode 100644 index 00000000000..b4998e93a14 --- /dev/null +++ b/docs-devsite/data-connect.connectorconfig.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# ConnectorConfig interface +Connector Config for calling Data Connect backend. + +Signature: + +```typescript +export declare interface ConnectorConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [connector](./data-connect.connectorconfig.md#connectorconfigconnector) | string | | +| [location](./data-connect.connectorconfig.md#connectorconfiglocation) | string | | +| [service](./data-connect.connectorconfig.md#connectorconfigservice) | string | | + +## ConnectorConfig.connector + +Signature: + +```typescript +connector: string; +``` + +## ConnectorConfig.location + +Signature: + +```typescript +location: string; +``` + +## ConnectorConfig.service + +Signature: + +```typescript +service: string; +``` diff --git a/docs-devsite/data-connect.dataconnect.md b/docs-devsite/data-connect.dataconnect.md new file mode 100644 index 00000000000..3b72473eae8 --- /dev/null +++ b/docs-devsite/data-connect.dataconnect.md @@ -0,0 +1,124 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DataConnect class +Class representing Firebase Data Connect + +Signature: + +```typescript +export declare class DataConnect +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(app, dataConnectOptions, \_authProvider)](./data-connect.dataconnect.md#dataconnectconstructor) | | Constructs a new instance of the DataConnect class | + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [app](./data-connect.dataconnect.md#dataconnectapp) | | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | | +| [initialized](./data-connect.dataconnect.md#dataconnectinitialized) | | boolean | | +| [isEmulator](./data-connect.dataconnect.md#dataconnectisemulator) | | boolean | | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [enableEmulator(transportOptions)](./data-connect.dataconnect.md#dataconnectenableemulator) | | | +| [getSettings()](./data-connect.dataconnect.md#dataconnectgetsettings) | | | +| [setInitialized()](./data-connect.dataconnect.md#dataconnectsetinitialized) | | | + +## DataConnect.(constructor) + +Constructs a new instance of the `DataConnect` class + +Signature: + +```typescript +constructor(app: FirebaseApp, dataConnectOptions: DataConnectOptions, _authProvider: Provider); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | | +| dataConnectOptions | [DataConnectOptions](./data-connect.dataconnectoptions.md#dataconnectoptions_interface) | | +| \_authProvider | Provider<FirebaseAuthInternalName> | | + +## DataConnect.app + +Signature: + +```typescript +readonly app: FirebaseApp; +``` + +## DataConnect.initialized + +Signature: + +```typescript +initialized: boolean; +``` + +## DataConnect.isEmulator + +Signature: + +```typescript +isEmulator: boolean; +``` + +## DataConnect.enableEmulator() + +Signature: + +```typescript +enableEmulator(transportOptions: TransportOptions): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| transportOptions | [TransportOptions](./data-connect.transportoptions.md#transportoptions_interface) | | + +Returns: + +void + +## DataConnect.getSettings() + +Signature: + +```typescript +getSettings(): ConnectorConfig; +``` +Returns: + +[ConnectorConfig](./data-connect.connectorconfig.md#connectorconfig_interface) + +## DataConnect.setInitialized() + +Signature: + +```typescript +setInitialized(): void; +``` +Returns: + +void + diff --git a/docs-devsite/data-connect.dataconnectoptions.md b/docs-devsite/data-connect.dataconnectoptions.md new file mode 100644 index 00000000000..8428cb65ca4 --- /dev/null +++ b/docs-devsite/data-connect.dataconnectoptions.md @@ -0,0 +1,34 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DataConnectOptions interface +DataConnectOptions including project id + +Signature: + +```typescript +export declare interface DataConnectOptions extends ConnectorConfig +``` +Extends: [ConnectorConfig](./data-connect.connectorconfig.md#connectorconfig_interface) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [projectId](./data-connect.dataconnectoptions.md#dataconnectoptionsprojectid) | string | | + +## DataConnectOptions.projectId + +Signature: + +```typescript +projectId: string; +``` diff --git a/docs-devsite/data-connect.dataconnectresult.md b/docs-devsite/data-connect.dataconnectresult.md new file mode 100644 index 00000000000..788eef76869 --- /dev/null +++ b/docs-devsite/data-connect.dataconnectresult.md @@ -0,0 +1,32 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DataConnectResult interface +Signature: + +```typescript +export declare interface DataConnectResult extends OpResult +``` +Extends: [OpResult](./data-connect.opresult.md#opresult_interface)<Data> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [ref](./data-connect.dataconnectresult.md#dataconnectresultref) | [OperationRef](./data-connect.operationref.md#operationref_interface)<Data, Variables> | | + +## DataConnectResult.ref + +Signature: + +```typescript +ref: OperationRef; +``` diff --git a/docs-devsite/data-connect.dataconnectsubscription.md b/docs-devsite/data-connect.dataconnectsubscription.md new file mode 100644 index 00000000000..8eb7d303faa --- /dev/null +++ b/docs-devsite/data-connect.dataconnectsubscription.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DataConnectSubscription interface +Representation of user provided subscription options. + +Signature: + +```typescript +export declare interface DataConnectSubscription +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [errCallback](./data-connect.dataconnectsubscription.md#dataconnectsubscriptionerrcallback) | (e?: [FirebaseError](./util.firebaseerror.md#firebaseerror_class)) => void | | +| [unsubscribe](./data-connect.dataconnectsubscription.md#dataconnectsubscriptionunsubscribe) | () => void | | +| [userCallback](./data-connect.dataconnectsubscription.md#dataconnectsubscriptionusercallback) | [OnResultSubscription](./data-connect.md#onresultsubscription)<Data, Variables> | | + +## DataConnectSubscription.errCallback + +Signature: + +```typescript +errCallback?: (e?: FirebaseError) => void; +``` + +## DataConnectSubscription.unsubscribe + +Signature: + +```typescript +unsubscribe: () => void; +``` + +## DataConnectSubscription.userCallback + +Signature: + +```typescript +userCallback: OnResultSubscription; +``` diff --git a/docs-devsite/data-connect.dataconnecttransport.md b/docs-devsite/data-connect.dataconnecttransport.md new file mode 100644 index 00000000000..f84693e0c2f --- /dev/null +++ b/docs-devsite/data-connect.dataconnecttransport.md @@ -0,0 +1,104 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# DataConnectTransport interface +Signature: + +```typescript +export declare interface DataConnectTransport +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [onTokenChanged](./data-connect.dataconnecttransport.md#dataconnecttransportontokenchanged) | (token: string \| null) => void | | + +## Methods + +| Method | Description | +| --- | --- | +| [invokeMutation(queryName, body)](./data-connect.dataconnecttransport.md#dataconnecttransportinvokemutation) | | +| [invokeQuery(queryName, body)](./data-connect.dataconnecttransport.md#dataconnecttransportinvokequery) | | +| [useEmulator(host, port, sslEnabled)](./data-connect.dataconnecttransport.md#dataconnecttransportuseemulator) | | + +## DataConnectTransport.onTokenChanged + +Signature: + +```typescript +onTokenChanged: (token: string | null) => void; +``` + +## DataConnectTransport.invokeMutation() + +Signature: + +```typescript +invokeMutation(queryName: string, body?: U): PromiseLike<{ + data: T; + errors: Error[]; + }>; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| queryName | string | | +| body | U | | + +Returns: + +PromiseLike<{ data: T; errors: Error\[\]; }> + +## DataConnectTransport.invokeQuery() + +Signature: + +```typescript +invokeQuery(queryName: string, body?: U): PromiseLike<{ + data: T; + errors: Error[]; + }>; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| queryName | string | | +| body | U | | + +Returns: + +PromiseLike<{ data: T; errors: Error\[\]; }> + +## DataConnectTransport.useEmulator() + +Signature: + +```typescript +useEmulator(host: string, port?: number, sslEnabled?: boolean): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| host | string | | +| port | number | | +| sslEnabled | boolean | | + +Returns: + +void + diff --git a/docs-devsite/data-connect.firebaseauthprovider.md b/docs-devsite/data-connect.firebaseauthprovider.md new file mode 100644 index 00000000000..27d2a7be277 --- /dev/null +++ b/docs-devsite/data-connect.firebaseauthprovider.md @@ -0,0 +1,105 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# FirebaseAuthProvider class +Signature: + +```typescript +export declare class FirebaseAuthProvider implements AuthTokenProvider +``` +Implements: [AuthTokenProvider](./data-connect.authtokenprovider.md#authtokenprovider_interface) + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(\_appName, \_options, \_authProvider)](./data-connect.firebaseauthprovider.md#firebaseauthproviderconstructor) | | Constructs a new instance of the FirebaseAuthProvider class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [addTokenChangeListener(listener)](./data-connect.firebaseauthprovider.md#firebaseauthprovideraddtokenchangelistener) | | | +| [getToken(forceRefresh)](./data-connect.firebaseauthprovider.md#firebaseauthprovidergettoken) | | | +| [removeTokenChangeListener(listener)](./data-connect.firebaseauthprovider.md#firebaseauthproviderremovetokenchangelistener) | | | + +## FirebaseAuthProvider.(constructor) + +Constructs a new instance of the `FirebaseAuthProvider` class + +Signature: + +```typescript +constructor(_appName: string, _options: FirebaseOptions, _authProvider: Provider); +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| \_appName | string | | +| \_options | [FirebaseOptions](./app.firebaseoptions.md#firebaseoptions_interface) | | +| \_authProvider | Provider<FirebaseAuthInternalName> | | + +## FirebaseAuthProvider.addTokenChangeListener() + +Signature: + +```typescript +addTokenChangeListener(listener: AuthTokenListener): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| listener | [AuthTokenListener](./data-connect.md#authtokenlistener) | | + +Returns: + +void + +## FirebaseAuthProvider.getToken() + +Signature: + +```typescript +getToken(forceRefresh: boolean): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| forceRefresh | boolean | | + +Returns: + +Promise<FirebaseAuthTokenData \| null> + +## FirebaseAuthProvider.removeTokenChangeListener() + +Signature: + +```typescript +removeTokenChangeListener(listener: (token: string | null) => void): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| listener | (token: string \| null) => void | | + +Returns: + +void + diff --git a/docs-devsite/data-connect.md b/docs-devsite/data-connect.md new file mode 100644 index 00000000000..36603f6dcd7 --- /dev/null +++ b/docs-devsite/data-connect.md @@ -0,0 +1,536 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# data-connect package +Firebase Data Connect + +## Functions + +| Function | Description | +| --- | --- | +| function(app, ...) | +| [getDataConnect(app, options)](./data-connect.md#getdataconnect_4a1329a) | Initialize DataConnect instance | +| function(dataConnect, ...) | +| [terminate(dataConnect)](./data-connect.md#terminate_43d8d88) | Delete DataConnect instance | +| function(dc, ...) | +| [connectDataConnectEmulator(dc, host, port, sslEnabled)](./data-connect.md#connectdataconnectemulator_842a91d) | Connect to the DataConnect Emulator | +| function(dcInstance, ...) | +| [mutationRef(dcInstance, mutationName)](./data-connect.md#mutationref_48ae5fa) | Creates a MutationRef | +| [mutationRef(dcInstance, mutationName, variables)](./data-connect.md#mutationref_1511672) | | +| [queryRef(dcInstance, queryName)](./data-connect.md#queryref_d968e5d) | Execute Query | +| [queryRef(dcInstance, queryName, variables)](./data-connect.md#queryref_6179f74) | Execute Query | +| function(logLevel, ...) | +| [setLogLevel(logLevel)](./data-connect.md#setloglevel_697d53a) | | +| function(mutationRef, ...) | +| [executeMutation(mutationRef)](./data-connect.md#executemutation_e8103b9) | Execute Mutation | +| function(options, ...) | +| [getDataConnect(options)](./data-connect.md#getdataconnect_f991922) | Initialize DataConnect instance | +| function(queryRef, ...) | +| [executeQuery(queryRef)](./data-connect.md#executequery_692a270) | Execute Query | +| function(queryRefOrSerializedResult, ...) | +| [subscribe(queryRefOrSerializedResult, observer)](./data-connect.md#subscribe_b2b4b07) | Subscribe to a QueryRef | +| [subscribe(queryRefOrSerializedResult, onNext, onError, onComplete)](./data-connect.md#subscribe_c02958e) | Subscribe to a QueryRef | +| function(serializedRef, ...) | +| [toQueryRef(serializedRef)](./data-connect.md#toqueryref_2c70e31) | Converts serialized ref to query ref | + +## Classes + +| Class | Description | +| --- | --- | +| [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | Class representing Firebase Data Connect | +| [FirebaseAuthProvider](./data-connect.firebaseauthprovider.md#firebaseauthprovider_class) | | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [AuthTokenProvider](./data-connect.authtokenprovider.md#authtokenprovider_interface) | | +| [CancellableOperation](./data-connect.cancellableoperation.md#cancellableoperation_interface) | | +| [ConnectorConfig](./data-connect.connectorconfig.md#connectorconfig_interface) | Connector Config for calling Data Connect backend. | +| [DataConnectOptions](./data-connect.dataconnectoptions.md#dataconnectoptions_interface) | DataConnectOptions including project id | +| [DataConnectResult](./data-connect.dataconnectresult.md#dataconnectresult_interface) | | +| [DataConnectSubscription](./data-connect.dataconnectsubscription.md#dataconnectsubscription_interface) | Representation of user provided subscription options. | +| [DataConnectTransport](./data-connect.dataconnecttransport.md#dataconnecttransport_interface) | | +| [MutationPromise](./data-connect.mutationpromise.md#mutationpromise_interface) | Mutation return value from executeMutation | +| [MutationRef](./data-connect.mutationref.md#mutationref_interface) | | +| [MutationResponse](./data-connect.mutationresponse.md#mutationresponse_interface) | | +| [MutationResult](./data-connect.mutationresult.md#mutationresult_interface) | Mutation Result from executeMutation | +| [OperationRef](./data-connect.operationref.md#operationref_interface) | | +| [OpResult](./data-connect.opresult.md#opresult_interface) | | +| [QueryPromise](./data-connect.querypromise.md#querypromise_interface) | Promise returned from executeQuery | +| [QueryRef](./data-connect.queryref.md#queryref_interface) | QueryRef object | +| [QueryResponse](./data-connect.queryresponse.md#queryresponse_interface) | | +| [QueryResult](./data-connect.queryresult.md#queryresult_interface) | Result of executeQuery | +| [RefInfo](./data-connect.refinfo.md#refinfo_interface) | Serialized RefInfo as a result of QueryResult.toJSON().refInfo | +| [Sender](./data-connect.sender.md#sender_interface) | | +| [SerializedRef](./data-connect.serializedref.md#serializedref_interface) | Serialized Ref as a result of QueryResult.toJSON() | +| [SubscriptionOptions](./data-connect.subscriptionoptions.md#subscriptionoptions_interface) | Representation of full observer options in subscribe | +| [TransportOptions](./data-connect.transportoptions.md#transportoptions_interface) | Options to connect to emulator | + +## Variables + +| Variable | Description | +| --- | --- | +| [FIREBASE\_DATA\_CONNECT\_EMULATOR\_HOST\_VAR](./data-connect.md#firebase_data_connect_emulator_host_var) | | +| [MUTATION\_STR](./data-connect.md#mutation_str) | | +| [QUERY\_STR](./data-connect.md#query_str) | | +| [SOURCE\_CACHE](./data-connect.md#source_cache) | | +| [SOURCE\_SERVER](./data-connect.md#source_server) | | + +## Type Aliases + +| Type Alias | Description | +| --- | --- | +| [AuthTokenListener](./data-connect.md#authtokenlistener) | | +| [DataSource](./data-connect.md#datasource) | | +| [OnCompleteSubscription](./data-connect.md#oncompletesubscription) | OnCompleteSubscription | +| [OnErrorSubscription](./data-connect.md#onerrorsubscription) | Signature for OnErrorSubscription for subscribe | +| [OnResultSubscription](./data-connect.md#onresultsubscription) | Signature for OnResultSubscription for subscribe | +| [QueryUnsubscribe](./data-connect.md#queryunsubscribe) | Signature for unsubscribe from subscribe | +| [ReferenceType](./data-connect.md#referencetype) | | +| [TransportClass](./data-connect.md#transportclass) | | + +## function(app, ...) + +### getDataConnect(app, options) {:#getdataconnect_4a1329a} + +Initialize DataConnect instance + +Signature: + +```typescript +export declare function getDataConnect(app: FirebaseApp, options: ConnectorConfig): DataConnect; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | FirebaseApp to initialize to. | +| options | [ConnectorConfig](./data-connect.connectorconfig.md#connectorconfig_interface) | ConnectorConfig | + +Returns: + +[DataConnect](./data-connect.dataconnect.md#dataconnect_class) + +## function(dataConnect, ...) + +### terminate(dataConnect) {:#terminate_43d8d88} + +Delete DataConnect instance + +Signature: + +```typescript +export declare function terminate(dataConnect: DataConnect): Promise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| dataConnect | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | DataConnect instance | + +Returns: + +Promise<void> + + +## function(dc, ...) + +### connectDataConnectEmulator(dc, host, port, sslEnabled) {:#connectdataconnectemulator_842a91d} + +Connect to the DataConnect Emulator + +Signature: + +```typescript +export declare function connectDataConnectEmulator(dc: DataConnect, host: string, port?: number, sslEnabled?: boolean): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| dc | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | Data Connect instance | +| host | string | host of emulator server | +| port | number | port of emulator server | +| sslEnabled | boolean | use https | + +Returns: + +void + +## function(dcInstance, ...) + +### mutationRef(dcInstance, mutationName) {:#mutationref_48ae5fa} + +Creates a `MutationRef` + +Signature: + +```typescript +export declare function mutationRef(dcInstance: DataConnect, mutationName: string): MutationRef; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| dcInstance | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | Data Connect instance | +| mutationName | string | name of mutation | + +Returns: + +[MutationRef](./data-connect.mutationref.md#mutationref_interface)<Data, undefined> + +### mutationRef(dcInstance, mutationName, variables) {:#mutationref_1511672} + +Signature: + +```typescript +export declare function mutationRef(dcInstance: DataConnect, mutationName: string, variables: Variables): MutationRef; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| dcInstance | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | Data Connect instance | +| mutationName | string | name of mutation | +| variables | Variables | variables to send with mutation | + +Returns: + +[MutationRef](./data-connect.mutationref.md#mutationref_interface)<Data, Variables> + +### queryRef(dcInstance, queryName) {:#queryref_d968e5d} + +Execute Query + +Signature: + +```typescript +export declare function queryRef(dcInstance: DataConnect, queryName: string): QueryRef; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| dcInstance | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | Data Connect instance to use. | +| queryName | string | Query to execute | + +Returns: + +[QueryRef](./data-connect.queryref.md#queryref_interface)<Data, undefined> + +`QueryRef` + +### queryRef(dcInstance, queryName, variables) {:#queryref_6179f74} + +Execute Query + +Signature: + +```typescript +export declare function queryRef(dcInstance: DataConnect, queryName: string, variables: Variables): QueryRef; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| dcInstance | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | Data Connect instance to use. | +| queryName | string | Query to execute | +| variables | Variables | Variables to execute with | + +Returns: + +[QueryRef](./data-connect.queryref.md#queryref_interface)<Data, Variables> + +`QueryRef` + +## function(logLevel, ...) + +### setLogLevel(logLevel) {:#setloglevel_697d53a} + +Signature: + +```typescript +export declare function setLogLevel(logLevel: LogLevelString): void; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| logLevel | LogLevelString | | + +Returns: + +void + +## function(mutationRef, ...) + +### executeMutation(mutationRef) {:#executemutation_e8103b9} + +Execute Mutation + +Signature: + +```typescript +export declare function executeMutation(mutationRef: MutationRef): MutationPromise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| mutationRef | [MutationRef](./data-connect.mutationref.md#mutationref_interface)<Data, Variables> | mutation to execute | + +Returns: + +[MutationPromise](./data-connect.mutationpromise.md#mutationpromise_interface)<Data, Variables> + +`MutationRef` + +## function(options, ...) + +### getDataConnect(options) {:#getdataconnect_f991922} + +Initialize DataConnect instance + +Signature: + +```typescript +export declare function getDataConnect(options: ConnectorConfig): DataConnect; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| options | [ConnectorConfig](./data-connect.connectorconfig.md#connectorconfig_interface) | ConnectorConfig | + +Returns: + +[DataConnect](./data-connect.dataconnect.md#dataconnect_class) + +## function(queryRef, ...) + +### executeQuery(queryRef) {:#executequery_692a270} + +Execute Query + +Signature: + +```typescript +export declare function executeQuery(queryRef: QueryRef): QueryPromise; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| queryRef | [QueryRef](./data-connect.queryref.md#queryref_interface)<Data, Variables> | query to execute. | + +Returns: + +[QueryPromise](./data-connect.querypromise.md#querypromise_interface)<Data, Variables> + +`QueryPromise` + +## function(queryRefOrSerializedResult, ...) + +### subscribe(queryRefOrSerializedResult, observer) {:#subscribe_b2b4b07} + +Subscribe to a `QueryRef` + +Signature: + +```typescript +export declare function subscribe(queryRefOrSerializedResult: QueryRef | SerializedRef, observer: SubscriptionOptions): QueryUnsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| queryRefOrSerializedResult | [QueryRef](./data-connect.queryref.md#queryref_interface)<Data, Variables> \| [SerializedRef](./data-connect.serializedref.md#serializedref_interface)<Data, Variables> | query ref or serialized result. | +| observer | [SubscriptionOptions](./data-connect.subscriptionoptions.md#subscriptionoptions_interface)<Data, Variables> | observer object to use for subscribing. | + +Returns: + +[QueryUnsubscribe](./data-connect.md#queryunsubscribe) + +`SubscriptionOptions` + +### subscribe(queryRefOrSerializedResult, onNext, onError, onComplete) {:#subscribe_c02958e} + +Subscribe to a `QueryRef` + +Signature: + +```typescript +export declare function subscribe(queryRefOrSerializedResult: QueryRef | SerializedRef, onNext: OnResultSubscription, onError?: OnErrorSubscription, onComplete?: OnCompleteSubscription): QueryUnsubscribe; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| queryRefOrSerializedResult | [QueryRef](./data-connect.queryref.md#queryref_interface)<Data, Variables> \| [SerializedRef](./data-connect.serializedref.md#serializedref_interface)<Data, Variables> | query ref or serialized result. | +| onNext | [OnResultSubscription](./data-connect.md#onresultsubscription)<Data, Variables> | Callback to call when result comes back. | +| onError | [OnErrorSubscription](./data-connect.md#onerrorsubscription) | Callback to call when error gets thrown. | +| onComplete | [OnCompleteSubscription](./data-connect.md#oncompletesubscription) | Called when subscription completes. | + +Returns: + +[QueryUnsubscribe](./data-connect.md#queryunsubscribe) + +`SubscriptionOptions` + +## function(serializedRef, ...) + +### toQueryRef(serializedRef) {:#toqueryref_2c70e31} + +Converts serialized ref to query ref + +Signature: + +```typescript +export declare function toQueryRef(serializedRef: SerializedRef): QueryRef; +``` + +#### Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| serializedRef | [SerializedRef](./data-connect.serializedref.md#serializedref_interface)<Data, Variables> | ref to convert to QueryRef | + +Returns: + +[QueryRef](./data-connect.queryref.md#queryref_interface)<unknown, Variables> + +`QueryRef` + +## FIREBASE\_DATA\_CONNECT\_EMULATOR\_HOST\_VAR + +Signature: + +```typescript +FIREBASE_DATA_CONNECT_EMULATOR_HOST_VAR = "FIREBASE_DATA_CONNECT_EMULATOR_HOST" +``` + +## MUTATION\_STR + +Signature: + +```typescript +MUTATION_STR = "mutation" +``` + +## QUERY\_STR + +Signature: + +```typescript +QUERY_STR = "query" +``` + +## SOURCE\_CACHE + +Signature: + +```typescript +SOURCE_CACHE = "CACHE" +``` + +## SOURCE\_SERVER + +Signature: + +```typescript +SOURCE_SERVER = "SERVER" +``` + +## AuthTokenListener + +Signature: + +```typescript +export declare type AuthTokenListener = (token: string | null) => void; +``` + +## DataSource + +Signature: + +```typescript +export declare type DataSource = typeof SOURCE_CACHE | typeof SOURCE_SERVER; +``` + +## OnCompleteSubscription + +`OnCompleteSubscription` + +Signature: + +```typescript +export declare type OnCompleteSubscription = () => void; +``` + +## OnErrorSubscription + +Signature for `OnErrorSubscription` for `subscribe` + +Signature: + +```typescript +export declare type OnErrorSubscription = (err?: FirebaseError) => void; +``` + +## OnResultSubscription + +Signature for `OnResultSubscription` for `subscribe` + +Signature: + +```typescript +export declare type OnResultSubscription = (res: QueryResult) => void; +``` + +## QueryUnsubscribe + +Signature for unsubscribe from `subscribe` + +Signature: + +```typescript +export declare type QueryUnsubscribe = () => void; +``` + +## ReferenceType + +Signature: + +```typescript +export declare type ReferenceType = typeof QUERY_STR | typeof MUTATION_STR; +``` + +## TransportClass + +Signature: + +```typescript +export declare type TransportClass = new (options: DataConnectOptions, apiKey?: string, authProvider?: AuthTokenProvider, transportOptions?: TransportOptions) => DataConnectTransport; +``` diff --git a/docs-devsite/data-connect.mutationpromise.md b/docs-devsite/data-connect.mutationpromise.md new file mode 100644 index 00000000000..60624870c1d --- /dev/null +++ b/docs-devsite/data-connect.mutationpromise.md @@ -0,0 +1,21 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# MutationPromise interface +Mutation return value from `executeMutation` + +Signature: + +```typescript +export declare interface MutationPromise extends PromiseLike> +``` +Extends: PromiseLike<[MutationResult](./data-connect.mutationresult.md#mutationresult_interface)<Data, Variables>> + diff --git a/docs-devsite/data-connect.mutationref.md b/docs-devsite/data-connect.mutationref.md new file mode 100644 index 00000000000..0cf5a7185c4 --- /dev/null +++ b/docs-devsite/data-connect.mutationref.md @@ -0,0 +1,32 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# MutationRef interface +Signature: + +```typescript +export declare interface MutationRef extends OperationRef +``` +Extends: [OperationRef](./data-connect.operationref.md#operationref_interface)<Data, Variables> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [refType](./data-connect.mutationref.md#mutationrefreftype) | typeof [MUTATION\_STR](./data-connect.md#mutation_str) | | + +## MutationRef.refType + +Signature: + +```typescript +refType: typeof MUTATION_STR; +``` diff --git a/docs-devsite/data-connect.mutationresponse.md b/docs-devsite/data-connect.mutationresponse.md new file mode 100644 index 00000000000..0b018d140ac --- /dev/null +++ b/docs-devsite/data-connect.mutationresponse.md @@ -0,0 +1,19 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# MutationResponse interface +Signature: + +```typescript +export declare interface MutationResponse extends CancellableOperation +``` +Extends: [CancellableOperation](./data-connect.cancellableoperation.md#cancellableoperation_interface)<T> + diff --git a/docs-devsite/data-connect.mutationresult.md b/docs-devsite/data-connect.mutationresult.md new file mode 100644 index 00000000000..94067123cff --- /dev/null +++ b/docs-devsite/data-connect.mutationresult.md @@ -0,0 +1,34 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# MutationResult interface +Mutation Result from `executeMutation` + +Signature: + +```typescript +export declare interface MutationResult extends DataConnectResult +``` +Extends: [DataConnectResult](./data-connect.dataconnectresult.md#dataconnectresult_interface)<Data, Variables> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [ref](./data-connect.mutationresult.md#mutationresultref) | [MutationRef](./data-connect.mutationref.md#mutationref_interface)<Data, Variables> | | + +## MutationResult.ref + +Signature: + +```typescript +ref: MutationRef; +``` diff --git a/docs-devsite/data-connect.operationref.md b/docs-devsite/data-connect.operationref.md new file mode 100644 index 00000000000..e73d249fbda --- /dev/null +++ b/docs-devsite/data-connect.operationref.md @@ -0,0 +1,58 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# OperationRef interface +Signature: + +```typescript +export declare interface OperationRef<_Data, Variables> +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [dataConnect](./data-connect.operationref.md#operationrefdataconnect) | [DataConnect](./data-connect.dataconnect.md#dataconnect_class) | | +| [name](./data-connect.operationref.md#operationrefname) | string | | +| [refType](./data-connect.operationref.md#operationrefreftype) | [ReferenceType](./data-connect.md#referencetype) | | +| [variables](./data-connect.operationref.md#operationrefvariables) | Variables | | + +## OperationRef.dataConnect + +Signature: + +```typescript +dataConnect: DataConnect; +``` + +## OperationRef.name + +Signature: + +```typescript +name: string; +``` + +## OperationRef.refType + +Signature: + +```typescript +refType: ReferenceType; +``` + +## OperationRef.variables + +Signature: + +```typescript +variables: Variables; +``` diff --git a/docs-devsite/data-connect.opresult.md b/docs-devsite/data-connect.opresult.md new file mode 100644 index 00000000000..1f0a4c2c0f2 --- /dev/null +++ b/docs-devsite/data-connect.opresult.md @@ -0,0 +1,49 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# OpResult interface +Signature: + +```typescript +export declare interface OpResult +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [data](./data-connect.opresult.md#opresultdata) | Data | | +| [fetchTime](./data-connect.opresult.md#opresultfetchtime) | string | | +| [source](./data-connect.opresult.md#opresultsource) | [DataSource](./data-connect.md#datasource) | | + +## OpResult.data + +Signature: + +```typescript +data: Data; +``` + +## OpResult.fetchTime + +Signature: + +```typescript +fetchTime: string; +``` + +## OpResult.source + +Signature: + +```typescript +source: DataSource; +``` diff --git a/docs-devsite/data-connect.querypromise.md b/docs-devsite/data-connect.querypromise.md new file mode 100644 index 00000000000..27dc6204260 --- /dev/null +++ b/docs-devsite/data-connect.querypromise.md @@ -0,0 +1,21 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# QueryPromise interface +Promise returned from `executeQuery` + +Signature: + +```typescript +export declare interface QueryPromise extends PromiseLike> +``` +Extends: PromiseLike<[QueryResult](./data-connect.queryresult.md#queryresult_interface)<Data, Variables>> + diff --git a/docs-devsite/data-connect.queryref.md b/docs-devsite/data-connect.queryref.md new file mode 100644 index 00000000000..2e67c884016 --- /dev/null +++ b/docs-devsite/data-connect.queryref.md @@ -0,0 +1,34 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# QueryRef interface +QueryRef object + +Signature: + +```typescript +export declare interface QueryRef extends OperationRef +``` +Extends: [OperationRef](./data-connect.operationref.md#operationref_interface)<Data, Variables> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [refType](./data-connect.queryref.md#queryrefreftype) | typeof [QUERY\_STR](./data-connect.md#query_str) | | + +## QueryRef.refType + +Signature: + +```typescript +refType: typeof QUERY_STR; +``` diff --git a/docs-devsite/data-connect.queryresponse.md b/docs-devsite/data-connect.queryresponse.md new file mode 100644 index 00000000000..0c1047339f6 --- /dev/null +++ b/docs-devsite/data-connect.queryresponse.md @@ -0,0 +1,19 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# QueryResponse interface +Signature: + +```typescript +export declare interface QueryResponse extends CancellableOperation +``` +Extends: [CancellableOperation](./data-connect.cancellableoperation.md#cancellableoperation_interface)<T> + diff --git a/docs-devsite/data-connect.queryresult.md b/docs-devsite/data-connect.queryresult.md new file mode 100644 index 00000000000..ac0380e2002 --- /dev/null +++ b/docs-devsite/data-connect.queryresult.md @@ -0,0 +1,43 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# QueryResult interface +Result of `executeQuery` + +Signature: + +```typescript +export declare interface QueryResult extends DataConnectResult +``` +Extends: [DataConnectResult](./data-connect.dataconnectresult.md#dataconnectresult_interface)<Data, Variables> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [ref](./data-connect.queryresult.md#queryresultref) | [QueryRef](./data-connect.queryref.md#queryref_interface)<Data, Variables> | | +| [toJSON](./data-connect.queryresult.md#queryresulttojson) | () => [SerializedRef](./data-connect.serializedref.md#serializedref_interface)<Data, Variables> | | + +## QueryResult.ref + +Signature: + +```typescript +ref: QueryRef; +``` + +## QueryResult.toJSON + +Signature: + +```typescript +toJSON: () => SerializedRef; +``` diff --git a/docs-devsite/data-connect.refinfo.md b/docs-devsite/data-connect.refinfo.md new file mode 100644 index 00000000000..6114fc0a1fc --- /dev/null +++ b/docs-devsite/data-connect.refinfo.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# RefInfo interface +Serialized RefInfo as a result of `QueryResult.toJSON().refInfo` + +Signature: + +```typescript +export declare interface RefInfo +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [connectorConfig](./data-connect.refinfo.md#refinfoconnectorconfig) | [DataConnectOptions](./data-connect.dataconnectoptions.md#dataconnectoptions_interface) | | +| [name](./data-connect.refinfo.md#refinfoname) | string | | +| [variables](./data-connect.refinfo.md#refinfovariables) | Variables | | + +## RefInfo.connectorConfig + +Signature: + +```typescript +connectorConfig: DataConnectOptions; +``` + +## RefInfo.name + +Signature: + +```typescript +name: string; +``` + +## RefInfo.variables + +Signature: + +```typescript +variables: Variables; +``` diff --git a/docs-devsite/data-connect.sender.md b/docs-devsite/data-connect.sender.md new file mode 100644 index 00000000000..64bab9156fe --- /dev/null +++ b/docs-devsite/data-connect.sender.md @@ -0,0 +1,40 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# Sender interface +Signature: + +```typescript +export declare interface Sender +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [abort](./data-connect.sender.md#senderabort) | () => void | | +| [send](./data-connect.sender.md#sendersend) | () => Promise<T> | | + +## Sender.abort + +Signature: + +```typescript +abort: () => void; +``` + +## Sender.send + +Signature: + +```typescript +send: () => Promise; +``` diff --git a/docs-devsite/data-connect.serializedref.md b/docs-devsite/data-connect.serializedref.md new file mode 100644 index 00000000000..f93c94d722d --- /dev/null +++ b/docs-devsite/data-connect.serializedref.md @@ -0,0 +1,34 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SerializedRef interface +Serialized Ref as a result of `QueryResult.toJSON()` + +Signature: + +```typescript +export declare interface SerializedRef extends OpResult +``` +Extends: [OpResult](./data-connect.opresult.md#opresult_interface)<Data> + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [refInfo](./data-connect.serializedref.md#serializedrefrefinfo) | [RefInfo](./data-connect.refinfo.md#refinfo_interface)<Variables> | | + +## SerializedRef.refInfo + +Signature: + +```typescript +refInfo: RefInfo; +``` diff --git a/docs-devsite/data-connect.subscriptionoptions.md b/docs-devsite/data-connect.subscriptionoptions.md new file mode 100644 index 00000000000..d666f5bb380 --- /dev/null +++ b/docs-devsite/data-connect.subscriptionoptions.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# SubscriptionOptions interface +Representation of full observer options in `subscribe` + +Signature: + +```typescript +export declare interface SubscriptionOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [onComplete](./data-connect.subscriptionoptions.md#subscriptionoptionsoncomplete) | [OnCompleteSubscription](./data-connect.md#oncompletesubscription) | | +| [onErr](./data-connect.subscriptionoptions.md#subscriptionoptionsonerr) | [OnErrorSubscription](./data-connect.md#onerrorsubscription) | | +| [onNext](./data-connect.subscriptionoptions.md#subscriptionoptionsonnext) | [OnResultSubscription](./data-connect.md#onresultsubscription)<Data, Variables> | | + +## SubscriptionOptions.onComplete + +Signature: + +```typescript +onComplete?: OnCompleteSubscription; +``` + +## SubscriptionOptions.onErr + +Signature: + +```typescript +onErr?: OnErrorSubscription; +``` + +## SubscriptionOptions.onNext + +Signature: + +```typescript +onNext?: OnResultSubscription; +``` diff --git a/docs-devsite/data-connect.transportoptions.md b/docs-devsite/data-connect.transportoptions.md new file mode 100644 index 00000000000..dbff25dc5d1 --- /dev/null +++ b/docs-devsite/data-connect.transportoptions.md @@ -0,0 +1,51 @@ +Project: /docs/reference/js/_project.yaml +Book: /docs/reference/_book.yaml +page_type: reference + +{% comment %} +DO NOT EDIT THIS FILE! +This is generated by the JS SDK team, and any local changes will be +overwritten. Changes should be made in the source code at +https://github.com/firebase/firebase-js-sdk +{% endcomment %} + +# TransportOptions interface +Options to connect to emulator + +Signature: + +```typescript +export declare interface TransportOptions +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [host](./data-connect.transportoptions.md#transportoptionshost) | string | | +| [port](./data-connect.transportoptions.md#transportoptionsport) | number | | +| [sslEnabled](./data-connect.transportoptions.md#transportoptionssslenabled) | boolean | | + +## TransportOptions.host + +Signature: + +```typescript +host: string; +``` + +## TransportOptions.port + +Signature: + +```typescript +port?: number; +``` + +## TransportOptions.sslEnabled + +Signature: + +```typescript +sslEnabled?: boolean; +``` diff --git a/packages/data-connect/karma.conf.js b/packages/data-connect/karma.conf.js new file mode 100644 index 00000000000..d51e08d046e --- /dev/null +++ b/packages/data-connect/karma.conf.js @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const karmaBase = require('../../config/karma.base'); + +const files = [`test/**/*.test.ts`]; + +module.exports = function (config) { + const karmaConfig = Object.assign({}, karmaBase, { + // files to load into karma + files: files, + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha'] + }); + + config.set(karmaConfig); +}; + +module.exports.files = files; diff --git a/packages/database/src/api/Reference_impl.ts b/packages/database/src/api/Reference_impl.ts index 53d4577368a..7870bf93e53 100644 --- a/packages/database/src/api/Reference_impl.ts +++ b/packages/database/src/api/Reference_impl.ts @@ -1985,7 +1985,6 @@ class QueryLimitToLastConstraint extends QueryConstraint { constructor(private readonly _limit: number) { super(); - console.log(this.type); } _apply(query: QueryImpl): QueryImpl { diff --git a/packages/database/test/exp/integration.test.ts b/packages/database/test/exp/integration.test.ts index ae82bd913f6..adf5094f222 100644 --- a/packages/database/test/exp/integration.test.ts +++ b/packages/database/test/exp/integration.test.ts @@ -27,13 +27,12 @@ import { onChildAdded, onValue, orderByChild, + query, refFromURL, set, startAt, update, - orderByKey, - query, - limitToLast + orderByKey } from '../../src/api/Reference_impl'; import { getDatabase, @@ -61,7 +60,7 @@ export function createTestApp() { } // Note: these run in parallel with the node environment. If you use the same paths in parallel, you may experience race conditions. -describe.only('Database@exp Tests', () => { +describe('Database@exp Tests', () => { let defaultApp; beforeEach(() => { @@ -78,27 +77,6 @@ describe.only('Database@exp Tests', () => { const db = getDatabase(defaultApp); expect(db).to.be.ok; }); - it.only('can use `toString` as parameter to refFromUrl', () => { - const app2 = initializeApp( - { - apiKey: 'AIzaSyAVya8asBa3HkmWFDG2SdNuljlcgTGqMq4', - authDomain: 'movie-picker-729bb.firebaseapp.com', - databaseURL: - 'https://movie-picker-729bb.europe-west1.firebasedatabase.app/', - projectId: 'movie-picker-729bb', - storageBucket: 'movie-picker-729bb.appspot.com', - messagingSenderId: '592198782208', - appId: '1:592198782208:web:cc1d88c2a2d53b20ea77e5' - }, - 'app2' - ); - const db = getDatabase(app2); - const q = ref(db, 'posts'); - const url = q.toString(); - const r = refFromURL(db, url); - const limitConstraint = limitToLast(100); - console.log(limitConstraint); - }); it("doesn't try to connect to emulator after database has already started", async () => { const db = getDatabase(defaultApp); const r = ref(db, '.info/connected'); @@ -168,7 +146,6 @@ describe.only('Database@exp Tests', () => { await set(root, {}); const q = query(root, orderByChild('testIndex'), limitToFirst(2)); - console.log(q.toString()); const i1 = child(root, 'i1'); await set(root, { From 680a25fa78e0749cc188c98bb9819f7989042270 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Wed, 3 Jul 2024 11:18:40 -0700 Subject: [PATCH 2/2] Removed old api review file --- common/api-review/connect.api.md | 133 ------------------------------- 1 file changed, 133 deletions(-) delete mode 100644 common/api-review/connect.api.md diff --git a/common/api-review/connect.api.md b/common/api-review/connect.api.md deleted file mode 100644 index f2b5d2fda4d..00000000000 --- a/common/api-review/connect.api.md +++ /dev/null @@ -1,133 +0,0 @@ -## API Report File for "@firebase/connect" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types'; -import { FirebaseApp } from '@firebase/app'; -import { FirebaseAuthInternalName } from '@firebase/auth-interop-types'; -import { Provider } from '@firebase/component'; - -// @public (undocumented) -export function connectDataConnectEmulator(dc: DataConnect, host: string, port: number, isSecure?: boolean): void; - -// @public (undocumented) -export interface Converter { - // (undocumented) - fromDataConnect: (data: DataConnectSnapshot) => Response; - // (undocumented) - fromResponse: (response: Response) => DataConnectSnapshot; -} - -// @public (undocumented) -export class DataConnect { - constructor(firebaseApp: FirebaseApp, authProvider: Provider, transportOptions: TransportOptions, projectOptions: ProjectOptions, appCheckProvider?: Provider, useRest?: boolean); - // (undocumented) - enableEmulator(host: string, port: number, isSecure: boolean): void; - // (undocumented) - setInitialized(): void; - } - -// @public (undocumented) -export interface DataConnectOptions { - // (undocumented) - projectOptions: ProjectOptions; - // (undocumented) - transportOptions?: TransportOptions; -} - -// @public (undocumented) -export interface DataConnectSnapshot { - // (undocumented) - data: Response; -} - -// @public (undocumented) -export interface DataConnectSubscription { - // (undocumented) - converter: Converter; - // (undocumented) - unsubscribe: () => void; - // (undocumented) - userCallback: (data: Response | undefined, error?: Error) => void; -} - -// @public (undocumented) -export function executeMutation(mutationRef: Mutation): Promise; - -// @public (undocumented) -export function executeQuery(queryRef: Query): Promise; - -// @public (undocumented) -export const FIREBASE_DATA_CONNECT_EMULATOR_HOST_VAR = "FIREBASE_DATA_CONNECT_EMULATOR_HOST"; - -// @public (undocumented) -export function getDataConnect(app: FirebaseApp, options: DataConnectOptions): DataConnect; - -// @public (undocumented) -export function getDataConnect(options: DataConnectOptions): DataConnect; - -// @public (undocumented) -export interface Mutation extends Reference { - // (undocumented) - dcInstance: DataConnect; -} - -// @public (undocumented) -export function mutationRef(dcInstance: DataConnect, queryName: string, variables: Variables): Mutation; - -// @public (undocumented) -export interface ProjectOptions { - // (undocumented) - connector: string; - // (undocumented) - location: string; - // (undocumented) - project: string; - // (undocumented) - service: string; -} - -// @public (undocumented) -export interface Query extends Reference { - // (undocumented) - dcInstance: DataConnect; -} - -// @public (undocumented) -export function queryRef(dcInstance: DataConnect, queryName: string, variables?: Variables): Query; - -// @public (undocumented) -export interface Reference<_Response, Variables> { - // (undocumented) - name: string; - // (undocumented) - refType: ReferenceType; - // (undocumented) - variables: Variables; -} - -// @public (undocumented) -export enum ReferenceType { - // (undocumented) - Mutation = "m", - // (undocumented) - Query = "q" -} - -// @public (undocumented) -export function subscribe(queryRef: Query, onSubscribe: DataConnectSubscription['userCallback'], converter: Converter): void; - -// @public (undocumented) -export interface TransportOptions { - // (undocumented) - host: string; - // (undocumented) - isSecure: boolean; - // (undocumented) - port: number; -} - - -```