@depup/firebase__data-connect 0.4.0-depup.0
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/README.md +31 -0
- package/changes.json +10 -0
- package/dist/index.cjs.js +2069 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +2039 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.node.cjs.js +2084 -0
- package/dist/index.node.cjs.js.map +1 -0
- package/dist/internal.d.ts +748 -0
- package/dist/node-esm/index.node.esm.js +2054 -0
- package/dist/node-esm/index.node.esm.js.map +1 -0
- package/dist/node-esm/package.json +1 -0
- package/dist/node-esm/src/api/DataConnect.d.ts +159 -0
- package/dist/node-esm/src/api/Mutation.d.ts +61 -0
- package/dist/node-esm/src/api/Reference.d.ts +53 -0
- package/dist/node-esm/src/api/index.d.ts +25 -0
- package/dist/node-esm/src/api/query.d.ts +71 -0
- package/dist/node-esm/src/api.browser.d.ts +18 -0
- package/dist/node-esm/src/api.node.d.ts +18 -0
- package/dist/node-esm/src/cache/Cache.d.ts +53 -0
- package/dist/node-esm/src/cache/CacheProvider.d.ts +25 -0
- package/dist/node-esm/src/cache/EntityDataObject.d.ts +37 -0
- package/dist/node-esm/src/cache/EntityNode.d.ts +56 -0
- package/dist/node-esm/src/cache/ImpactedQueryRefsAccumulator.d.ts +23 -0
- package/dist/node-esm/src/cache/InMemoryCacheProvider.d.ts +30 -0
- package/dist/node-esm/src/cache/ResultTree.d.ts +42 -0
- package/dist/node-esm/src/cache/ResultTreeProcessor.d.ts +40 -0
- package/dist/node-esm/src/cache/cacheUtils.d.ts +20 -0
- package/dist/node-esm/src/core/AppCheckTokenProvider.d.ts +31 -0
- package/dist/node-esm/src/core/FirebaseAuthProvider.d.ts +36 -0
- package/dist/node-esm/src/core/error.d.ts +53 -0
- package/dist/node-esm/src/core/query/QueryManager.d.ts +47 -0
- package/dist/node-esm/src/core/query/queryOptions.d.ts +25 -0
- package/dist/node-esm/src/core/query/subscribe.d.ts +67 -0
- package/dist/node-esm/src/core/version.d.ts +23 -0
- package/dist/node-esm/src/index.d.ts +29 -0
- package/dist/node-esm/src/index.node.d.ts +18 -0
- package/dist/node-esm/src/logger.d.ts +20 -0
- package/dist/node-esm/src/network/fetch.d.ts +24 -0
- package/dist/node-esm/src/network/index.d.ts +17 -0
- package/dist/node-esm/src/network/transport/index.d.ts +81 -0
- package/dist/node-esm/src/network/transport/rest.d.ts +49 -0
- package/dist/node-esm/src/register.d.ts +1 -0
- package/dist/node-esm/src/util/encoder.d.ts +22 -0
- package/dist/node-esm/src/util/map.d.ts +17 -0
- package/dist/node-esm/src/util/url.d.ts +20 -0
- package/dist/node-esm/src/util/validateArgs.d.ts +33 -0
- package/dist/private.d.ts +655 -0
- package/dist/public.d.ts +350 -0
- package/dist/src/api/DataConnect.d.ts +159 -0
- package/dist/src/api/Mutation.d.ts +61 -0
- package/dist/src/api/Reference.d.ts +53 -0
- package/dist/src/api/index.d.ts +25 -0
- package/dist/src/api/query.d.ts +71 -0
- package/dist/src/api.browser.d.ts +18 -0
- package/dist/src/api.node.d.ts +18 -0
- package/dist/src/cache/Cache.d.ts +53 -0
- package/dist/src/cache/CacheProvider.d.ts +25 -0
- package/dist/src/cache/EntityDataObject.d.ts +37 -0
- package/dist/src/cache/EntityNode.d.ts +56 -0
- package/dist/src/cache/ImpactedQueryRefsAccumulator.d.ts +23 -0
- package/dist/src/cache/InMemoryCacheProvider.d.ts +30 -0
- package/dist/src/cache/ResultTree.d.ts +42 -0
- package/dist/src/cache/ResultTreeProcessor.d.ts +40 -0
- package/dist/src/cache/cacheUtils.d.ts +20 -0
- package/dist/src/core/AppCheckTokenProvider.d.ts +31 -0
- package/dist/src/core/FirebaseAuthProvider.d.ts +36 -0
- package/dist/src/core/error.d.ts +53 -0
- package/dist/src/core/query/QueryManager.d.ts +47 -0
- package/dist/src/core/query/queryOptions.d.ts +25 -0
- package/dist/src/core/query/subscribe.d.ts +67 -0
- package/dist/src/core/version.d.ts +23 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/index.node.d.ts +18 -0
- package/dist/src/logger.d.ts +20 -0
- package/dist/src/network/fetch.d.ts +24 -0
- package/dist/src/network/index.d.ts +17 -0
- package/dist/src/network/transport/index.d.ts +81 -0
- package/dist/src/network/transport/rest.d.ts +49 -0
- package/dist/src/register.d.ts +1 -0
- package/dist/src/tsdoc-metadata.json +11 -0
- package/dist/src/util/encoder.d.ts +22 -0
- package/dist/src/util/map.d.ts +17 -0
- package/dist/src/util/url.d.ts +20 -0
- package/dist/src/util/validateArgs.d.ts +33 -0
- package/package.json +99 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { QueryRef, QueryResult } from '../../api/query';
|
|
18
|
+
import { SerializedRef } from '../../api/Reference';
|
|
19
|
+
import { DataConnectError } from '../error';
|
|
20
|
+
/**
|
|
21
|
+
* `OnCompleteSubscription`
|
|
22
|
+
*/
|
|
23
|
+
export type OnCompleteSubscription = () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Representation of full observer options in `subscribe`
|
|
26
|
+
*/
|
|
27
|
+
export interface SubscriptionOptions<Data, Variables> {
|
|
28
|
+
onNext?: OnResultSubscription<Data, Variables>;
|
|
29
|
+
onErr?: OnErrorSubscription;
|
|
30
|
+
onComplete?: OnCompleteSubscription;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Signature for `OnResultSubscription` for `subscribe`
|
|
34
|
+
*/
|
|
35
|
+
export type OnResultSubscription<Data, Variables> = (res: QueryResult<Data, Variables>) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Signature for `OnErrorSubscription` for `subscribe`
|
|
38
|
+
*/
|
|
39
|
+
export type OnErrorSubscription = (err?: DataConnectError) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Signature for unsubscribe from `subscribe`
|
|
42
|
+
*/
|
|
43
|
+
export type QueryUnsubscribe = () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Representation of user provided subscription options.
|
|
46
|
+
*/
|
|
47
|
+
export interface DataConnectSubscription<Data, Variables> {
|
|
48
|
+
userCallback: OnResultSubscription<Data, Variables>;
|
|
49
|
+
errCallback?: (e?: DataConnectError) => void;
|
|
50
|
+
unsubscribe: () => void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Subscribe to a `QueryRef`
|
|
54
|
+
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
55
|
+
* @param observer observer object to use for subscribing.
|
|
56
|
+
* @returns `SubscriptionOptions`
|
|
57
|
+
*/
|
|
58
|
+
export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: QueryRef<Data, Variables> | SerializedRef<Data, Variables>, observer: SubscriptionOptions<Data, Variables>): QueryUnsubscribe;
|
|
59
|
+
/**
|
|
60
|
+
* Subscribe to a `QueryRef`
|
|
61
|
+
* @param queryRefOrSerializedResult query ref or serialized result.
|
|
62
|
+
* @param onNext Callback to call when result comes back.
|
|
63
|
+
* @param onError Callback to call when error gets thrown.
|
|
64
|
+
* @param onComplete Called when subscription completes.
|
|
65
|
+
* @returns `SubscriptionOptions`
|
|
66
|
+
*/
|
|
67
|
+
export declare function subscribe<Data, Variables>(queryRefOrSerializedResult: QueryRef<Data, Variables> | SerializedRef<Data, Variables>, onNext: OnResultSubscription<Data, Variables>, onError?: OnErrorSubscription, onComplete?: OnCompleteSubscription): QueryUnsubscribe;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/** The semver (www.semver.org) version of the SDK. */
|
|
18
|
+
export declare let SDK_VERSION: string;
|
|
19
|
+
/**
|
|
20
|
+
* SDK_VERSION should be set before any database instance is created
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function setSDKVersion(version: string): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Firebase Data Connect
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2024 Google LLC
|
|
9
|
+
*
|
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
* you may not use this file except in compliance with the License.
|
|
12
|
+
* You may obtain a copy of the License at
|
|
13
|
+
*
|
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
*
|
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
* See the License for the specific language governing permissions and
|
|
20
|
+
* limitations under the License.
|
|
21
|
+
*/
|
|
22
|
+
import { DataConnect } from './api/DataConnect';
|
|
23
|
+
export * from './api';
|
|
24
|
+
export * from './api.browser';
|
|
25
|
+
declare module '@firebase/component' {
|
|
26
|
+
interface NameServiceMapping {
|
|
27
|
+
'data-connect': DataConnect;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export * from './api';
|
|
18
|
+
export * from './api.node';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { LogLevelString } from '@firebase/logger';
|
|
18
|
+
export declare function setLogLevel(logLevel: LogLevelString): void;
|
|
19
|
+
export declare function logDebug(msg: string): void;
|
|
20
|
+
export declare function logError(msg: string): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { CallerSdkType, DataConnectResponse } from './transport';
|
|
18
|
+
export declare function initializeFetch(fetchImpl: typeof fetch): void;
|
|
19
|
+
export interface DataConnectFetchBody<T> {
|
|
20
|
+
name: string;
|
|
21
|
+
operationName: string;
|
|
22
|
+
variables: T;
|
|
23
|
+
}
|
|
24
|
+
export declare function dcFetch<T, U>(url: string, body: DataConnectFetchBody<U>, { signal }: AbortController, appId: string | null | undefined, accessToken: string | null, appCheckToken: string | null | undefined, _isUsingGen: boolean, _callerSdkType: CallerSdkType, _isUsingEmulator: boolean): Promise<DataConnectResponse<T>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export { CallerSdkType, CallerSdkTypeEnum, DataConnectTransport, DataConnectEntityArray, DataConnectSingleEntity, DataConnectExtension, Extensions, TransportClass } from './transport';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { DataConnectOptions, TransportOptions } from '../../api/DataConnect';
|
|
18
|
+
import { AppCheckTokenProvider } from '../../core/AppCheckTokenProvider';
|
|
19
|
+
import { AuthTokenProvider } from '../../core/FirebaseAuthProvider';
|
|
20
|
+
/**
|
|
21
|
+
* enum representing different flavors of the SDK used by developers
|
|
22
|
+
* use the CallerSdkType for type-checking, and the CallerSdkTypeEnum for value-checking/assigning
|
|
23
|
+
*/
|
|
24
|
+
export type CallerSdkType = 'Base' | 'Generated' | 'TanstackReactCore' | 'GeneratedReact' | 'TanstackAngularCore' | 'GeneratedAngular';
|
|
25
|
+
export declare const CallerSdkTypeEnum: {
|
|
26
|
+
readonly Base: "Base";
|
|
27
|
+
readonly Generated: "Generated";
|
|
28
|
+
readonly TanstackReactCore: "TanstackReactCore";
|
|
29
|
+
readonly GeneratedReact: "GeneratedReact";
|
|
30
|
+
readonly TanstackAngularCore: "TanstackAngularCore";
|
|
31
|
+
readonly GeneratedAngular: "GeneratedAngular";
|
|
32
|
+
};
|
|
33
|
+
export interface DataConnectEntityArray {
|
|
34
|
+
entityIds: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface DataConnectSingleEntity {
|
|
37
|
+
entityId: string;
|
|
38
|
+
}
|
|
39
|
+
export type DataConnectExtension = {
|
|
40
|
+
path: Array<string | number>;
|
|
41
|
+
} & (DataConnectEntityArray | DataConnectSingleEntity);
|
|
42
|
+
/** @internal */
|
|
43
|
+
export interface DataConnectMaxAge {
|
|
44
|
+
maxAge: string;
|
|
45
|
+
}
|
|
46
|
+
/** @internal */
|
|
47
|
+
export type DataConnectExtensionWithMaxAge = {
|
|
48
|
+
path: Array<string | number>;
|
|
49
|
+
} & (DataConnectEntityArray | DataConnectSingleEntity | DataConnectMaxAge);
|
|
50
|
+
export interface Extensions {
|
|
51
|
+
dataConnect?: DataConnectExtension[];
|
|
52
|
+
}
|
|
53
|
+
/** @internal */
|
|
54
|
+
export interface ExtensionsWithMaxAge {
|
|
55
|
+
dataConnect?: DataConnectExtensionWithMaxAge[];
|
|
56
|
+
}
|
|
57
|
+
export interface DataConnectResponse<T> {
|
|
58
|
+
data: T;
|
|
59
|
+
errors: Error[];
|
|
60
|
+
extensions: Extensions;
|
|
61
|
+
}
|
|
62
|
+
/** @internal */
|
|
63
|
+
export interface DataConnectResponseWithMaxAge<T> {
|
|
64
|
+
data: T;
|
|
65
|
+
errors: Error[];
|
|
66
|
+
extensions: ExtensionsWithMaxAge;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
export interface DataConnectTransport {
|
|
72
|
+
invokeQuery<T, U>(queryName: string, body?: U): Promise<DataConnectResponseWithMaxAge<T>>;
|
|
73
|
+
invokeMutation<T, U>(queryName: string, body?: U): Promise<DataConnectResponse<T>>;
|
|
74
|
+
useEmulator(host: string, port?: number, sslEnabled?: boolean): void;
|
|
75
|
+
onTokenChanged: (token: string | null) => void;
|
|
76
|
+
_setCallerSdkType(callerSdkType: CallerSdkType): void;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export type TransportClass = new (options: DataConnectOptions, apiKey?: string, appId?: string, authProvider?: AuthTokenProvider, appCheckProvider?: AppCheckTokenProvider, transportOptions?: TransportOptions, _isUsingGen?: boolean, _callerSdkType?: CallerSdkType) => DataConnectTransport;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { DataConnectOptions, TransportOptions } from '../../api/DataConnect';
|
|
18
|
+
import { AppCheckTokenProvider } from '../../core/AppCheckTokenProvider';
|
|
19
|
+
import { AuthTokenProvider } from '../../core/FirebaseAuthProvider';
|
|
20
|
+
import { CallerSdkType, DataConnectResponse, DataConnectTransport } from '.';
|
|
21
|
+
export declare class RESTTransport implements DataConnectTransport {
|
|
22
|
+
private apiKey?;
|
|
23
|
+
private appId?;
|
|
24
|
+
private authProvider?;
|
|
25
|
+
private appCheckProvider?;
|
|
26
|
+
private _isUsingGen;
|
|
27
|
+
private _callerSdkType;
|
|
28
|
+
private _host;
|
|
29
|
+
private _port;
|
|
30
|
+
private _location;
|
|
31
|
+
private _connectorName;
|
|
32
|
+
private _secure;
|
|
33
|
+
private _project;
|
|
34
|
+
private _serviceName;
|
|
35
|
+
private _accessToken;
|
|
36
|
+
private _appCheckToken;
|
|
37
|
+
private _lastToken;
|
|
38
|
+
private _isUsingEmulator;
|
|
39
|
+
constructor(options: DataConnectOptions, apiKey?: string | undefined, appId?: (string | null) | undefined, authProvider?: AuthTokenProvider | undefined, appCheckProvider?: AppCheckTokenProvider | undefined, transportOptions?: TransportOptions | undefined, _isUsingGen?: boolean, _callerSdkType?: CallerSdkType);
|
|
40
|
+
get endpointUrl(): string;
|
|
41
|
+
useEmulator(host: string, port?: number, isSecure?: boolean): void;
|
|
42
|
+
onTokenChanged(newToken: string | null): void;
|
|
43
|
+
getWithAuth(forceToken?: boolean): Promise<string | null>;
|
|
44
|
+
_setLastToken(lastToken: string | null): void;
|
|
45
|
+
withRetry<T>(promiseFactory: () => Promise<DataConnectResponse<T>>, retry?: boolean): Promise<DataConnectResponse<T>>;
|
|
46
|
+
invokeQuery: <T, U>(queryName: string, body?: U) => Promise<DataConnectResponse<T>>;
|
|
47
|
+
invokeMutation: <T, U>(queryName: string, body?: U) => Promise<DataConnectResponse<T>>;
|
|
48
|
+
_setCallerSdkType(callerSdkType: CallerSdkType): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerDataConnect(variant?: string): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "0.1.2"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export type HmacImpl = (obj: Record<string, unknown>) => string;
|
|
18
|
+
export declare let encoderImpl: HmacImpl;
|
|
19
|
+
export type DecodeHmacImpl = (s: string) => Record<string, unknown>;
|
|
20
|
+
export declare let decoderImpl: DecodeHmacImpl;
|
|
21
|
+
export declare function setEncoder(encoder: HmacImpl): void;
|
|
22
|
+
export declare function setDecoder(decoder: DecodeHmacImpl): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setIfNotExists<T>(map: Map<string, T>, key: string, val: T): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { DataConnectOptions, TransportOptions } from '../api/DataConnect';
|
|
18
|
+
export declare const PROD_HOST = "firebasedataconnect.googleapis.com";
|
|
19
|
+
export declare function urlBuilder(projectConfig: DataConnectOptions, transportOptions: TransportOptions): string;
|
|
20
|
+
export declare function addToken(url: string, apiKey?: string): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { ConnectorConfig, DataConnect } from '../api/DataConnect';
|
|
18
|
+
interface ParsedArgs<Variables> {
|
|
19
|
+
dc: DataConnect;
|
|
20
|
+
vars: Variables;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The generated SDK will allow the user to pass in either the variable or the data connect instance with the variable,
|
|
24
|
+
* and this function validates the variables and returns back the DataConnect instance and variables based on the arguments passed in.
|
|
25
|
+
* @param connectorConfig
|
|
26
|
+
* @param dcOrVars
|
|
27
|
+
* @param vars
|
|
28
|
+
* @param validateVars
|
|
29
|
+
* @returns {DataConnect} and {Variables} instance
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function validateArgs<Variables extends object>(connectorConfig: ConnectorConfig, dcOrVars?: DataConnect | Variables, vars?: Variables, validateVars?: boolean): ParsedArgs<Variables>;
|
|
33
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@depup/firebase__data-connect",
|
|
3
|
+
"version": "0.4.0-depup.0",
|
|
4
|
+
"description": "[DepUp] Dependency-bumped version of @firebase/data-connect",
|
|
5
|
+
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
|
+
"main": "dist/index.node.cjs.js",
|
|
7
|
+
"browser": "dist/index.esm.js",
|
|
8
|
+
"module": "dist/index.esm.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/public.d.ts",
|
|
12
|
+
"node": {
|
|
13
|
+
"import": "./dist/node-esm/index.node.esm.js",
|
|
14
|
+
"require": "./dist/index.node.cjs.js"
|
|
15
|
+
},
|
|
16
|
+
"browser": {
|
|
17
|
+
"require": "./dist/index.cjs.js",
|
|
18
|
+
"import": "./dist/index.esm.js"
|
|
19
|
+
},
|
|
20
|
+
"default": "./dist/index.esm.js"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"changes.json",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore' --fix",
|
|
31
|
+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
|
32
|
+
"build": "rollup -c rollup.config.js && yarn api-report",
|
|
33
|
+
"prettier": "prettier --write '*.js' '*.ts' '@(src|test)/**/*.ts'",
|
|
34
|
+
"build:deps": "lerna run --scope @firebase/'{app,data-connect}' --include-dependencies build",
|
|
35
|
+
"dev": "rollup -c -w",
|
|
36
|
+
"test": "run-p --npm-path npm lint test:emulator",
|
|
37
|
+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
|
|
38
|
+
"test:all": "run-p --npm-path npm lint test:browser test:node",
|
|
39
|
+
"test:browser": "karma start",
|
|
40
|
+
"test:node": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
|
|
41
|
+
"test:unit": "TS_NODE_FILES=true TS_NODE_CACHE=NO TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'test/unit/**/*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
|
|
42
|
+
"test:emulator": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/dataconnect-test-runner.ts",
|
|
43
|
+
"api-report": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package data-connect --packageRoot . --typescriptDts ./dist/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/public.d.ts && yarn api-report:api-json",
|
|
44
|
+
"api-report:api-json": "rm -rf temp && api-extractor run --local --verbose",
|
|
45
|
+
"doc": "api-documenter markdown --input temp --output docs",
|
|
46
|
+
"typings:public": "node ../../scripts/build/use_typings.js ./dist/public.d.ts"
|
|
47
|
+
},
|
|
48
|
+
"license": "Apache-2.0",
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@firebase/app": "0.x"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@firebase/auth-interop-types": "0.2.4",
|
|
54
|
+
"@firebase/component": "0.7.1",
|
|
55
|
+
"@firebase/logger": "0.5.0",
|
|
56
|
+
"@firebase/util": "1.14.0",
|
|
57
|
+
"tslib": "^2.8.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@firebase/app": "0.14.9",
|
|
61
|
+
"rollup": "2.79.2",
|
|
62
|
+
"rollup-plugin-typescript2": "0.36.0",
|
|
63
|
+
"typescript": "5.5.4"
|
|
64
|
+
},
|
|
65
|
+
"repository": {
|
|
66
|
+
"directory": "packages/data-connect",
|
|
67
|
+
"type": "git",
|
|
68
|
+
"url": "https://github.com/firebase/firebase-js-sdk.git"
|
|
69
|
+
},
|
|
70
|
+
"bugs": {
|
|
71
|
+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
|
72
|
+
},
|
|
73
|
+
"typings": "./dist/public.d.ts",
|
|
74
|
+
"nyc": {
|
|
75
|
+
"extension": [
|
|
76
|
+
".ts"
|
|
77
|
+
],
|
|
78
|
+
"reportDir": "./coverage/node"
|
|
79
|
+
},
|
|
80
|
+
"keywords": [
|
|
81
|
+
"depup",
|
|
82
|
+
"dependency-bumped",
|
|
83
|
+
"updated-deps",
|
|
84
|
+
"@firebase/data-connect"
|
|
85
|
+
],
|
|
86
|
+
"depup": {
|
|
87
|
+
"changes": {
|
|
88
|
+
"tslib": {
|
|
89
|
+
"from": "^2.1.0",
|
|
90
|
+
"to": "^2.8.1"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"depsUpdated": 1,
|
|
94
|
+
"originalPackage": "@firebase/data-connect",
|
|
95
|
+
"originalVersion": "0.4.0",
|
|
96
|
+
"processedAt": "2026-03-17T16:32:31.685Z",
|
|
97
|
+
"smokeTest": "failed"
|
|
98
|
+
}
|
|
99
|
+
}
|