Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Feiyang1 committed Sep 24, 2021
1 parent 19c310b commit d2b9d8c
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 167 deletions.
13 changes: 6 additions & 7 deletions packages/database-compat/standalone/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "@firebase/database-compat/standalone",
"description": "The entry point for sharing code with Admin SDK",
"main": "../dist/index.standalone.js",
"typings": "../dist/database-compat/src/index.standalone.d.ts",
"private": true
}

"name": "@firebase/database-compat/standalone",
"description": "The entry point for sharing code with Admin SDK",
"main": "../dist/index.standalone.js",
"typings": "../dist/database-compat/src/index.standalone.d.ts",
"private": true
}
96 changes: 96 additions & 0 deletions packages/database/src/api.standalone.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// APIs that don't depend on @firebase/app
export {
Database,
EmulatorMockTokenOptions,
enableLogging,
goOffline,
goOnline,
connectDatabaseEmulator
} from './api/Database';
export {
Query,
DatabaseReference,
ListenOptions,
Unsubscribe,
ThenableReference
} from './api/Reference';
export { OnDisconnect } from './api/OnDisconnect';
export {
DataSnapshot,
EventType,
QueryConstraint,
QueryConstraintType,
endAt,
endBefore,
equalTo,
get,
limitToFirst,
limitToLast,
off,
onChildAdded,
onChildChanged,
onChildMoved,
onChildRemoved,
onDisconnect,
onValue,
orderByChild,
orderByKey,
orderByPriority,
orderByValue,
push,
query,
ref,
refFromURL,
remove,
set,
setPriority,
setWithPriority,
startAfter,
startAt,
update,
child
} from './api/Reference_impl';
export { increment, serverTimestamp } from './api/ServerValue';
export {
runTransaction,
TransactionOptions,
TransactionResult
} from './api/Transaction';

// internal exports
export { setSDKVersion as _setSDKVersion } from './core/version';
export {
ReferenceImpl as _ReferenceImpl,
QueryImpl as _QueryImpl
} from './api/Reference_impl';
export { repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp } from './api/Database';
export {
validatePathString as _validatePathString,
validateWritablePath as _validateWritablePath
} from './core/util/validation';
export { UserCallback as _UserCallback } from './core/view/EventRegistration';
export { QueryParams as _QueryParams } from './core/view/QueryParams';

/* eslint-disable camelcase */
export {
hijackHash as _TEST_ACCESS_hijackHash,
forceRestClient as _TEST_ACCESS_forceRestClient
} from './api/test_access';
/* eslint-enable camelcase */
81 changes: 2 additions & 79 deletions packages/database/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,82 +15,5 @@
* limitations under the License.
*/

export {
Database,
EmulatorMockTokenOptions,
enableLogging,
getDatabase,
goOffline,
goOnline,
connectDatabaseEmulator
} from './api/Database';
export {
Query,
DatabaseReference,
ListenOptions,
Unsubscribe,
ThenableReference
} from './api/Reference';
export { OnDisconnect } from './api/OnDisconnect';
export {
DataSnapshot,
EventType,
QueryConstraint,
QueryConstraintType,
endAt,
endBefore,
equalTo,
get,
limitToFirst,
limitToLast,
off,
onChildAdded,
onChildChanged,
onChildMoved,
onChildRemoved,
onDisconnect,
onValue,
orderByChild,
orderByKey,
orderByPriority,
orderByValue,
push,
query,
ref,
refFromURL,
remove,
set,
setPriority,
setWithPriority,
startAfter,
startAt,
update,
child
} from './api/Reference_impl';
export { increment, serverTimestamp } from './api/ServerValue';
export {
runTransaction,
TransactionOptions,
TransactionResult
} from './api/Transaction';

// internal exports
export { setSDKVersion as _setSDKVersion } from './core/version';
export {
ReferenceImpl as _ReferenceImpl,
QueryImpl as _QueryImpl
} from './api/Reference_impl';
export { repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp } from './api/Database';
export {
validatePathString as _validatePathString,
validateWritablePath as _validateWritablePath
} from './core/util/validation';
export { UserCallback as _UserCallback } from './core/view/EventRegistration';
export { QueryParams as _QueryParams } from './core/view/QueryParams';

/* eslint-disable camelcase */
export {
hijackHash as _TEST_ACCESS_hijackHash,
forceRestClient as _TEST_ACCESS_forceRestClient
} from './api/test_access';
/* eslint-enable camelcase */
export * from './api.standalone';
export { getDatabase } from './api/Database';
99 changes: 18 additions & 81 deletions packages/database/src/index.standalone.ts
Original file line number Diff line number Diff line change
@@ -1,88 +1,25 @@
/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { Client } from 'faye-websocket';

import { setWebSocketImpl } from './realtime/WebSocketConnection';

setWebSocketImpl(Client);

// Identical to the exports from api.ts, but doesn't include getDatabase()
// to avoid dependency on @firebase/app.
// This entry point should only be consumed by Admin SDK
export {
Database,
EmulatorMockTokenOptions,
enableLogging,
goOffline,
goOnline,
connectDatabaseEmulator
} from './api/Database';
export {
Query,
DatabaseReference,
ListenOptions,
Unsubscribe,
ThenableReference
} from './api/Reference';
export { OnDisconnect } from './api/OnDisconnect';
export {
DataSnapshot,
EventType,
QueryConstraint,
QueryConstraintType,
endAt,
endBefore,
equalTo,
get,
limitToFirst,
limitToLast,
off,
onChildAdded,
onChildChanged,
onChildMoved,
onChildRemoved,
onDisconnect,
onValue,
orderByChild,
orderByKey,
orderByPriority,
orderByValue,
push,
query,
ref,
refFromURL,
remove,
set,
setPriority,
setWithPriority,
startAfter,
startAt,
update,
child
} from './api/Reference_impl';
export { increment, serverTimestamp } from './api/ServerValue';
export {
runTransaction,
TransactionOptions,
TransactionResult
} from './api/Transaction';

// internal exports
export { setSDKVersion as _setSDKVersion } from './core/version';
export {
ReferenceImpl as _ReferenceImpl,
QueryImpl as _QueryImpl
} from './api/Reference_impl';
export { repoManagerDatabaseFromApp as _repoManagerDatabaseFromApp } from './api/Database';
export {
validatePathString as _validatePathString,
validateWritablePath as _validateWritablePath
} from './core/util/validation';
export { UserCallback as _UserCallback } from './core/view/EventRegistration';
export { QueryParams as _QueryParams } from './core/view/QueryParams';

/* eslint-disable camelcase */
export {
hijackHash as _TEST_ACCESS_hijackHash,
forceRestClient as _TEST_ACCESS_forceRestClient
} from './api/test_access';
/* eslint-enable camelcase */

export * from './api.standalone';

0 comments on commit d2b9d8c

Please sign in to comment.