From ac578e98f6234e380f3bdc6c161db6f68e3cada6 Mon Sep 17 00:00:00 2001 From: wu-hui <53845758+wu-hui@users.noreply.github.com> Date: Fri, 5 Aug 2022 21:17:46 -0400 Subject: [PATCH] Make index beta (#6510) * Make index beta * Update API reports * Add missing one. * Update API reports * Fix format Co-authored-by: wu-hui --- common/api-review/firestore.api.md | 30 ------------------- .../firestore/src/api/index_configuration.ts | 7 +++-- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md index 469eca6f2ee..db36b60482c 100644 --- a/common/api-review/firestore.api.md +++ b/common/api-review/firestore.api.md @@ -233,30 +233,6 @@ export function getFirestore(app?: FirebaseApp): Firestore; // @public export function increment(n: number): FieldValue; -// @public -export interface Index { - // (undocumented) - [key: string]: unknown; - readonly collectionGroup: string; - readonly fields?: IndexField[]; -} - -// @public -export interface IndexConfiguration { - // (undocumented) - [key: string]: unknown; - readonly indexes?: Index[]; -} - -// @public -export interface IndexField { - // (undocumented) - [key: string]: unknown; - readonly arrayConfig?: 'CONTAINS'; - readonly fieldPath: string; - readonly order?: 'ASCENDING' | 'DESCENDING'; -} - // @public export function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings): Firestore; @@ -420,12 +396,6 @@ export function setDoc(reference: DocumentReference, data: WithFieldValue< // @public export function setDoc(reference: DocumentReference, data: PartialWithFieldValue, options: SetOptions): Promise; -// @public -export function setIndexConfiguration(firestore: Firestore, configuration: IndexConfiguration): Promise; - -// @public -export function setIndexConfiguration(firestore: Firestore, json: string): Promise; - // @public export function setLogLevel(logLevel: LogLevel): void; diff --git a/packages/firestore/src/api/index_configuration.ts b/packages/firestore/src/api/index_configuration.ts index 6fd53693c75..9ea31a28db1 100644 --- a/packages/firestore/src/api/index_configuration.ts +++ b/packages/firestore/src/api/index_configuration.ts @@ -35,10 +35,9 @@ export { EmulatorMockTokenOptions } from '../lite-api/database'; -// TODO(indexing): Remove "@internal" from the API. - /** * A single field element in an index configuration. + * @beta */ export interface IndexField { /** The field path to index. */ @@ -63,6 +62,7 @@ export interface IndexField { /** * The SDK definition of a Firestore index. + * @beta */ export interface Index { /** The ID of the collection to index. */ @@ -78,6 +78,7 @@ export interface Index { * * See {@link https://firebase.google.com/docs/reference/firestore/indexes/#json_format | JSON Format} * for a description of the format of the index definition. + * @beta */ export interface IndexConfiguration { /** A list of all Firestore indexes. */ @@ -106,6 +107,7 @@ export interface IndexConfiguration { * @throws FirestoreError if the JSON format is invalid. * @returns A `Promise` that resolves once all indices are successfully * configured. + * @beta */ export function setIndexConfiguration( firestore: Firestore, @@ -136,6 +138,7 @@ export function setIndexConfiguration( * @throws FirestoreError if the JSON format is invalid. * @returns A `Promise` that resolves once all indices are successfully * configured. + * @beta */ export function setIndexConfiguration( firestore: Firestore,