@firebase/data-connect 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +4 -4
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +4 -4
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/network/stream/wire.d.ts +1 -1
- package/dist/public.d.ts +278 -110
- package/dist/src/network/stream/wire.d.ts +1 -1
- package/package.json +6 -6
|
@@ -49,7 +49,7 @@ export interface StreamRequestHeaders {
|
|
|
49
49
|
/** used to initially authenticate or re-authenticate user */
|
|
50
50
|
'X-Firebase-Auth-Token'?: string;
|
|
51
51
|
/** used to initially attest app */
|
|
52
|
-
'X-Firebase-
|
|
52
|
+
'X-Firebase-AppCheck'?: string;
|
|
53
53
|
/** SDK telemetry header */
|
|
54
54
|
'X-Goog-Api-Client'?: string;
|
|
55
55
|
/** firebase appid */
|
package/dist/public.d.ts
CHANGED
|
@@ -3,44 +3,68 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
|
|
8
|
+
|
|
9
|
+
import { FirebaseApp } from '@firebase/app';
|
|
10
|
+
|
|
8
11
|
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
|
|
9
|
-
|
|
10
|
-
import { LogLevelString } from '@firebase/logger';
|
|
12
|
+
|
|
11
13
|
import { FirebaseError } from '@firebase/util';
|
|
12
14
|
|
|
15
|
+
import { LogLevelString } from '@firebase/logger';
|
|
16
|
+
|
|
17
|
+
import { Provider } from '@firebase/component';
|
|
18
|
+
|
|
19
|
+
/* Excluded from this release type: AbstractDataConnectTransport */
|
|
20
|
+
|
|
21
|
+
/* Excluded from this release type: AppCheckTokenProvider */
|
|
22
|
+
|
|
23
|
+
/* Excluded from this release type: areTransportOptionsEqual */
|
|
13
24
|
|
|
14
25
|
export declare interface CacheProvider<T extends StorageType> {
|
|
15
|
-
|
|
26
|
+
type: T;
|
|
27
|
+
/* Excluded from this release type: initialize */
|
|
16
28
|
}
|
|
29
|
+
|
|
17
30
|
export declare interface CacheSettings {
|
|
18
|
-
|
|
19
|
-
|
|
31
|
+
cacheProvider: CacheProvider<StorageType>;
|
|
32
|
+
maxAgeSeconds?: number;
|
|
20
33
|
}
|
|
34
|
+
|
|
21
35
|
/**
|
|
22
36
|
* enum representing different flavors of the SDK used by developers
|
|
23
37
|
* use the CallerSdkType for type-checking, and the CallerSdkTypeEnum for value-checking/assigning
|
|
24
38
|
*/
|
|
25
|
-
export declare type CallerSdkType =
|
|
39
|
+
export declare type CallerSdkType =
|
|
40
|
+
| 'Base'
|
|
41
|
+
| 'Generated'
|
|
42
|
+
| 'TanstackReactCore'
|
|
43
|
+
| 'GeneratedReact'
|
|
44
|
+
| 'TanstackAngularCore'
|
|
45
|
+
| 'GeneratedAngular';
|
|
46
|
+
|
|
26
47
|
export declare const CallerSdkTypeEnum: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
readonly Base: 'Base';
|
|
49
|
+
readonly Generated: 'Generated';
|
|
50
|
+
readonly TanstackReactCore: 'TanstackReactCore';
|
|
51
|
+
readonly GeneratedReact: 'GeneratedReact';
|
|
52
|
+
readonly TanstackAngularCore: 'TanstackAngularCore';
|
|
53
|
+
readonly GeneratedAngular: 'GeneratedAngular';
|
|
33
54
|
};
|
|
55
|
+
|
|
34
56
|
export declare type Code = DataConnectErrorCode;
|
|
57
|
+
|
|
35
58
|
export declare const Code: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
59
|
+
OTHER: DataConnectErrorCode;
|
|
60
|
+
ALREADY_INITIALIZED: DataConnectErrorCode;
|
|
61
|
+
NOT_INITIALIZED: DataConnectErrorCode;
|
|
62
|
+
NOT_SUPPORTED: DataConnectErrorCode;
|
|
63
|
+
INVALID_ARGUMENT: DataConnectErrorCode;
|
|
64
|
+
PARTIAL_ERROR: DataConnectErrorCode;
|
|
65
|
+
UNAUTHORIZED: DataConnectErrorCode;
|
|
43
66
|
};
|
|
67
|
+
|
|
44
68
|
/**
|
|
45
69
|
* Connect to the DataConnect Emulator
|
|
46
70
|
* @param dc Data Connect instance
|
|
@@ -48,181 +72,273 @@ export declare const Code: {
|
|
|
48
72
|
* @param port port of emulator server
|
|
49
73
|
* @param sslEnabled use https
|
|
50
74
|
*/
|
|
51
|
-
export declare function connectDataConnectEmulator(
|
|
75
|
+
export declare function connectDataConnectEmulator(
|
|
76
|
+
dc: DataConnect,
|
|
77
|
+
host: string,
|
|
78
|
+
port?: number,
|
|
79
|
+
sslEnabled?: boolean
|
|
80
|
+
): void;
|
|
81
|
+
|
|
52
82
|
/**
|
|
53
83
|
* Connector Config for calling Data Connect backend.
|
|
54
84
|
*/
|
|
55
85
|
export declare interface ConnectorConfig {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
86
|
+
location: string;
|
|
87
|
+
connector: string;
|
|
88
|
+
service: string;
|
|
59
89
|
}
|
|
90
|
+
|
|
60
91
|
/**
|
|
61
92
|
* Class representing Firebase Data Connect
|
|
62
93
|
*/
|
|
63
94
|
export declare class DataConnect {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
95
|
+
readonly app: FirebaseApp;
|
|
96
|
+
private readonly dataConnectOptions;
|
|
97
|
+
isEmulator: boolean;
|
|
98
|
+
/* Excluded from this release type: cache */
|
|
99
|
+
constructor(
|
|
100
|
+
app: FirebaseApp,
|
|
101
|
+
dataConnectOptions: DataConnectOptions,
|
|
102
|
+
_authProvider: Provider<FirebaseAuthInternalName>,
|
|
103
|
+
_appCheckProvider: Provider<AppCheckInternalComponentName>
|
|
104
|
+
);
|
|
105
|
+
/* Excluded from this release type: getCache */
|
|
106
|
+
getSettings(): ConnectorConfig;
|
|
107
|
+
/* Excluded from this release type: setCacheSettings */
|
|
108
|
+
setInitialized(): void;
|
|
109
|
+
enableEmulator(transportOptions: TransportOptions): void;
|
|
73
110
|
}
|
|
111
|
+
|
|
74
112
|
export declare interface DataConnectEntityArray {
|
|
75
|
-
|
|
113
|
+
entityIds: string[];
|
|
76
114
|
}
|
|
115
|
+
|
|
77
116
|
/** An error returned by a DataConnect operation. */
|
|
78
117
|
export declare class DataConnectError extends FirebaseError {
|
|
79
|
-
|
|
80
|
-
|
|
118
|
+
/* Excluded from this release type: name */
|
|
119
|
+
constructor(code: Code, message: string);
|
|
120
|
+
/* Excluded from this release type: toString */
|
|
81
121
|
}
|
|
82
|
-
|
|
122
|
+
|
|
123
|
+
export declare type DataConnectErrorCode =
|
|
124
|
+
| 'other'
|
|
125
|
+
| 'already-initialized'
|
|
126
|
+
| 'not-initialized'
|
|
127
|
+
| 'not-supported'
|
|
128
|
+
| 'invalid-argument'
|
|
129
|
+
| 'partial-error'
|
|
130
|
+
| 'unauthorized';
|
|
131
|
+
|
|
83
132
|
export declare type DataConnectExtension = {
|
|
84
|
-
|
|
133
|
+
path: Array<string | number>;
|
|
85
134
|
} & (DataConnectEntityArray | DataConnectSingleEntity);
|
|
135
|
+
|
|
86
136
|
/* Excluded from this release type: DataConnectExtensionWithMaxAge */
|
|
137
|
+
|
|
87
138
|
/* Excluded from this release type: DataConnectMaxAge */
|
|
139
|
+
|
|
88
140
|
/** An error returned by a DataConnect operation. */
|
|
89
141
|
export declare class DataConnectOperationError extends DataConnectError {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
142
|
+
/* Excluded from this release type: name */
|
|
143
|
+
/** The response received from the backend. */
|
|
144
|
+
readonly response: DataConnectOperationFailureResponse;
|
|
145
|
+
private constructor();
|
|
94
146
|
}
|
|
147
|
+
|
|
95
148
|
export declare interface DataConnectOperationFailureResponse {
|
|
96
|
-
|
|
97
|
-
|
|
149
|
+
readonly data?: Record<string, unknown> | null;
|
|
150
|
+
readonly errors: DataConnectOperationFailureResponseErrorInfo[];
|
|
98
151
|
}
|
|
152
|
+
|
|
99
153
|
export declare interface DataConnectOperationFailureResponseErrorInfo {
|
|
100
|
-
|
|
101
|
-
|
|
154
|
+
readonly message: string;
|
|
155
|
+
readonly path: Array<string | number>;
|
|
102
156
|
}
|
|
157
|
+
|
|
103
158
|
/**
|
|
104
159
|
* DataConnectOptions including project id
|
|
105
160
|
*/
|
|
106
161
|
export declare interface DataConnectOptions extends ConnectorConfig {
|
|
107
|
-
|
|
162
|
+
projectId: string;
|
|
108
163
|
}
|
|
164
|
+
|
|
109
165
|
/* Excluded from this release type: DataConnectResponse */
|
|
166
|
+
|
|
110
167
|
/* Excluded from this release type: DataConnectResponseWithMaxAge */
|
|
111
|
-
|
|
112
|
-
|
|
168
|
+
|
|
169
|
+
export declare interface DataConnectResult<Data, Variables>
|
|
170
|
+
extends OpResult<Data> {
|
|
171
|
+
ref: OperationRef<Data, Variables>;
|
|
113
172
|
}
|
|
173
|
+
|
|
114
174
|
export declare interface DataConnectSettings {
|
|
115
|
-
|
|
175
|
+
cacheSettings?: CacheSettings;
|
|
116
176
|
}
|
|
177
|
+
|
|
117
178
|
export declare interface DataConnectSingleEntity {
|
|
118
|
-
|
|
179
|
+
entityId: string;
|
|
119
180
|
}
|
|
181
|
+
|
|
120
182
|
/**
|
|
121
183
|
* Representation of user provided subscription options.
|
|
122
184
|
*/
|
|
123
185
|
export declare interface DataConnectSubscription<Data, Variables> {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
186
|
+
userCallback: OnResultSubscription<Data, Variables>;
|
|
187
|
+
errCallback?: (e?: DataConnectError) => void;
|
|
188
|
+
unsubscribe: () => void;
|
|
127
189
|
}
|
|
190
|
+
|
|
128
191
|
/* Excluded from this release type: DataConnectTransportInterface */
|
|
192
|
+
|
|
129
193
|
export declare type DataSource = typeof SOURCE_CACHE | typeof SOURCE_SERVER;
|
|
130
194
|
/**
|
|
131
195
|
* Execute Mutation
|
|
132
196
|
* @param mutationRef mutation to execute
|
|
133
197
|
* @returns `MutationRef`
|
|
134
198
|
*/
|
|
135
|
-
export declare function executeMutation<Data, Variables>(
|
|
199
|
+
export declare function executeMutation<Data, Variables>(
|
|
200
|
+
mutationRef: MutationRef<Data, Variables>
|
|
201
|
+
): MutationPromise<Data, Variables>;
|
|
202
|
+
|
|
136
203
|
/**
|
|
137
204
|
* Execute Query
|
|
138
205
|
* @param queryRef query to execute.
|
|
139
206
|
* @returns `QueryPromise`
|
|
140
207
|
*/
|
|
141
|
-
export declare function executeQuery<Data, Variables>(
|
|
208
|
+
export declare function executeQuery<Data, Variables>(
|
|
209
|
+
queryRef: QueryRef<Data, Variables>,
|
|
210
|
+
options?: ExecuteQueryOptions
|
|
211
|
+
): QueryPromise<Data, Variables>;
|
|
212
|
+
|
|
142
213
|
/**
|
|
143
214
|
* Options for executing a query.
|
|
144
215
|
*/
|
|
145
216
|
export declare interface ExecuteQueryOptions {
|
|
146
|
-
|
|
217
|
+
fetchPolicy: QueryFetchPolicy;
|
|
147
218
|
}
|
|
219
|
+
|
|
148
220
|
export declare interface Extensions {
|
|
149
|
-
|
|
221
|
+
dataConnect?: DataConnectExtension[];
|
|
150
222
|
}
|
|
223
|
+
|
|
224
|
+
/* Excluded from this release type: ExtensionsWithMaxAge */
|
|
151
225
|
/**
|
|
152
226
|
* Initialize DataConnect instance
|
|
153
227
|
* @param options ConnectorConfig
|
|
154
228
|
*/
|
|
155
|
-
export declare function getDataConnect(
|
|
229
|
+
export declare function getDataConnect(
|
|
230
|
+
options: ConnectorConfig,
|
|
231
|
+
settings?: DataConnectSettings
|
|
232
|
+
): DataConnect;
|
|
233
|
+
|
|
156
234
|
export declare function getDataConnect(options: ConnectorConfig): DataConnect;
|
|
235
|
+
|
|
157
236
|
/**
|
|
158
237
|
* Initialize DataConnect instance
|
|
159
238
|
* @param app FirebaseApp to initialize to.
|
|
160
239
|
* @param connectorConfig ConnectorConfig
|
|
161
240
|
*/
|
|
162
|
-
export declare function getDataConnect(
|
|
241
|
+
export declare function getDataConnect(
|
|
242
|
+
app: FirebaseApp,
|
|
243
|
+
connectorConfig: ConnectorConfig
|
|
244
|
+
): DataConnect;
|
|
245
|
+
|
|
163
246
|
/**
|
|
164
247
|
* Initialize DataConnect instance
|
|
165
248
|
* @param app FirebaseApp to initialize to.
|
|
166
249
|
* @param connectorConfig ConnectorConfig
|
|
167
250
|
*/
|
|
168
|
-
export declare function getDataConnect(
|
|
251
|
+
export declare function getDataConnect(
|
|
252
|
+
app: FirebaseApp,
|
|
253
|
+
connectorConfig: ConnectorConfig,
|
|
254
|
+
settings: DataConnectSettings
|
|
255
|
+
): DataConnect;
|
|
256
|
+
|
|
257
|
+
/* Excluded from this release type: getGoogApiClientValue */
|
|
169
258
|
/* Excluded from this release type: InternalQueryResult */
|
|
259
|
+
|
|
170
260
|
export declare function makeMemoryCacheProvider(): CacheProvider<'MEMORY'>;
|
|
171
|
-
|
|
261
|
+
|
|
262
|
+
export declare const MUTATION_STR = 'mutation';
|
|
263
|
+
|
|
172
264
|
/* Excluded from this release type: MutationManager */
|
|
265
|
+
|
|
173
266
|
/**
|
|
174
267
|
* Mutation return value from `executeMutation`
|
|
175
268
|
*/
|
|
176
|
-
export declare interface MutationPromise<Data, Variables>
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
269
|
+
export declare interface MutationPromise<Data, Variables>
|
|
270
|
+
extends Promise<MutationResult<Data, Variables>> {}
|
|
271
|
+
|
|
272
|
+
export declare interface MutationRef<Data, Variables>
|
|
273
|
+
extends OperationRef<Data, Variables> {
|
|
274
|
+
refType: typeof MUTATION_STR;
|
|
180
275
|
}
|
|
276
|
+
|
|
181
277
|
/**
|
|
182
278
|
* Creates a `MutationRef`
|
|
183
279
|
* @param dcInstance Data Connect instance
|
|
184
280
|
* @param mutationName name of mutation
|
|
185
281
|
*/
|
|
186
|
-
export declare function mutationRef<Data>(
|
|
282
|
+
export declare function mutationRef<Data>(
|
|
283
|
+
dcInstance: DataConnect,
|
|
284
|
+
mutationName: string
|
|
285
|
+
): MutationRef<Data, undefined>;
|
|
286
|
+
|
|
187
287
|
/**
|
|
188
288
|
*
|
|
189
289
|
* @param dcInstance Data Connect instance
|
|
190
290
|
* @param mutationName name of mutation
|
|
191
291
|
* @param variables variables to send with mutation
|
|
192
292
|
*/
|
|
193
|
-
export declare function mutationRef<Data, Variables>(
|
|
293
|
+
export declare function mutationRef<Data, Variables>(
|
|
294
|
+
dcInstance: DataConnect,
|
|
295
|
+
mutationName: string,
|
|
296
|
+
variables: Variables
|
|
297
|
+
): MutationRef<Data, Variables>;
|
|
298
|
+
|
|
194
299
|
/**
|
|
195
300
|
* Mutation Result from `executeMutation`
|
|
196
301
|
*/
|
|
197
|
-
export declare interface MutationResult<Data, Variables>
|
|
198
|
-
|
|
302
|
+
export declare interface MutationResult<Data, Variables>
|
|
303
|
+
extends DataConnectResult<Data, Variables> {
|
|
304
|
+
ref: MutationRef<Data, Variables>;
|
|
199
305
|
}
|
|
306
|
+
|
|
200
307
|
/**
|
|
201
308
|
* `OnCompleteSubscription`
|
|
202
309
|
*/
|
|
203
310
|
export declare type OnCompleteSubscription = () => void;
|
|
311
|
+
|
|
204
312
|
/**
|
|
205
313
|
* Signature for `OnErrorSubscription` for `subscribe`
|
|
206
314
|
*/
|
|
207
315
|
export declare type OnErrorSubscription = (err?: DataConnectError) => void;
|
|
316
|
+
|
|
208
317
|
/**
|
|
209
318
|
* Signature for `OnResultSubscription` for `subscribe`
|
|
210
319
|
*/
|
|
211
|
-
export declare type OnResultSubscription<Data, Variables> = (
|
|
320
|
+
export declare type OnResultSubscription<Data, Variables> = (
|
|
321
|
+
res: QueryResult<Data, Variables>
|
|
322
|
+
) => void;
|
|
323
|
+
|
|
212
324
|
export declare interface OperationRef<_Data, Variables> {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
325
|
+
name: string;
|
|
326
|
+
variables: Variables;
|
|
327
|
+
refType: ReferenceType;
|
|
328
|
+
dataConnect: DataConnect;
|
|
217
329
|
}
|
|
330
|
+
|
|
218
331
|
export declare interface OpResult<Data> {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
332
|
+
data: Data;
|
|
333
|
+
source: DataSource;
|
|
334
|
+
fetchTime: string;
|
|
335
|
+
extensions?: Extensions;
|
|
223
336
|
}
|
|
337
|
+
|
|
224
338
|
/* Excluded from this release type: parseOptions */
|
|
225
|
-
|
|
339
|
+
|
|
340
|
+
export declare const QUERY_STR = 'query';
|
|
341
|
+
|
|
226
342
|
/**
|
|
227
343
|
* @license
|
|
228
344
|
* Copyright 2025 Google LLC
|
|
@@ -240,29 +356,39 @@ export declare const QUERY_STR = "query";
|
|
|
240
356
|
* limitations under the License.
|
|
241
357
|
*/
|
|
242
358
|
export declare const QueryFetchPolicy: {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
359
|
+
readonly PREFER_CACHE: 'PREFER_CACHE';
|
|
360
|
+
readonly CACHE_ONLY: 'CACHE_ONLY';
|
|
361
|
+
readonly SERVER_ONLY: 'SERVER_ONLY';
|
|
246
362
|
};
|
|
247
|
-
|
|
363
|
+
|
|
364
|
+
export declare type QueryFetchPolicy =
|
|
365
|
+
(typeof QueryFetchPolicy)[keyof typeof QueryFetchPolicy];
|
|
366
|
+
|
|
248
367
|
/**
|
|
249
368
|
* Promise returned from `executeQuery`
|
|
250
369
|
*/
|
|
251
|
-
export declare interface QueryPromise<Data, Variables>
|
|
252
|
-
}
|
|
370
|
+
export declare interface QueryPromise<Data, Variables>
|
|
371
|
+
extends Promise<QueryResult<Data, Variables>> {}
|
|
372
|
+
|
|
253
373
|
/**
|
|
254
374
|
* QueryRef object
|
|
255
375
|
*/
|
|
256
|
-
export declare interface QueryRef<Data, Variables>
|
|
257
|
-
|
|
376
|
+
export declare interface QueryRef<Data, Variables>
|
|
377
|
+
extends OperationRef<Data, Variables> {
|
|
378
|
+
refType: typeof QUERY_STR;
|
|
258
379
|
}
|
|
380
|
+
|
|
259
381
|
/**
|
|
260
382
|
* Execute Query
|
|
261
383
|
* @param dcInstance Data Connect instance to use.
|
|
262
384
|
* @param queryName Query to execute
|
|
263
385
|
* @returns `QueryRef`
|
|
264
386
|
*/
|
|
265
|
-
export declare function queryRef<Data>(
|
|
387
|
+
export declare function queryRef<Data>(
|
|
388
|
+
dcInstance: DataConnect,
|
|
389
|
+
queryName: string
|
|
390
|
+
): QueryRef<Data, undefined>;
|
|
391
|
+
|
|
266
392
|
/**
|
|
267
393
|
* Execute Query
|
|
268
394
|
* @param dcInstance Data Connect instance to use.
|
|
@@ -270,47 +396,70 @@ export declare function queryRef<Data>(dcInstance: DataConnect, queryName: strin
|
|
|
270
396
|
* @param variables Variables to execute with
|
|
271
397
|
* @returns `QueryRef`
|
|
272
398
|
*/
|
|
273
|
-
export declare function queryRef<Data, Variables>(
|
|
399
|
+
export declare function queryRef<Data, Variables>(
|
|
400
|
+
dcInstance: DataConnect,
|
|
401
|
+
queryName: string,
|
|
402
|
+
variables: Variables
|
|
403
|
+
): QueryRef<Data, Variables>;
|
|
404
|
+
|
|
274
405
|
/**
|
|
275
406
|
* Result of `executeQuery`
|
|
276
407
|
*/
|
|
277
|
-
export declare interface QueryResult<Data, Variables>
|
|
278
|
-
|
|
279
|
-
|
|
408
|
+
export declare interface QueryResult<Data, Variables>
|
|
409
|
+
extends DataConnectResult<Data, Variables> {
|
|
410
|
+
ref: QueryRef<Data, Variables>;
|
|
411
|
+
toJSON: () => SerializedRef<Data, Variables>;
|
|
280
412
|
}
|
|
413
|
+
|
|
281
414
|
/**
|
|
282
415
|
* Signature for unsubscribe from `subscribe`
|
|
283
416
|
*/
|
|
284
417
|
export declare type QueryUnsubscribe = () => void;
|
|
418
|
+
|
|
285
419
|
export declare type ReferenceType = typeof QUERY_STR | typeof MUTATION_STR;
|
|
420
|
+
|
|
286
421
|
/**
|
|
287
422
|
* Serialized RefInfo as a result of `QueryResult.toJSON().refInfo`
|
|
288
423
|
*/
|
|
289
424
|
export declare interface RefInfo<Variables> {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
425
|
+
name: string;
|
|
426
|
+
variables: Variables;
|
|
427
|
+
connectorConfig: DataConnectOptions;
|
|
293
428
|
}
|
|
429
|
+
|
|
294
430
|
/**
|
|
295
431
|
* Serialized Ref as a result of `QueryResult.toJSON()`
|
|
296
432
|
*/
|
|
297
433
|
export declare interface SerializedRef<Data, Variables> extends OpResult<Data> {
|
|
298
|
-
|
|
434
|
+
refInfo: RefInfo<Variables>;
|
|
299
435
|
}
|
|
436
|
+
|
|
300
437
|
export declare function setLogLevel(logLevel: LogLevelString): void;
|
|
301
|
-
|
|
302
|
-
export declare const
|
|
438
|
+
|
|
439
|
+
export declare const SOURCE_CACHE = 'CACHE';
|
|
440
|
+
|
|
441
|
+
export declare const SOURCE_SERVER = 'SERVER';
|
|
442
|
+
|
|
303
443
|
export declare const StorageType: {
|
|
304
|
-
|
|
444
|
+
readonly MEMORY: 'MEMORY';
|
|
305
445
|
};
|
|
306
|
-
|
|
446
|
+
|
|
447
|
+
export declare type StorageType =
|
|
448
|
+
(typeof StorageType)[keyof typeof StorageType];
|
|
449
|
+
|
|
307
450
|
/**
|
|
308
451
|
* Subscribe to a `QueryRef`
|
|
309
452
|
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
310
453
|
* @param observer observer object to use for subscribing.
|
|
311
454
|
* @returns `SubscriptionOptions`
|
|
312
455
|
*/
|
|
313
|
-
export declare function subscribe<Data, Variables>(
|
|
456
|
+
export declare function subscribe<Data, Variables>(
|
|
457
|
+
queryRefOrSerializedResult:
|
|
458
|
+
| QueryRef<Data, Variables>
|
|
459
|
+
| SerializedRef<Data, Variables>,
|
|
460
|
+
observer: SubscriptionOptions<Data, Variables>
|
|
461
|
+
): QueryUnsubscribe;
|
|
462
|
+
|
|
314
463
|
/**
|
|
315
464
|
* Subscribe to a `QueryRef`
|
|
316
465
|
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
@@ -319,38 +468,57 @@ export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: Q
|
|
|
319
468
|
* @param onComplete Called when subscription completes.
|
|
320
469
|
* @returns `SubscriptionOptions`
|
|
321
470
|
*/
|
|
322
|
-
export declare function subscribe<Data, Variables>(
|
|
471
|
+
export declare function subscribe<Data, Variables>(
|
|
472
|
+
queryRefOrSerializedResult:
|
|
473
|
+
| QueryRef<Data, Variables>
|
|
474
|
+
| SerializedRef<Data, Variables>,
|
|
475
|
+
onNext: OnResultSubscription<Data, Variables>,
|
|
476
|
+
onError?: OnErrorSubscription,
|
|
477
|
+
onComplete?: OnCompleteSubscription
|
|
478
|
+
): QueryUnsubscribe;
|
|
479
|
+
|
|
323
480
|
/* Excluded from this release type: SubscribeObserver */
|
|
481
|
+
|
|
324
482
|
/**
|
|
325
483
|
* Representation of full observer options in `subscribe`
|
|
326
484
|
*/
|
|
327
485
|
export declare interface SubscriptionOptions<Data, Variables> {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
486
|
+
onNext?: OnResultSubscription<Data, Variables>;
|
|
487
|
+
onErr?: OnErrorSubscription;
|
|
488
|
+
onComplete?: OnCompleteSubscription;
|
|
331
489
|
}
|
|
490
|
+
|
|
332
491
|
/**
|
|
333
492
|
* Delete DataConnect instance
|
|
334
493
|
* @param dataConnect DataConnect instance
|
|
335
494
|
* @returns
|
|
336
495
|
*/
|
|
337
496
|
export declare function terminate(dataConnect: DataConnect): Promise<void>;
|
|
497
|
+
|
|
338
498
|
/**
|
|
339
499
|
* Converts serialized ref to query ref
|
|
340
500
|
* @param serializedRef ref to convert to `QueryRef`
|
|
341
501
|
* @returns `QueryRef`
|
|
342
502
|
*/
|
|
343
|
-
export declare function toQueryRef<Data, Variables>(
|
|
503
|
+
export declare function toQueryRef<Data, Variables>(
|
|
504
|
+
serializedRef: SerializedRef<Data, Variables>
|
|
505
|
+
): QueryRef<Data, Variables>;
|
|
506
|
+
|
|
344
507
|
/* Excluded from this release type: TransportClass */
|
|
508
|
+
|
|
345
509
|
/**
|
|
346
510
|
* Options to connect to emulator
|
|
347
511
|
*/
|
|
348
512
|
export declare interface TransportOptions {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
513
|
+
host: string;
|
|
514
|
+
sslEnabled?: boolean;
|
|
515
|
+
port?: number;
|
|
352
516
|
}
|
|
517
|
+
|
|
353
518
|
/* Excluded from this release type: validateArgs */
|
|
519
|
+
|
|
354
520
|
/* Excluded from this release type: validateArgsWithOptions */
|
|
521
|
+
|
|
355
522
|
/* Excluded from this release type: validateDCOptions */
|
|
523
|
+
|
|
356
524
|
export {};
|
|
@@ -49,7 +49,7 @@ export interface StreamRequestHeaders {
|
|
|
49
49
|
/** used to initially authenticate or re-authenticate user */
|
|
50
50
|
'X-Firebase-Auth-Token'?: string;
|
|
51
51
|
/** used to initially attest app */
|
|
52
|
-
'X-Firebase-
|
|
52
|
+
'X-Firebase-AppCheck'?: string;
|
|
53
53
|
/** SDK telemetry header */
|
|
54
54
|
'X-Goog-Api-Client'?: string;
|
|
55
55
|
/** firebase appid */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/data-connect",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"@firebase/app": "0.x"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@firebase/auth-interop-types": "0.2.
|
|
52
|
-
"@firebase/component": "0.7.
|
|
53
|
-
"@firebase/logger": "0.5.
|
|
54
|
-
"@firebase/util": "1.15.
|
|
51
|
+
"@firebase/auth-interop-types": "0.2.6",
|
|
52
|
+
"@firebase/component": "0.7.5",
|
|
53
|
+
"@firebase/logger": "0.5.2",
|
|
54
|
+
"@firebase/util": "1.15.3",
|
|
55
55
|
"tslib": "^2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@firebase/app": "0.16.
|
|
58
|
+
"@firebase/app": "0.16.1",
|
|
59
59
|
"rollup": "4.62.2",
|
|
60
60
|
"rollup-plugin-typescript2": "0.37.0",
|
|
61
61
|
"typescript": "5.5.4"
|