Skip to content

Fix Data Connect Types #8898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hungry-snails-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/data-connect": patch
---

Fix DataConnectOperationError.
18 changes: 17 additions & 1 deletion common/api-review/data-connect.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ export const CallerSdkTypeEnum: {
readonly GeneratedAngular: "GeneratedAngular";
};

// @public (undocumented)
export type Code = DataConnectErrorCode;

// @public (undocumented)
export const Code: {
OTHER: DataConnectErrorCode;
ALREADY_INITIALIZED: DataConnectErrorCode;
NOT_INITIALIZED: DataConnectErrorCode;
NOT_SUPPORTED: DataConnectErrorCode;
INVALID_ARGUMENT: DataConnectErrorCode;
PARTIAL_ERROR: DataConnectErrorCode;
UNAUTHORIZED: DataConnectErrorCode;
};

// @public
export function connectDataConnectEmulator(dc: DataConnect, host: string, port?: number, sslEnabled?: boolean): void;

Expand Down Expand Up @@ -54,7 +68,9 @@ export class DataConnect {

// @public
export class DataConnectError extends FirebaseError {
}
/* Excluded from this release type: name */
constructor(code: Code, message: string);
}

// @public (undocumented)
export type DataConnectErrorCode = 'other' | 'already-initialized' | 'not-initialized' | 'not-supported' | 'invalid-argument' | 'partial-error' | 'unauthorized';
Expand Down
1 change: 1 addition & 0 deletions packages/data-connect/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export { setLogLevel } from '../logger';
export { validateArgs } from '../util/validateArgs';
export {
DataConnectErrorCode,
Code,
DataConnectError,
DataConnectOperationError,
DataConnectOperationFailureResponse,
Expand Down
1 change: 0 additions & 1 deletion packages/data-connect/src/core/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export class DataConnectError extends FirebaseError {
/** @internal */
readonly name: string = 'DataConnectError';

/** @hideconstructor */
constructor(code: Code, message: string) {
super(code, message);

Expand Down
Loading