@firebase/data-connect 0.3.2 → 0.3.3
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 +29 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +28 -19
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +29 -18
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/internal.d.ts +39 -21
- package/dist/node-esm/index.node.esm.js +28 -19
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/api/index.d.ts +1 -0
- package/dist/node-esm/src/core/error.d.ts +22 -19
- package/dist/private.d.ts +36 -21
- package/dist/public.d.ts +22 -2
- package/dist/src/api/index.d.ts +1 -0
- package/dist/src/core/error.d.ts +22 -19
- package/package.json +2 -2
package/dist/public.d.ts
CHANGED
|
@@ -52,6 +52,26 @@ export declare class DataConnect {
|
|
|
52
52
|
setInitialized(): void;
|
|
53
53
|
enableEmulator(transportOptions: TransportOptions): void;
|
|
54
54
|
}
|
|
55
|
+
/** An error returned by a DataConnect operation. */
|
|
56
|
+
export declare class DataConnectError extends FirebaseError {
|
|
57
|
+
private constructor();
|
|
58
|
+
}
|
|
59
|
+
export declare type DataConnectErrorCode = 'other' | 'already-initialized' | 'not-initialized' | 'not-supported' | 'invalid-argument' | 'partial-error' | 'unauthorized';
|
|
60
|
+
/** An error returned by a DataConnect operation. */
|
|
61
|
+
export declare class DataConnectOperationError extends DataConnectError {
|
|
62
|
+
/* Excluded from this release type: name */
|
|
63
|
+
/** The response received from the backend. */
|
|
64
|
+
readonly response: DataConnectOperationFailureResponse;
|
|
65
|
+
private constructor();
|
|
66
|
+
}
|
|
67
|
+
export declare interface DataConnectOperationFailureResponse {
|
|
68
|
+
readonly data?: Record<string, unknown> | null;
|
|
69
|
+
readonly errors: DataConnectOperationFailureResponseErrorInfo[];
|
|
70
|
+
}
|
|
71
|
+
export declare interface DataConnectOperationFailureResponseErrorInfo {
|
|
72
|
+
readonly message: string;
|
|
73
|
+
readonly path: Array<string | number>;
|
|
74
|
+
}
|
|
55
75
|
/**
|
|
56
76
|
* DataConnectOptions including project id
|
|
57
77
|
*/
|
|
@@ -66,7 +86,7 @@ export declare interface DataConnectResult<Data, Variables> extends OpResult<Dat
|
|
|
66
86
|
*/
|
|
67
87
|
export declare interface DataConnectSubscription<Data, Variables> {
|
|
68
88
|
userCallback: OnResultSubscription<Data, Variables>;
|
|
69
|
-
errCallback?: (e?:
|
|
89
|
+
errCallback?: (e?: DataConnectError) => void;
|
|
70
90
|
unsubscribe: () => void;
|
|
71
91
|
}
|
|
72
92
|
/* Excluded from this release type: DataConnectTransport */
|
|
@@ -130,7 +150,7 @@ export declare type OnCompleteSubscription = () => void;
|
|
|
130
150
|
/**
|
|
131
151
|
* Signature for `OnErrorSubscription` for `subscribe`
|
|
132
152
|
*/
|
|
133
|
-
export declare type OnErrorSubscription = (err?:
|
|
153
|
+
export declare type OnErrorSubscription = (err?: DataConnectError) => void;
|
|
134
154
|
/**
|
|
135
155
|
* Signature for `OnResultSubscription` for `subscribe`
|
|
136
156
|
*/
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -21,3 +21,4 @@ export * from './Mutation';
|
|
|
21
21
|
export * from './query';
|
|
22
22
|
export { setLogLevel } from '../logger';
|
|
23
23
|
export { validateArgs } from '../util/validateArgs';
|
|
24
|
+
export { DataConnectErrorCode, DataConnectError, DataConnectOperationError, DataConnectOperationFailureResponse, DataConnectOperationFailureResponseErrorInfo } from '../core/error';
|
package/dist/src/core/error.d.ts
CHANGED
|
@@ -28,24 +28,27 @@ export declare const Code: {
|
|
|
28
28
|
};
|
|
29
29
|
/** An error returned by a DataConnect operation. */
|
|
30
30
|
export declare class DataConnectError extends FirebaseError {
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
/** @internal */
|
|
32
|
+
readonly name: string;
|
|
33
|
+
/** @hideconstructor */
|
|
34
|
+
constructor(code: Code, message: string);
|
|
35
|
+
/** @internal */
|
|
36
|
+
toString(): string;
|
|
37
|
+
}
|
|
38
|
+
/** An error returned by a DataConnect operation. */
|
|
39
|
+
export declare class DataConnectOperationError extends DataConnectError {
|
|
40
|
+
/** @internal */
|
|
41
|
+
readonly name: string;
|
|
42
|
+
/** The response received from the backend. */
|
|
43
|
+
readonly response: DataConnectOperationFailureResponse;
|
|
41
44
|
/** @hideconstructor */
|
|
42
|
-
constructor(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
constructor(message: string, response: DataConnectOperationFailureResponse);
|
|
46
|
+
}
|
|
47
|
+
export interface DataConnectOperationFailureResponse {
|
|
48
|
+
readonly data?: Record<string, unknown> | null;
|
|
49
|
+
readonly errors: DataConnectOperationFailureResponseErrorInfo[];
|
|
50
|
+
}
|
|
51
|
+
export interface DataConnectOperationFailureResponseErrorInfo {
|
|
52
|
+
readonly message: string;
|
|
53
|
+
readonly path: Array<string | number>;
|
|
51
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/data-connect",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.node.cjs.js",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"tslib": "^2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@firebase/app": "0.11.
|
|
58
|
+
"@firebase/app": "0.11.4",
|
|
59
59
|
"rollup": "2.79.2",
|
|
60
60
|
"rollup-plugin-typescript2": "0.36.0",
|
|
61
61
|
"typescript": "5.5.4"
|