@firebase/data-connect 0.1.1 → 0.1.2
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 +1108 -1108
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +1108 -1108
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +1123 -1123
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +1123 -1123
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/DataConnect.d.ts +108 -108
- package/dist/node-esm/src/api/Mutation.d.ts +61 -61
- package/dist/node-esm/src/api/Reference.d.ts +51 -51
- package/dist/node-esm/src/api/index.d.ts +23 -23
- package/dist/node-esm/src/api/query.d.ts +96 -96
- package/dist/node-esm/src/api.browser.d.ts +34 -34
- package/dist/node-esm/src/api.node.d.ts +17 -17
- package/dist/node-esm/src/core/AppCheckTokenProvider.d.ts +30 -30
- package/dist/node-esm/src/core/FirebaseAuthProvider.d.ts +34 -34
- package/dist/node-esm/src/core/QueryManager.d.ts +36 -36
- package/dist/node-esm/src/core/error.d.ts +51 -51
- package/dist/node-esm/src/core/version.d.ts +23 -23
- package/dist/node-esm/src/index.d.ts +29 -29
- package/dist/node-esm/src/index.node.d.ts +18 -18
- package/dist/node-esm/src/logger.d.ts +20 -20
- package/dist/node-esm/src/network/fetch.d.ts +21 -21
- package/dist/node-esm/src/network/index.d.ts +17 -17
- package/dist/node-esm/src/network/transport/index.d.ts +43 -43
- package/dist/node-esm/src/network/transport/rest.d.ts +58 -58
- package/dist/node-esm/src/register.d.ts +1 -1
- package/dist/node-esm/src/util/encoder.d.ts +19 -19
- package/dist/node-esm/src/util/map.d.ts +17 -17
- package/dist/node-esm/src/util/url.d.ts +19 -19
- package/dist/node-esm/src/util/validateArgs.d.ts +33 -33
- package/dist/src/api/DataConnect.d.ts +108 -108
- package/dist/src/api/Mutation.d.ts +61 -61
- package/dist/src/api/Reference.d.ts +51 -51
- package/dist/src/api/index.d.ts +23 -23
- package/dist/src/api/query.d.ts +96 -96
- package/dist/src/api.browser.d.ts +34 -34
- package/dist/src/api.node.d.ts +17 -17
- package/dist/src/core/AppCheckTokenProvider.d.ts +30 -30
- package/dist/src/core/FirebaseAuthProvider.d.ts +34 -34
- package/dist/src/core/QueryManager.d.ts +36 -36
- package/dist/src/core/error.d.ts +51 -51
- package/dist/src/core/version.d.ts +23 -23
- package/dist/src/index.d.ts +29 -29
- package/dist/src/index.node.d.ts +18 -18
- package/dist/src/logger.d.ts +20 -20
- package/dist/src/network/fetch.d.ts +21 -21
- package/dist/src/network/index.d.ts +17 -17
- package/dist/src/network/transport/index.d.ts +43 -43
- package/dist/src/network/transport/rest.d.ts +58 -58
- package/dist/src/register.d.ts +1 -1
- package/dist/src/util/encoder.d.ts +19 -19
- package/dist/src/util/map.d.ts +17 -17
- package/dist/src/util/url.d.ts +19 -19
- package/dist/src/util/validateArgs.d.ts +33 -33
- package/package.json +7 -7
package/dist/src/index.d.ts
CHANGED
|
@@ -1,29 +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
|
-
}
|
|
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
|
+
}
|
package/dist/src/index.node.d.ts
CHANGED
|
@@ -1,18 +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';
|
|
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';
|
package/dist/src/logger.d.ts
CHANGED
|
@@ -1,20 +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;
|
|
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;
|
|
@@ -1,21 +1,21 @@
|
|
|
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 initializeFetch(fetchImpl: typeof fetch): void;
|
|
18
|
-
export declare function dcFetch<T, U>(url: string, body: U, { signal }: AbortController, appId: string | null, accessToken: string | null, appCheckToken: string | null, _isUsingGen: boolean): Promise<{
|
|
19
|
-
data: T;
|
|
20
|
-
errors: Error[];
|
|
21
|
-
}>;
|
|
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 initializeFetch(fetchImpl: typeof fetch): void;
|
|
18
|
+
export declare function dcFetch<T, U>(url: string, body: U, { signal }: AbortController, appId: string | null, accessToken: string | null, appCheckToken: string | null, _isUsingGen: boolean): Promise<{
|
|
19
|
+
data: T;
|
|
20
|
+
errors: Error[];
|
|
21
|
+
}>;
|
|
@@ -1,17 +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 * from './transport';
|
|
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 './transport';
|
|
@@ -1,43 +1,43 @@
|
|
|
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
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export interface DataConnectTransport {
|
|
24
|
-
invokeQuery<T, U>(queryName: string, body?: U): PromiseLike<{
|
|
25
|
-
data: T;
|
|
26
|
-
errors: Error[];
|
|
27
|
-
}>;
|
|
28
|
-
invokeMutation<T, U>(queryName: string, body?: U): PromiseLike<{
|
|
29
|
-
data: T;
|
|
30
|
-
errors: Error[];
|
|
31
|
-
}>;
|
|
32
|
-
useEmulator(host: string, port?: number, sslEnabled?: boolean): void;
|
|
33
|
-
onTokenChanged: (token: string | null) => void;
|
|
34
|
-
}
|
|
35
|
-
export interface CancellableOperation<T> extends PromiseLike<{
|
|
36
|
-
data: T;
|
|
37
|
-
}> {
|
|
38
|
-
cancel: () => void;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
|
-
export
|
|
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
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export interface DataConnectTransport {
|
|
24
|
+
invokeQuery<T, U>(queryName: string, body?: U): PromiseLike<{
|
|
25
|
+
data: T;
|
|
26
|
+
errors: Error[];
|
|
27
|
+
}>;
|
|
28
|
+
invokeMutation<T, U>(queryName: string, body?: U): PromiseLike<{
|
|
29
|
+
data: T;
|
|
30
|
+
errors: Error[];
|
|
31
|
+
}>;
|
|
32
|
+
useEmulator(host: string, port?: number, sslEnabled?: boolean): void;
|
|
33
|
+
onTokenChanged: (token: string | null) => void;
|
|
34
|
+
}
|
|
35
|
+
export interface CancellableOperation<T> extends PromiseLike<{
|
|
36
|
+
data: T;
|
|
37
|
+
}> {
|
|
38
|
+
cancel: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export type TransportClass = new (options: DataConnectOptions, apiKey?: string, appId?: string, authProvider?: AuthTokenProvider, appCheckProvider?: AppCheckTokenProvider, transportOptions?: TransportOptions, _isUsingGen?: boolean) => DataConnectTransport;
|
|
@@ -1,58 +1,58 @@
|
|
|
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 { 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 _host;
|
|
28
|
-
private _port;
|
|
29
|
-
private _location;
|
|
30
|
-
private _connectorName;
|
|
31
|
-
private _secure;
|
|
32
|
-
private _project;
|
|
33
|
-
private _serviceName;
|
|
34
|
-
private _accessToken;
|
|
35
|
-
private _appCheckToken;
|
|
36
|
-
private _lastToken;
|
|
37
|
-
constructor(options: DataConnectOptions, apiKey?: string | undefined, appId?: string, authProvider?: AuthTokenProvider | undefined, appCheckProvider?: AppCheckTokenProvider | undefined, transportOptions?: TransportOptions | undefined, _isUsingGen?: boolean);
|
|
38
|
-
get endpointUrl(): string;
|
|
39
|
-
useEmulator(host: string, port?: number, isSecure?: boolean): void;
|
|
40
|
-
onTokenChanged(newToken: string | null): void;
|
|
41
|
-
getWithAuth(forceToken?: boolean): Promise<string>;
|
|
42
|
-
_setLastToken(lastToken: string | null): void;
|
|
43
|
-
withRetry<T>(promiseFactory: () => Promise<{
|
|
44
|
-
data: T;
|
|
45
|
-
errors: Error[];
|
|
46
|
-
}>, retry?: boolean): Promise<{
|
|
47
|
-
data: T;
|
|
48
|
-
errors: Error[];
|
|
49
|
-
}>;
|
|
50
|
-
invokeQuery: <T, U>(queryName: string, body?: U) => PromiseLike<{
|
|
51
|
-
data: T;
|
|
52
|
-
errors: Error[];
|
|
53
|
-
}>;
|
|
54
|
-
invokeMutation: <T, U>(queryName: string, body?: U) => PromiseLike<{
|
|
55
|
-
data: T;
|
|
56
|
-
errors: Error[];
|
|
57
|
-
}>;
|
|
58
|
-
}
|
|
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 { 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 _host;
|
|
28
|
+
private _port;
|
|
29
|
+
private _location;
|
|
30
|
+
private _connectorName;
|
|
31
|
+
private _secure;
|
|
32
|
+
private _project;
|
|
33
|
+
private _serviceName;
|
|
34
|
+
private _accessToken;
|
|
35
|
+
private _appCheckToken;
|
|
36
|
+
private _lastToken;
|
|
37
|
+
constructor(options: DataConnectOptions, apiKey?: string | undefined, appId?: string, authProvider?: AuthTokenProvider | undefined, appCheckProvider?: AppCheckTokenProvider | undefined, transportOptions?: TransportOptions | undefined, _isUsingGen?: boolean);
|
|
38
|
+
get endpointUrl(): string;
|
|
39
|
+
useEmulator(host: string, port?: number, isSecure?: boolean): void;
|
|
40
|
+
onTokenChanged(newToken: string | null): void;
|
|
41
|
+
getWithAuth(forceToken?: boolean): Promise<string>;
|
|
42
|
+
_setLastToken(lastToken: string | null): void;
|
|
43
|
+
withRetry<T>(promiseFactory: () => Promise<{
|
|
44
|
+
data: T;
|
|
45
|
+
errors: Error[];
|
|
46
|
+
}>, retry?: boolean): Promise<{
|
|
47
|
+
data: T;
|
|
48
|
+
errors: Error[];
|
|
49
|
+
}>;
|
|
50
|
+
invokeQuery: <T, U>(queryName: string, body?: U) => PromiseLike<{
|
|
51
|
+
data: T;
|
|
52
|
+
errors: Error[];
|
|
53
|
+
}>;
|
|
54
|
+
invokeMutation: <T, U>(queryName: string, body?: U) => PromiseLike<{
|
|
55
|
+
data: T;
|
|
56
|
+
errors: Error[];
|
|
57
|
+
}>;
|
|
58
|
+
}
|
package/dist/src/register.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function registerDataConnect(variant?: string): void;
|
|
1
|
+
export declare function registerDataConnect(variant?: string): void;
|
|
@@ -1,19 +1,19 @@
|
|
|
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
|
|
18
|
-
export declare let encoderImpl: HmacImpl;
|
|
19
|
-
export declare function setEncoder(encoder: HmacImpl): void;
|
|
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: unknown) => string;
|
|
18
|
+
export declare let encoderImpl: HmacImpl;
|
|
19
|
+
export declare function setEncoder(encoder: HmacImpl): void;
|
package/dist/src/util/map.d.ts
CHANGED
|
@@ -1,17 +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;
|
|
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;
|
package/dist/src/util/url.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 function urlBuilder(projectConfig: DataConnectOptions, transportOptions: TransportOptions): string;
|
|
19
|
-
export declare function addToken(url: string, apiKey?: string): string;
|
|
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 function urlBuilder(projectConfig: DataConnectOptions, transportOptions: TransportOptions): string;
|
|
19
|
+
export declare function addToken(url: string, apiKey?: string): string;
|
|
@@ -1,33 +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 {};
|
|
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/data-connect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -48,17 +48,17 @@
|
|
|
48
48
|
"@firebase/app": "0.x"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@firebase/auth-interop-types": "0.2.
|
|
52
|
-
"@firebase/component": "0.6.
|
|
53
|
-
"@firebase/logger": "0.4.
|
|
54
|
-
"@firebase/util": "1.10.
|
|
51
|
+
"@firebase/auth-interop-types": "0.2.4",
|
|
52
|
+
"@firebase/component": "0.6.11",
|
|
53
|
+
"@firebase/logger": "0.4.4",
|
|
54
|
+
"@firebase/util": "1.10.2",
|
|
55
55
|
"tslib": "^2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@firebase/app": "0.10.
|
|
58
|
+
"@firebase/app": "0.10.16",
|
|
59
59
|
"rollup": "2.79.1",
|
|
60
60
|
"rollup-plugin-typescript2": "0.31.2",
|
|
61
|
-
"typescript": "
|
|
61
|
+
"typescript": "5.5.4"
|
|
62
62
|
},
|
|
63
63
|
"repository": {
|
|
64
64
|
"directory": "packages/data-connect",
|